Subversion Repositories Applications.papyrus

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1317 → Rev 1318

/trunk/api/js/dojo/src/widget/Menu2.js
New file
0,0 → 1,453
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Menu2");
dojo.require("dojo.widget.PopupContainer");
dojo.declare("dojo.widget.MenuBase", null, function () {
this.eventNames = {open:""};
}, {isContainer:true, isMenu:true, eventNaming:"default", templateCssString:"\n.dojoPopupMenu2 {\n\tposition: absolute;\n\tborder: 1px solid #7298d0;\n\tbackground:#85aeec url(images/soriaMenuBg.gif) repeat-x bottom left !important;\n\tpadding: 1px;\n\tmargin-top: 1px;\n\tmargin-bottom: 1px;\n}\n\n.dojoMenuItem2{\n\twhite-space: nowrap;\n\tfont: menu;\n\tmargin: 0;\n}\n\n.dojoMenuItem2Hover {\n\tbackground-color: #D2E4FD;\n\tcursor:pointer;\n\tcursor:hand;\n}\n\n.dojoMenuItem2Icon {\n\tposition: relative;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\twidth: 16px;\n\theight: 16px;\n\tpadding-right: 3px;\n}\n\n.dojoMenuItem2Label {\n\tposition: relative;\n\tvertical-align: middle;\n}\n\n/* main label text */\n.dojoMenuItem2Label {\n\tposition: relative;\n\tvertical-align: middle;\n}\n\n.dojoMenuItem2Accel {\n\tposition: relative;\n\tvertical-align: middle;\n\tpadding-left: 3px;\n}\n\n.dojoMenuItem2Disabled .dojoMenuItem2Label,\n.dojoMenuItem2Disabled .dojoMenuItem2Accel {\n\tcolor: #607a9e;\n}\n\n.dojoMenuItem2Submenu {\n\tposition: relative;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\tbackground-image: url(images/submenu_off.gif);\n\twidth: 5px;\n\theight: 9px;\n\tpadding-left: 3px;\n}\n.dojoMenuItem2Hover .dojoMenuItem2Submenu {\n\tbackground-image: url(images/submenu_on.gif);\n}\n\n.dojoMenuItem2Disabled .dojoMenuItem2Submenu {\n\tbackground-image: url(images/submenu_disabled.gif);\n}\n\n.dojoMenuSeparator2 {\n\tfont-size: 1px;\n\tmargin: 0;\n}\n\n.dojoMenuSeparator2Top {\n\theight: 50%;\n\tborder-bottom: 1px solid #7a98c4;\n\tmargin: 0px 2px;\n\tfont-size: 1px;\n}\n\n.dojoMenuSeparator2Bottom {\n\theight: 50%;\n\tborder-top: 1px solid #c9deff;\n\tmargin: 0px 2px;\n\tfont-size: 1px;\n}\n\n.dojoMenuBar2 {\n\tbackground:#85aeec url(images/soriaBarBg.gif) repeat-x top left;\n\t/*border-bottom:1px solid #6b9fec;*/\n\tpadding: 1px;\n}\n\n.dojoMenuBar2 .dojoMenuItem2 {\n\twhite-space: nowrap;\n\tfont: menu;\n\tmargin: 0;\n\tposition: relative;\n\tvertical-align: middle;\n\tz-index: 1;\n\tpadding: 3px 8px;\n\tdisplay: inline;/* needed in khtml to display correctly */\n\tdisplay: -moz-inline-box;/* needed in firefox */\n\tcursor:pointer;\n\tcursor:hand;\n}\n\n.dojoMenuBar2 .dojoMenuItem2Hover {\n\tbackground-color:#d2e4fd;\n}\n\n.dojoMenuBar2 .dojoMenuItem2Disabled span {\n\tcolor: #4f6582;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Menu2.css"), submenuDelay:500, initialize:function (args, frag) {
if (this.eventNaming == "default") {
for (var eventName in this.eventNames) {
this.eventNames[eventName] = this.widgetId + "/" + eventName;
}
}
}, _moveToNext:function (evt) {
this._highlightOption(1);
return true;
}, _moveToPrevious:function (evt) {
this._highlightOption(-1);
return true;
}, _moveToParentMenu:function (evt) {
if (this._highlighted_option && this.parentMenu) {
if (evt._menu2UpKeyProcessed) {
return true;
} else {
this._highlighted_option.onUnhover();
this.closeSubmenu();
evt._menu2UpKeyProcessed = true;
}
}
return false;
}, _moveToChildMenu:function (evt) {
if (this._highlighted_option && this._highlighted_option.submenuId) {
this._highlighted_option._onClick(true);
return true;
}
return false;
}, _selectCurrentItem:function (evt) {
if (this._highlighted_option) {
this._highlighted_option._onClick();
return true;
}
return false;
}, processKey:function (evt) {
if (evt.ctrlKey || evt.altKey || !evt.key) {
return false;
}
var rval = false;
switch (evt.key) {
case evt.KEY_DOWN_ARROW:
rval = this._moveToNext(evt);
break;
case evt.KEY_UP_ARROW:
rval = this._moveToPrevious(evt);
break;
case evt.KEY_RIGHT_ARROW:
rval = this._moveToChildMenu(evt);
break;
case evt.KEY_LEFT_ARROW:
rval = this._moveToParentMenu(evt);
break;
case " ":
case evt.KEY_ENTER:
if (rval = this._selectCurrentItem(evt)) {
break;
}
case evt.KEY_ESCAPE:
case evt.KEY_TAB:
this.close(true);
rval = true;
break;
}
return rval;
}, _findValidItem:function (dir, curItem) {
if (curItem) {
curItem = dir > 0 ? curItem.getNextSibling() : curItem.getPreviousSibling();
}
for (var i = 0; i < this.children.length; ++i) {
if (!curItem) {
curItem = dir > 0 ? this.children[0] : this.children[this.children.length - 1];
}
if (curItem.onHover && curItem.isShowing()) {
return curItem;
}
curItem = dir > 0 ? curItem.getNextSibling() : curItem.getPreviousSibling();
}
}, _highlightOption:function (dir) {
var item;
if ((!this._highlighted_option)) {
item = this._findValidItem(dir);
} else {
item = this._findValidItem(dir, this._highlighted_option);
}
if (item) {
if (this._highlighted_option) {
this._highlighted_option.onUnhover();
}
item.onHover();
dojo.html.scrollIntoView(item.domNode);
try {
var node = dojo.html.getElementsByClass("dojoMenuItem2Label", item.domNode)[0];
node.focus();
}
catch (e) {
}
}
}, onItemClick:function (item) {
}, closeSubmenu:function (force) {
if (this.currentSubmenu == null) {
return;
}
this.currentSubmenu.close(force);
this.currentSubmenu = null;
this.currentSubmenuTrigger.is_open = false;
this.currentSubmenuTrigger._closedSubmenu(force);
this.currentSubmenuTrigger = null;
}});
dojo.widget.defineWidget("dojo.widget.PopupMenu2", [dojo.widget.HtmlWidget, dojo.widget.PopupContainerBase, dojo.widget.MenuBase], function () {
this.targetNodeIds = [];
}, {templateString:"<table class=\"dojoPopupMenu2\" border=0 cellspacing=0 cellpadding=0 style=\"display: none; position: absolute;\">" + "<tbody dojoAttachPoint=\"containerNode\"></tbody>" + "</table>", submenuOverlap:5, contextMenuForWindow:false, parentMenu:null, postCreate:function () {
if (this.contextMenuForWindow) {
var doc = dojo.body();
this.bindDomNode(doc);
} else {
if (this.targetNodeIds.length > 0) {
dojo.lang.forEach(this.targetNodeIds, this.bindDomNode, this);
}
}
this._subscribeSubitemsOnOpen();
}, _subscribeSubitemsOnOpen:function () {
var subItems = this.getChildrenOfType(dojo.widget.MenuItem2);
for (var i = 0; i < subItems.length; i++) {
dojo.event.topic.subscribe(this.eventNames.open, subItems[i], "menuOpen");
}
}, getTopOpenEvent:function () {
var menu = this;
while (menu.parentMenu) {
menu = menu.parentMenu;
}
return menu.openEvent;
}, bindDomNode:function (node) {
node = dojo.byId(node);
var win = dojo.html.getElementWindow(node);
if (dojo.html.isTag(node, "iframe") == "iframe") {
win = dojo.html.iframeContentWindow(node);
node = dojo.withGlobal(win, dojo.body);
}
dojo.widget.Menu2.OperaAndKonqFixer.fixNode(node);
dojo.event.kwConnect({srcObj:node, srcFunc:"oncontextmenu", targetObj:this, targetFunc:"onOpen", once:true});
if (dojo.render.html.moz && win.document.designMode.toLowerCase() == "on") {
dojo.event.browser.addListener(node, "contextmenu", dojo.lang.hitch(this, "onOpen"));
}
dojo.widget.PopupManager.registerWin(win);
}, unBindDomNode:function (nodeName) {
var node = dojo.byId(nodeName);
dojo.event.kwDisconnect({srcObj:node, srcFunc:"oncontextmenu", targetObj:this, targetFunc:"onOpen", once:true});
dojo.widget.Menu2.OperaAndKonqFixer.cleanNode(node);
}, _openAsSubmenu:function (parent, explodeSrc, orient) {
if (this.isShowingNow) {
return;
}
this.parentMenu = parent;
this.open(explodeSrc, parent, explodeSrc, orient);
}, close:function (force) {
if (this.animationInProgress) {
dojo.widget.PopupContainerBase.prototype.close.call(this, force);
return;
}
if (this._highlighted_option) {
this._highlighted_option.onUnhover();
}
dojo.widget.PopupContainerBase.prototype.close.call(this, force);
this.parentMenu = null;
}, closeAll:function (force) {
if (this.parentMenu) {
this.parentMenu.closeAll(force);
} else {
this.close(force);
}
}, _openSubmenu:function (submenu, from_item) {
submenu._openAsSubmenu(this, from_item.arrow, {"TR":"TL", "TL":"TR"});
this.currentSubmenu = submenu;
this.currentSubmenuTrigger = from_item;
this.currentSubmenuTrigger.is_open = true;
}, focus:function () {
if (this.currentSubmenuTrigger) {
if (this.currentSubmenuTrigger.caption) {
try {
this.currentSubmenuTrigger.caption.focus();
}
catch (e) {
}
} else {
try {
this.currentSubmenuTrigger.domNode.focus();
}
catch (e) {
}
}
}
}, onOpen:function (e) {
this.openEvent = e;
if (e["target"]) {
this.openedForWindow = dojo.html.getElementWindow(e.target);
} else {
this.openedForWindow = null;
}
var x = e.pageX, y = e.pageY;
var win = dojo.html.getElementWindow(e.target);
var iframe = win._frameElement || win.frameElement;
if (iframe) {
var cood = dojo.html.abs(iframe, true);
x += cood.x - dojo.withGlobal(win, dojo.html.getScroll).left;
y += cood.y - dojo.withGlobal(win, dojo.html.getScroll).top;
}
this.open(x, y, null, [x, y]);
dojo.event.browser.stopEvent(e);
}});
dojo.widget.defineWidget("dojo.widget.MenuItem2", dojo.widget.HtmlWidget, function () {
this.eventNames = {engage:""};
}, {templateString:"<tr class=\"dojoMenuItem2\" dojoAttachEvent=\"onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick; onKey:onKey;\">" + "<td><div class=\"${this.iconClass}\" style=\"${this.iconStyle}\"></div></td>" + "<td tabIndex=\"-1\" class=\"dojoMenuItem2Label\" dojoAttachPoint=\"caption\">${this.caption}</td>" + "<td class=\"dojoMenuItem2Accel\">${this.accelKey}</td>" + "<td><div class=\"dojoMenuItem2Submenu\" style=\"display:${this.arrowDisplay};\" dojoAttachPoint=\"arrow\"></div></td>" + "</tr>", is_hovering:false, hover_timer:null, is_open:false, topPosition:0, caption:"Untitled", accelKey:"", iconSrc:"", disabledClass:"dojoMenuItem2Disabled", iconClass:"dojoMenuItem2Icon", submenuId:"", eventNaming:"default", highlightClass:"dojoMenuItem2Hover", postMixInProperties:function () {
this.iconStyle = "";
if (this.iconSrc) {
if ((this.iconSrc.toLowerCase().substring(this.iconSrc.length - 4) == ".png") && (dojo.render.html.ie55 || dojo.render.html.ie60)) {
this.iconStyle = "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.iconSrc + "', sizingMethod='image')";
} else {
this.iconStyle = "background-image: url(" + this.iconSrc + ")";
}
}
this.arrowDisplay = this.submenuId ? "block" : "none";
dojo.widget.MenuItem2.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
dojo.html.disableSelection(this.domNode);
if (this.disabled) {
this.setDisabled(true);
}
if (this.eventNaming == "default") {
for (var eventName in this.eventNames) {
this.eventNames[eventName] = this.widgetId + "/" + eventName;
}
}
}, onHover:function () {
this.onUnhover();
if (this.is_hovering) {
return;
}
if (this.is_open) {
return;
}
if (this.parent._highlighted_option) {
this.parent._highlighted_option.onUnhover();
}
this.parent.closeSubmenu();
this.parent._highlighted_option = this;
dojo.widget.PopupManager.setFocusedMenu(this.parent);
this._highlightItem();
if (this.is_hovering) {
this._stopSubmenuTimer();
}
this.is_hovering = true;
this._startSubmenuTimer();
}, onUnhover:function () {
if (!this.is_open) {
this._unhighlightItem();
}
this.is_hovering = false;
this.parent._highlighted_option = null;
if (this.parent.parentMenu) {
dojo.widget.PopupManager.setFocusedMenu(this.parent.parentMenu);
}
this._stopSubmenuTimer();
}, _onClick:function (focus) {
var displayingSubMenu = false;
if (this.disabled) {
return false;
}
if (this.submenuId) {
if (!this.is_open) {
this._stopSubmenuTimer();
this._openSubmenu();
}
displayingSubMenu = true;
} else {
this.onUnhover();
this.parent.closeAll(true);
}
this.onClick();
dojo.event.topic.publish(this.eventNames.engage, this);
if (displayingSubMenu && focus) {
dojo.widget.getWidgetById(this.submenuId)._highlightOption(1);
}
return;
}, onClick:function () {
this.parent.onItemClick(this);
}, _highlightItem:function () {
dojo.html.addClass(this.domNode, this.highlightClass);
}, _unhighlightItem:function () {
dojo.html.removeClass(this.domNode, this.highlightClass);
}, _startSubmenuTimer:function () {
this._stopSubmenuTimer();
if (this.disabled) {
return;
}
var self = this;
var closure = function () {
return function () {
self._openSubmenu();
};
}();
this.hover_timer = dojo.lang.setTimeout(closure, this.parent.submenuDelay);
}, _stopSubmenuTimer:function () {
if (this.hover_timer) {
dojo.lang.clearTimeout(this.hover_timer);
this.hover_timer = null;
}
}, _openSubmenu:function () {
if (this.disabled) {
return;
}
this.parent.closeSubmenu();
var submenu = dojo.widget.getWidgetById(this.submenuId);
if (submenu) {
this.parent._openSubmenu(submenu, this);
}
}, _closedSubmenu:function () {
this.onUnhover();
}, setDisabled:function (value) {
this.disabled = value;
if (this.disabled) {
dojo.html.addClass(this.domNode, this.disabledClass);
} else {
dojo.html.removeClass(this.domNode, this.disabledClass);
}
}, enable:function () {
this.setDisabled(false);
}, disable:function () {
this.setDisabled(true);
}, menuOpen:function (message) {
}});
dojo.widget.defineWidget("dojo.widget.MenuSeparator2", dojo.widget.HtmlWidget, {templateString:"<tr class=\"dojoMenuSeparator2\"><td colspan=4>" + "<div class=\"dojoMenuSeparator2Top\"></div>" + "<div class=\"dojoMenuSeparator2Bottom\"></div>" + "</td></tr>", postCreate:function () {
dojo.html.disableSelection(this.domNode);
}});
dojo.widget.defineWidget("dojo.widget.MenuBar2", [dojo.widget.HtmlWidget, dojo.widget.MenuBase], {menuOverlap:2, templateString:"<div class=\"dojoMenuBar2\" dojoAttachPoint=\"containerNode\" tabIndex=\"0\"></div>", close:function (force) {
if (this._highlighted_option) {
this._highlighted_option.onUnhover();
}
this.closeSubmenu(force);
}, closeAll:function (force) {
this.close(force);
}, processKey:function (evt) {
if (evt.ctrlKey || evt.altKey) {
return false;
}
var rval = false;
switch (evt.key) {
case evt.KEY_DOWN_ARROW:
rval = this._moveToChildMenu(evt);
break;
case evt.KEY_UP_ARROW:
rval = this._moveToParentMenu(evt);
break;
case evt.KEY_RIGHT_ARROW:
rval = this._moveToNext(evt);
break;
case evt.KEY_LEFT_ARROW:
rval = this._moveToPrevious(evt);
break;
default:
rval = dojo.widget.MenuBar2.superclass.processKey.apply(this, arguments);
break;
}
return rval;
}, postCreate:function () {
dojo.widget.MenuBar2.superclass.postCreate.apply(this, arguments);
this.isShowingNow = true;
}, _openSubmenu:function (submenu, from_item) {
submenu._openAsSubmenu(this, from_item.domNode, {"BL":"TL", "TL":"BL"});
this.currentSubmenu = submenu;
this.currentSubmenuTrigger = from_item;
this.currentSubmenuTrigger.is_open = true;
}});
dojo.widget.defineWidget("dojo.widget.MenuBarItem2", dojo.widget.MenuItem2, {templateString:"<span class=\"dojoMenuItem2\" dojoAttachEvent=\"onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick;\">${this.caption}</span>"});
dojo.widget.Menu2.OperaAndKonqFixer = new function () {
var implement = true;
var delfunc = false;
if (!dojo.lang.isFunction(dojo.doc().oncontextmenu)) {
dojo.doc().oncontextmenu = function () {
implement = false;
delfunc = true;
};
}
if (dojo.doc().createEvent) {
try {
var e = dojo.doc().createEvent("MouseEvents");
e.initMouseEvent("contextmenu", 1, 1, dojo.global(), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, null);
dojo.doc().dispatchEvent(e);
}
catch (e) {
}
} else {
implement = false;
}
if (delfunc) {
delete dojo.doc().oncontextmenu;
}
this.fixNode = function (node) {
if (implement) {
if (!dojo.lang.isFunction(node.oncontextmenu)) {
node.oncontextmenu = function (e) {
};
}
if (dojo.render.html.opera) {
node._menufixer_opera = function (e) {
if (e.ctrlKey) {
this.oncontextmenu(e);
}
};
dojo.event.connect(node, "onclick", node, "_menufixer_opera");
} else {
node._menufixer_konq = function (e) {
if (e.button == 2) {
e.preventDefault();
this.oncontextmenu(e);
}
};
dojo.event.connect(node, "onmousedown", node, "_menufixer_konq");
}
}
};
this.cleanNode = function (node) {
if (implement) {
if (node._menufixer_opera) {
dojo.event.disconnect(node, "onclick", node, "_menufixer_opera");
delete node._menufixer_opera;
} else {
if (node._menufixer_konq) {
dojo.event.disconnect(node, "onmousedown", node, "_menufixer_konq");
delete node._menufixer_konq;
}
}
if (node.oncontextmenu) {
delete node.oncontextmenu;
}
}
};
};
 
/trunk/api/js/dojo/src/widget/AnimatedPng.js
New file
0,0 → 1,45
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.AnimatedPng");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.AnimatedPng", dojo.widget.HtmlWidget, {isContainer:false, width:0, height:0, aniSrc:"", interval:100, _blankSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), templateString:"<img class=\"dojoAnimatedPng\" />", postCreate:function () {
this.cellWidth = this.width;
this.cellHeight = this.height;
var img = new Image();
var self = this;
img.onload = function () {
self._initAni(img.width, img.height);
};
img.src = this.aniSrc;
}, _initAni:function (w, h) {
this.domNode.src = this._blankSrc;
this.domNode.width = this.cellWidth;
this.domNode.height = this.cellHeight;
this.domNode.style.backgroundImage = "url(" + this.aniSrc + ")";
this.domNode.style.backgroundRepeat = "no-repeat";
this.aniCols = Math.floor(w / this.cellWidth);
this.aniRows = Math.floor(h / this.cellHeight);
this.aniCells = this.aniCols * this.aniRows;
this.aniFrame = 0;
window.setInterval(dojo.lang.hitch(this, "_tick"), this.interval);
}, _tick:function () {
this.aniFrame++;
if (this.aniFrame == this.aniCells) {
this.aniFrame = 0;
}
var col = this.aniFrame % this.aniCols;
var row = Math.floor(this.aniFrame / this.aniCols);
var bx = -1 * col * this.cellWidth;
var by = -1 * row * this.cellHeight;
this.domNode.style.backgroundPosition = bx + "px " + by + "px";
}});
 
/trunk/api/js/dojo/src/widget/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.xml.Parse", "dojo.widget.Widget", "dojo.widget.Parse", "dojo.widget.Manager"], browser:["dojo.widget.DomWidget", "dojo.widget.HtmlWidget"], dashboard:["dojo.widget.DomWidget", "dojo.widget.HtmlWidget"], svg:["dojo.widget.SvgWidget"], rhino:["dojo.widget.SwtWidget"]});
dojo.provide("dojo.widget.*");
 
/trunk/api/js/dojo/src/widget/DropdownDatePicker.js
New file
0,0 → 1,108
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DropdownDatePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.DatePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.date.format");
dojo.require("dojo.date.serialize");
dojo.require("dojo.string.common");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.widget", "DropdownDatePicker", null, "ROOT");
dojo.widget.defineWidget("dojo.widget.DropdownDatePicker", dojo.widget.DropdownContainer, {iconURL:dojo.uri.moduleUri("dojo.widget", "templates/images/dateIcon.gif"), formatLength:"short", displayFormat:"", saveFormat:"", value:"", name:"", displayWeeks:6, adjustWeeks:false, startDate:"1492-10-12", endDate:"2941-10-12", weekStartsOn:"", staticDisplay:false, postMixInProperties:function (localProperties, frag) {
dojo.widget.DropdownDatePicker.superclass.postMixInProperties.apply(this, arguments);
var messages = dojo.i18n.getLocalization("dojo.widget", "DropdownDatePicker", this.lang);
this.iconAlt = messages.selectDate;
if (typeof (this.value) == "string" && this.value.toLowerCase() == "today") {
this.value = new Date();
}
if (this.value && isNaN(this.value)) {
var orig = this.value;
this.value = dojo.date.fromRfc3339(this.value);
if (!this.value) {
this.value = new Date(orig);
dojo.deprecated("dojo.widget.DropdownDatePicker", "date attributes must be passed in Rfc3339 format", "0.5");
}
}
if (this.value && !isNaN(this.value)) {
this.value = new Date(this.value);
}
}, fillInTemplate:function (args, frag) {
dojo.widget.DropdownDatePicker.superclass.fillInTemplate.call(this, args, frag);
var dpArgs = {widgetContainerId:this.widgetId, lang:this.lang, value:this.value, startDate:this.startDate, endDate:this.endDate, displayWeeks:this.displayWeeks, weekStartsOn:this.weekStartsOn, adjustWeeks:this.adjustWeeks, staticDisplay:this.staticDisplay};
this.datePicker = dojo.widget.createWidget("DatePicker", dpArgs, this.containerNode, "child");
dojo.event.connect(this.datePicker, "onValueChanged", this, "_updateText");
dojo.event.connect(this.inputNode, "onChange", this, "_updateText");
if (this.value) {
this._updateText();
}
this.containerNode.explodeClassName = "calendarBodyContainer";
this.valueNode.name = this.name;
}, getValue:function () {
return this.valueNode.value;
}, getDate:function () {
return this.datePicker.value;
}, setValue:function (rfcDate) {
this.setDate(rfcDate);
}, setDate:function (dateObj) {
this.datePicker.setDate(dateObj);
this._syncValueNode();
}, _updateText:function () {
this.inputNode.value = this.datePicker.value ? dojo.date.format(this.datePicker.value, {formatLength:this.formatLength, datePattern:this.displayFormat, selector:"dateOnly", locale:this.lang}) : "";
if (this.value < this.datePicker.startDate || this.value > this.datePicker.endDate) {
this.inputNode.value = "";
}
this._syncValueNode();
this.onValueChanged(this.getDate());
this.hideContainer();
}, onValueChanged:function (dateObj) {
}, onInputChange:function () {
var input = dojo.string.trim(this.inputNode.value);
if (input) {
var inputDate = dojo.date.parse(input, {formatLength:this.formatLength, datePattern:this.displayFormat, selector:"dateOnly", locale:this.lang});
if (!this.datePicker._isDisabledDate(inputDate)) {
this.setDate(inputDate);
}
} else {
if (input == "") {
this.datePicker.setDate("");
}
this.valueNode.value = input;
}
if (input) {
this._updateText();
}
}, _syncValueNode:function () {
var date = this.datePicker.value;
var value = "";
switch (this.saveFormat.toLowerCase()) {
case "rfc":
case "iso":
case "":
value = dojo.date.toRfc3339(date, "dateOnly");
break;
case "posix":
case "unix":
value = Number(date);
break;
default:
if (date) {
value = dojo.date.format(date, {datePattern:this.saveFormat, selector:"dateOnly", locale:this.lang});
}
}
this.valueNode.value = value;
}, destroy:function (finalize) {
this.datePicker.destroy(finalize);
dojo.widget.DropdownDatePicker.superclass.destroy.apply(this, arguments);
}});
 
/trunk/api/js/dojo/src/widget/TreeContextMenu.js
New file
0,0 → 1,108
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeContextMenu");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.Menu2");
dojo.widget.defineWidget("dojo.widget.TreeContextMenu", dojo.widget.PopupMenu2, function () {
this.listenedTrees = [];
}, {open:function (x, y, parentMenu, explodeSrc) {
var result = dojo.widget.PopupMenu2.prototype.open.apply(this, arguments);
dojo.event.topic.publish(this.eventNames.open, {menu:this});
return result;
}, listenTree:function (tree) {
var nodes = tree.getDescendants();
for (var i = 0; i < nodes.length; i++) {
if (!nodes[i].isTreeNode) {
continue;
}
this.bindDomNode(nodes[i].labelNode);
}
var _this = this;
dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.subscribe(tree.eventNames.moveTo, this, "onMoveTo");
dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.subscribe(tree.eventNames.addChild, this, "onAddChild");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
this.listenedTrees.push(tree);
}, unlistenTree:function (tree) {
dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.unsubscribe(tree.eventNames.moveTo, this, "onMoveTo");
dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.unsubscribe(tree.eventNames.addChild, this, "onAddChild");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
for (var i = 0; i < this.listenedTrees.length; i++) {
if (this.listenedTrees[i] === tree) {
this.listenedTrees.splice(i, 1);
break;
}
}
}, onTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, bindTreeNode:function (node) {
var _this = this;
dojo.lang.forEach(node.getDescendants(), function (e) {
_this.bindDomNode(e.labelNode);
});
}, unBindTreeNode:function (node) {
var _this = this;
dojo.lang.forEach(node.getDescendants(), function (e) {
_this.unBindDomNode(e.labelNode);
});
}, onCreateDOMNode:function (message) {
this.bindTreeNode(message.source);
}, onMoveFrom:function (message) {
if (!dojo.lang.inArray(this.listenedTrees, message.newTree)) {
this.unBindTreeNode(message.child);
}
}, onMoveTo:function (message) {
if (dojo.lang.inArray(this.listenedTrees, message.newTree)) {
this.bindTreeNode(message.child);
}
}, onRemoveNode:function (message) {
this.unBindTreeNode(message.child);
}, onAddChild:function (message) {
if (message.domNodeInitialized) {
this.bindTreeNode(message.child);
}
}});
dojo.widget.defineWidget("dojo.widget.TreeMenuItem", dojo.widget.MenuItem2, {treeActions:"", initialize:function (args, frag) {
this.treeActions = this.treeActions.split(",");
for (var i = 0; i < this.treeActions.length; i++) {
this.treeActions[i] = this.treeActions[i].toUpperCase();
}
}, getTreeNode:function () {
var menu = this;
while (!(menu instanceof dojo.widget.TreeContextMenu)) {
menu = menu.parent;
}
var source = menu.getTopOpenEvent().target;
while (!source.getAttribute("treeNode") && source.tagName != "body") {
source = source.parentNode;
}
if (source.tagName == "body") {
dojo.raise("treeNode not detected");
}
var treeNode = dojo.widget.manager.getWidgetById(source.getAttribute("treeNode"));
return treeNode;
}, menuOpen:function (message) {
var treeNode = this.getTreeNode();
this.setDisabled(false);
var _this = this;
dojo.lang.forEach(_this.treeActions, function (action) {
_this.setDisabled(treeNode.actionIsDisabled(action));
});
}, toString:function () {
return "[" + this.widgetType + " node " + this.getTreeNode() + "]";
}});
 
/trunk/api/js/dojo/src/widget/validate.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.validate");
dojo.deprecated("dojo.widget.validate", "use one of the specific widgets in dojo.widget.<name>Textbox instead", "0.5");
 
/trunk/api/js/dojo/src/widget/FilteringTable.js
New file
0,0 → 1,708
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.FilteringTable");
dojo.require("dojo.date.format");
dojo.require("dojo.math");
dojo.require("dojo.collections.Store");
dojo.require("dojo.html.*");
dojo.require("dojo.html.util");
dojo.require("dojo.html.style");
dojo.require("dojo.html.selection");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.FilteringTable", dojo.widget.HtmlWidget, function () {
this.store = new dojo.collections.Store();
this.valueField = "Id";
this.multiple = false;
this.maxSelect = 0;
this.maxSortable = 1;
this.minRows = 0;
this.defaultDateFormat = "%D";
this.isInitialized = false;
this.alternateRows = false;
this.columns = [];
this.sortInformation = [{index:0, direction:0}];
this.headClass = "";
this.tbodyClass = "";
this.headerClass = "";
this.headerUpClass = "selectedUp";
this.headerDownClass = "selectedDown";
this.rowClass = "";
this.rowAlternateClass = "alt";
this.rowSelectedClass = "selected";
this.columnSelected = "sorted-column";
}, {isContainer:false, templatePath:null, templateCssPath:null, getTypeFromString:function (s) {
var parts = s.split("."), i = 0, obj = dj_global;
do {
obj = obj[parts[i++]];
} while (i < parts.length && obj);
return (obj != dj_global) ? obj : null;
}, getByRow:function (row) {
return this.store.getByKey(dojo.html.getAttribute(row, "value"));
}, getDataByRow:function (row) {
return this.store.getDataByKey(dojo.html.getAttribute(row, "value"));
}, getRow:function (obj) {
var rows = this.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
if (this.store.getDataByKey(dojo.html.getAttribute(rows[i], "value")) == obj) {
return rows[i];
}
}
return null;
}, getColumnIndex:function (fieldPath) {
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].getField() == fieldPath) {
return i;
}
}
return -1;
}, getSelectedData:function () {
var data = this.store.get();
var a = [];
for (var i = 0; i < data.length; i++) {
if (data[i].isSelected) {
a.push(data[i].src);
}
}
if (this.multiple) {
return a;
} else {
return a[0];
}
}, isSelected:function (obj) {
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
return true;
}
}
return false;
}, isValueSelected:function (val) {
var v = this.store.getByKey(val);
if (v) {
return v.isSelected;
}
return false;
}, isIndexSelected:function (idx) {
var v = this.store.getByIndex(idx);
if (v) {
return v.isSelected;
}
return false;
}, isRowSelected:function (row) {
var v = this.getByRow(row);
if (v) {
return v.isSelected;
}
return false;
}, reset:function () {
this.store.clearData();
this.columns = [];
this.sortInformation = [{index:0, direction:0}];
this.resetSelections();
this.isInitialized = false;
this.onReset();
}, resetSelections:function () {
this.store.forEach(function (element) {
element.isSelected = false;
});
}, onReset:function () {
}, select:function (obj) {
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
data[i].isSelected = true;
break;
}
}
this.onDataSelect(obj);
}, selectByValue:function (val) {
this.select(this.store.getDataByKey(val));
}, selectByIndex:function (idx) {
this.select(this.store.getDataByIndex(idx));
}, selectByRow:function (row) {
this.select(this.getDataByRow(row));
}, selectAll:function () {
this.store.forEach(function (element) {
element.isSelected = true;
});
}, onDataSelect:function (obj) {
}, toggleSelection:function (obj) {
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
data[i].isSelected = !data[i].isSelected;
break;
}
}
this.onDataToggle(obj);
}, toggleSelectionByValue:function (val) {
this.toggleSelection(this.store.getDataByKey(val));
}, toggleSelectionByIndex:function (idx) {
this.toggleSelection(this.store.getDataByIndex(idx));
}, toggleSelectionByRow:function (row) {
this.toggleSelection(this.getDataByRow(row));
}, toggleAll:function () {
this.store.forEach(function (element) {
element.isSelected = !element.isSelected;
});
}, onDataToggle:function (obj) {
}, _meta:{field:null, format:null, filterer:null, noSort:false, sortType:"String", dataType:String, sortFunction:null, filterFunction:null, label:null, align:"left", valign:"middle", getField:function () {
return this.field || this.label;
}, getType:function () {
return this.dataType;
}}, createMetaData:function (obj) {
for (var p in this._meta) {
if (!obj[p]) {
obj[p] = this._meta[p];
}
}
if (!obj.label) {
obj.label = obj.field;
}
if (!obj.filterFunction) {
obj.filterFunction = this._defaultFilter;
}
return obj;
}, parseMetadata:function (head) {
this.columns = [];
this.sortInformation = [];
var row = head.getElementsByTagName("tr")[0];
var cells = row.getElementsByTagName("td");
if (cells.length == 0) {
cells = row.getElementsByTagName("th");
}
for (var i = 0; i < cells.length; i++) {
var o = this.createMetaData({});
if (dojo.html.hasAttribute(cells[i], "align")) {
o.align = dojo.html.getAttribute(cells[i], "align");
}
if (dojo.html.hasAttribute(cells[i], "valign")) {
o.valign = dojo.html.getAttribute(cells[i], "valign");
}
if (dojo.html.hasAttribute(cells[i], "nosort")) {
o.noSort = (dojo.html.getAttribute(cells[i], "nosort") == "true");
}
if (dojo.html.hasAttribute(cells[i], "sortusing")) {
var trans = dojo.html.getAttribute(cells[i], "sortusing");
var f = this.getTypeFromString(trans);
if (f != null && f != window && typeof (f) == "function") {
o.sortFunction = f;
}
}
o.label = dojo.html.renderedTextContent(cells[i]);
if (dojo.html.hasAttribute(cells[i], "field")) {
o.field = dojo.html.getAttribute(cells[i], "field");
} else {
if (o.label.length > 0) {
o.field = o.label;
} else {
o.field = "field" + i;
}
}
if (dojo.html.hasAttribute(cells[i], "format")) {
o.format = dojo.html.getAttribute(cells[i], "format");
}
if (dojo.html.hasAttribute(cells[i], "dataType")) {
var sortType = dojo.html.getAttribute(cells[i], "dataType");
if (sortType.toLowerCase() == "html" || sortType.toLowerCase() == "markup") {
o.sortType = "__markup__";
} else {
var type = this.getTypeFromString(sortType);
if (type) {
o.sortType = sortType;
o.dataType = type;
}
}
}
if (dojo.html.hasAttribute(cells[i], "filterusing")) {
var trans = dojo.html.getAttribute(cells[i], "filterusing");
var f = this.getTypeFromString(trans);
if (f != null && f != window && typeof (f) == "function") {
o.filterFunction = f;
}
}
this.columns.push(o);
if (dojo.html.hasAttribute(cells[i], "sort")) {
var info = {index:i, direction:0};
var dir = dojo.html.getAttribute(cells[i], "sort");
if (!isNaN(parseInt(dir))) {
dir = parseInt(dir);
info.direction = (dir != 0) ? 1 : 0;
} else {
info.direction = (dir.toLowerCase() == "desc") ? 1 : 0;
}
this.sortInformation.push(info);
}
}
if (this.sortInformation.length == 0) {
this.sortInformation.push({index:0, direction:0});
} else {
if (this.sortInformation.length > this.maxSortable) {
this.sortInformation.length = this.maxSortable;
}
}
}, parseData:function (body) {
if (body.rows.length == 0 && this.columns.length == 0) {
return;
}
var self = this;
this["__selected__"] = [];
var arr = this.store.getFromHtml(this.columns, body, function (obj, row) {
if (typeof (obj[self.valueField]) == "undefined" || obj[self.valueField] == null) {
obj[self.valueField] = dojo.html.getAttribute(row, "value");
}
if (dojo.html.getAttribute(row, "selected") == "true") {
self["__selected__"].push(obj);
}
});
this.store.setData(arr, true);
this.render();
for (var i = 0; i < this["__selected__"].length; i++) {
this.select(this["__selected__"][i]);
}
this.renderSelections();
delete this["__selected__"];
this.isInitialized = true;
}, onSelect:function (e) {
var row = dojo.html.getParentByType(e.target, "tr");
if (dojo.html.hasAttribute(row, "emptyRow")) {
return;
}
var body = dojo.html.getParentByType(row, "tbody");
if (this.multiple) {
if (e.shiftKey) {
var startRow;
var rows = body.rows;
for (var i = 0; i < rows.length; i++) {
if (rows[i] == row) {
break;
}
if (this.isRowSelected(rows[i])) {
startRow = rows[i];
}
}
if (!startRow) {
startRow = row;
for (; i < rows.length; i++) {
if (this.isRowSelected(rows[i])) {
row = rows[i];
break;
}
}
}
this.resetSelections();
if (startRow == row) {
this.toggleSelectionByRow(row);
} else {
var doSelect = false;
for (var i = 0; i < rows.length; i++) {
if (rows[i] == startRow) {
doSelect = true;
}
if (doSelect) {
this.selectByRow(rows[i]);
}
if (rows[i] == row) {
doSelect = false;
}
}
}
} else {
this.toggleSelectionByRow(row);
}
} else {
this.resetSelections();
this.toggleSelectionByRow(row);
}
this.renderSelections();
}, onSort:function (e) {
var oldIndex = this.sortIndex;
var oldDirection = this.sortDirection;
var source = e.target;
var row = dojo.html.getParentByType(source, "tr");
var cellTag = "td";
if (row.getElementsByTagName(cellTag).length == 0) {
cellTag = "th";
}
var headers = row.getElementsByTagName(cellTag);
var header = dojo.html.getParentByType(source, cellTag);
for (var i = 0; i < headers.length; i++) {
dojo.html.setClass(headers[i], this.headerClass);
if (headers[i] == header) {
if (this.sortInformation[0].index != i) {
this.sortInformation.unshift({index:i, direction:0});
} else {
this.sortInformation[0] = {index:i, direction:(~this.sortInformation[0].direction) & 1};
}
}
}
this.sortInformation.length = Math.min(this.sortInformation.length, this.maxSortable);
for (var i = 0; i < this.sortInformation.length; i++) {
var idx = this.sortInformation[i].index;
var dir = (~this.sortInformation[i].direction) & 1;
dojo.html.setClass(headers[idx], dir == 0 ? this.headerDownClass : this.headerUpClass);
}
this.render();
}, onFilter:function () {
}, _defaultFilter:function (obj) {
return true;
}, setFilter:function (field, fn) {
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].getField() == field) {
this.columns[i].filterFunction = fn;
break;
}
}
this.applyFilters();
}, setFilterByIndex:function (idx, fn) {
this.columns[idx].filterFunction = fn;
this.applyFilters();
}, clearFilter:function (field) {
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].getField() == field) {
this.columns[i].filterFunction = this._defaultFilter;
break;
}
}
this.applyFilters();
}, clearFilterByIndex:function (idx) {
this.columns[idx].filterFunction = this._defaultFilter;
this.applyFilters();
}, clearFilters:function () {
for (var i = 0; i < this.columns.length; i++) {
this.columns[i].filterFunction = this._defaultFilter;
}
var rows = this.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
rows[i].style.display = "";
if (this.alternateRows) {
dojo.html[((i % 2 == 1) ? "addClass" : "removeClass")](rows[i], this.rowAlternateClass);
}
}
this.onFilter();
}, applyFilters:function () {
var alt = 0;
var rows = this.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
var b = true;
var row = rows[i];
for (var j = 0; j < this.columns.length; j++) {
var value = this.store.getField(this.getDataByRow(row), this.columns[j].getField());
if (this.columns[j].getType() == Date && value != null && !value.getYear) {
value = new Date(value);
}
if (!this.columns[j].filterFunction(value)) {
b = false;
break;
}
}
row.style.display = (b ? "" : "none");
if (b && this.alternateRows) {
dojo.html[((alt++ % 2 == 1) ? "addClass" : "removeClass")](row, this.rowAlternateClass);
}
}
this.onFilter();
}, createSorter:function (info) {
var self = this;
var sortFunctions = [];
function createSortFunction(fieldIndex, dir) {
var meta = self.columns[fieldIndex];
var field = meta.getField();
return function (rowA, rowB) {
if (dojo.html.hasAttribute(rowA, "emptyRow")) {
return 1;
}
if (dojo.html.hasAttribute(rowB, "emptyRow")) {
return -1;
}
var a = self.store.getField(self.getDataByRow(rowA), field);
var b = self.store.getField(self.getDataByRow(rowB), field);
var ret = 0;
if (a > b) {
ret = 1;
}
if (a < b) {
ret = -1;
}
return dir * ret;
};
}
var current = 0;
var max = Math.min(info.length, this.maxSortable, this.columns.length);
while (current < max) {
var direction = (info[current].direction == 0) ? 1 : -1;
sortFunctions.push(createSortFunction(info[current].index, direction));
current++;
}
return function (rowA, rowB) {
var idx = 0;
while (idx < sortFunctions.length) {
var ret = sortFunctions[idx++](rowA, rowB);
if (ret != 0) {
return ret;
}
}
return 0;
};
}, createRow:function (obj) {
var row = document.createElement("tr");
dojo.html.disableSelection(row);
if (obj.key != null) {
row.setAttribute("value", obj.key);
}
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.setAttribute("align", this.columns[j].align);
cell.setAttribute("valign", this.columns[j].valign);
dojo.html.disableSelection(cell);
var val = this.store.getField(obj.src, this.columns[j].getField());
if (typeof (val) == "undefined") {
val = "";
}
this.fillCell(cell, this.columns[j], val);
row.appendChild(cell);
}
return row;
}, fillCell:function (cell, meta, val) {
if (meta.sortType == "__markup__") {
cell.innerHTML = val;
} else {
if (meta.getType() == Date) {
val = new Date(val);
if (!isNaN(val)) {
var format = this.defaultDateFormat;
if (meta.format) {
format = meta.format;
}
cell.innerHTML = dojo.date.strftime(val, format);
} else {
cell.innerHTML = val;
}
} else {
if ("Number number int Integer float Float".indexOf(meta.getType()) > -1) {
if (val.length == 0) {
val = "0";
}
var n = parseFloat(val, 10) + "";
if (n.indexOf(".") > -1) {
n = dojo.math.round(parseFloat(val, 10), 2);
}
cell.innerHTML = n;
} else {
cell.innerHTML = val;
}
}
}
}, prefill:function () {
this.isInitialized = false;
var body = this.domNode.tBodies[0];
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
if (this.minRows > 0) {
for (var i = 0; i < this.minRows; i++) {
var row = document.createElement("tr");
if (this.alternateRows) {
dojo.html[((i % 2 == 1) ? "addClass" : "removeClass")](row, this.rowAlternateClass);
}
row.setAttribute("emptyRow", "true");
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.innerHTML = "&nbsp;";
row.appendChild(cell);
}
body.appendChild(row);
}
}
}, init:function () {
this.isInitialized = false;
var head = this.domNode.getElementsByTagName("thead")[0];
if (head.getElementsByTagName("tr").length == 0) {
var row = document.createElement("tr");
for (var i = 0; i < this.columns.length; i++) {
var cell = document.createElement("td");
cell.setAttribute("align", this.columns[i].align);
cell.setAttribute("valign", this.columns[i].valign);
dojo.html.disableSelection(cell);
cell.innerHTML = this.columns[i].label;
row.appendChild(cell);
if (!this.columns[i].noSort) {
dojo.event.connect(cell, "onclick", this, "onSort");
}
}
dojo.html.prependChild(row, head);
}
if (this.store.get().length == 0) {
return false;
}
var idx = this.domNode.tBodies[0].rows.length;
if (!idx || idx == 0 || this.domNode.tBodies[0].rows[0].getAttribute("emptyRow") == "true") {
idx = 0;
var body = this.domNode.tBodies[0];
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
var row = this.createRow(data[i]);
body.appendChild(row);
idx++;
}
}
if (this.minRows > 0 && idx < this.minRows) {
idx = this.minRows - idx;
for (var i = 0; i < idx; i++) {
row = document.createElement("tr");
row.setAttribute("emptyRow", "true");
for (var j = 0; j < this.columns.length; j++) {
cell = document.createElement("td");
cell.innerHTML = "&nbsp;";
row.appendChild(cell);
}
body.appendChild(row);
}
}
var row = this.domNode.getElementsByTagName("thead")[0].rows[0];
var cellTag = "td";
if (row.getElementsByTagName(cellTag).length == 0) {
cellTag = "th";
}
var headers = row.getElementsByTagName(cellTag);
for (var i = 0; i < headers.length; i++) {
dojo.html.setClass(headers[i], this.headerClass);
}
for (var i = 0; i < this.sortInformation.length; i++) {
var idx = this.sortInformation[i].index;
var dir = (~this.sortInformation[i].direction) & 1;
dojo.html.setClass(headers[idx], dir == 0 ? this.headerDownClass : this.headerUpClass);
}
this.isInitialized = true;
return this.isInitialized;
}, render:function () {
if (!this.isInitialized) {
var b = this.init();
if (!b) {
this.prefill();
return;
}
}
var rows = [];
var body = this.domNode.tBodies[0];
var emptyRowIdx = -1;
for (var i = 0; i < body.rows.length; i++) {
rows.push(body.rows[i]);
}
var sortFunction = this.createSorter(this.sortInformation);
if (sortFunction) {
rows.sort(sortFunction);
}
for (var i = 0; i < rows.length; i++) {
if (this.alternateRows) {
dojo.html[((i % 2 == 1) ? "addClass" : "removeClass")](rows[i], this.rowAlternateClass);
}
dojo.html[(this.isRowSelected(body.rows[i]) ? "addClass" : "removeClass")](body.rows[i], this.rowSelectedClass);
body.appendChild(rows[i]);
}
}, renderSelections:function () {
var body = this.domNode.tBodies[0];
for (var i = 0; i < body.rows.length; i++) {
dojo.html[(this.isRowSelected(body.rows[i]) ? "addClass" : "removeClass")](body.rows[i], this.rowSelectedClass);
}
}, initialize:function () {
var self = this;
dojo.event.connect(this.store, "onSetData", function () {
self.store.forEach(function (element) {
element.isSelected = false;
});
self.isInitialized = false;
var body = self.domNode.tBodies[0];
if (body) {
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
}
self.render();
});
dojo.event.connect(this.store, "onClearData", function () {
self.isInitialized = false;
self.render();
});
dojo.event.connect(this.store, "onAddData", function (addedObject) {
var row = self.createRow(addedObject);
self.domNode.tBodies[0].appendChild(row);
self.render();
});
dojo.event.connect(this.store, "onAddDataRange", function (arr) {
for (var i = 0; i < arr.length; i++) {
arr[i].isSelected = false;
var row = self.createRow(arr[i]);
self.domNode.tBodies[0].appendChild(row);
}
self.render();
});
dojo.event.connect(this.store, "onRemoveData", function (removedObject) {
var rows = self.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
if (self.getDataByRow(rows[i]) == removedObject.src) {
rows[i].parentNode.removeChild(rows[i]);
break;
}
}
self.render();
});
dojo.event.connect(this.store, "onUpdateField", function (obj, fieldPath, val) {
var row = self.getRow(obj);
var idx = self.getColumnIndex(fieldPath);
if (row && row.cells[idx] && self.columns[idx]) {
self.fillCell(row.cells[idx], self.columns[idx], val);
}
});
}, postCreate:function () {
this.store.keyField = this.valueField;
if (this.domNode) {
if (this.domNode.nodeName.toLowerCase() != "table") {
}
if (this.domNode.getElementsByTagName("thead")[0]) {
var head = this.domNode.getElementsByTagName("thead")[0];
if (this.headClass.length > 0) {
head.className = this.headClass;
}
dojo.html.disableSelection(this.domNode);
this.parseMetadata(head);
var header = "td";
if (head.getElementsByTagName(header).length == 0) {
header = "th";
}
var headers = head.getElementsByTagName(header);
for (var i = 0; i < headers.length; i++) {
if (!this.columns[i].noSort) {
dojo.event.connect(headers[i], "onclick", this, "onSort");
}
}
} else {
this.domNode.appendChild(document.createElement("thead"));
}
if (this.domNode.tBodies.length < 1) {
var body = document.createElement("tbody");
this.domNode.appendChild(body);
} else {
var body = this.domNode.tBodies[0];
}
if (this.tbodyClass.length > 0) {
body.className = this.tbodyClass;
}
dojo.event.connect(body, "onclick", this, "onSelect");
this.parseData(body);
}
}});
 
/trunk/api/js/dojo/src/widget/Editor2Toolbar.js
New file
0,0 → 1,494
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Toolbar");
dojo.require("dojo.lang.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.widget.RichText");
dojo.require("dojo.widget.PopupContainer");
dojo.require("dojo.widget.ColorPalette");
dojo.lang.declare("dojo.widget.HandlerManager", null, function () {
this._registeredHandlers = [];
}, {registerHandler:function (obj, func) {
if (arguments.length == 2) {
this._registeredHandlers.push(function () {
return obj[func].apply(obj, arguments);
});
} else {
this._registeredHandlers.push(obj);
}
}, removeHandler:function (func) {
for (var i = 0; i < this._registeredHandlers.length; i++) {
if (func === this._registeredHandlers[i]) {
delete this._registeredHandlers[i];
return;
}
}
dojo.debug("HandlerManager handler " + func + " is not registered, can not remove.");
}, destroy:function () {
for (var i = 0; i < this._registeredHandlers.length; i++) {
delete this._registeredHandlers[i];
}
}});
dojo.widget.Editor2ToolbarItemManager = new dojo.widget.HandlerManager;
dojo.lang.mixin(dojo.widget.Editor2ToolbarItemManager, {getToolbarItem:function (name) {
var item;
name = name.toLowerCase();
for (var i = 0; i < this._registeredHandlers.length; i++) {
item = this._registeredHandlers[i](name);
if (item) {
return item;
}
}
switch (name) {
case "bold":
case "copy":
case "cut":
case "delete":
case "indent":
case "inserthorizontalrule":
case "insertorderedlist":
case "insertunorderedlist":
case "italic":
case "justifycenter":
case "justifyfull":
case "justifyleft":
case "justifyright":
case "outdent":
case "paste":
case "redo":
case "removeformat":
case "selectall":
case "strikethrough":
case "subscript":
case "superscript":
case "underline":
case "undo":
case "unlink":
case "createlink":
case "insertimage":
case "htmltoggle":
item = new dojo.widget.Editor2ToolbarButton(name);
break;
case "forecolor":
case "hilitecolor":
item = new dojo.widget.Editor2ToolbarColorPaletteButton(name);
break;
case "plainformatblock":
item = new dojo.widget.Editor2ToolbarFormatBlockPlainSelect("formatblock");
break;
case "formatblock":
item = new dojo.widget.Editor2ToolbarFormatBlockSelect("formatblock");
break;
case "fontsize":
item = new dojo.widget.Editor2ToolbarFontSizeSelect("fontsize");
break;
case "fontname":
item = new dojo.widget.Editor2ToolbarFontNameSelect("fontname");
break;
case "inserttable":
case "insertcell":
case "insertcol":
case "insertrow":
case "deletecells":
case "deletecols":
case "deleterows":
case "mergecells":
case "splitcell":
dojo.debug(name + " is implemented in dojo.widget.Editor2Plugin.TableOperation, please require it first.");
break;
case "inserthtml":
case "blockdirltr":
case "blockdirrtl":
case "dirltr":
case "dirrtl":
case "inlinedirltr":
case "inlinedirrtl":
dojo.debug("Not yet implemented toolbar item: " + name);
break;
default:
dojo.debug("dojo.widget.Editor2ToolbarItemManager.getToolbarItem: Unknown toolbar item: " + name);
}
return item;
}});
dojo.addOnUnload(dojo.widget.Editor2ToolbarItemManager, "destroy");
dojo.declare("dojo.widget.Editor2ToolbarButton", null, function (name) {
this._name = name;
}, {create:function (node, toolbar, nohover) {
this._domNode = node;
var cmd = toolbar.parent.getCommand(this._name);
if (cmd) {
this._domNode.title = cmd.getText();
}
this.disableSelection(this._domNode);
this._parentToolbar = toolbar;
dojo.event.connect(this._domNode, "onclick", this, "onClick");
if (!nohover) {
dojo.event.connect(this._domNode, "onmouseover", this, "onMouseOver");
dojo.event.connect(this._domNode, "onmouseout", this, "onMouseOut");
}
}, disableSelection:function (rootnode) {
dojo.html.disableSelection(rootnode);
var nodes = rootnode.all || rootnode.getElementsByTagName("*");
for (var x = 0; x < nodes.length; x++) {
dojo.html.disableSelection(nodes[x]);
}
}, onMouseOver:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command && _command.getState() != dojo.widget.Editor2Manager.commandState.Disabled) {
this.highlightToolbarItem();
}
}
}, onMouseOut:function () {
this.unhighlightToolbarItem();
}, destroy:function () {
this._domNode = null;
this._parentToolbar = null;
}, onClick:function (e) {
if (this._domNode && !this._domNode.disabled && this._parentToolbar.checkAvailability()) {
e.preventDefault();
e.stopPropagation();
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute();
}
}
}
}, refreshState:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var em = dojo.widget.Editor2Manager;
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var state = _command.getState();
if (state != this._lastState) {
switch (state) {
case em.commandState.Latched:
this.latchToolbarItem();
break;
case em.commandState.Enabled:
this.enableToolbarItem();
break;
case em.commandState.Disabled:
default:
this.disableToolbarItem();
}
this._lastState = state;
}
}
}
return em.commandState.Enabled;
}, latchToolbarItem:function () {
this._domNode.disabled = false;
this.removeToolbarItemStyle(this._domNode);
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarLatchedItemStyle);
}, enableToolbarItem:function () {
this._domNode.disabled = false;
this.removeToolbarItemStyle(this._domNode);
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarEnabledItemStyle);
}, disableToolbarItem:function () {
this._domNode.disabled = true;
this.removeToolbarItemStyle(this._domNode);
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarDisabledItemStyle);
}, highlightToolbarItem:function () {
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarHighlightedItemStyle);
}, unhighlightToolbarItem:function () {
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarHighlightedItemStyle);
}, removeToolbarItemStyle:function () {
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarEnabledItemStyle);
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarLatchedItemStyle);
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarDisabledItemStyle);
this.unhighlightToolbarItem();
}});
dojo.declare("dojo.widget.Editor2ToolbarDropDownButton", dojo.widget.Editor2ToolbarButton, {onClick:function () {
if (this._domNode && !this._domNode.disabled && this._parentToolbar.checkAvailability()) {
if (!this._dropdown) {
this._dropdown = dojo.widget.createWidget("PopupContainer", {});
this._domNode.appendChild(this._dropdown.domNode);
}
if (this._dropdown.isShowingNow) {
this._dropdown.close();
} else {
this.onDropDownShown();
this._dropdown.open(this._domNode, null, this._domNode);
}
}
}, destroy:function () {
this.onDropDownDestroy();
if (this._dropdown) {
this._dropdown.destroy();
}
dojo.widget.Editor2ToolbarDropDownButton.superclass.destroy.call(this);
}, onDropDownShown:function () {
}, onDropDownDestroy:function () {
}});
dojo.declare("dojo.widget.Editor2ToolbarColorPaletteButton", dojo.widget.Editor2ToolbarDropDownButton, {onDropDownShown:function () {
if (!this._colorpalette) {
this._colorpalette = dojo.widget.createWidget("ColorPalette", {});
this._dropdown.addChild(this._colorpalette);
this.disableSelection(this._dropdown.domNode);
this.disableSelection(this._colorpalette.domNode);
dojo.event.connect(this._colorpalette, "onColorSelect", this, "setColor");
dojo.event.connect(this._dropdown, "open", this, "latchToolbarItem");
dojo.event.connect(this._dropdown, "close", this, "enableToolbarItem");
}
}, setColor:function (color) {
this._dropdown.close();
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute(color);
}
}
}});
dojo.declare("dojo.widget.Editor2ToolbarFormatBlockPlainSelect", dojo.widget.Editor2ToolbarButton, {create:function (node, toolbar) {
this._domNode = node;
this._parentToolbar = toolbar;
this._domNode = node;
this.disableSelection(this._domNode);
dojo.event.connect(this._domNode, "onchange", this, "onChange");
}, destroy:function () {
this._domNode = null;
}, onChange:function () {
if (this._parentToolbar.checkAvailability()) {
var sv = this._domNode.value.toLowerCase();
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute(sv);
}
}
}
}, refreshState:function () {
if (this._domNode) {
dojo.widget.Editor2ToolbarFormatBlockPlainSelect.superclass.refreshState.call(this);
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var format = _command.getValue();
if (!format) {
format = "";
}
dojo.lang.forEach(this._domNode.options, function (item) {
if (item.value.toLowerCase() == format.toLowerCase()) {
item.selected = true;
}
});
}
}
}
}});
dojo.declare("dojo.widget.Editor2ToolbarComboItem", dojo.widget.Editor2ToolbarDropDownButton, {href:null, create:function (node, toolbar) {
dojo.widget.Editor2ToolbarComboItem.superclass.create.apply(this, arguments);
if (!this._contentPane) {
dojo.require("dojo.widget.ContentPane");
this._contentPane = dojo.widget.createWidget("ContentPane", {preload:"true"});
this._contentPane.addOnLoad(this, "setup");
this._contentPane.setUrl(this.href);
}
}, onMouseOver:function (e) {
if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectStyle);
}
}, onMouseOut:function (e) {
dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectStyle);
}, onDropDownShown:function () {
if (!this._dropdown.__addedContentPage) {
this._dropdown.addChild(this._contentPane);
this._dropdown.__addedContentPage = true;
}
}, setup:function () {
}, onChange:function (e) {
if (this._parentToolbar.checkAvailability()) {
var name = e.currentTarget.getAttribute("dropDownItemName");
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute(name);
}
}
}
this._dropdown.close();
}, onMouseOverItem:function (e) {
dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);
}, onMouseOutItem:function (e) {
dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);
}});
dojo.declare("dojo.widget.Editor2ToolbarFormatBlockSelect", dojo.widget.Editor2ToolbarComboItem, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FormatBlock.html"), setup:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);
var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");
this._blockNames = {};
this._blockDisplayNames = {};
for (var x = 0; x < nodes.length; x++) {
var node = nodes[x];
dojo.html.disableSelection(node);
var name = node.getAttribute("dropDownItemName");
if (name) {
this._blockNames[name] = node;
var childrennodes = node.getElementsByTagName(name);
this._blockDisplayNames[name] = childrennodes[childrennodes.length - 1].innerHTML;
}
}
for (var name in this._blockNames) {
dojo.event.connect(this._blockNames[name], "onclick", this, "onChange");
dojo.event.connect(this._blockNames[name], "onmouseover", this, "onMouseOverItem");
dojo.event.connect(this._blockNames[name], "onmouseout", this, "onMouseOutItem");
}
}, onDropDownDestroy:function () {
if (this._blockNames) {
for (var name in this._blockNames) {
delete this._blockNames[name];
delete this._blockDisplayNames[name];
}
}
}, refreshState:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);
if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var format = _command.getValue();
if (format == this._lastSelectedFormat && this._blockDisplayNames) {
return this._lastState;
}
this._lastSelectedFormat = format;
var label = this._domNode.getElementsByTagName("label")[0];
var isSet = false;
if (this._blockDisplayNames) {
for (var name in this._blockDisplayNames) {
if (name == format) {
label.innerHTML = this._blockDisplayNames[name];
isSet = true;
break;
}
}
if (!isSet) {
label.innerHTML = "&nbsp;";
}
}
}
}
}
return this._lastState;
}});
dojo.declare("dojo.widget.Editor2ToolbarFontSizeSelect", dojo.widget.Editor2ToolbarComboItem, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FontSize.html"), setup:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);
var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");
this._fontsizes = {};
this._fontSizeDisplayNames = {};
for (var x = 0; x < nodes.length; x++) {
var node = nodes[x];
dojo.html.disableSelection(node);
var name = node.getAttribute("dropDownItemName");
if (name) {
this._fontsizes[name] = node;
this._fontSizeDisplayNames[name] = node.getElementsByTagName("font")[0].innerHTML;
}
}
for (var name in this._fontsizes) {
dojo.event.connect(this._fontsizes[name], "onclick", this, "onChange");
dojo.event.connect(this._fontsizes[name], "onmouseover", this, "onMouseOverItem");
dojo.event.connect(this._fontsizes[name], "onmouseout", this, "onMouseOutItem");
}
}, onDropDownDestroy:function () {
if (this._fontsizes) {
for (var name in this._fontsizes) {
delete this._fontsizes[name];
delete this._fontSizeDisplayNames[name];
}
}
}, refreshState:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);
if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var size = _command.getValue();
if (size == this._lastSelectedSize && this._fontSizeDisplayNames) {
return this._lastState;
}
this._lastSelectedSize = size;
var label = this._domNode.getElementsByTagName("label")[0];
var isSet = false;
if (this._fontSizeDisplayNames) {
for (var name in this._fontSizeDisplayNames) {
if (name == size) {
label.innerHTML = this._fontSizeDisplayNames[name];
isSet = true;
break;
}
}
if (!isSet) {
label.innerHTML = "&nbsp;";
}
}
}
}
}
return this._lastState;
}});
dojo.declare("dojo.widget.Editor2ToolbarFontNameSelect", dojo.widget.Editor2ToolbarFontSizeSelect, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FontName.html")});
dojo.widget.defineWidget("dojo.widget.Editor2Toolbar", dojo.widget.HtmlWidget, function () {
dojo.event.connect(this, "fillInTemplate", dojo.lang.hitch(this, function () {
if (dojo.render.html.ie) {
this.domNode.style.zoom = 1;
}
}));
}, {templateString:"<div dojoAttachPoint=\"domNode\" class=\"EditorToolbarDomNode\" unselectable=\"on\">\n\t<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n\t\t<!--\n\t\t\tour toolbar should look something like:\n\n\t\t\t+=======+=======+=======+=============================================+\n\t\t\t| w w | style | copy | bo | it | un | le | ce | ri |\n\t\t\t| w w w | style |=======|==============|==============|\n\t\t\t| w w | style | paste | undo | redo | change style |\n\t\t\t+=======+=======+=======+=============================================+\n\t\t-->\n\t\t<tbody>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t<div class=\"bigIcon\" dojoAttachPoint=\"wikiWordButton\"\n\t\t\t\t\t\tdojoOnClick=\"wikiWordClick; buttonClick;\">\n\t\t\t\t\t\t<span style=\"font-size: 30px; margin-left: 5px;\">\n\t\t\t\t\t\t\tW\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t<div class=\"bigIcon\" dojoAttachPoint=\"styleDropdownButton\"\n\t\t\t\t\t\tdojoOnClick=\"styleDropdownClick; buttonClick;\">\n\t\t\t\t\t\t<span unselectable=\"on\"\n\t\t\t\t\t\t\tstyle=\"font-size: 30px; margin-left: 5px;\">\n\t\t\t\t\t\t\tS\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"StyleDropdownContainer\" style=\"display: none;\"\n\t\t\t\t\t\tdojoAttachPoint=\"styleDropdownContainer\">\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"\n\t\t\t\t\t\t\theight=\"100%\" width=\"100%\">\n\t\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<div style=\"height: 245px; overflow: auto;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"normalTextClick\">normal</div>\n\t\t\t\t\t\t\t\t\t\t<h1 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h1TextClick\">Heading 1</h1>\n\t\t\t\t\t\t\t\t\t\t<h2 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h2TextClick\">Heading 2</h2>\n\t\t\t\t\t\t\t\t\t\t<h3 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h3TextClick\">Heading 3</h3>\n\t\t\t\t\t\t\t\t\t\t<h4 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h4TextClick\">Heading 4</h4>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyleft\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifycenter\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyright\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyfull\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\tthud\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<!-- copy -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"copyButton\"\n\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\tdojoOnClick=\"copyClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon copy\" \n\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span> copy\n\t\t\t\t\t</span>\n\t\t\t\t\t<!-- \"droppable\" options -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"boldButton\"\n\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\tdojoOnClick=\"boldClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon bold\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"italicButton\"\n\t\t\t\t\t\tdojoOnClick=\"italicClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon italic\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"underlineButton\"\n\t\t\t\t\t\tdojoOnClick=\"underlineClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon underline\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"leftButton\"\n\t\t\t\t\t\tdojoOnClick=\"leftClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyleft\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"fullButton\"\n\t\t\t\t\t\tdojoOnClick=\"fullClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyfull\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"rightButton\"\n\t\t\t\t\t\tdojoOnClick=\"rightClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyright\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<!-- paste -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"pasteButton\"\n\t\t\t\t\t\tdojoOnClick=\"pasteClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon paste\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> paste\n\t\t\t\t\t</span>\n\t\t\t\t\t<!-- \"droppable\" options -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"undoButton\"\n\t\t\t\t\t\tdojoOnClick=\"undoClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon undo\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> undo\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"redoButton\"\n\t\t\t\t\t\tdojoOnClick=\"redoClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon redo\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> redo\n\t\t\t\t\t</span>\n\t\t\t\t</td>\t\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:".StyleDropdownContainer {\n\tposition: absolute;\n\tz-index: 1000;\n\toverflow: auto;\n\tcursor: default;\n\twidth: 250px;\n\theight: 250px;\n\tbackground-color: white;\n\tborder: 1px solid black;\n}\n\n.ColorDropdownContainer {\n\tposition: absolute;\n\tz-index: 1000;\n\toverflow: auto;\n\tcursor: default;\n\twidth: 250px;\n\theight: 150px;\n\tbackground-color: white;\n\tborder: 1px solid black;\n}\n\n.EditorToolbarDomNode {\n\tbackground-image: url(buttons/bg-fade.png);\n\tbackground-repeat: repeat-x;\n\tbackground-position: 0px -50px;\n}\n\n.EditorToolbarSmallBg {\n\tbackground-image: url(images/toolbar-bg.gif);\n\tbackground-repeat: repeat-x;\n\tbackground-position: 0px 0px;\n}\n\n/*\nbody {\n\tbackground:url(images/blank.gif) fixed;\n}*/\n\n.IEFixedToolbar {\n\tposition:absolute;\n\t/* top:0; */\n\ttop: expression(eval((document.documentElement||document.body).scrollTop));\n}\n\ndiv.bigIcon {\n\twidth: 40px;\n\theight: 40px; \n\t/* background-color: white; */\n\t/* border: 1px solid #a6a7a3; */\n\tfont-family: Verdana, Trebuchet, Tahoma, Arial;\n}\n\n.iconContainer {\n\tfont-family: Verdana, Trebuchet, Tahoma, Arial;\n\tfont-size: 13px;\n\tfloat: left;\n\theight: 18px;\n\tdisplay: block;\n\t/* background-color: white; */\n\tcursor: pointer;\n\tpadding: 1px 4px 1px 1px; /* almost the same as a transparent border */\n\tborder: 0px;\n}\n\n.dojoE2TBIcon {\n\tdisplay: block;\n\ttext-align: center;\n\tmin-width: 18px;\n\twidth: 18px;\n\theight: 18px;\n\t/* background-color: #a6a7a3; */\n\tbackground-repeat: no-repeat;\n\tbackground-image: url(buttons/aggregate.gif);\n}\n\n\n.dojoE2TBIcon[class~=dojoE2TBIcon] {\n}\n\n.ToolbarButtonLatched {\n border: #316ac5 1px solid; !important;\n padding: 0px 3px 0px 0px; !important; /* make room for border */\n background-color: #c1d2ee;\n}\n\n.ToolbarButtonHighlighted {\n border: #316ac5 1px solid; !important;\n padding: 0px 3px 0px 0px; !important; /* make room for border */\n background-color: #dff1ff;\n}\n\n.ToolbarButtonDisabled{\n filter: gray() alpha(opacity=30); /* IE */\n opacity: 0.30; /* Safari, Opera and Mozilla */\n}\n\n.headingContainer {\n\twidth: 150px;\n\theight: 30px;\n\tmargin: 0px;\n\t/* padding-left: 5px; */\n\toverflow: hidden;\n\tline-height: 25px;\n\tborder-bottom: 1px solid black;\n\tborder-top: 1px solid white;\n}\n\n.EditorToolbarDomNode select {\n\tfont-size: 14px;\n}\n \n.dojoE2TBIcon_Sep { width: 5px; min-width: 5px; max-width: 5px; background-position: 0px 0px}\n.dojoE2TBIcon_Backcolor { background-position: -18px 0px}\n.dojoE2TBIcon_Bold { background-position: -36px 0px}\n.dojoE2TBIcon_Cancel { background-position: -54px 0px}\n.dojoE2TBIcon_Copy { background-position: -72px 0px}\n.dojoE2TBIcon_Link { background-position: -90px 0px}\n.dojoE2TBIcon_Cut { background-position: -108px 0px}\n.dojoE2TBIcon_Delete { background-position: -126px 0px}\n.dojoE2TBIcon_TextColor { background-position: -144px 0px}\n.dojoE2TBIcon_BackgroundColor { background-position: -162px 0px}\n.dojoE2TBIcon_Indent { background-position: -180px 0px}\n.dojoE2TBIcon_HorizontalLine { background-position: -198px 0px}\n.dojoE2TBIcon_Image { background-position: -216px 0px}\n.dojoE2TBIcon_NumberedList { background-position: -234px 0px}\n.dojoE2TBIcon_Table { background-position: -252px 0px}\n.dojoE2TBIcon_BulletedList { background-position: -270px 0px}\n.dojoE2TBIcon_Italic { background-position: -288px 0px}\n.dojoE2TBIcon_CenterJustify { background-position: -306px 0px}\n.dojoE2TBIcon_BlockJustify { background-position: -324px 0px}\n.dojoE2TBIcon_LeftJustify { background-position: -342px 0px}\n.dojoE2TBIcon_RightJustify { background-position: -360px 0px}\n.dojoE2TBIcon_left_to_right { background-position: -378px 0px}\n.dojoE2TBIcon_list_bullet_indent { background-position: -396px 0px}\n.dojoE2TBIcon_list_bullet_outdent { background-position: -414px 0px}\n.dojoE2TBIcon_list_num_indent { background-position: -432px 0px}\n.dojoE2TBIcon_list_num_outdent { background-position: -450px 0px}\n.dojoE2TBIcon_Outdent { background-position: -468px 0px}\n.dojoE2TBIcon_Paste { background-position: -486px 0px}\n.dojoE2TBIcon_Redo { background-position: -504px 0px}\ndojoE2TBIcon_RemoveFormat { background-position: -522px 0px}\n.dojoE2TBIcon_right_to_left { background-position: -540px 0px}\n.dojoE2TBIcon_Save { background-position: -558px 0px}\n.dojoE2TBIcon_Space { background-position: -576px 0px}\n.dojoE2TBIcon_StrikeThrough { background-position: -594px 0px}\n.dojoE2TBIcon_Subscript { background-position: -612px 0px}\n.dojoE2TBIcon_Superscript { background-position: -630px 0px}\n.dojoE2TBIcon_Underline { background-position: -648px 0px}\n.dojoE2TBIcon_Undo { background-position: -666px 0px}\n.dojoE2TBIcon_WikiWord { background-position: -684px 0px}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/EditorToolbar.css"), ToolbarLatchedItemStyle:"ToolbarButtonLatched", ToolbarEnabledItemStyle:"ToolbarButtonEnabled", ToolbarDisabledItemStyle:"ToolbarButtonDisabled", ToolbarHighlightedItemStyle:"ToolbarButtonHighlighted", ToolbarHighlightedSelectStyle:"ToolbarSelectHighlighted", ToolbarHighlightedSelectItemStyle:"ToolbarSelectHighlightedItem", postCreate:function () {
var nodes = dojo.html.getElementsByClass("dojoEditorToolbarItem", this.domNode);
this.items = {};
for (var x = 0; x < nodes.length; x++) {
var node = nodes[x];
var itemname = node.getAttribute("dojoETItemName");
if (itemname) {
var item = dojo.widget.Editor2ToolbarItemManager.getToolbarItem(itemname);
if (item) {
item.create(node, this);
this.items[itemname.toLowerCase()] = item;
} else {
node.style.display = "none";
}
}
}
}, update:function () {
for (var cmd in this.items) {
this.items[cmd].refreshState();
}
}, shareGroup:"", checkAvailability:function () {
if (!this.shareGroup) {
this.parent.focus();
return true;
}
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (this.shareGroup == curInst.toolbarGroup) {
return true;
}
return false;
}, destroy:function () {
for (var it in this.items) {
this.items[it].destroy();
delete this.items[it];
}
dojo.widget.Editor2Toolbar.superclass.destroy.call(this);
}});
 
/trunk/api/js/dojo/src/widget/Textbox.js
New file
0,0 → 1,50
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Textbox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.widget.Parse");
dojo.require("dojo.xml.Parse");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.common");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.widget", "validate", null, "fr,ja,zh-cn,ROOT");
dojo.widget.defineWidget("dojo.widget.Textbox", dojo.widget.HtmlWidget, {className:"", name:"", value:"", type:"", trim:false, uppercase:false, lowercase:false, ucFirst:false, digit:false, htmlfloat:"none", templateString:"<span style='float:${this.htmlfloat};'>\n\t<input dojoAttachPoint='textbox' dojoAttachEvent='onblur;onfocus'\n\t\tid='${this.widgetId}' name='${this.name}'\n\t\tclass='${this.className}' type='${this.type}' >\n</span>\n", textbox:null, fillInTemplate:function () {
this.textbox.value = this.value;
}, filter:function () {
if (this.trim) {
this.textbox.value = this.textbox.value.replace(/(^\s*|\s*$)/g, "");
}
if (this.uppercase) {
this.textbox.value = this.textbox.value.toUpperCase();
}
if (this.lowercase) {
this.textbox.value = this.textbox.value.toLowerCase();
}
if (this.ucFirst) {
this.textbox.value = this.textbox.value.replace(/\b\w+\b/g, function (word) {
return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
});
}
if (this.digit) {
this.textbox.value = this.textbox.value.replace(/\D/g, "");
}
}, onfocus:function () {
}, onblur:function () {
this.filter();
}, mixInProperties:function (localProperties, frag) {
dojo.widget.Textbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties["class"]) {
this.className = localProperties["class"];
}
}});
 
/trunk/api/js/dojo/src/widget/SplitContainer.js
New file
0,0 → 1,323
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SplitContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.io.cookie");
dojo.widget.defineWidget("dojo.widget.SplitContainer", dojo.widget.HtmlWidget, function () {
this.sizers = [];
}, {isContainer:true, templateCssString:".dojoSplitContainer{\n\tposition: relative;\n\toverflow: hidden;\n\tdisplay: block;\n}\n\n.dojoSplitPane{\n\tposition: absolute;\n}\n\n.dojoSplitContainerSizerH,\n.dojoSplitContainerSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDFace;\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tmargin: 0;\n}\n\n.dojoSplitContainerSizerV {\n\tcursor: n-resize;\n}\n\n.dojoSplitContainerVirtualSizerH,\n.dojoSplitContainerVirtualSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDShadow;\n\t-moz-opacity: 0.5;\n\topacity: 0.5;\n\tfilter: Alpha(Opacity=50);\n\tmargin: 0;\n}\n\n.dojoSplitContainerVirtualSizerV {\n\tcursor: n-resize;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/SplitContainer.css"), activeSizing:false, sizerWidth:15, orientation:"horizontal", persist:true, postMixInProperties:function () {
dojo.widget.SplitContainer.superclass.postMixInProperties.apply(this, arguments);
this.isHorizontal = (this.orientation == "horizontal");
}, fillInTemplate:function () {
dojo.widget.SplitContainer.superclass.fillInTemplate.apply(this, arguments);
dojo.html.addClass(this.domNode, "dojoSplitContainer");
if (dojo.render.html.moz) {
this.domNode.style.overflow = "-moz-scrollbars-none";
}
var content = dojo.html.getContentBox(this.domNode);
this.paneWidth = content.width;
this.paneHeight = content.height;
}, onResized:function (e) {
var content = dojo.html.getContentBox(this.domNode);
this.paneWidth = content.width;
this.paneHeight = content.height;
this._layoutPanels();
}, postCreate:function (args, fragment, parentComp) {
dojo.widget.SplitContainer.superclass.postCreate.apply(this, arguments);
for (var i = 0; i < this.children.length; i++) {
with (this.children[i].domNode.style) {
position = "absolute";
}
dojo.html.addClass(this.children[i].domNode, "dojoSplitPane");
if (i == this.children.length - 1) {
break;
}
this._addSizer();
}
if (typeof this.sizerWidth == "object") {
try {
this.sizerWidth = parseInt(this.sizerWidth.toString());
}
catch (e) {
this.sizerWidth = 15;
}
}
this.virtualSizer = document.createElement("div");
this.virtualSizer.style.position = "absolute";
this.virtualSizer.style.display = "none";
this.virtualSizer.style.zIndex = 10;
this.virtualSizer.className = this.isHorizontal ? "dojoSplitContainerVirtualSizerH" : "dojoSplitContainerVirtualSizerV";
this.domNode.appendChild(this.virtualSizer);
dojo.html.disableSelection(this.virtualSizer);
if (this.persist) {
this._restoreState();
}
this.resizeSoon();
}, _injectChild:function (child) {
with (child.domNode.style) {
position = "absolute";
}
dojo.html.addClass(child.domNode, "dojoSplitPane");
}, _addSizer:function () {
var i = this.sizers.length;
this.sizers[i] = document.createElement("div");
this.sizers[i].style.position = "absolute";
this.sizers[i].className = this.isHorizontal ? "dojoSplitContainerSizerH" : "dojoSplitContainerSizerV";
var self = this;
var handler = (function () {
var sizer_i = i;
return function (e) {
self.beginSizing(e, sizer_i);
};
})();
dojo.event.connect(this.sizers[i], "onmousedown", handler);
this.domNode.appendChild(this.sizers[i]);
dojo.html.disableSelection(this.sizers[i]);
}, removeChild:function (widget) {
if (this.sizers.length > 0) {
for (var x = 0; x < this.children.length; x++) {
if (this.children[x] === widget) {
var i = this.sizers.length - 1;
this.domNode.removeChild(this.sizers[i]);
this.sizers.length = i;
break;
}
}
}
dojo.widget.SplitContainer.superclass.removeChild.call(this, widget, arguments);
this.onResized();
}, addChild:function (widget) {
dojo.widget.SplitContainer.superclass.addChild.apply(this, arguments);
this._injectChild(widget);
if (this.children.length > 1) {
this._addSizer();
}
this._layoutPanels();
}, _layoutPanels:function () {
if (this.children.length == 0) {
return;
}
var space = this.isHorizontal ? this.paneWidth : this.paneHeight;
if (this.children.length > 1) {
space -= this.sizerWidth * (this.children.length - 1);
}
var out_of = 0;
for (var i = 0; i < this.children.length; i++) {
out_of += this.children[i].sizeShare;
}
var pix_per_unit = space / out_of;
var total_size = 0;
for (var i = 0; i < this.children.length - 1; i++) {
var size = Math.round(pix_per_unit * this.children[i].sizeShare);
this.children[i].sizeActual = size;
total_size += size;
}
this.children[this.children.length - 1].sizeActual = space - total_size;
this._checkSizes();
var pos = 0;
var size = this.children[0].sizeActual;
this._movePanel(this.children[0], pos, size);
this.children[0].position = pos;
pos += size;
for (var i = 1; i < this.children.length; i++) {
this._moveSlider(this.sizers[i - 1], pos, this.sizerWidth);
this.sizers[i - 1].position = pos;
pos += this.sizerWidth;
size = this.children[i].sizeActual;
this._movePanel(this.children[i], pos, size);
this.children[i].position = pos;
pos += size;
}
}, _movePanel:function (panel, pos, size) {
if (this.isHorizontal) {
panel.domNode.style.left = pos + "px";
panel.domNode.style.top = 0;
panel.resizeTo(size, this.paneHeight);
} else {
panel.domNode.style.left = 0;
panel.domNode.style.top = pos + "px";
panel.resizeTo(this.paneWidth, size);
}
}, _moveSlider:function (slider, pos, size) {
if (this.isHorizontal) {
slider.style.left = pos + "px";
slider.style.top = 0;
dojo.html.setMarginBox(slider, {width:size, height:this.paneHeight});
} else {
slider.style.left = 0;
slider.style.top = pos + "px";
dojo.html.setMarginBox(slider, {width:this.paneWidth, height:size});
}
}, _growPane:function (growth, pane) {
if (growth > 0) {
if (pane.sizeActual > pane.sizeMin) {
if ((pane.sizeActual - pane.sizeMin) > growth) {
pane.sizeActual = pane.sizeActual - growth;
growth = 0;
} else {
growth -= pane.sizeActual - pane.sizeMin;
pane.sizeActual = pane.sizeMin;
}
}
}
return growth;
}, _checkSizes:function () {
var total_min_size = 0;
var total_size = 0;
for (var i = 0; i < this.children.length; i++) {
total_size += this.children[i].sizeActual;
total_min_size += this.children[i].sizeMin;
}
if (total_min_size <= total_size) {
var growth = 0;
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].sizeActual < this.children[i].sizeMin) {
growth += this.children[i].sizeMin - this.children[i].sizeActual;
this.children[i].sizeActual = this.children[i].sizeMin;
}
}
if (growth > 0) {
if (this.isDraggingLeft) {
for (var i = this.children.length - 1; i >= 0; i--) {
growth = this._growPane(growth, this.children[i]);
}
} else {
for (var i = 0; i < this.children.length; i++) {
growth = this._growPane(growth, this.children[i]);
}
}
}
} else {
for (var i = 0; i < this.children.length; i++) {
this.children[i].sizeActual = Math.round(total_size * (this.children[i].sizeMin / total_min_size));
}
}
}, beginSizing:function (e, i) {
this.paneBefore = this.children[i];
this.paneAfter = this.children[i + 1];
this.isSizing = true;
this.sizingSplitter = this.sizers[i];
this.originPos = dojo.html.getAbsolutePosition(this.children[0].domNode, true, dojo.html.boxSizing.MARGIN_BOX);
if (this.isHorizontal) {
var client = (e.layerX ? e.layerX : e.offsetX);
var screen = e.pageX;
this.originPos = this.originPos.x;
} else {
var client = (e.layerY ? e.layerY : e.offsetY);
var screen = e.pageY;
this.originPos = this.originPos.y;
}
this.startPoint = this.lastPoint = screen;
this.screenToClientOffset = screen - client;
this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position;
if (!this.activeSizing) {
this._showSizingLine();
}
dojo.event.connect(document.documentElement, "onmousemove", this, "changeSizing");
dojo.event.connect(document.documentElement, "onmouseup", this, "endSizing");
dojo.event.browser.stopEvent(e);
}, changeSizing:function (e) {
this.lastPoint = this.isHorizontal ? e.pageX : e.pageY;
if (this.activeSizing) {
this.movePoint();
this._updateSize();
} else {
this.movePoint();
this._moveSizingLine();
}
dojo.event.browser.stopEvent(e);
}, endSizing:function (e) {
if (!this.activeSizing) {
this._hideSizingLine();
}
this._updateSize();
this.isSizing = false;
dojo.event.disconnect(document.documentElement, "onmousemove", this, "changeSizing");
dojo.event.disconnect(document.documentElement, "onmouseup", this, "endSizing");
if (this.persist) {
this._saveState(this);
}
}, movePoint:function () {
var p = this.lastPoint - this.screenToClientOffset;
var a = p - this.dragOffset;
a = this.legaliseSplitPoint(a);
p = a + this.dragOffset;
this.lastPoint = p + this.screenToClientOffset;
}, legaliseSplitPoint:function (a) {
a += this.sizingSplitter.position;
this.isDraggingLeft = (a > 0) ? true : false;
if (!this.activeSizing) {
if (a < this.paneBefore.position + this.paneBefore.sizeMin) {
a = this.paneBefore.position + this.paneBefore.sizeMin;
}
if (a > this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin))) {
a = this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin));
}
}
a -= this.sizingSplitter.position;
this._checkSizes();
return a;
}, _updateSize:function () {
var pos = this.lastPoint - this.dragOffset - this.originPos;
var start_region = this.paneBefore.position;
var end_region = this.paneAfter.position + this.paneAfter.sizeActual;
this.paneBefore.sizeActual = pos - start_region;
this.paneAfter.position = pos + this.sizerWidth;
this.paneAfter.sizeActual = end_region - this.paneAfter.position;
for (var i = 0; i < this.children.length; i++) {
this.children[i].sizeShare = this.children[i].sizeActual;
}
this._layoutPanels();
}, _showSizingLine:function () {
this._moveSizingLine();
if (this.isHorizontal) {
dojo.html.setMarginBox(this.virtualSizer, {width:this.sizerWidth, height:this.paneHeight});
} else {
dojo.html.setMarginBox(this.virtualSizer, {width:this.paneWidth, height:this.sizerWidth});
}
this.virtualSizer.style.display = "block";
}, _hideSizingLine:function () {
this.virtualSizer.style.display = "none";
}, _moveSizingLine:function () {
var pos = this.lastPoint - this.startPoint + this.sizingSplitter.position;
if (this.isHorizontal) {
this.virtualSizer.style.left = pos + "px";
} else {
var pos = (this.lastPoint - this.startPoint) + this.sizingSplitter.position;
this.virtualSizer.style.top = pos + "px";
}
}, _getCookieName:function (i) {
return this.widgetId + "_" + i;
}, _restoreState:function () {
for (var i = 0; i < this.children.length; i++) {
var cookieName = this._getCookieName(i);
var cookieValue = dojo.io.cookie.getCookie(cookieName);
if (cookieValue != null) {
var pos = parseInt(cookieValue);
if (typeof pos == "number") {
this.children[i].sizeShare = pos;
}
}
}
}, _saveState:function () {
for (var i = 0; i < this.children.length; i++) {
var cookieName = this._getCookieName(i);
dojo.io.cookie.setCookie(cookieName, this.children[i].sizeShare, null, null, null, null);
}
}});
dojo.lang.extend(dojo.widget.Widget, {sizeMin:10, sizeShare:10});
dojo.widget.defineWidget("dojo.widget.SplitContainerPanel", dojo.widget.ContentPane, {});
 
/trunk/api/js/dojo/src/widget/Dialog.js
New file
0,0 → 1,298
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Dialog");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.event.*");
dojo.require("dojo.gfx.color");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.html.iframe");
dojo.declare("dojo.widget.ModalDialogBase", null, {isContainer:true, focusElement:"", bgColor:"black", bgOpacity:0.4, followScroll:true, closeOnBackgroundClick:false, trapTabs:function (e) {
if (e.target == this.tabStartOuter) {
if (this._fromTrap) {
this.tabStart.focus();
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabEnd.focus();
}
} else {
if (e.target == this.tabStart) {
if (this._fromTrap) {
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabEnd.focus();
}
} else {
if (e.target == this.tabEndOuter) {
if (this._fromTrap) {
this.tabEnd.focus();
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabStart.focus();
}
} else {
if (e.target == this.tabEnd) {
if (this._fromTrap) {
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabStart.focus();
}
}
}
}
}
}, clearTrap:function (e) {
var _this = this;
setTimeout(function () {
_this._fromTrap = false;
}, 100);
}, postCreate:function () {
with (this.domNode.style) {
position = "absolute";
zIndex = 999;
display = "none";
overflow = "visible";
}
var b = dojo.body();
b.appendChild(this.domNode);
this.bg = document.createElement("div");
this.bg.className = "dialogUnderlay";
with (this.bg.style) {
position = "absolute";
left = top = "0px";
zIndex = 998;
display = "none";
}
b.appendChild(this.bg);
this.setBackgroundColor(this.bgColor);
this.bgIframe = new dojo.html.BackgroundIframe();
if (this.bgIframe.iframe) {
with (this.bgIframe.iframe.style) {
position = "absolute";
left = top = "0px";
zIndex = 90;
display = "none";
}
}
if (this.closeOnBackgroundClick) {
dojo.event.kwConnect({srcObj:this.bg, srcFunc:"onclick", adviceObj:this, adviceFunc:"onBackgroundClick", once:true});
}
}, uninitialize:function () {
this.bgIframe.remove();
dojo.html.removeNode(this.bg, true);
}, setBackgroundColor:function (color) {
if (arguments.length >= 3) {
color = new dojo.gfx.color.Color(arguments[0], arguments[1], arguments[2]);
} else {
color = new dojo.gfx.color.Color(color);
}
this.bg.style.backgroundColor = color.toString();
return this.bgColor = color;
}, setBackgroundOpacity:function (op) {
if (arguments.length == 0) {
op = this.bgOpacity;
}
dojo.html.setOpacity(this.bg, op);
try {
this.bgOpacity = dojo.html.getOpacity(this.bg);
}
catch (e) {
this.bgOpacity = op;
}
return this.bgOpacity;
}, _sizeBackground:function () {
if (this.bgOpacity > 0) {
var viewport = dojo.html.getViewport();
var h = viewport.height;
var w = viewport.width;
with (this.bg.style) {
width = w + "px";
height = h + "px";
}
var scroll_offset = dojo.html.getScroll().offset;
this.bg.style.top = scroll_offset.y + "px";
this.bg.style.left = scroll_offset.x + "px";
var viewport = dojo.html.getViewport();
if (viewport.width != w) {
this.bg.style.width = viewport.width + "px";
}
if (viewport.height != h) {
this.bg.style.height = viewport.height + "px";
}
}
this.bgIframe.size(this.bg);
}, _showBackground:function () {
if (this.bgOpacity > 0) {
this.bg.style.display = "block";
}
if (this.bgIframe.iframe) {
this.bgIframe.iframe.style.display = "block";
}
}, placeModalDialog:function () {
var scroll_offset = dojo.html.getScroll().offset;
var viewport_size = dojo.html.getViewport();
var mb;
if (this.isShowing()) {
mb = dojo.html.getMarginBox(this.domNode);
} else {
dojo.html.setVisibility(this.domNode, false);
dojo.html.show(this.domNode);
mb = dojo.html.getMarginBox(this.domNode);
dojo.html.hide(this.domNode);
dojo.html.setVisibility(this.domNode, true);
}
var x = scroll_offset.x + (viewport_size.width - mb.width) / 2;
var y = scroll_offset.y + (viewport_size.height - mb.height) / 2;
with (this.domNode.style) {
left = x + "px";
top = y + "px";
}
}, _onKey:function (evt) {
if (evt.key) {
var node = evt.target;
while (node != null) {
if (node == this.domNode) {
return;
}
node = node.parentNode;
}
if (evt.key != evt.KEY_TAB) {
dojo.event.browser.stopEvent(evt);
} else {
if (!dojo.render.html.opera) {
try {
this.tabStart.focus();
}
catch (e) {
}
}
}
}
}, showModalDialog:function () {
if (this.followScroll && !this._scrollConnected) {
this._scrollConnected = true;
dojo.event.connect(window, "onscroll", this, "_onScroll");
}
dojo.event.connect(document.documentElement, "onkey", this, "_onKey");
this.placeModalDialog();
this.setBackgroundOpacity();
this._sizeBackground();
this._showBackground();
this._fromTrap = true;
setTimeout(dojo.lang.hitch(this, function () {
try {
this.tabStart.focus();
}
catch (e) {
}
}), 50);
}, hideModalDialog:function () {
if (this.focusElement) {
dojo.byId(this.focusElement).focus();
dojo.byId(this.focusElement).blur();
}
this.bg.style.display = "none";
this.bg.style.width = this.bg.style.height = "1px";
if (this.bgIframe.iframe) {
this.bgIframe.iframe.style.display = "none";
}
dojo.event.disconnect(document.documentElement, "onkey", this, "_onKey");
if (this._scrollConnected) {
this._scrollConnected = false;
dojo.event.disconnect(window, "onscroll", this, "_onScroll");
}
}, _onScroll:function () {
var scroll_offset = dojo.html.getScroll().offset;
this.bg.style.top = scroll_offset.y + "px";
this.bg.style.left = scroll_offset.x + "px";
this.placeModalDialog();
}, checkSize:function () {
if (this.isShowing()) {
this._sizeBackground();
this.placeModalDialog();
this.onResized();
}
}, onBackgroundClick:function () {
if (this.lifetime - this.timeRemaining >= this.blockDuration) {
return;
}
this.hide();
}});
dojo.widget.defineWidget("dojo.widget.Dialog", [dojo.widget.ContentPane, dojo.widget.ModalDialogBase], {templateString:"<div id=\"${this.widgetId}\" class=\"dojoDialog\" dojoattachpoint=\"wrapper\">\n\t<span dojoattachpoint=\"tabStartOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\"\ttabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabStart\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoattachpoint=\"containerNode\" style=\"position: relative; z-index: 2;\"></div>\n\t<span dojoattachpoint=\"tabEnd\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabEndOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n</div>\n", blockDuration:0, lifetime:0, closeNode:"", postMixInProperties:function () {
dojo.widget.Dialog.superclass.postMixInProperties.apply(this, arguments);
if (this.closeNode) {
this.setCloseControl(this.closeNode);
}
}, postCreate:function () {
dojo.widget.Dialog.superclass.postCreate.apply(this, arguments);
dojo.widget.ModalDialogBase.prototype.postCreate.apply(this, arguments);
}, show:function () {
if (this.lifetime) {
this.timeRemaining = this.lifetime;
if (this.timerNode) {
this.timerNode.innerHTML = Math.ceil(this.timeRemaining / 1000);
}
if (this.blockDuration && this.closeNode) {
if (this.lifetime > this.blockDuration) {
this.closeNode.style.visibility = "hidden";
} else {
this.closeNode.style.display = "none";
}
}
if (this.timer) {
clearInterval(this.timer);
}
this.timer = setInterval(dojo.lang.hitch(this, "_onTick"), 100);
}
this.showModalDialog();
dojo.widget.Dialog.superclass.show.call(this);
}, onLoad:function () {
this.placeModalDialog();
dojo.widget.Dialog.superclass.onLoad.call(this);
}, fillInTemplate:function () {
}, hide:function () {
this.hideModalDialog();
dojo.widget.Dialog.superclass.hide.call(this);
if (this.timer) {
clearInterval(this.timer);
}
}, setTimerNode:function (node) {
this.timerNode = node;
}, setCloseControl:function (node) {
this.closeNode = dojo.byId(node);
dojo.event.connect(this.closeNode, "onclick", this, "hide");
}, setShowControl:function (node) {
node = dojo.byId(node);
dojo.event.connect(node, "onclick", this, "show");
}, _onTick:function () {
if (this.timer) {
this.timeRemaining -= 100;
if (this.lifetime - this.timeRemaining >= this.blockDuration) {
if (this.closeNode) {
this.closeNode.style.visibility = "visible";
}
}
if (!this.timeRemaining) {
clearInterval(this.timer);
this.hide();
} else {
if (this.timerNode) {
this.timerNode.innerHTML = Math.ceil(this.timeRemaining / 1000);
}
}
}
}});
 
/trunk/api/js/dojo/src/widget/LinkPane.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.LinkPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.LinkPane", dojo.widget.ContentPane, {templateString:"<div class=\"dojoLinkPane\"></div>", fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
this.label += source.innerHTML;
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
}});
 
/trunk/api/js/dojo/src/widget/Form.js
New file
0,0 → 1,265
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Form");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.Form", dojo.widget.HtmlWidget, {isContainer:true, templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onSubmit:onSubmit'></form>", formElements:[], ignoreNullValues:false, postCreate:function (args, frag) {
for (var key in args) {
if (key == "dojotype") {
continue;
}
var attr = document.createAttribute(key);
attr.nodeValue = args[key];
this.containerNode.setAttributeNode(attr);
}
}, _createRepeaters:function (obj, widget) {
for (var i = 0; i < widget.children.length; ++i) {
if (widget.children[i].widgetType == "RepeaterContainer") {
var rIndex = widget.children[i].index;
var rIndexPos = rIndex.indexOf("%{index}");
rIndex = rIndex.substr(0, rIndexPos - 1);
var myObj = this._getObject(obj, rIndex);
if (typeof (myObj) == "object" && myObj.length == 0) {
myObj = new Array();
}
var rowCount = widget.children[i].getRowCount();
for (var j = 0, len = rowCount; j < len; ++j) {
widget.children[i].deleteRow(0);
}
for (var j = 0; j < myObj.length; j++) {
widget.children[i].addRow(false);
}
}
if (widget.children[i].isContainer) {
this._createRepeaters(obj, widget.children[i]);
}
}
}, _createFormElements:function () {
if (dojo.render.html.safari) {
this.formElements = [];
var elems = ["INPUT", "SELECT", "TEXTAREA"];
for (var k = 0; k < elems.length; k++) {
var list = this.containerNode.getElementsByTagName(elems[k]);
for (var j = 0, len2 = list.length; j < len2; j++) {
this.formElements.push(list[j]);
}
}
} else {
this.formElements = this.containerNode.elements;
}
}, onSubmit:function (e) {
e.preventDefault();
}, submit:function () {
this.containerNode.submit();
}, _getFormElement:function (name) {
if (dojo.render.html.ie) {
for (var i = 0, len = this.formElements.length; i < len; i++) {
var element = this.formElements[i];
if (element.name == name) {
return element;
}
}
} else {
var elem = this.formElements[name];
if (typeof (elem) != "undefined") {
return elem;
}
}
return null;
}, _getObject:function (obj, searchString) {
var namePath = [];
namePath = searchString.split(".");
var myObj = obj;
var name = namePath[namePath.length - 1];
for (var j = 0, len = namePath.length; j < len; ++j) {
var p = namePath[j];
if (typeof (myObj[p]) == "undefined") {
myObj[p] = {};
}
myObj = myObj[p];
}
return myObj;
}, _setToContainers:function (obj, widget) {
for (var i = 0, len = widget.children.length; i < len; ++i) {
var currentWidget = widget.children[i];
if (currentWidget.widgetType == "Repeater") {
for (var j = 0, len = currentWidget.getRowCount(); j < len; ++j) {
currentWidget._initRow(j);
}
}
if (currentWidget.isContainer) {
this._setToContainers(obj, currentWidget);
continue;
}
switch (currentWidget.widgetType) {
case "Checkbox":
currentWidget.setValue(currentWidget.inputNode.checked);
break;
case "DropdownDatePicker":
currentWidget.setValue(currentWidget.getValue());
break;
case "Select":
continue;
break;
case "ComboBox":
continue;
break;
default:
break;
}
}
}, setValues:function (obj) {
this._createFormElements();
this._createRepeaters(obj, this);
for (var i = 0, len = this.formElements.length; i < len; i++) {
var element = this.formElements[i];
if (element.name == "") {
continue;
}
var namePath = new Array();
namePath = element.name.split(".");
var myObj = obj;
var name = namePath[namePath.length - 1];
for (var j = 1, len2 = namePath.length; j < len2; ++j) {
var p = namePath[j - 1];
if (typeof (myObj[p]) == "undefined") {
myObj = undefined;
break;
}
myObj = myObj[p];
}
if (typeof (myObj) == "undefined") {
continue;
}
if (typeof (myObj[name]) == "undefined" && this.ignoreNullValues) {
continue;
}
var type = element.type;
if (type == "hidden" || type == "text" || type == "textarea" || type == "password") {
type = "text";
}
switch (type) {
case "checkbox":
element.checked = false;
if (typeof (myObj[name]) == "undefined") {
continue;
}
for (var j = 0, len2 = myObj[name].length; j < len2; ++j) {
if (element.value == myObj[name][j]) {
element.checked = true;
}
}
break;
case "radio":
element.checked = false;
if (typeof (myObj[name]) == "undefined") {
continue;
}
if (myObj[name] == element.value) {
element.checked = true;
}
break;
case "select-multiple":
element.selectedIndex = -1;
for (var j = 0, len2 = element.options.length; j < len2; ++j) {
for (var k = 0, len3 = myObj[name].length; k < len3; ++k) {
if (element.options[j].value == myObj[name][k]) {
element.options[j].selected = true;
}
}
}
break;
case "select-one":
element.selectedIndex = "0";
for (var j = 0, len2 = element.options.length; j < len2; ++j) {
if (element.options[j].value == myObj[name]) {
element.options[j].selected = true;
} else {
}
}
break;
case "text":
var value = "";
if (typeof (myObj[name]) != "undefined") {
value = myObj[name];
}
element.value = value;
break;
default:
dojo.debug("Not supported type (" + type + ")");
break;
}
}
this._setToContainers(obj, this);
}, getValues:function () {
this._createFormElements();
var obj = {};
for (var i = 0, len = this.formElements.length; i < len; i++) {
var elm = this.formElements[i];
var namePath = [];
if (elm.name == "") {
continue;
}
namePath = elm.name.split(".");
var myObj = obj;
var name = namePath[namePath.length - 1];
for (var j = 1, len2 = namePath.length; j < len2; ++j) {
var nameIndex = null;
var p = namePath[j - 1];
var nameA = p.split("[");
if (nameA.length > 1) {
if (typeof (myObj[nameA[0]]) == "undefined") {
myObj[nameA[0]] = [];
}
nameIndex = parseInt(nameA[1]);
if (typeof (myObj[nameA[0]][nameIndex]) == "undefined") {
myObj[nameA[0]][nameIndex] = {};
}
} else {
if (typeof (myObj[nameA[0]]) == "undefined") {
myObj[nameA[0]] = {};
}
}
if (nameA.length == 1) {
myObj = myObj[nameA[0]];
} else {
myObj = myObj[nameA[0]][nameIndex];
}
}
if ((elm.type != "select-multiple" && elm.type != "checkbox" && elm.type != "radio") || (elm.type == "radio" && elm.checked)) {
if (name == name.split("[")[0]) {
myObj[name] = elm.value;
} else {
}
} else {
if (elm.type == "checkbox" && elm.checked) {
if (typeof (myObj[name]) == "undefined") {
myObj[name] = [];
}
myObj[name].push(elm.value);
} else {
if (elm.type == "select-multiple") {
if (typeof (myObj[name]) == "undefined") {
myObj[name] = [];
}
for (var jdx = 0, len3 = elm.options.length; jdx < len3; ++jdx) {
if (elm.options[jdx].selected) {
myObj[name].push(elm.options[jdx].value);
}
}
}
}
}
name = undefined;
}
return obj;
}});
 
/trunk/api/js/dojo/src/widget/TreeBasicController.js
New file
0,0 → 1,152
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeBasicController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeBasicController", dojo.widget.HtmlWidget, {widgetType:"TreeBasicController", DNDController:"", dieWithTree:false, initialize:function (args, frag) {
if (this.DNDController == "create") {
dojo.require("dojo.dnd.TreeDragAndDrop");
this.DNDController = new dojo.dnd.TreeDNDController(this);
}
}, listenTree:function (tree) {
dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.subscribe(tree.eventNames.treeClick, this, "onTreeClick");
dojo.event.topic.subscribe(tree.eventNames.treeCreate, this, "onTreeCreate");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
if (this.DNDController) {
this.DNDController.listenTree(tree);
}
}, unlistenTree:function (tree) {
dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeClick, this, "onTreeClick");
dojo.event.topic.unsubscribe(tree.eventNames.treeCreate, this, "onTreeCreate");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
}, onTreeDestroy:function (message) {
var tree = message.source;
this.unlistenTree(tree);
if (this.dieWithTree) {
this.destroy();
}
}, onCreateDOMNode:function (message) {
var node = message.source;
if (node.expandLevel > 0) {
this.expandToLevel(node, node.expandLevel);
}
}, onTreeCreate:function (message) {
var tree = message.source;
var _this = this;
if (tree.expandLevel) {
dojo.lang.forEach(tree.children, function (child) {
_this.expandToLevel(child, tree.expandLevel - 1);
});
}
}, expandToLevel:function (node, level) {
if (level == 0) {
return;
}
var children = node.children;
var _this = this;
var handler = function (node, expandLevel) {
this.node = node;
this.expandLevel = expandLevel;
this.process = function () {
for (var i = 0; i < this.node.children.length; i++) {
var child = node.children[i];
_this.expandToLevel(child, this.expandLevel);
}
};
};
var h = new handler(node, level - 1);
this.expand(node, false, h, h.process);
}, onTreeClick:function (message) {
var node = message.source;
if (node.isLocked()) {
return false;
}
if (node.isExpanded) {
this.collapse(node);
} else {
this.expand(node);
}
}, expand:function (node, sync, callObj, callFunc) {
node.expand();
if (callFunc) {
callFunc.apply(callObj, [node]);
}
}, collapse:function (node) {
node.collapse();
}, canMove:function (child, newParent) {
if (child.actionIsDisabled(child.actions.MOVE)) {
return false;
}
if (child.parent !== newParent && newParent.actionIsDisabled(newParent.actions.ADDCHILD)) {
return false;
}
var node = newParent;
while (node.isTreeNode) {
if (node === child) {
return false;
}
node = node.parent;
}
return true;
}, move:function (child, newParent, index) {
if (!this.canMove(child, newParent)) {
return false;
}
var result = this.doMove(child, newParent, index);
if (!result) {
return result;
}
if (newParent.isTreeNode) {
this.expand(newParent);
}
return result;
}, doMove:function (child, newParent, index) {
child.tree.move(child, newParent, index);
return true;
}, canRemoveNode:function (child) {
if (child.actionIsDisabled(child.actions.REMOVE)) {
return false;
}
return true;
}, removeNode:function (node, callObj, callFunc) {
if (!this.canRemoveNode(node)) {
return false;
}
return this.doRemoveNode(node, callObj, callFunc);
}, doRemoveNode:function (node, callObj, callFunc) {
node.tree.removeNode(node);
if (callFunc) {
callFunc.apply(dojo.lang.isUndefined(callObj) ? this : callObj, [node]);
}
}, canCreateChild:function (parent, index, data) {
if (parent.actionIsDisabled(parent.actions.ADDCHILD)) {
return false;
}
return true;
}, createChild:function (parent, index, data, callObj, callFunc) {
if (!this.canCreateChild(parent, index, data)) {
return false;
}
return this.doCreateChild.apply(this, arguments);
}, doCreateChild:function (parent, index, data, callObj, callFunc) {
var widgetType = data.widgetType ? data.widgetType : "TreeNode";
var newChild = dojo.widget.createWidget(widgetType, data);
parent.addChild(newChild, index);
this.expand(parent);
if (callFunc) {
callFunc.apply(callObj, [newChild]);
}
return newChild;
}});
 
/trunk/api/js/dojo/src/widget/TreeEditor.js
New file
0,0 → 1,65
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.RichText");
dojo.provide("dojo.widget.TreeEditor");
dojo.widget.defineWidget("dojo.widget.TreeEditor", dojo.widget.HtmlWidget, {singleLineMode:false, saveOnBlur:true, sync:false, selectOnOpen:true, controller:null, node:null, richTextParams:{styleSheets:"src/widget/templates/TreeEditor.css"}, getContents:function () {
return this.richText.getEditorContent();
}, open:function (node) {
if (!this.richText) {
this.richText = dojo.widget.createWidget("RichText", this.richTextParams, node.labelNode);
dojo.event.connect("around", this.richText, "onKeyDown", this, "richText_onKeyDown");
dojo.event.connect(this.richText, "onBlur", this, "richText_onBlur");
var self = this;
dojo.event.connect(this.richText, "onLoad", function () {
if (self.selectOnOpen) {
self.richText.execCommand("selectall");
}
});
} else {
this.richText.open(node.labelNode);
}
this.node = node;
}, close:function (save) {
this.richText.close(save);
this.node = null;
}, isClosed:function () {
return !this.richText || this.richText.isClosed;
}, execCommand:function () {
this.richText.execCommand.apply(this.richText, arguments);
}, richText_onKeyDown:function (invocation) {
var e = invocation.args[0];
if ((!e) && (this.object)) {
e = dojo.event.browser.fixEvent(this.editor.window.event);
}
switch (e.keyCode) {
case e.KEY_ESCAPE:
this.finish(false);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_ENTER:
if (e.ctrlKey && !this.singleLineMode) {
this.execCommand("inserthtml", "<br/>");
} else {
this.finish(true);
}
dojo.event.browser.stopEvent(e);
break;
default:
return invocation.proceed();
}
}, richText_onBlur:function () {
this.finish(this.saveOnBlur);
}, finish:function (save) {
return this.controller.editLabelFinish(save, this.sync);
}});
 
/trunk/api/js/dojo/src/widget/FloatingPane.js
New file
0,0 → 1,247
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.FloatingPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.iframe");
dojo.require("dojo.html.selection");
dojo.require("dojo.lfx.shadow");
dojo.require("dojo.widget.html.layout");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.dnd.HtmlDragMove");
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.widget.ResizeHandle");
dojo.declare("dojo.widget.FloatingPaneBase", null, {title:"", iconSrc:"", hasShadow:false, constrainToContainer:false, taskBarId:"", resizable:true, titleBarDisplay:true, windowState:"normal", displayCloseAction:false, displayMinimizeAction:false, displayMaximizeAction:false, _max_taskBarConnectAttempts:5, _taskBarConnectAttempts:0, templateString:"<div id=\"${this.widgetId}\" dojoAttachEvent=\"onMouseDown\" class=\"dojoFloatingPane\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoFloatingPaneTitleBar\" style=\"display:none\">\n\t \t<img dojoAttachPoint=\"titleBarIcon\" class=\"dojoFloatingPaneTitleBarIcon\">\n\t\t<div dojoAttachPoint=\"closeAction\" dojoAttachEvent=\"onClick:closeWindow\"\n \t \t\tclass=\"dojoFloatingPaneCloseIcon\"></div>\n\t\t<div dojoAttachPoint=\"restoreAction\" dojoAttachEvent=\"onClick:restoreWindow\"\n \t \t\tclass=\"dojoFloatingPaneRestoreIcon\"></div>\n\t\t<div dojoAttachPoint=\"maximizeAction\" dojoAttachEvent=\"onClick:maximizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMaximizeIcon\"></div>\n\t\t<div dojoAttachPoint=\"minimizeAction\" dojoAttachEvent=\"onClick:minimizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMinimizeIcon\"></div>\n\t \t<div dojoAttachPoint=\"titleBarText\" class=\"dojoFloatingPaneTitleText\">${this.title}</div>\n\t</div>\n\n\t<div id=\"${this.widgetId}_container\" dojoAttachPoint=\"containerNode\" class=\"dojoFloatingPaneClient\"></div>\n\n\t<div dojoAttachPoint=\"resizeBar\" class=\"dojoFloatingPaneResizebar\" style=\"display:none\"></div>\n</div>\n", templateCssString:"\n/********** Outer Window ***************/\n\n.dojoFloatingPane {\n\t/* essential css */\n\tposition: absolute;\n\toverflow: visible;\t\t/* so drop shadow is displayed */\n\tz-index: 10;\n\n\t/* styling css */\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tbackground-color: ThreeDFace;\n}\n\n\n/********** Title Bar ****************/\n\n.dojoFloatingPaneTitleBar {\n\tvertical-align: top;\n\tmargin: 2px 2px 2px 2px;\n\tz-index: 10;\n\tbackground-color: #7596c6;\n\tcursor: default;\n\toverflow: hidden;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tvertical-align: middle;\n}\n\n.dojoFloatingPaneTitleText {\n\tfloat: left;\n\tpadding: 2px 4px 2px 2px;\n\twhite-space: nowrap;\n\tcolor: CaptionText;\n\tfont: small-caption;\n}\n\n.dojoTitleBarIcon {\n\tfloat: left;\n\theight: 22px;\n\twidth: 22px;\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\n}\n\n.dojoFloatingPaneActions{\n\tfloat: right;\n\tposition: absolute;\n\tright: 2px;\n\ttop: 2px;\n\tvertical-align: middle;\n}\n\n\n.dojoFloatingPaneActionItem {\n\tvertical-align: middle;\n\tmargin-right: 1px;\n\theight: 22px;\n\twidth: 22px;\n}\n\n\n.dojoFloatingPaneTitleBarIcon {\n\t/* essential css */\n\tfloat: left;\n\n\t/* styling css */\n\tmargin-left: 2px;\n\tmargin-right: 4px;\n\theight: 22px;\n}\n\n/* minimize/maximize icons are specified by CSS only */\n.dojoFloatingPaneMinimizeIcon,\n.dojoFloatingPaneMaximizeIcon,\n.dojoFloatingPaneRestoreIcon,\n.dojoFloatingPaneCloseIcon {\n\tvertical-align: middle;\n\theight: 22px;\n\twidth: 22px;\n\tfloat: right;\n}\n.dojoFloatingPaneMinimizeIcon {\n\tbackground-image: url(images/floatingPaneMinimize.gif);\n}\n.dojoFloatingPaneMaximizeIcon {\n\tbackground-image: url(images/floatingPaneMaximize.gif);\n}\n.dojoFloatingPaneRestoreIcon {\n\tbackground-image: url(images/floatingPaneRestore.gif);\n}\n.dojoFloatingPaneCloseIcon {\n\tbackground-image: url(images/floatingPaneClose.gif);\n}\n\n/* bar at bottom of window that holds resize handle */\n.dojoFloatingPaneResizebar {\n\tz-index: 10;\n\theight: 13px;\n\tbackground-color: ThreeDFace;\n}\n\n/************* Client Area ***************/\n\n.dojoFloatingPaneClient {\n\tposition: relative;\n\tz-index: 10;\n\tborder: 1px solid;\n\tborder-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;\n\tmargin: 2px;\n\tbackground-color: ThreeDFace;\n\tpadding: 8px;\n\tfont-family: Verdana, Helvetica, Garamond, sans-serif;\n\tfont-size: 12px;\n\toverflow: auto;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/FloatingPane.css"), fillInFloatingPaneTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
dojo.body().appendChild(this.domNode);
if (!this.isShowing()) {
this.windowState = "minimized";
}
if (this.iconSrc == "") {
dojo.html.removeNode(this.titleBarIcon);
} else {
this.titleBarIcon.src = this.iconSrc.toString();
}
if (this.titleBarDisplay) {
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 = "";
this.resizeHandle = dojo.widget.createWidget("ResizeHandle", {targetElmId:this.widgetId, id:this.widgetId + "_resize"});
this.resizeBar.appendChild(this.resizeHandle.domNode);
}
if (this.hasShadow) {
this.shadow = new dojo.lfx.shadow(this.domNode);
}
this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
if (this.taskBarId) {
this._taskBarSetup();
}
dojo.body().removeChild(this.domNode);
}, postCreate:function () {
if (dojo.hostenv.post_load_) {
this._setInitialWindowState();
} else {
dojo.addOnLoad(this, "_setInitialWindowState");
}
}, maximizeWindow:function (evt) {
var mb = dojo.html.getMarginBox(this.domNode);
this.previous = {width:mb.width || this.width, height:mb.height || this.height, left:this.domNode.style.left, top:this.domNode.style.top, bottom:this.domNode.style.bottom, right:this.domNode.style.right};
if (this.domNode.parentNode.style.overflow.toLowerCase() != "hidden") {
this.parentPrevious = {overflow:this.domNode.parentNode.style.overflow};
dojo.debug(this.domNode.parentNode.style.overflow);
this.domNode.parentNode.style.overflow = "hidden";
}
this.domNode.style.left = dojo.html.getPixelValue(this.domNode.parentNode, "padding-left", true) + "px";
this.domNode.style.top = dojo.html.getPixelValue(this.domNode.parentNode, "padding-top", true) + "px";
if ((this.domNode.parentNode.nodeName.toLowerCase() == "body")) {
var viewport = dojo.html.getViewport();
var padding = dojo.html.getPadding(dojo.body());
this.resizeTo(viewport.width - padding.width, viewport.height - padding.height);
} else {
var content = dojo.html.getContentBox(this.domNode.parentNode);
this.resizeTo(content.width, content.height);
}
this.maximizeAction.style.display = "none";
this.restoreAction.style.display = "";
if (this.resizeHandle) {
this.resizeHandle.domNode.style.display = "none";
}
this.drag.setDragHandle(null);
this.windowState = "maximized";
}, minimizeWindow:function (evt) {
this.hide();
for (var attr in this.parentPrevious) {
this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
}
this.lastWindowState = this.windowState;
this.windowState = "minimized";
}, restoreWindow:function (evt) {
if (this.windowState == "minimized") {
this.show();
if (this.lastWindowState == "maximized") {
this.domNode.parentNode.style.overflow = "hidden";
this.windowState = "maximized";
} else {
this.windowState = "normal";
}
} else {
if (this.windowState == "maximized") {
for (var attr in this.previous) {
this.domNode.style[attr] = this.previous[attr];
}
for (var attr in this.parentPrevious) {
this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
}
this.resizeTo(this.previous.width, this.previous.height);
this.previous = null;
this.parentPrevious = null;
this.restoreAction.style.display = "none";
this.maximizeAction.style.display = this.displayMaximizeAction ? "" : "none";
if (this.resizeHandle) {
this.resizeHandle.domNode.style.display = "";
}
this.drag.setDragHandle(this.titleBar);
this.windowState = "normal";
} else {
}
}
}, toggleDisplay:function () {
if (this.windowState == "minimized") {
this.restoreWindow();
} else {
this.minimizeWindow();
}
}, closeWindow:function (evt) {
dojo.html.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 * 2;
}
}, _setInitialWindowState:function () {
if (this.isShowing()) {
this.width = -1;
var mb = dojo.html.getMarginBox(this.domNode);
this.resizeTo(mb.width, mb.height);
}
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";
}, _taskBarSetup:function () {
var taskbar = dojo.widget.getWidgetById(this.taskBarId);
if (!taskbar) {
if (this._taskBarConnectAttempts < this._max_taskBarConnectAttempts) {
dojo.lang.setTimeout(this, this._taskBarSetup, 50);
this._taskBarConnectAttempts++;
} else {
dojo.debug("Unable to connect to the taskBar");
}
return;
}
taskbar.addChild(this);
}, showFloatingPane:function () {
this.bringToTop();
}, onFloatingPaneShow:function () {
var mb = dojo.html.getMarginBox(this.domNode);
this.resizeTo(mb.width, mb.height);
}, resizeTo:function (width, height) {
dojo.html.setMarginBox(this.domNode, {width:width, height:height});
dojo.widget.html.layout(this.domNode, [{domNode:this.titleBar, layoutAlign:"top"}, {domNode:this.resizeBar, layoutAlign:"bottom"}, {domNode:this.containerNode, layoutAlign:"client"}]);
dojo.widget.html.layout(this.containerNode, this.children, "top-bottom");
this.bgIframe.onResized();
if (this.shadow) {
this.shadow.size(width, height);
}
this.onResized();
}, checkSize:function () {
}, destroyFloatingPane:function () {
if (this.resizeHandle) {
this.resizeHandle.destroy();
this.resizeHandle = null;
}
}});
dojo.widget.defineWidget("dojo.widget.FloatingPane", [dojo.widget.ContentPane, dojo.widget.FloatingPaneBase], {fillInTemplate:function (args, frag) {
this.fillInFloatingPaneTemplate(args, frag);
dojo.widget.FloatingPane.superclass.fillInTemplate.call(this, args, frag);
}, postCreate:function () {
dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this, arguments);
dojo.widget.FloatingPane.superclass.postCreate.apply(this, arguments);
}, show:function () {
dojo.widget.FloatingPane.superclass.show.apply(this, arguments);
this.showFloatingPane();
}, onShow:function () {
dojo.widget.FloatingPane.superclass.onShow.call(this);
this.onFloatingPaneShow();
}, destroy:function () {
this.destroyFloatingPane();
dojo.widget.FloatingPane.superclass.destroy.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.ModalFloatingPane", [dojo.widget.FloatingPane, dojo.widget.ModalDialogBase], {windowState:"minimized", displayCloseAction:true, postCreate:function () {
dojo.widget.ModalDialogBase.prototype.postCreate.call(this);
dojo.widget.ModalFloatingPane.superclass.postCreate.call(this);
}, show:function () {
this.showModalDialog();
dojo.widget.ModalFloatingPane.superclass.show.apply(this, arguments);
this.bg.style.zIndex = this.domNode.style.zIndex - 1;
}, hide:function () {
this.hideModalDialog();
dojo.widget.ModalFloatingPane.superclass.hide.apply(this, arguments);
}, closeWindow:function () {
this.hide();
dojo.widget.ModalFloatingPane.superclass.closeWindow.apply(this, arguments);
}});
 
/trunk/api/js/dojo/src/widget/RegexpTextbox.js
New file
0,0 → 1,25
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RegexpTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.widget.defineWidget("dojo.widget.RegexpTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.RegexpTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.regexp) {
this.flags.regexp = localProperties.regexp;
}
if (localProperties.flags) {
this.flags.flags = localProperties.flags;
}
}, isValid:function () {
var regexp = new RegExp(this.flags.regexp, this.flags.flags);
return regexp.test(this.textbox.value);
}});
 
/trunk/api/js/dojo/src/widget/Editor2.js
New file
0,0 → 1,410
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.RichText");
dojo.require("dojo.widget.Editor2Toolbar");
dojo.require("dojo.uri.cache");
dojo.widget.Editor2Manager = new dojo.widget.HandlerManager;
dojo.lang.mixin(dojo.widget.Editor2Manager, {_currentInstance:null, commandState:{Disabled:0, Latched:1, Enabled:2}, getCurrentInstance:function () {
return this._currentInstance;
}, setCurrentInstance:function (inst) {
this._currentInstance = inst;
}, getCommand:function (editor, name) {
var oCommand;
name = name.toLowerCase();
for (var i = 0; i < this._registeredHandlers.length; i++) {
oCommand = this._registeredHandlers[i](editor, name);
if (oCommand) {
return oCommand;
}
}
switch (name) {
case "htmltoggle":
oCommand = new dojo.widget.Editor2BrowserCommand(editor, name);
break;
case "formatblock":
oCommand = new dojo.widget.Editor2FormatBlockCommand(editor, name);
break;
case "anchor":
oCommand = new dojo.widget.Editor2Command(editor, name);
break;
case "createlink":
oCommand = new dojo.widget.Editor2DialogCommand(editor, name, {contentFile:"dojo.widget.Editor2Plugin.CreateLinkDialog", contentClass:"Editor2CreateLinkDialog", title:"Insert/Edit Link", width:"300px", height:"200px"});
break;
case "insertimage":
oCommand = new dojo.widget.Editor2DialogCommand(editor, name, {contentFile:"dojo.widget.Editor2Plugin.InsertImageDialog", contentClass:"Editor2InsertImageDialog", title:"Insert/Edit Image", width:"400px", height:"270px"});
break;
default:
var curtInst = this.getCurrentInstance();
if ((curtInst && curtInst.queryCommandAvailable(name)) || (!curtInst && dojo.widget.Editor2.prototype.queryCommandAvailable(name))) {
oCommand = new dojo.widget.Editor2BrowserCommand(editor, name);
} else {
dojo.debug("dojo.widget.Editor2Manager.getCommand: Unknown command " + name);
return;
}
}
return oCommand;
}, destroy:function () {
this._currentInstance = null;
dojo.widget.HandlerManager.prototype.destroy.call(this);
}});
dojo.addOnUnload(dojo.widget.Editor2Manager, "destroy");
dojo.lang.declare("dojo.widget.Editor2Command", null, function (editor, name) {
this._editor = editor;
this._updateTime = 0;
this._name = name;
}, {_text:"Unknown", execute:function (para) {
dojo.unimplemented("dojo.widget.Editor2Command.execute");
}, getText:function () {
return this._text;
}, getState:function () {
return dojo.widget.Editor2Manager.commandState.Enabled;
}, destroy:function () {
}});
dojo.widget.Editor2BrowserCommandNames = {"bold":"Bold", "copy":"Copy", "cut":"Cut", "Delete":"Delete", "indent":"Indent", "inserthorizontalrule":"Horizental Rule", "insertorderedlist":"Numbered List", "insertunorderedlist":"Bullet List", "italic":"Italic", "justifycenter":"Align Center", "justifyfull":"Justify", "justifyleft":"Align Left", "justifyright":"Align Right", "outdent":"Outdent", "paste":"Paste", "redo":"Redo", "removeformat":"Remove Format", "selectall":"Select All", "strikethrough":"Strikethrough", "subscript":"Subscript", "superscript":"Superscript", "underline":"Underline", "undo":"Undo", "unlink":"Remove Link", "createlink":"Create Link", "insertimage":"Insert Image", "htmltoggle":"HTML Source", "forecolor":"Foreground Color", "hilitecolor":"Background Color", "plainformatblock":"Paragraph Style", "formatblock":"Paragraph Style", "fontsize":"Font Size", "fontname":"Font Name"};
dojo.lang.declare("dojo.widget.Editor2BrowserCommand", dojo.widget.Editor2Command, function (editor, name) {
var text = dojo.widget.Editor2BrowserCommandNames[name.toLowerCase()];
if (text) {
this._text = text;
}
}, {execute:function (para) {
this._editor.execCommand(this._name, para);
}, getState:function () {
if (this._editor._lastStateTimestamp > this._updateTime || this._state == undefined) {
this._updateTime = this._editor._lastStateTimestamp;
try {
if (this._editor.queryCommandEnabled(this._name)) {
if (this._editor.queryCommandState(this._name)) {
this._state = dojo.widget.Editor2Manager.commandState.Latched;
} else {
this._state = dojo.widget.Editor2Manager.commandState.Enabled;
}
} else {
this._state = dojo.widget.Editor2Manager.commandState.Disabled;
}
}
catch (e) {
this._state = dojo.widget.Editor2Manager.commandState.Enabled;
}
}
return this._state;
}, getValue:function () {
try {
return this._editor.queryCommandValue(this._name);
}
catch (e) {
}
}});
dojo.lang.declare("dojo.widget.Editor2FormatBlockCommand", dojo.widget.Editor2BrowserCommand, {});
dojo.require("dojo.widget.FloatingPane");
dojo.widget.defineWidget("dojo.widget.Editor2Dialog", [dojo.widget.HtmlWidget, dojo.widget.FloatingPaneBase, dojo.widget.ModalDialogBase], {templateString:"<div id=\"${this.widgetId}\" class=\"dojoFloatingPane\">\n\t<span dojoattachpoint=\"tabStartOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\"\ttabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabStart\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoFloatingPaneTitleBar\" style=\"display:none\">\n\t \t<img dojoAttachPoint=\"titleBarIcon\" class=\"dojoFloatingPaneTitleBarIcon\">\n\t\t<div dojoAttachPoint=\"closeAction\" dojoAttachEvent=\"onClick:hide\"\n \t \t\tclass=\"dojoFloatingPaneCloseIcon\"></div>\n\t\t<div dojoAttachPoint=\"restoreAction\" dojoAttachEvent=\"onClick:restoreWindow\"\n \t \t\tclass=\"dojoFloatingPaneRestoreIcon\"></div>\n\t\t<div dojoAttachPoint=\"maximizeAction\" dojoAttachEvent=\"onClick:maximizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMaximizeIcon\"></div>\n\t\t<div dojoAttachPoint=\"minimizeAction\" dojoAttachEvent=\"onClick:minimizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMinimizeIcon\"></div>\n\t \t<div dojoAttachPoint=\"titleBarText\" class=\"dojoFloatingPaneTitleText\">${this.title}</div>\n\t</div>\n\n\t<div id=\"${this.widgetId}_container\" dojoAttachPoint=\"containerNode\" class=\"dojoFloatingPaneClient\"></div>\n\t<span dojoattachpoint=\"tabEnd\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabEndOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoAttachPoint=\"resizeBar\" class=\"dojoFloatingPaneResizebar\" style=\"display:none\"></div>\n</div>\n", modal:true, width:"", height:"", windowState:"minimized", displayCloseAction:true, contentFile:"", contentClass:"", fillInTemplate:function (args, frag) {
this.fillInFloatingPaneTemplate(args, frag);
dojo.widget.Editor2Dialog.superclass.fillInTemplate.call(this, args, frag);
}, postCreate:function () {
if (this.contentFile) {
dojo.require(this.contentFile);
}
if (this.modal) {
dojo.widget.ModalDialogBase.prototype.postCreate.call(this);
} else {
with (this.domNode.style) {
zIndex = 999;
display = "none";
}
}
dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this, arguments);
dojo.widget.Editor2Dialog.superclass.postCreate.call(this);
if (this.width && this.height) {
with (this.domNode.style) {
width = this.width;
height = this.height;
}
}
}, createContent:function () {
if (!this.contentWidget && this.contentClass) {
this.contentWidget = dojo.widget.createWidget(this.contentClass);
this.addChild(this.contentWidget);
}
}, show:function () {
if (!this.contentWidget) {
dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);
this.createContent();
dojo.widget.Editor2Dialog.superclass.hide.call(this);
}
if (!this.contentWidget || !this.contentWidget.loadContent()) {
return;
}
this.showFloatingPane();
dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);
if (this.modal) {
this.showModalDialog();
}
if (this.modal) {
this.bg.style.zIndex = this.domNode.style.zIndex - 1;
}
}, onShow:function () {
dojo.widget.Editor2Dialog.superclass.onShow.call(this);
this.onFloatingPaneShow();
}, closeWindow:function () {
this.hide();
dojo.widget.Editor2Dialog.superclass.closeWindow.apply(this, arguments);
}, hide:function () {
if (this.modal) {
this.hideModalDialog();
}
dojo.widget.Editor2Dialog.superclass.hide.call(this);
}, checkSize:function () {
if (this.isShowing()) {
if (this.modal) {
this._sizeBackground();
}
this.placeModalDialog();
this.onResized();
}
}});
dojo.widget.defineWidget("dojo.widget.Editor2DialogContent", dojo.widget.HtmlWidget, {widgetsInTemplate:true, loadContent:function () {
return true;
}, cancel:function () {
this.parent.hide();
}});
dojo.lang.declare("dojo.widget.Editor2DialogCommand", dojo.widget.Editor2BrowserCommand, function (editor, name, dialogParas) {
this.dialogParas = dialogParas;
}, {execute:function () {
if (!this.dialog) {
if (!this.dialogParas.contentFile || !this.dialogParas.contentClass) {
alert("contentFile and contentClass should be set for dojo.widget.Editor2DialogCommand.dialogParas!");
return;
}
this.dialog = dojo.widget.createWidget("Editor2Dialog", this.dialogParas);
dojo.body().appendChild(this.dialog.domNode);
dojo.event.connect(this, "destroy", this.dialog, "destroy");
}
this.dialog.show();
}, getText:function () {
return this.dialogParas.title || dojo.widget.Editor2DialogCommand.superclass.getText.call(this);
}});
dojo.widget.Editor2ToolbarGroups = {};
dojo.widget.defineWidget("dojo.widget.Editor2", dojo.widget.RichText, function () {
this._loadedCommands = {};
}, {toolbarAlwaysVisible:false, toolbarWidget:null, scrollInterval:null, toolbarTemplatePath:dojo.uri.cache.set(dojo.uri.moduleUri("dojo.widget", "templates/EditorToolbarOneline.html"), "<div class=\"EditorToolbarDomNode EditorToolbarSmallBg\">\n\t<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\">\n\t\t<tbody>\n\t\t\t<tr valign=\"top\" align=\"left\">\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"htmltoggle\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon\" \n\t\t\t\t\t\tstyle=\"background-image: none; width: 30px;\" >&lt;h&gt;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"copy\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Copy\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"paste\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Paste\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"undo\">\n\t\t\t\t\t\t<!-- FIXME: should we have the text \"undo\" here? -->\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Undo\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"redo\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Redo\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\"\tstyle=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"createlink\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Link\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertimage\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Image\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"inserthorizontalrule\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_HorizontalLine \">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"bold\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Bold\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"italic\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Italic\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"underline\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Underline\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"strikethrough\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_StrikeThrough\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" \n\t\t\t\t\t\t\tstyle=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertunorderedlist\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_BulletedList\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertorderedlist\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_NumberedList\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"indent\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Indent\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"outdent\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Outdent\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"forecolor\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_TextColor\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"hilitecolor\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_BackgroundColor\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyleft\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_LeftJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifycenter\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_CenterJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyright\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_RightJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyfull\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_BlockJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\t\n\t\t\t\t<td>\n\t\t\t\t\t<select class=\"dojoEditorToolbarItem\" dojoETItemName=\"plainformatblock\">\n\t\t\t\t\t\t<!-- FIXME: using \"p\" here inserts a paragraph in most cases! -->\n\t\t\t\t\t\t<option value=\"\">-- format --</option>\n\t\t\t\t\t\t<option value=\"p\">Normal</option>\n\t\t\t\t\t\t<option value=\"pre\">Fixed Font</option>\n\t\t\t\t\t\t<option value=\"h1\">Main Heading</option>\n\t\t\t\t\t\t<option value=\"h2\">Section Heading</option>\n\t\t\t\t\t\t<option value=\"h3\">Sub-Heading</option>\n\t\t\t\t\t\t<!-- <option value=\"blockquote\">Block Quote</option> -->\n\t\t\t\t\t</select>\n\t\t\t\t</td>\n\t\t\t\t<td><!-- uncomment to enable save button -->\n\t\t\t\t\t<!-- save -->\n\t\t\t\t\t<!--span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"save\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Save\">&nbsp;</span>\n\t\t\t\t\t</span-->\n\t\t\t\t</td>\n\t\t\t\t<td width=\"*\">&nbsp;</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n"), toolbarTemplateCssPath:null, toolbarPlaceHolder:"", _inSourceMode:false, _htmlEditNode:null, toolbarGroup:"", shareToolbar:false, contextMenuGroupSet:"", editorOnLoad:function () {
dojo.event.topic.publish("dojo.widget.Editor2::preLoadingToolbar", this);
if (this.toolbarAlwaysVisible) {
dojo.require("dojo.widget.Editor2Plugin.AlwaysShowToolbar");
}
if (this.toolbarWidget) {
this.toolbarWidget.show();
dojo.html.insertBefore(this.toolbarWidget.domNode, this.domNode.firstChild);
} else {
if (this.shareToolbar) {
dojo.deprecated("Editor2:shareToolbar is deprecated in favor of toolbarGroup", "0.5");
this.toolbarGroup = "defaultDojoToolbarGroup";
}
if (this.toolbarGroup) {
if (dojo.widget.Editor2ToolbarGroups[this.toolbarGroup]) {
this.toolbarWidget = dojo.widget.Editor2ToolbarGroups[this.toolbarGroup];
}
}
if (!this.toolbarWidget) {
var tbOpts = {shareGroup:this.toolbarGroup, parent:this};
tbOpts.templateString = dojo.uri.cache.get(this.toolbarTemplatePath);
if (this.toolbarTemplateCssPath) {
tbOpts.templateCssPath = this.toolbarTemplateCssPath;
tbOpts.templateCssString = dojo.uri.cache.get(this.toolbarTemplateCssPath);
}
if (this.toolbarPlaceHolder) {
this.toolbarWidget = dojo.widget.createWidget("Editor2Toolbar", tbOpts, dojo.byId(this.toolbarPlaceHolder), "after");
} else {
this.toolbarWidget = dojo.widget.createWidget("Editor2Toolbar", tbOpts, this.domNode.firstChild, "before");
}
if (this.toolbarGroup) {
dojo.widget.Editor2ToolbarGroups[this.toolbarGroup] = this.toolbarWidget;
}
dojo.event.connect(this, "close", this.toolbarWidget, "hide");
this.toolbarLoaded();
}
}
dojo.event.topic.registerPublisher("Editor2.clobberFocus", this, "clobberFocus");
dojo.event.topic.subscribe("Editor2.clobberFocus", this, "setBlur");
dojo.event.topic.publish("dojo.widget.Editor2::onLoad", this);
}, toolbarLoaded:function () {
}, registerLoadedPlugin:function (obj) {
if (!this.loadedPlugins) {
this.loadedPlugins = [];
}
this.loadedPlugins.push(obj);
}, unregisterLoadedPlugin:function (obj) {
for (var i in this.loadedPlugins) {
if (this.loadedPlugins[i] === obj) {
delete this.loadedPlugins[i];
return;
}
}
dojo.debug("dojo.widget.Editor2.unregisterLoadedPlugin: unknow plugin object: " + obj);
}, execCommand:function (command, argument) {
switch (command.toLowerCase()) {
case "htmltoggle":
this.toggleHtmlEditing();
break;
default:
dojo.widget.Editor2.superclass.execCommand.apply(this, arguments);
}
}, queryCommandEnabled:function (command, argument) {
switch (command.toLowerCase()) {
case "htmltoggle":
return true;
default:
if (this._inSourceMode) {
return false;
}
return dojo.widget.Editor2.superclass.queryCommandEnabled.apply(this, arguments);
}
}, queryCommandState:function (command, argument) {
switch (command.toLowerCase()) {
case "htmltoggle":
return this._inSourceMode;
default:
return dojo.widget.Editor2.superclass.queryCommandState.apply(this, arguments);
}
}, onClick:function (e) {
dojo.widget.Editor2.superclass.onClick.call(this, e);
if (dojo.widget.PopupManager) {
if (!e) {
e = this.window.event;
}
dojo.widget.PopupManager.onClick(e);
}
}, clobberFocus:function () {
}, toggleHtmlEditing:function () {
if (this === dojo.widget.Editor2Manager.getCurrentInstance()) {
if (!this._inSourceMode) {
var html = this.getEditorContent();
this._inSourceMode = true;
if (!this._htmlEditNode) {
this._htmlEditNode = dojo.doc().createElement("textarea");
dojo.html.insertAfter(this._htmlEditNode, this.editorObject);
}
this._htmlEditNode.style.display = "";
this._htmlEditNode.style.width = "100%";
this._htmlEditNode.style.height = dojo.html.getBorderBox(this.editNode).height + "px";
this._htmlEditNode.value = html;
with (this.editorObject.style) {
position = "absolute";
left = "-2000px";
top = "-2000px";
}
} else {
this._inSourceMode = false;
this._htmlEditNode.blur();
with (this.editorObject.style) {
position = "";
left = "";
top = "";
}
var html = this._htmlEditNode.value;
dojo.lang.setTimeout(this, "replaceEditorContent", 1, html);
this._htmlEditNode.style.display = "none";
this.focus();
}
this.onDisplayChanged(null, true);
}
}, setFocus:function () {
if (dojo.widget.Editor2Manager.getCurrentInstance() === this) {
return;
}
this.clobberFocus();
dojo.widget.Editor2Manager.setCurrentInstance(this);
}, setBlur:function () {
}, saveSelection:function () {
this._bookmark = null;
this._bookmark = dojo.withGlobal(this.window, dojo.html.selection.getBookmark);
}, restoreSelection:function () {
if (this._bookmark) {
this.focus();
dojo.withGlobal(this.window, "moveToBookmark", dojo.html.selection, [this._bookmark]);
this._bookmark = null;
} else {
dojo.debug("restoreSelection: no saved selection is found!");
}
}, _updateToolbarLastRan:null, _updateToolbarTimer:null, _updateToolbarFrequency:500, updateToolbar:function (force) {
if ((!this.isLoaded) || (!this.toolbarWidget)) {
return;
}
var diff = new Date() - this._updateToolbarLastRan;
if ((!force) && (this._updateToolbarLastRan) && ((diff < this._updateToolbarFrequency))) {
clearTimeout(this._updateToolbarTimer);
var _this = this;
this._updateToolbarTimer = setTimeout(function () {
_this.updateToolbar();
}, this._updateToolbarFrequency / 2);
return;
} else {
this._updateToolbarLastRan = new Date();
}
if (dojo.widget.Editor2Manager.getCurrentInstance() !== this) {
return;
}
this.toolbarWidget.update();
}, destroy:function (finalize) {
this._htmlEditNode = null;
dojo.event.disconnect(this, "close", this.toolbarWidget, "hide");
if (!finalize) {
this.toolbarWidget.destroy();
}
dojo.widget.Editor2.superclass.destroy.call(this);
}, _lastStateTimestamp:0, onDisplayChanged:function (e, forceUpdate) {
this._lastStateTimestamp = (new Date()).getTime();
dojo.widget.Editor2.superclass.onDisplayChanged.call(this, e);
this.updateToolbar(forceUpdate);
}, onLoad:function () {
try {
dojo.widget.Editor2.superclass.onLoad.call(this);
}
catch (e) {
dojo.debug(e);
}
this.editorOnLoad();
}, onFocus:function () {
dojo.widget.Editor2.superclass.onFocus.call(this);
this.setFocus();
}, getEditorContent:function () {
if (this._inSourceMode) {
return this._htmlEditNode.value;
}
return dojo.widget.Editor2.superclass.getEditorContent.call(this);
}, replaceEditorContent:function (html) {
if (this._inSourceMode) {
this._htmlEditNode.value = html;
return;
}
dojo.widget.Editor2.superclass.replaceEditorContent.apply(this, arguments);
}, getCommand:function (name) {
if (this._loadedCommands[name]) {
return this._loadedCommands[name];
}
var cmd = dojo.widget.Editor2Manager.getCommand(this, name);
this._loadedCommands[name] = cmd;
return cmd;
}, shortcuts:[["bold"], ["italic"], ["underline"], ["selectall", "a"], ["insertunorderedlist", "\\"]], setupDefaultShortcuts:function () {
var exec = function (cmd) {
return function () {
cmd.execute();
};
};
var self = this;
dojo.lang.forEach(this.shortcuts, function (item) {
var cmd = self.getCommand(item[0]);
if (cmd) {
self.addKeyHandler(item[1] ? item[1] : item[0].charAt(0), item[2] == undefined ? self.KEY_CTRL : item[2], exec(cmd));
}
});
}});
 
/trunk/api/js/dojo/src/widget/TreeSelectorV3.js
New file
0,0 → 1,158
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeSelectorV3");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeCommon");
dojo.widget.defineWidget("dojo.widget.TreeSelectorV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.eventNames = {};
this.listenedTrees = {};
this.selectedNodes = [];
this.lastClicked = {};
}, {listenTreeEvents:["afterTreeCreate", "afterCollapse", "afterChangeTree", "afterDetach", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, allowedMulti:true, dblselectTimeout:300, eventNamesDefault:{select:"select", deselect:"deselect", dblselect:"dblselect"}, onAfterTreeCreate:function (message) {
var tree = message.source;
dojo.event.browser.addListener(tree.domNode, "onclick", dojo.lang.hitch(this, this.onTreeClick));
if (dojo.render.html.ie) {
dojo.event.browser.addListener(tree.domNode, "ondblclick", dojo.lang.hitch(this, this.onTreeDblClick));
}
dojo.event.browser.addListener(tree.domNode, "onKey", dojo.lang.hitch(this, this.onKey));
}, onKey:function (e) {
if (!e.key || e.ctrkKey || e.altKey) {
return;
}
switch (e.key) {
case e.KEY_ENTER:
var node = this.domElement2TreeNode(e.target);
if (node) {
this.processNode(node, e);
}
}
}, onAfterChangeTree:function (message) {
if (!message.oldTree && message.node.selected) {
this.select(message.node);
}
if (!message.newTree || !this.listenedTrees[message.newTree.widgetId]) {
if (this.selectedNode && message.node.children) {
this.deselectIfAncestorMatch(message.node);
}
}
}, initialize:function (args) {
for (name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
}, onBeforeTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, onAfterCollapse:function (message) {
this.deselectIfAncestorMatch(message.source);
}, onTreeDblClick:function (event) {
this.onTreeClick(event);
}, checkSpecialEvent:function (event) {
return event.shiftKey || event.ctrlKey;
}, onTreeClick:function (event) {
var node = this.domElement2TreeNode(event.target);
if (!node) {
return;
}
var checkLabelClick = function (domElement) {
return domElement === node.labelNode;
};
if (this.checkPathCondition(event.target, checkLabelClick)) {
this.processNode(node, event);
}
}, processNode:function (node, event) {
if (node.actionIsDisabled(node.actions.SELECT)) {
return;
}
if (dojo.lang.inArray(this.selectedNodes, node)) {
if (this.checkSpecialEvent(event)) {
this.deselect(node);
return;
}
var _this = this;
var i = 0;
var selectedNode;
while (this.selectedNodes.length > i) {
selectedNode = this.selectedNodes[i];
if (selectedNode !== node) {
this.deselect(selectedNode);
continue;
}
i++;
}
var wasJustClicked = this.checkRecentClick(node);
eventName = wasJustClicked ? this.eventNames.dblselect : this.eventNames.select;
if (wasJustClicked) {
eventName = this.eventNames.dblselect;
this.forgetLastClicked();
} else {
eventName = this.eventNames.select;
this.setLastClicked(node);
}
dojo.event.topic.publish(eventName, {node:node});
return;
}
this.deselectIfNoMulti(event);
this.setLastClicked(node);
this.select(node);
}, forgetLastClicked:function () {
this.lastClicked = {};
}, setLastClicked:function (node) {
this.lastClicked.date = new Date();
this.lastClicked.node = node;
}, checkRecentClick:function (node) {
var diff = new Date() - this.lastClicked.date;
if (this.lastClicked.node && diff < this.dblselectTimeout) {
return true;
} else {
return false;
}
}, deselectIfNoMulti:function (event) {
if (!this.checkSpecialEvent(event) || !this.allowedMulti) {
this.deselectAll();
}
}, deselectIfAncestorMatch:function (ancestor) {
var _this = this;
dojo.lang.forEach(this.selectedNodes, function (node) {
var selectedNode = node;
node = node.parent;
while (node && node.isTreeNode) {
if (node === ancestor) {
_this.deselect(selectedNode);
return;
}
node = node.parent;
}
});
}, onAfterDetach:function (message) {
this.deselectIfAncestorMatch(message.child);
}, select:function (node) {
var index = dojo.lang.find(this.selectedNodes, node, true);
if (index >= 0) {
return;
}
this.selectedNodes.push(node);
dojo.event.topic.publish(this.eventNames.select, {node:node});
}, deselect:function (node) {
var index = dojo.lang.find(this.selectedNodes, node, true);
if (index < 0) {
return;
}
this.selectedNodes.splice(index, 1);
dojo.event.topic.publish(this.eventNames.deselect, {node:node});
}, deselectAll:function () {
while (this.selectedNodes.length) {
this.deselect(this.selectedNodes[0]);
}
}});
 
/trunk/api/js/dojo/src/widget/DocPane.js
New file
0,0 → 1,260
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DocPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.io.*");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Editor2");
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.html.common");
dojo.require("dojo.html.display");
dojo.widget.DocPane = function () {
dojo.event.topic.subscribe("/docs/function/results", this, "onDocResults");
dojo.event.topic.subscribe("/docs/package/results", this, "onPkgResults");
dojo.event.topic.subscribe("/docs/function/detail", this, "onDocSelectFunction");
};
dojo.widget.defineWidget("dojo.widget.DocPane", dojo.widget.HtmlWidget, {dialog:null, dialogBg:null, dialogFg:null, logIn:null, edit:null, save:null, cancel:null, detail:null, result:null, packag:null, fn:null, fnLink:null, count:null, row:null, summary:null, description:null, variables:null, vRow:null, vLink:null, vDesc:null, methods:null, mRow:null, mLink:null, mDesc:null, requires:null, rRow:null, rRow2:null, rH3:null, rLink:null, parameters:null, pRow:null, pLink:null, pDesc:null, pOpt:null, pType:null, sType:null, sName:null, sParams:null, sPType:null, sPTypeSave:null, sPName:null, sPNameSave:null, pkgDescription:null, _appends:[], templateString:"<div class=\"dojoDocPane\">\n\t<div dojoAttachPoint=\"containerNode\" class=\"container\"></div>\n\n\t<div dojoAttachPoint=\"dialog\" class=\"dialog\">\n\t\t<div class=\"container\" dojoAttachPoint=\"dialogBg\">\n\t\t\t<div class=\"docDialog\" dojoAttachPoint=\"dialogFg\">\n\t\t\t\t<h2>Log In</h2>\n\t\t\t\t<p><input id=\"dojoDocUserName\" dojoAttachPoint=\"userName\"><label for=\"dojoDocUserName\">User Name:</label></p>\n\t\t\t\t<p><input id=\"dojoDocPassword\" dojoAttachPoint=\"password\" type=\"password\"><label for=\"dojoDocPassword\">Password:</label></p>\n\t\t\t\t<p><input type=\"button\" dojoAttachPoint=\"cancel\" value=\"cancel\"> <input type=\"button\" dojoAttachPoint=\"logIn\" value=\"Log In\"></p>\n\t\t\t\t<p></p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div dojoAttachPoint=\"nav\" class=\"nav\"><span>Detail</span> | <span>Source</span> | <span>Examples</span> | <span>Walkthrough</span></div>\n\n\t<div dojoAttachPoint=\"detail\" class=\"detail\">\n\t\t<h1>Detail: <span class=\"fn\" dojoAttachPoint=\"fn\">dojo.select</span></h1>\n\t\t<div class=\"description\" dojoAttachPoint=\"description\">Description</div>\n\t\t<div class=\"params\" dojoAttachPoint=\"parameters\">\n\t\t\t<h2>Parameters</h2>\n\t\t\t<div class=\"row\" dojoAttachPoint=\"pRow\">\n\t\t\t\t<span dojoAttachPoint=\"pOpt\"><em>optional</em> </span>\n\t\t\t\t<span><span dojoAttachPoint=\"pType\">type</span> </span>\n\t\t\t\t<a href=\"#\" dojoAttachPoint=\"pLink\">variable</a>\n\t\t\t\t<span> - <span dojoAttachPoint=\"pDesc\"></span></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"variables\" dojoAttachPoint=\"variables\">\n\t\t\t<h2>Variables</h2>\n\t\t\t<div class\"row\" dojoAttachPoint=\"vRow\">\n\t\t\t\t<a href=\"#\" dojoAttachPoint=\"vLink\">variable</a><span> - <span dojoAttachPoint=\"vDesc\"></span></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"signature\">\n\t\t\t<h2>Signature</h2>\n\t\t\t<div class=\"source\">\n\t\t\t\t<span class=\"return\" dojoAttachPoint=\"sType\">returnType</span> \n\t\t\t\t<span class=\"function\" dojoAttachPoint=\"sName\">foo</span>\n\t\t\t\t(<span class=\"params\" dojoAttachPoint=\"sParams\">\n\t\t\t\t\t<span class=\"type\" dojoAttachPoint=\"sPType\">type </span>\n\t\t\t\t\t<span class=\"name\" dojoAttachPoint=\"sPName\">paramName</span>\n\t\t\t\t</span>)\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t\n\t<div dojoAttachPoint=\"result\" class=\"result\">\n\t\t<h1>Search Results: <span dojoAttachPoint=\"count\">0</span> matches</h1>\n\t\t<div class=\"row\" dojoAttachPoint=\"row\">\n\t\t\t<a href=\"#\" dojoAttachPoint=\"fnLink\">dojo.fnLink</a>\n\t\t\t<span> - <span class=\"summary\" dojoAttachPoint=\"summary\">summary</span></span>\n\t\t</div>\n\t</div>\n\n\t<div dojoAttachPoint=\"packag\" class=\"package\">\n\t\t<h1>Package: \n\t\t\t<span class=\"pkg\" dojoAttachPoint=\"pkg\">dojo.package</span> \n\t\t\t<span class=\"edit\" dojoAttachPoint=\"edit\">[edit]</span> \n\t\t\t<span class=\"save\" dojoAttachPoint=\"save\">[save]</span>\n\t\t</h1>\n\t\t<div dojoAttachPoint=\"pkgDescription\" class=\"description\">Description</div>\n\t\t<div class=\"methods\" dojoAttachPoint=\"methods\">\n\t\t\t<h2>Methods</h2>\n\t\t\t<div class=\"row\" dojoAttachPoint=\"mRow\">\n\t\t\t\t<a href=\"#\" dojoAttachPoint=\"mLink\">method</a>\n\t\t\t\t<span> - <span class=\"description\" dojoAttachPoint=\"mDesc\"></span></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"requires\" dojoAttachPoint=\"requires\">\n\t\t\t<h2>Requires</h2>\n\t\t\t<div class=\"row\" dojoAttachPoint=\"rRow\">\n\t\t\t\t<h3 dojoAttachPoint=\"rH3\">Environment</h3>\n\t\t\t\t<div dojoAttachPoint=\"rRow2\"><a href=\"#\" dojoAttachPoint=\"rLink\" class=\"package\">require</a></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n", templateCssString:".dojoDocPane { padding:1em; font: 1em Georgia,Times,\"Times New Roman\",serif; }\n\n.dojoDocPane .container{ }\n\n.dojoDocPane .dialog{ }\n.dojoDocPane .dialog .container{ padding: 0.5em; background: #fff; border: 2px solid #333; }\n.dojoDocPane .dialog .docDialog{ background: transparent; width: 20em; }\n.dojoDocPane .dialog .docDialog h2{ margin-top: 0; padding-top: 0; }\n.dojoDocPane .dialog .docDialog input { float: right; margin-right: 1em; }\n.dojoDocPane .dialog .docDialog p{ clear: both; }\n#dojoDocUserName, #dojoDocPassword { width: 10em; }\n\n.dojoDocPane .nav{ }\n.dojoDocPane .nav span{ }\n\n.dojoDocPane .detail{ }\n.dojoDocPane .detail h1{ }\n.dojoDocPane .detail h1 span.fn{ }\n.dojoDocPane .detail .description{ }\n.dojoDocPane .detail .params{ }\n.dojoDocPane .detail .params .row{ }\n.dojoDocPane .detail .params .row span{ }\n.dojoDocPane .detail .variables{ }\n.dojoDocPane .detail .variables .row{ }\n.dojoDocPane .detail .signature{ }\n.dojoDocPane .detail .signature .source{ white-space: pre; font: 0.8em Monaco, Courier, \"Courier New\", monospace; }\n.dojoDocPane .detail .signature .source .return{ color:#369; }\n.dojoDocPane .detail .signature .source .function{ color: #98543F; font-weight: bold; }\n.dojoDocPane .detail .signature .source .params{ }\n.dojoDocPane .detail .signature .source .params .type{ font-style: italic; color: #d17575; }\n.dojoDocPane .detail .signature .source .params .name{ color: #d14040; }\n\n.dojoDocPane .result{ }\n.dojoDocPane .result h1{ }\n.dojoDocPane .result .row{ }\n.dojoDocPane .result .row .summary{ }\n\n.dojoDocPane .package{ }\n.dojoDocPane .package h1{ }\n.dojoDocPane .package .row{ }\n.dojoDocPane .package .row .summary{ }\n.dojoDocPane .package .description{ }\n.dojoDocPane .package .methods{ }\n.dojoDocPane .package .methods h2{ }\n.dojoDocPane .package .methods .row{ }\n.dojoDocPane .package .methods .row .description{ }\n.dojoDocPane .package .requires{ }\n.dojoDocPane .package .requires h2{ }\n.dojoDocPane .package .requires .row{ }\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/DocPane.css"), isContainer:true, fillInTemplate:function () {
this.requires = dojo.html.removeNode(this.requires);
this.rRow.style.display = "none";
this.rRow2.style.display = "none";
this.methods = dojo.html.removeNode(this.methods);
this.mRow.style.display = "none";
this.dialog = dojo.widget.createWidget("dialog", {}, this.dialog);
this.dialog.setCloseControl(this.cancel);
dojo.html.setOpacity(this.dialogBg, 0.8);
dojo.html.setOpacity(this.dialogFg, 1);
dojo.event.connect(this.edit, "onclick", dojo.lang.hitch(this, function () {
if (!this._isLoggedIn) {
this.dialog.show();
}
}));
dojo.event.connect(this.logIn, "onclick", this, "_logIn");
dojo.event.connect(this.save, "onclick", this, "_save");
dojo.event.connect(dojo.docs, "logInSuccess", this, "_loggedIn");
this.homeSave = this.containerNode.cloneNode(true);
this.detailSave = dojo.html.removeNode(this.detail);
this.resultSave = dojo.html.removeNode(this.result);
this.packageSave = dojo.html.removeNode(this.packag);
this.results = dojo.html.removeNode(this.results);
this.rowParent = this.row.parentNode;
this.rowSave = dojo.html.removeNode(this.row);
this.vParent = this.vRow.parentNode;
this.vSave = dojo.html.removeNode(this.vRow);
this.pParent = this.pRow.parentNode;
this.pSave = dojo.html.removeNode(this.pRow);
this.sPTypeSave = dojo.html.removeNode(this.sPType);
this.sPNameSave = dojo.html.removeNode(this.sPName);
this.navSave = dojo.html.removeNode(this.nav);
}, _logIn:function () {
dojo.docs.setUserName(this.userName.value);
dojo.docs.setPassword(this.password.value);
}, _loggedIn:function () {
this._isLoggedIn = true;
this.dialog.hide();
this.pkgEditor = dojo.widget.createWidget("editor2", {toolbarAlwaysVisible:true}, this.pkgDescription);
}, _save:function () {
if (this.pkgEditor) {
dojo.docs.savePackage(this._pkgPath, {description:this.pkgEditor.getEditorContent()});
}
}, onDocSelectFunction:function (message) {
dojo.debug("onDocSelectFunction()");
for (var key in message) {
dojo.debug(key + ": " + dojo.json.serialize(message[key]));
}
var meta = message.meta;
if (meta) {
var variables = meta.variables;
var this_variables = meta.this_variables;
var child_variables = meta.child_variables;
var parameters = meta.parameters;
}
var doc = message.doc;
dojo.debug(dojo.json.serialize(doc));
var appends = this._appends;
dojo.html.removeChildren(this.domNode);
this.fn.innerHTML = message.name;
this.variables.style.display = "block";
var all = [];
if (variables) {
all = variables;
}
if (this_variables) {
all = all.concat(this_variables);
}
if (child_variables) {
all = all.concat(child_variables);
}
if (!all.length) {
this.variables.style.display = "none";
} else {
for (var i = 0, one; one = all[i]; i++) {
this.vLink.innerHTML = one;
this.vDesc.parentNode.style.display = "none";
appends.push(this.vParent.appendChild(this.vSave.cloneNode(true)));
}
}
this.sParams.innerHTML = "";
var first = true;
for (var param in parameters) {
var paramType = parameters[param].type;
var paramSummary = parameters[param].summary;
var paramName = param;
this.parameters.style.display = "block";
this.pLink.innerHTML = paramName;
this.pOpt.style.display = "none";
if (parameters[param].opt) {
this.pOpt.style.display = "inline";
}
this.pType.parentNode.style.display = "none";
if (parameters[param][0]) {
this.pType.parentNode.style.display = "inline";
this.pType.innerHTML = paramType;
}
this.pDesc.parentNode.style.display = "none";
if (paramSummary) {
this.pDesc.parentNode.style.display = "inline";
this.pDesc.innerHTML = paramSummary;
}
appends.push(this.pParent.appendChild(this.pSave.cloneNode(true)));
if (!first) {
this.sParams.appendChild(document.createTextNode(", "));
}
first = false;
if (paramType) {
dojo.debug(this.sPTypeSave);
this.sPTypeSave.innerHTML = paramType;
this.sParams.appendChild(this.sPTypeSave.cloneNode(true));
this.sParams.appendChild(document.createTextNode(" "));
}
dojo.debug(this.sPNameSave);
this.sPNameSave.innerHTML = paramName;
this.sParams.appendChild(this.sPNameSave.cloneNode(true));
}
if (message.returns) {
this.sType.innerHTML = message.returns;
} else {
this.sType.innerHTML = "void";
}
this.sName.innerHTML = message.name;
this.domNode.appendChild(this.navSave);
this.domNode.appendChild(this.detailSave.cloneNode(true));
for (var i = 0, append; append = appends[i]; i++) {
dojo.html.removeNode(append);
}
}, onPkgResult:function (results) {
if (this.pkgEditor) {
this.pkgEditor.close(true);
dojo.debug(this.pkgDescription);
}
var methods = results.methods;
var requires = results.requires;
var description = results.description;
this._pkgPath = results.path;
var requireLinks = [];
var appends = this._appends;
while (appends.length) {
dojo.html.removeNode(appends.shift());
}
dojo.html.removeChildren(this.domNode);
this.pkg.innerHTML = results.pkg;
var hasRequires = false;
for (var env in requires) {
hasRequires = true;
this.rH3.style.display = "none";
if (env != "common") {
this.rH3.style.display = "";
this.rH3.innerHTML = env;
}
for (var i = 0, require; require = requires[env][i]; i++) {
requireLinks.push({name:require});
this.rLink.innerHTML = require;
this.rLink.href = "#" + require;
var rRow2 = this.rRow2.parentNode.insertBefore(this.rRow2.cloneNode(true), this.rRow2);
rRow2.style.display = "";
appends.push(rRow2);
}
var rRow = this.rRow.parentNode.insertBefore(this.rRow.cloneNode(true), this.rRow);
rRow.style.display = "";
appends.push(rRow);
}
if (hasRequires) {
appends.push(this.packageSave.appendChild(this.requires.cloneNode(true)));
}
if (results.size) {
for (var i = 0, method; method = methods[i]; i++) {
this.mLink.innerHTML = method.name;
this.mLink.href = "#" + method.name;
this.mDesc.parentNode.style.display = "none";
if (method.summary) {
this.mDesc.parentNode.style.display = "inline";
this.mDesc.innerHTML = method.summary;
}
var mRow = this.mRow.parentNode.insertBefore(this.mRow.cloneNode(true), this.mRow);
mRow.style.display = "";
appends.push(mRow);
}
appends.push(this.packageSave.appendChild(this.methods.cloneNode(true)));
}
this.domNode.appendChild(this.packageSave);
this.pkgDescription.innerHTML = description;
function makeSelect(fOrP, x) {
return function (e) {
dojo.event.topic.publish("/docs/" + fOrP + "/select", x);
};
}
var as = this.domNode.getElementsByTagName("a");
for (var i = 0, a; a = as[i]; i++) {
if (a.className == "docMLink") {
dojo.event.connect(a, "onclick", makeSelect("function", methods[i]));
} else {
if (a.className == "docRLink") {
dojo.event.connect(a, "onclick", makeSelect("package", requireLinks[i]));
}
}
}
}, onDocResults:function (fns) {
dojo.debug("onDocResults(): called");
if (fns.length == 1) {
dojo.event.topic.publish("/docs/function/select", fns[0]);
return;
}
dojo.html.removeChildren(this.domNode);
this.count.innerHTML = fns.length;
var appends = [];
for (var i = 0, fn; fn = fns[i]; i++) {
this.fnLink.innerHTML = fn.name;
this.fnLink.href = "#" + fn.name;
if (fn.id) {
this.fnLink.href = this.fnLink.href + "," + fn.id;
}
this.summary.parentNode.style.display = "none";
if (fn.summary) {
this.summary.parentNode.style.display = "inline";
this.summary.innerHTML = fn.summary;
}
appends.push(this.rowParent.appendChild(this.rowSave.cloneNode(true)));
}
function makeSelect(x) {
return function (e) {
dojo.event.topic.publish("/docs/function/select", x);
};
}
this.domNode.appendChild(this.resultSave.cloneNode(true));
var as = this.domNode.getElementsByTagName("a");
for (var i = 0, a; a = as[i]; i++) {
dojo.event.connect(a, "onclick", makeSelect(fns[i]));
}
for (var i = 0, append; append = appends[i]; i++) {
this.rowParent.removeChild(append);
}
}});
 
/trunk/api/js/dojo/src/widget/Button.js
New file
0,0 → 1,257
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Button");
dojo.require("dojo.lang.extras");
dojo.require("dojo.html.*");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.*");
dojo.widget.defineWidget("dojo.widget.Button", dojo.widget.HtmlWidget, {isContainer:true, caption:"", templateString:"<div dojoAttachPoint=\"buttonNode\" class=\"dojoButton\" style=\"position:relative;\" dojoAttachEvent=\"onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick; onKey:onKey; onFocus;\">\n <div class=\"dojoButtonContents\" align=center dojoAttachPoint=\"containerNode\" style=\"position:absolute;z-index:2;\"></div>\n <img dojoAttachPoint=\"leftImage\" style=\"position:absolute;left:0px;\">\n <img dojoAttachPoint=\"centerImage\" style=\"position:absolute;z-index:1;\">\n <img dojoAttachPoint=\"rightImage\" style=\"position:absolute;top:0px;right:0px;\">\n</div>\n", templateCssString:"/* ---- button --- */\n.dojoButton {\n\tpadding: 0 0 0 0;\n\tfont-size: 8pt;\n\twhite-space: nowrap;\n\tcursor: pointer;\n\tfont-family: Myriad, Tahoma, Verdana, sans-serif;\n}\n\n.dojoButton .dojoButtonContents {\n\tpadding: 2px 2px 2px 2px;\n\ttext-align: center;\t\t/* if icon and label are split across two lines, center icon */\n\tcolor: white;\n}\n\n.dojoButtonLeftPart .dojoButtonContents {\n\tpadding-right: 8px;\n}\n\n.dojoButtonDisabled {\n\tcursor: url(\"images/no.gif\"), default;\n}\n\n\n.dojoButtonContents img {\n\tvertical-align: middle;\t/* if icon and label are on same line, center them */\n}\n\n/* -------- colors ------------ */\n\n.dojoButtonHover .dojoButtonContents {\n}\n\n.dojoButtonDepressed .dojoButtonContents {\n\tcolor: #293a4b;\n}\n\n.dojoButtonDisabled .dojoButtonContents {\n\tcolor: #aaa;\n}\n\n\n/* ---------- drop down button specific ---------- */\n\n/* border between label and arrow (for drop down buttons */\n.dojoButton .border {\n\twidth: 1px;\n\tbackground: gray;\n}\n\n/* button arrow */\n.dojoButton .downArrow {\n\tpadding-left: 10px;\n\ttext-align: center;\n}\n\n.dojoButton.disabled .downArrow {\n\tcursor : default;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ButtonTemplate.css"), inactiveImg:"templates/images/soriaButton-", activeImg:"templates/images/soriaActive-", pressedImg:"templates/images/soriaPressed-", disabledImg:"templates/images/soriaDisabled-", width2height:1 / 3, fillInTemplate:function () {
if (this.caption) {
this.containerNode.appendChild(document.createTextNode(this.caption));
}
dojo.html.disableSelection(this.containerNode);
}, postCreate:function () {
this._sizeMyself();
}, _sizeMyself:function () {
if (this.domNode.parentNode) {
var placeHolder = document.createElement("span");
dojo.html.insertBefore(placeHolder, this.domNode);
}
dojo.body().appendChild(this.domNode);
this._sizeMyselfHelper();
if (placeHolder) {
dojo.html.insertBefore(this.domNode, placeHolder);
dojo.html.removeNode(placeHolder);
}
}, _sizeMyselfHelper:function () {
var mb = dojo.html.getMarginBox(this.containerNode);
this.height = mb.height;
this.containerWidth = mb.width;
var endWidth = this.height * this.width2height;
this.containerNode.style.left = endWidth + "px";
this.leftImage.height = this.rightImage.height = this.centerImage.height = this.height;
this.leftImage.width = this.rightImage.width = endWidth + 1;
this.centerImage.width = this.containerWidth;
this.centerImage.style.left = endWidth + "px";
this._setImage(this.disabled ? this.disabledImg : this.inactiveImg);
if (this.disabled) {
dojo.html.prependClass(this.domNode, "dojoButtonDisabled");
this.domNode.removeAttribute("tabIndex");
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", true);
} else {
dojo.html.removeClass(this.domNode, "dojoButtonDisabled");
this.domNode.setAttribute("tabIndex", "0");
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", false);
}
this.domNode.style.height = this.height + "px";
this.domNode.style.width = (this.containerWidth + 2 * endWidth) + "px";
}, onMouseOver:function (e) {
if (this.disabled) {
return;
}
if (!dojo.html.hasClass(this.buttonNode, "dojoButtonHover")) {
dojo.html.prependClass(this.buttonNode, "dojoButtonHover");
}
this._setImage(this.activeImg);
}, onMouseDown:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.buttonNode, "dojoButtonDepressed");
dojo.html.removeClass(this.buttonNode, "dojoButtonHover");
this._setImage(this.pressedImg);
}, onMouseUp:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.buttonNode, "dojoButtonHover");
dojo.html.removeClass(this.buttonNode, "dojoButtonDepressed");
this._setImage(this.activeImg);
}, onMouseOut:function (e) {
if (this.disabled) {
return;
}
if (e.toElement && dojo.html.isDescendantOf(e.toElement, this.buttonNode)) {
return;
}
dojo.html.removeClass(this.buttonNode, "dojoButtonHover");
dojo.html.removeClass(this.buttonNode, "dojoButtonDepressed");
this._setImage(this.inactiveImg);
}, onKey:function (e) {
if (!e.key) {
return;
}
var menu = dojo.widget.getWidgetById(this.menuId);
if (e.key == e.KEY_ENTER || e.key == " ") {
this.onMouseDown(e);
this.buttonClick(e);
dojo.lang.setTimeout(this, "onMouseUp", 75, e);
dojo.event.browser.stopEvent(e);
}
if (menu && menu.isShowingNow && e.key == e.KEY_DOWN_ARROW) {
dojo.event.disconnect(this.domNode, "onblur", this, "onBlur");
}
}, onFocus:function (e) {
var menu = dojo.widget.getWidgetById(this.menuId);
if (menu) {
dojo.event.connectOnce(this.domNode, "onblur", this, "onBlur");
}
}, onBlur:function (e) {
var menu = dojo.widget.getWidgetById(this.menuId);
if (!menu) {
return;
}
if (menu.close && menu.isShowingNow) {
menu.close();
}
}, buttonClick:function (e) {
if (!this.disabled) {
try {
this.domNode.focus();
}
catch (e2) {
}
this.onClick(e);
}
}, onClick:function (e) {
}, _setImage:function (prefix) {
this.leftImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "l.gif");
this.centerImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "c.gif");
this.rightImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "r.gif");
}, _toggleMenu:function (menuId) {
var menu = dojo.widget.getWidgetById(menuId);
if (!menu) {
return;
}
if (menu.open && !menu.isShowingNow) {
var pos = dojo.html.getAbsolutePosition(this.domNode, false);
menu.open(pos.x, pos.y + this.height, this);
dojo.event.disconnect(this.domNode, "onblur", this, "onBlur");
} else {
if (menu.close && menu.isShowingNow) {
menu.close();
} else {
menu.toggle();
}
}
}, setCaption:function (content) {
this.caption = content;
this.containerNode.innerHTML = content;
this._sizeMyself();
}, setDisabled:function (disabled) {
this.disabled = disabled;
this._sizeMyself();
}});
dojo.widget.defineWidget("dojo.widget.DropDownButton", dojo.widget.Button, {menuId:"", downArrow:"templates/images/whiteDownArrow.gif", disabledDownArrow:"templates/images/whiteDownArrow.gif", fillInTemplate:function () {
dojo.widget.DropDownButton.superclass.fillInTemplate.apply(this, arguments);
this.arrow = document.createElement("img");
dojo.html.setClass(this.arrow, "downArrow");
dojo.widget.wai.setAttr(this.domNode, "waiState", "haspopup", this.menuId);
}, _sizeMyselfHelper:function () {
this.arrow.src = dojo.uri.moduleUri("dojo.widget", this.disabled ? this.disabledDownArrow : this.downArrow);
this.containerNode.appendChild(this.arrow);
dojo.widget.DropDownButton.superclass._sizeMyselfHelper.call(this);
}, onClick:function (e) {
this._toggleMenu(this.menuId);
}});
dojo.widget.defineWidget("dojo.widget.ComboButton", dojo.widget.Button, {menuId:"", templateString:"<div class=\"dojoButton\" style=\"position:relative;top:0px;left:0px; text-align:none;\" dojoAttachEvent=\"onKey;onFocus\">\n\n\t<div dojoAttachPoint=\"buttonNode\" class=\"dojoButtonLeftPart\" style=\"position:absolute;left:0px;top:0px;\"\n\t\tdojoAttachEvent=\"onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick;\">\n\t\t<div class=\"dojoButtonContents\" dojoAttachPoint=\"containerNode\" style=\"position:absolute;top:0px;right:0px;z-index:2;\"></div>\n\t\t<img dojoAttachPoint=\"leftImage\" style=\"position:absolute;left:0px;top:0px;\">\n\t\t<img dojoAttachPoint=\"centerImage\" style=\"position:absolute;right:0px;top:0px;z-index:1;\">\n\t</div>\n\n\t<div dojoAttachPoint=\"rightPart\" class=\"dojoButtonRightPart\" style=\"position:absolute;top:0px;right:0px;\"\n\t\tdojoAttachEvent=\"onMouseOver:rightOver; onMouseOut:rightOut; onMouseDown:rightDown; onMouseUp:rightUp; onClick:rightClick;\">\n\t\t<img dojoAttachPoint=\"arrowBackgroundImage\" style=\"position:absolute;top:0px;left:0px;z-index:1;\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/images/whiteDownArrow.gif\"\n\t\t \t\tstyle=\"z-index:2;position:absolute;left:3px;top:50%;\">\n\t\t<img dojoAttachPoint=\"rightImage\" style=\"position:absolute;top:0px;right:0px;\">\n\t</div>\n\n</div>\n", splitWidth:2, arrowWidth:5, _sizeMyselfHelper:function (e) {
var mb = dojo.html.getMarginBox(this.containerNode);
this.height = mb.height;
this.containerWidth = mb.width;
var endWidth = this.height / 3;
if (this.disabled) {
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", true);
this.domNode.removeAttribute("tabIndex");
} else {
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", false);
this.domNode.setAttribute("tabIndex", "0");
}
this.leftImage.height = this.rightImage.height = this.centerImage.height = this.arrowBackgroundImage.height = this.height;
this.leftImage.width = endWidth + 1;
this.centerImage.width = this.containerWidth;
this.buttonNode.style.height = this.height + "px";
this.buttonNode.style.width = endWidth + this.containerWidth + "px";
this._setImage(this.disabled ? this.disabledImg : this.inactiveImg);
this.arrowBackgroundImage.width = this.arrowWidth;
this.rightImage.width = endWidth + 1;
this.rightPart.style.height = this.height + "px";
this.rightPart.style.width = this.arrowWidth + endWidth + "px";
this._setImageR(this.disabled ? this.disabledImg : this.inactiveImg);
this.domNode.style.height = this.height + "px";
var totalWidth = this.containerWidth + this.splitWidth + this.arrowWidth + 2 * endWidth;
this.domNode.style.width = totalWidth + "px";
}, _setImage:function (prefix) {
this.leftImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "l.gif");
this.centerImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "c.gif");
}, rightOver:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.rightPart, "dojoButtonHover");
this._setImageR(this.activeImg);
}, rightDown:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.rightPart, "dojoButtonDepressed");
dojo.html.removeClass(this.rightPart, "dojoButtonHover");
this._setImageR(this.pressedImg);
}, rightUp:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.rightPart, "dojoButtonHover");
dojo.html.removeClass(this.rightPart, "dojoButtonDepressed");
this._setImageR(this.activeImg);
}, rightOut:function (e) {
if (this.disabled) {
return;
}
dojo.html.removeClass(this.rightPart, "dojoButtonHover");
dojo.html.removeClass(this.rightPart, "dojoButtonDepressed");
this._setImageR(this.inactiveImg);
}, rightClick:function (e) {
if (this.disabled) {
return;
}
try {
this.domNode.focus();
}
catch (e2) {
}
this._toggleMenu(this.menuId);
}, _setImageR:function (prefix) {
this.arrowBackgroundImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "c.gif");
this.rightImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "r.gif");
}, onKey:function (e) {
if (!e.key) {
return;
}
var menu = dojo.widget.getWidgetById(this.menuId);
if (e.key == e.KEY_ENTER || e.key == " ") {
this.onMouseDown(e);
this.buttonClick(e);
dojo.lang.setTimeout(this, "onMouseUp", 75, e);
dojo.event.browser.stopEvent(e);
} else {
if (e.key == e.KEY_DOWN_ARROW && e.altKey) {
this.rightDown(e);
this.rightClick(e);
dojo.lang.setTimeout(this, "rightUp", 75, e);
dojo.event.browser.stopEvent(e);
} else {
if (menu && menu.isShowingNow && e.key == e.KEY_DOWN_ARROW) {
dojo.event.disconnect(this.domNode, "onblur", this, "onBlur");
}
}
}
}});
 
/trunk/api/js/dojo/src/widget/DatePicker.js
New file
0,0 → 1,347
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DatePicker");
dojo.require("dojo.date.common");
dojo.require("dojo.date.format");
dojo.require("dojo.date.serialize");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.DatePicker", dojo.widget.HtmlWidget, {value:"", name:"", displayWeeks:6, adjustWeeks:false, startDate:"1492-10-12", endDate:"2941-10-12", weekStartsOn:"", staticDisplay:false, dayWidth:"narrow", classNames:{previous:"previousMonth", disabledPrevious:"previousMonthDisabled", current:"currentMonth", disabledCurrent:"currentMonthDisabled", next:"nextMonth", disabledNext:"nextMonthDisabled", currentDate:"currentDate", selectedDate:"selectedDate"}, templateString:"<div class=\"datePickerContainer\" dojoAttachPoint=\"datePickerContainerNode\">\n\t<table cellspacing=\"0\" cellpadding=\"0\" class=\"calendarContainer\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<td class=\"monthWrapper\" valign=\"top\">\n\t\t\t\t\t<table class=\"monthContainer\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"monthCurve monthCurveTL\" valign=\"top\"></td>\n\t\t\t\t\t\t\t<td class=\"monthLabelContainer\" valign=\"top\">\n\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"increaseWeekNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\t\t\t\t\t\t\tclass=\"incrementControl increase\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/incrementMonth.png\" \n\t\t\t\t\t\t\t\t\talt=\"&darr;\" style=\"width:7px;height:5px;\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"increaseMonthNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl increase\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/incrementMonth.png\" \n\t\t\t\t\t\t\t\t\t\talt=\"&darr;\" dojoAttachPoint=\"incrementMonthImageNode\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"decreaseWeekNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\t\t\t\t\t\t\tclass=\"incrementControl decrease\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/decrementMonth.png\" alt=\"&uarr;\" style=\"width:7px;height:5px;\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"decreaseMonthNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl decrease\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/decrementMonth.png\" \n\t\t\t\t\t\t\t\t\t\talt=\"&uarr;\" dojoAttachPoint=\"decrementMonthImageNode\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"monthLabelNode\" class=\"month\"></span>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"monthCurve monthCurveTR\" valign=\"top\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t<table class=\"calendarBodyContainer\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr dojoAttachPoint=\"dayLabelsRow\">\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"calendarDatesContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: _handleUiClick;\">\n\t\t\t\t\t\t\t<tr dojoAttachPoint=\"calendarWeekTemplate\">\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\" class=\"yearWrapper\">\n\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"yearContainer\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"curveBL\" valign=\"top\"></td>\n\t\t\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t\t\t<h3 class=\"yearLabel\">\n\t\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\"\n\t\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"previousYear\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"selectedYear\" dojoAttachPoint=\"currentYearLabelNode\"></span>\n\t\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" \n\t\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"nextYear\"></span>\n\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"curveBR\" valign=\"top\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tfoot>\n\t</table>\n</div>\n", templateCssString:".datePickerContainer {\n\twidth:164px; /* needed for proper user styling */\n}\n\n.calendarContainer {\n/*\tborder:1px solid #566f8f;*/\n}\n\n.calendarBodyContainer {\n\twidth:100%; /* needed for the explode effect (explain?) */\n\tbackground: #7591bc url(\"images/dpBg.gif\") top left repeat-x;\n}\n\n.calendarBodyContainer thead tr td {\n\tcolor:#293a4b;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n\tpadding:0.25em;\n\tbackground: url(\"images/dpHorizLine.gif\") bottom left repeat-x;\n}\n\n.calendarBodyContainer tbody tr td {\n\tcolor:#fff;\n\tfont:bold 0.7em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n\tpadding:0.4em;\n\tbackground: url(\"images/dpVertLine.gif\") top right repeat-y;\n\tcursor:pointer;\n\tcursor:hand;\n}\n\n\n.monthWrapper {\n\tpadding-bottom:2px;\n\tbackground: url(\"images/dpHorizLine.gif\") bottom left repeat-x;\n}\n\n.monthContainer {\n\twidth:100%;\n}\n\n.monthLabelContainer {\n\ttext-align:center;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\tbackground: url(\"images/dpMonthBg.png\") repeat-x top left !important;\n\tcolor:#293a4b;\n\tpadding:0.25em;\n}\n\n.monthCurve {\n\twidth:12px;\n}\n\n.monthCurveTL {\n\tbackground: url(\"images/dpCurveTL.png\") no-repeat top left !important;\n}\n\n.monthCurveTR {\n\t\tbackground: url(\"images/dpCurveTR.png\") no-repeat top right !important;\n}\n\n\n.yearWrapper {\n\tbackground: url(\"images/dpHorizLineFoot.gif\") top left repeat-x;\n\tpadding-top:2px;\n}\n\n.yearContainer {\n\twidth:100%;\n}\n\n.yearContainer td {\n\tbackground:url(\"images/dpYearBg.png\") top left repeat-x;\n}\n\n.yearContainer .yearLabel {\n\tmargin:0;\n\tpadding:0.45em 0 0.45em 0;\n\tcolor:#fff;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n}\n\n.curveBL {\n\tbackground: url(\"images/dpCurveBL.png\") bottom left no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n.curveBR {\n\tbackground: url(\"images/dpCurveBR.png\") bottom right no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n\n.previousMonth {\n\tbackground-color:#6782a8 !important;\n}\n\n.previousMonthDisabled {\n\tbackground-color:#a4a5a6 !important;\n\tcursor:default !important\n}\n.currentMonth {\n}\n\n.currentMonthDisabled {\n\tbackground-color:#bbbbbc !important;\n\tcursor:default !important\n}\n.nextMonth {\n\tbackground-color:#6782a8 !important;\n}\n.nextMonthDisabled {\n\tbackground-color:#a4a5a6 !important;\n\tcursor:default !important;\n}\n\n.currentDate {\n\ttext-decoration:underline;\n\tfont-style:italic;\n}\n\n.selectedDate {\n\tbackground-color:#fff !important;\n\tcolor:#6782a8 !important;\n}\n\n.yearLabel .selectedYear {\n\tpadding:0.2em;\n\tbackground-color:#9ec3fb !important;\n}\n\n.nextYear, .previousYear {\n\tcursor:pointer;cursor:hand;\n\tpadding:0;\n}\n\n.nextYear {\n\tmargin:0 0 0 0.55em;\n}\n\n.previousYear {\n\tmargin:0 0.55em 0 0;\n}\n\n.incrementControl {\n\tcursor:pointer;cursor:hand;\n\twidth:1em;\n}\n\n.increase {\n\tfloat:right;\n}\n\n.decrease {\n\tfloat:left;\n}\n\n.lastColumn {\n\tbackground-image:none !important;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/DatePicker.css"), postMixInProperties:function () {
dojo.widget.DatePicker.superclass.postMixInProperties.apply(this, arguments);
if (!this.weekStartsOn) {
this.weekStartsOn = dojo.date.getFirstDayOfWeek(this.lang);
}
this.today = new Date();
this.today.setHours(0, 0, 0, 0);
if (typeof (this.value) == "string" && this.value.toLowerCase() == "today") {
this.value = new Date();
} else {
if (this.value && (typeof this.value == "string") && (this.value.split("-").length > 2)) {
this.value = dojo.date.fromRfc3339(this.value);
this.value.setHours(0, 0, 0, 0);
}
}
}, fillInTemplate:function (args, frag) {
dojo.widget.DatePicker.superclass.fillInTemplate.apply(this, arguments);
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
this.weekTemplate = dojo.dom.removeNode(this.calendarWeekTemplate);
this._preInitUI(this.value ? this.value : this.today, false, true);
var dayLabels = dojo.lang.unnest(dojo.date.getNames("days", this.dayWidth, "standAlone", this.lang));
if (this.weekStartsOn > 0) {
for (var i = 0; i < this.weekStartsOn; i++) {
dayLabels.push(dayLabels.shift());
}
}
var dayLabelNodes = this.dayLabelsRow.getElementsByTagName("td");
for (i = 0; i < 7; i++) {
dayLabelNodes.item(i).innerHTML = dayLabels[i];
}
if (this.value) {
this.setValue(this.value);
}
}, getValue:function () {
return dojo.date.toRfc3339(new Date(this.value), "dateOnly");
}, getDate:function () {
return this.value;
}, setValue:function (rfcDate) {
this.setDate(rfcDate);
}, setDate:function (dateObj) {
if (dateObj == "") {
this.value = "";
this._preInitUI(this.curMonth, false, true);
} else {
if (typeof dateObj == "string") {
this.value = dojo.date.fromRfc3339(dateObj);
this.value.setHours(0, 0, 0, 0);
} else {
this.value = new Date(dateObj);
this.value.setHours(0, 0, 0, 0);
}
}
if (this.selectedNode != null) {
dojo.html.removeClass(this.selectedNode, this.classNames.selectedDate);
}
if (this.clickedNode != null) {
dojo.debug("adding selectedDate");
dojo.html.addClass(this.clickedNode, this.classNames.selectedDate);
this.selectedNode = this.clickedNode;
} else {
this._preInitUI(this.value, false, true);
}
this.clickedNode = null;
this.onValueChanged(this.value);
}, _preInitUI:function (dateObj, initFirst, initUI) {
if (typeof (this.startDate) == "string") {
this.startDate = dojo.date.fromRfc3339(this.startDate);
}
if (typeof (this.endDate) == "string") {
this.endDate = dojo.date.fromRfc3339(this.endDate);
}
this.startDate.setHours(0, 0, 0, 0);
this.endDate.setHours(24, 0, 0, -1);
if (dateObj < this.startDate || dateObj > this.endDate) {
dateObj = new Date((dateObj < this.startDate) ? this.startDate : this.endDate);
}
this.firstDay = this._initFirstDay(dateObj, initFirst);
this.selectedIsUsed = false;
this.currentIsUsed = false;
var nextDate = new Date(this.firstDay);
var tmpMonth = nextDate.getMonth();
this.curMonth = new Date(nextDate);
this.curMonth.setDate(nextDate.getDate() + 6);
this.curMonth.setDate(1);
if (this.displayWeeks == "" || this.adjustWeeks) {
this.adjustWeeks = true;
this.displayWeeks = Math.ceil((dojo.date.getDaysInMonth(this.curMonth) + this._getAdjustedDay(this.curMonth)) / 7);
}
var days = this.displayWeeks * 7;
if (dojo.date.diff(this.startDate, this.endDate, dojo.date.dateParts.DAY) < days) {
this.staticDisplay = true;
if (dojo.date.diff(nextDate, this.endDate, dojo.date.dateParts.DAY) > days) {
this._preInitUI(this.startDate, true, false);
nextDate = new Date(this.firstDay);
}
this.curMonth = new Date(nextDate);
this.curMonth.setDate(nextDate.getDate() + 6);
this.curMonth.setDate(1);
var curClass = (nextDate.getMonth() == this.curMonth.getMonth()) ? "current" : "previous";
}
if (initUI) {
this._initUI(days);
}
}, _initUI:function (days) {
dojo.dom.removeChildren(this.calendarDatesContainerNode);
for (var i = 0; i < this.displayWeeks; i++) {
this.calendarDatesContainerNode.appendChild(this.weekTemplate.cloneNode(true));
}
var nextDate = new Date(this.firstDay);
this._setMonthLabel(this.curMonth.getMonth());
this._setYearLabels(this.curMonth.getFullYear());
var calendarNodes = this.calendarDatesContainerNode.getElementsByTagName("td");
var calendarRows = this.calendarDatesContainerNode.getElementsByTagName("tr");
var currentCalendarNode;
for (i = 0; i < days; i++) {
currentCalendarNode = calendarNodes.item(i);
currentCalendarNode.innerHTML = nextDate.getDate();
currentCalendarNode.setAttribute("djDateValue", nextDate.valueOf());
var curClass = (nextDate.getMonth() != this.curMonth.getMonth() && Number(nextDate) < Number(this.curMonth)) ? "previous" : (nextDate.getMonth() == this.curMonth.getMonth()) ? "current" : "next";
var mappedClass = curClass;
if (this._isDisabledDate(nextDate)) {
var classMap = {previous:"disabledPrevious", current:"disabledCurrent", next:"disabledNext"};
mappedClass = classMap[curClass];
}
dojo.html.setClass(currentCalendarNode, this._getDateClassName(nextDate, mappedClass));
if (dojo.html.hasClass(currentCalendarNode, this.classNames.selectedDate)) {
this.selectedNode = currentCalendarNode;
}
nextDate = dojo.date.add(nextDate, dojo.date.dateParts.DAY, 1);
}
this.lastDay = dojo.date.add(nextDate, dojo.date.dateParts.DAY, -1);
this._initControls();
}, _initControls:function () {
var d = this.firstDay;
var d2 = this.lastDay;
var decWeek, incWeek, decMonth, incMonth, decYear, incYear;
decWeek = incWeek = decMonth = incMonth = decYear = incYear = !this.staticDisplay;
with (dojo.date.dateParts) {
var add = dojo.date.add;
if (decWeek && add(d, DAY, (-1 * (this._getAdjustedDay(d) + 1))) < this.startDate) {
decWeek = decMonth = decYear = false;
}
if (incWeek && d2 > this.endDate) {
incWeek = incMonth = incYear = false;
}
if (decMonth && add(d, DAY, -1) < this.startDate) {
decMonth = decYear = false;
}
if (incMonth && add(d2, DAY, 1) > this.endDate) {
incMonth = incYear = false;
}
if (decYear && add(d2, YEAR, -1) < this.startDate) {
decYear = false;
}
if (incYear && add(d, YEAR, 1) > this.endDate) {
incYear = false;
}
}
function enableControl(node, enabled) {
dojo.html.setVisibility(node, enabled ? "" : "hidden");
}
enableControl(this.decreaseWeekNode, decWeek);
enableControl(this.increaseWeekNode, incWeek);
enableControl(this.decreaseMonthNode, decMonth);
enableControl(this.increaseMonthNode, incMonth);
enableControl(this.previousYearLabelNode, decYear);
enableControl(this.nextYearLabelNode, incYear);
}, _incrementWeek:function (evt) {
var d = new Date(this.firstDay);
switch (evt.target) {
case this.increaseWeekNode.getElementsByTagName("img").item(0):
case this.increaseWeekNode:
var tmpDate = dojo.date.add(d, dojo.date.dateParts.WEEK, 1);
if (tmpDate < this.endDate) {
d = dojo.date.add(d, dojo.date.dateParts.WEEK, 1);
}
break;
case this.decreaseWeekNode.getElementsByTagName("img").item(0):
case this.decreaseWeekNode:
if (d >= this.startDate) {
d = dojo.date.add(d, dojo.date.dateParts.WEEK, -1);
}
break;
}
this._preInitUI(d, true, true);
}, _incrementMonth:function (evt) {
var d = new Date(this.curMonth);
var tmpDate = new Date(this.firstDay);
switch (evt.currentTarget) {
case this.increaseMonthNode.getElementsByTagName("img").item(0):
case this.increaseMonthNode:
tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.DAY, this.displayWeeks * 7);
if (tmpDate < this.endDate) {
d = dojo.date.add(d, dojo.date.dateParts.MONTH, 1);
} else {
var revertToEndDate = true;
}
break;
case this.decreaseMonthNode.getElementsByTagName("img").item(0):
case this.decreaseMonthNode:
if (tmpDate > this.startDate) {
d = dojo.date.add(d, dojo.date.dateParts.MONTH, -1);
} else {
var revertToStartDate = true;
}
break;
}
if (revertToStartDate) {
d = new Date(this.startDate);
} else {
if (revertToEndDate) {
d = new Date(this.endDate);
}
}
this._preInitUI(d, false, true);
}, _incrementYear:function (evt) {
var year = this.curMonth.getFullYear();
var tmpDate = new Date(this.firstDay);
switch (evt.target) {
case this.nextYearLabelNode:
tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.YEAR, 1);
if (tmpDate < this.endDate) {
year++;
} else {
var revertToEndDate = true;
}
break;
case this.previousYearLabelNode:
tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.YEAR, -1);
if (tmpDate > this.startDate) {
year--;
} else {
var revertToStartDate = true;
}
break;
}
var d;
if (revertToStartDate) {
d = new Date(this.startDate);
} else {
if (revertToEndDate) {
d = new Date(this.endDate);
} else {
d = new Date(year, this.curMonth.getMonth(), 1);
}
}
this._preInitUI(d, false, true);
}, onIncrementWeek:function (evt) {
evt.stopPropagation();
if (!this.staticDisplay) {
this._incrementWeek(evt);
}
}, onIncrementMonth:function (evt) {
evt.stopPropagation();
if (!this.staticDisplay) {
this._incrementMonth(evt);
}
}, onIncrementYear:function (evt) {
evt.stopPropagation();
if (!this.staticDisplay) {
this._incrementYear(evt);
}
}, _setMonthLabel:function (monthIndex) {
this.monthLabelNode.innerHTML = dojo.date.getNames("months", "wide", "standAlone", this.lang)[monthIndex];
}, _setYearLabels:function (year) {
var y = year - 1;
var that = this;
function f(n) {
that[n + "YearLabelNode"].innerHTML = dojo.date.format(new Date(y++, 0), {formatLength:"yearOnly", locale:that.lang});
}
f("previous");
f("current");
f("next");
}, _getDateClassName:function (date, monthState) {
var currentClassName = this.classNames[monthState];
if ((!this.selectedIsUsed && this.value) && (Number(date) == Number(this.value))) {
currentClassName = this.classNames.selectedDate + " " + currentClassName;
this.selectedIsUsed = true;
}
if ((!this.currentIsUsed) && (Number(date) == Number(this.today))) {
currentClassName = currentClassName + " " + this.classNames.currentDate;
this.currentIsUsed = true;
}
return currentClassName;
}, onClick:function (evt) {
dojo.event.browser.stopEvent(evt);
}, _handleUiClick:function (evt) {
var eventTarget = evt.target;
if (eventTarget.nodeType != dojo.dom.ELEMENT_NODE) {
eventTarget = eventTarget.parentNode;
}
dojo.event.browser.stopEvent(evt);
this.selectedIsUsed = this.todayIsUsed = false;
if (dojo.html.hasClass(eventTarget, this.classNames["disabledPrevious"]) || dojo.html.hasClass(eventTarget, this.classNames["disabledCurrent"]) || dojo.html.hasClass(eventTarget, this.classNames["disabledNext"])) {
return;
}
this.clickedNode = eventTarget;
this.setDate(new Date(Number(dojo.html.getAttribute(eventTarget, "djDateValue"))));
}, onValueChanged:function (date) {
}, _isDisabledDate:function (dateObj) {
if (dateObj < this.startDate || dateObj > this.endDate) {
return true;
}
return this.isDisabledDate(dateObj, this.lang);
}, isDisabledDate:function (dateObj, locale) {
return false;
}, _initFirstDay:function (dateObj, adj) {
var d = new Date(dateObj);
if (!adj) {
d.setDate(1);
}
d.setDate(d.getDate() - this._getAdjustedDay(d, this.weekStartsOn));
d.setHours(0, 0, 0, 0);
return d;
}, _getAdjustedDay:function (dateObj) {
var days = [0, 1, 2, 3, 4, 5, 6];
if (this.weekStartsOn > 0) {
for (var i = 0; i < this.weekStartsOn; i++) {
days.unshift(days.pop());
}
}
return days[dateObj.getDay()];
}, destroy:function () {
dojo.widget.DatePicker.superclass.destroy.apply(this, arguments);
dojo.html.destroyNode(this.weekTemplate);
}});
 
/trunk/api/js/dojo/src/widget/TreeNodeV3.js
New file
0,0 → 1,308
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeNodeV3");
dojo.require("dojo.html.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeWithNode");
dojo.widget.defineWidget("dojo.widget.TreeNodeV3", [dojo.widget.HtmlWidget, dojo.widget.TreeWithNode], function () {
this.actionsDisabled = [];
this.object = {};
}, {tryLazyInit:true, actions:{MOVE:"MOVE", DETACH:"DETACH", EDIT:"EDIT", ADDCHILD:"ADDCHILD", SELECT:"SELECT"}, labelClass:"", contentClass:"", expandNode:null, labelNode:null, nodeDocType:"", selected:false, getnodeDocType:function () {
return this.nodeDocType;
}, cloneProperties:["actionsDisabled", "tryLazyInit", "nodeDocType", "objectId", "object", "title", "isFolder", "isExpanded", "state"], clone:function (deep) {
var ret = new this.constructor();
for (var i = 0; i < this.cloneProperties.length; i++) {
var prop = this.cloneProperties[i];
ret[prop] = dojo.lang.shallowCopy(this[prop], true);
}
if (this.tree.unsetFolderOnEmpty && !deep && this.isFolder) {
ret.isFolder = false;
}
ret.toggleObj = this.toggleObj;
dojo.widget.manager.add(ret);
ret.tree = this.tree;
ret.buildRendering({}, {});
ret.initialize({}, {});
if (deep && this.children.length) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child.clone) {
ret.children.push(child.clone(deep));
} else {
ret.children.push(dojo.lang.shallowCopy(child, deep));
}
}
ret.setChildren();
}
return ret;
}, markProcessing:function () {
this.markProcessingSavedClass = dojo.html.getClass(this.expandNode);
dojo.html.setClass(this.expandNode, this.tree.classPrefix + "ExpandLoading");
}, unmarkProcessing:function () {
dojo.html.setClass(this.expandNode, this.markProcessingSavedClass);
}, buildRendering:function (args, fragment, parent) {
if (args.tree) {
this.tree = dojo.lang.isString(args.tree) ? dojo.widget.manager.getWidgetById(args.tree) : args.tree;
} else {
if (parent && parent.tree) {
this.tree = parent.tree;
}
}
if (!this.tree) {
dojo.raise("Can't evaluate tree from arguments or parent");
}
this.domNode = this.tree.nodeTemplate.cloneNode(true);
this.expandNode = this.domNode.firstChild;
this.contentNode = this.domNode.childNodes[1];
this.labelNode = this.contentNode.firstChild;
if (this.labelClass) {
dojo.html.addClass(this.labelNode, this.labelClass);
}
if (this.contentClass) {
dojo.html.addClass(this.contentNode, this.contentClass);
}
this.domNode.widgetId = this.widgetId;
this.labelNode.innerHTML = this.title;
}, isTreeNode:true, object:{}, title:"", isFolder:null, contentNode:null, expandClass:"", isExpanded:false, containerNode:null, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId, index:this.getParentIndex()};
return info;
}, setFolder:function () {
this.isFolder = true;
this.viewSetExpand();
if (!this.containerNode) {
this.viewAddContainer();
}
dojo.event.topic.publish(this.tree.eventNames.afterSetFolder, {source:this});
}, initialize:function (args, frag, parent) {
if (args.isFolder) {
this.isFolder = true;
}
if (this.children.length || this.isFolder) {
this.setFolder();
} else {
this.viewSetExpand();
}
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
dojo.event.topic.publish(this.tree.eventNames.afterChangeTree, {oldTree:null, newTree:this.tree, node:this});
}, unsetFolder:function () {
this.isFolder = false;
this.viewSetExpand();
dojo.event.topic.publish(this.tree.eventNames.afterUnsetFolder, {source:this});
}, insertNode:function (parent, index) {
if (!index) {
index = 0;
}
if (index == 0) {
dojo.html.prependChild(this.domNode, parent.containerNode);
} else {
dojo.html.insertAfter(this.domNode, parent.children[index - 1].domNode);
}
}, updateTree:function (newTree) {
if (this.tree === newTree) {
return;
}
var oldTree = this.tree;
dojo.lang.forEach(this.getDescendants(), function (elem) {
elem.tree = newTree;
});
if (oldTree.classPrefix != newTree.classPrefix) {
var stack = [this.domNode];
var elem;
var reg = new RegExp("(^|\\s)" + oldTree.classPrefix, "g");
while (elem = stack.pop()) {
for (var i = 0; i < elem.childNodes.length; i++) {
var childNode = elem.childNodes[i];
if (childNode.nodeDocType != 1) {
continue;
}
dojo.html.setClass(childNode, dojo.html.getClass(childNode).replace(reg, "$1" + newTree.classPrefix));
stack.push(childNode);
}
}
}
var message = {oldTree:oldTree, newTree:newTree, node:this};
dojo.event.topic.publish(this.tree.eventNames.afterChangeTree, message);
dojo.event.topic.publish(newTree.eventNames.afterChangeTree, message);
}, addedTo:function (parent, index, dontPublishEvent) {
if (this.tree !== parent.tree) {
this.updateTree(parent.tree);
}
if (parent.isTreeNode) {
if (!parent.isFolder) {
parent.setFolder();
parent.state = parent.loadStates.LOADED;
}
}
var siblingsCount = parent.children.length;
this.insertNode(parent, index);
this.viewAddLayout();
if (siblingsCount > 1) {
if (index == 0 && parent.children[1] instanceof dojo.widget.Widget) {
parent.children[1].viewUpdateLayout();
}
if (index == siblingsCount - 1 && parent.children[siblingsCount - 2] instanceof dojo.widget.Widget) {
parent.children[siblingsCount - 2].viewUpdateLayout();
}
} else {
if (parent.isTreeNode) {
parent.viewSetHasChildren();
}
}
if (!dontPublishEvent) {
var message = {child:this, index:index, parent:parent};
dojo.event.topic.publish(this.tree.eventNames.afterAddChild, message);
}
}, createSimple:function (args, parent) {
if (args.tree) {
var tree = args.tree;
} else {
if (parent) {
var tree = parent.tree;
} else {
dojo.raise("createSimple: can't evaluate tree");
}
}
tree = dojo.widget.byId(tree);
var treeNode = new tree.defaultChildWidget();
for (var x in args) {
treeNode[x] = args[x];
}
treeNode.toggleObj = dojo.lfx.toggle[treeNode.toggle.toLowerCase()] || dojo.lfx.toggle.plain;
dojo.widget.manager.add(treeNode);
treeNode.buildRendering(args, {}, parent);
treeNode.initialize(args, {}, parent);
if (treeNode.parent) {
delete dojo.widget.manager.topWidgets[treeNode.widgetId];
}
return treeNode;
}, viewUpdateLayout:function () {
this.viewRemoveLayout();
this.viewAddLayout();
}, viewAddContainer:function () {
this.containerNode = this.tree.containerNodeTemplate.cloneNode(true);
this.domNode.appendChild(this.containerNode);
}, viewAddLayout:function () {
if (this.parent["isTree"]) {
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode) + " " + this.tree.classPrefix + "IsRoot");
}
if (this.isLastChild()) {
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode) + " " + this.tree.classPrefix + "IsLast");
}
}, viewRemoveLayout:function () {
dojo.html.removeClass(this.domNode, this.tree.classPrefix + "IsRoot");
dojo.html.removeClass(this.domNode, this.tree.classPrefix + "IsLast");
}, viewGetExpandClass:function () {
if (this.isFolder) {
return this.isExpanded ? "ExpandOpen" : "ExpandClosed";
} else {
return "ExpandLeaf";
}
}, viewSetExpand:function () {
var expand = this.tree.classPrefix + this.viewGetExpandClass();
var reg = new RegExp("(^|\\s)" + this.tree.classPrefix + "Expand\\w+", "g");
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg, "") + " " + expand);
this.viewSetHasChildrenAndExpand();
}, viewGetChildrenClass:function () {
return "Children" + (this.children.length ? "Yes" : "No");
}, viewSetHasChildren:function () {
var clazz = this.tree.classPrefix + this.viewGetChildrenClass();
var reg = new RegExp("(^|\\s)" + this.tree.classPrefix + "Children\\w+", "g");
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg, "") + " " + clazz);
this.viewSetHasChildrenAndExpand();
}, viewSetHasChildrenAndExpand:function () {
var clazz = this.tree.classPrefix + "State" + this.viewGetChildrenClass() + "-" + this.viewGetExpandClass();
var reg = new RegExp("(^|\\s)" + this.tree.classPrefix + "State[\\w-]+", "g");
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg, "") + " " + clazz);
}, viewUnfocus:function () {
dojo.html.removeClass(this.labelNode, this.tree.classPrefix + "LabelFocused");
}, viewFocus:function () {
dojo.html.addClass(this.labelNode, this.tree.classPrefix + "LabelFocused");
}, viewEmphasize:function () {
dojo.html.clearSelection(this.labelNode);
dojo.html.addClass(this.labelNode, this.tree.classPrefix + "NodeEmphasized");
}, viewUnemphasize:function () {
dojo.html.removeClass(this.labelNode, this.tree.classPrefix + "NodeEmphasized");
}, detach:function () {
if (!this.parent) {
return;
}
var parent = this.parent;
var index = this.getParentIndex();
this.doDetach.apply(this, arguments);
dojo.event.topic.publish(this.tree.eventNames.afterDetach, {child:this, parent:parent, index:index});
}, doDetach:function () {
var parent = this.parent;
if (!parent) {
return;
}
var index = this.getParentIndex();
this.viewRemoveLayout();
dojo.widget.DomWidget.prototype.removeChild.call(parent, this);
var siblingsCount = parent.children.length;
if (siblingsCount > 0) {
if (index == 0) {
parent.children[0].viewUpdateLayout();
}
if (index == siblingsCount) {
parent.children[siblingsCount - 1].viewUpdateLayout();
}
} else {
if (parent.isTreeNode) {
parent.viewSetHasChildren();
}
}
if (this.tree.unsetFolderOnEmpty && !parent.children.length && parent.isTreeNode) {
parent.unsetFolder();
}
this.parent = null;
}, destroy:function () {
dojo.event.topic.publish(this.tree.eventNames.beforeNodeDestroy, {source:this});
this.detach();
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, expand:function () {
if (this.isExpanded) {
return;
}
if (this.tryLazyInit) {
this.setChildren();
this.tryLazyInit = false;
}
this.isExpanded = true;
this.viewSetExpand();
this.showChildren();
}, collapse:function () {
if (!this.isExpanded) {
return;
}
this.isExpanded = false;
this.hideChildren();
}, hideChildren:function () {
this.tree.toggleObj.hide(this.containerNode, this.tree.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onHideChildren"));
}, showChildren:function () {
this.tree.toggleObj.show(this.containerNode, this.tree.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onShowChildren"));
}, onShowChildren:function () {
this.onShow();
dojo.event.topic.publish(this.tree.eventNames.afterExpand, {source:this});
}, onHideChildren:function () {
this.viewSetExpand();
this.onHide();
dojo.event.topic.publish(this.tree.eventNames.afterCollapse, {source:this});
}, setTitle:function (title) {
var oldTitle = this.title;
this.labelNode.innerHTML = this.title = title;
dojo.event.topic.publish(this.tree.eventNames.afterSetTitle, {source:this, oldTitle:oldTitle});
}, toString:function () {
return "[" + this.widgetType + ", " + this.title + "]";
}});
 
/trunk/api/js/dojo/src/widget/ShowAction.js
New file
0,0 → 1,18
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ShowAction");
dojo.require("dojo.widget.*");
dojo.widget.defineWidget("dojo.widget.ShowAction", dojo.widget.HtmlWidget, {on:"", action:"fade", duration:350, from:"", to:"", auto:"false", postMixInProperties:function () {
if (dojo.render.html.opera) {
this.action = this.action.split("/").pop();
}
}});
 
/trunk/api/js/dojo/src/widget/PageContainer.js
New file
0,0 → 1,200
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.PageContainer");
dojo.require("dojo.lang.func");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.PageContainer", dojo.widget.HtmlWidget, {isContainer:true, doLayout:true, templateString:"<div dojoAttachPoint='containerNode'></div>", selectedChild:"", fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
dojo.widget.PageContainer.superclass.fillInTemplate.apply(this, arguments);
}, postCreate:function (args, frag) {
if (this.children.length) {
dojo.lang.forEach(this.children, this._setupChild, this);
var initialChild;
if (this.selectedChild) {
this.selectChild(this.selectedChild);
} else {
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].selected) {
this.selectChild(this.children[i]);
break;
}
}
if (!this.selectedChildWidget) {
this.selectChild(this.children[0]);
}
}
}
}, addChild:function (child) {
dojo.widget.PageContainer.superclass.addChild.apply(this, arguments);
this._setupChild(child);
this.onResized();
if (!this.selectedChildWidget) {
this.selectChild(child);
}
}, _setupChild:function (page) {
page.hide();
page.domNode.style.position = "relative";
dojo.event.topic.publish(this.widgetId + "-addChild", page);
}, removeChild:function (page) {
dojo.widget.PageContainer.superclass.removeChild.apply(this, arguments);
if (this._beingDestroyed) {
return;
}
dojo.event.topic.publish(this.widgetId + "-removeChild", page);
this.onResized();
if (this.selectedChildWidget === page) {
this.selectedChildWidget = undefined;
if (this.children.length > 0) {
this.selectChild(this.children[0], true);
}
}
}, selectChild:function (page, callingWidget) {
page = dojo.widget.byId(page);
this.correspondingPageButton = callingWidget;
if (this.selectedChildWidget) {
this._hideChild(this.selectedChildWidget);
}
this.selectedChildWidget = page;
this.selectedChild = page.widgetId;
this._showChild(page);
page.isFirstChild = (page == this.children[0]);
page.isLastChild = (page == this.children[this.children.length - 1]);
dojo.event.topic.publish(this.widgetId + "-selectChild", page);
}, forward:function () {
var index = dojo.lang.find(this.children, this.selectedChildWidget);
this.selectChild(this.children[index + 1]);
}, back:function () {
var index = dojo.lang.find(this.children, this.selectedChildWidget);
this.selectChild(this.children[index - 1]);
}, onResized:function () {
if (this.doLayout && this.selectedChildWidget) {
with (this.selectedChildWidget.domNode.style) {
top = dojo.html.getPixelValue(this.containerNode, "padding-top", true);
left = dojo.html.getPixelValue(this.containerNode, "padding-left", true);
}
var content = dojo.html.getContentBox(this.containerNode);
this.selectedChildWidget.resizeTo(content.width, content.height);
}
}, _showChild:function (page) {
if (this.doLayout) {
var content = dojo.html.getContentBox(this.containerNode);
page.resizeTo(content.width, content.height);
}
page.selected = true;
page.show();
}, _hideChild:function (page) {
page.selected = false;
page.hide();
}, closeChild:function (page) {
var remove = page.onClose(this, page);
if (remove) {
this.removeChild(page);
page.destroy();
}
}, destroy:function () {
this._beingDestroyed = true;
dojo.event.topic.destroy(this.widgetId + "-addChild");
dojo.event.topic.destroy(this.widgetId + "-removeChild");
dojo.event.topic.destroy(this.widgetId + "-selectChild");
dojo.widget.PageContainer.superclass.destroy.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.PageController", dojo.widget.HtmlWidget, {templateString:"<span wairole='tablist' dojoAttachEvent='onKey'></span>", isContainer:true, containerId:"", buttonWidget:"PageButton", "class":"dojoPageController", fillInTemplate:function () {
dojo.html.addClass(this.domNode, this["class"]);
dojo.widget.wai.setAttr(this.domNode, "waiRole", "role", "tablist");
}, postCreate:function () {
this.pane2button = {};
var container = dojo.widget.byId(this.containerId);
if (container) {
dojo.lang.forEach(container.children, this.onAddChild, this);
}
dojo.event.topic.subscribe(this.containerId + "-addChild", this, "onAddChild");
dojo.event.topic.subscribe(this.containerId + "-removeChild", this, "onRemoveChild");
dojo.event.topic.subscribe(this.containerId + "-selectChild", this, "onSelectChild");
}, destroy:function () {
dojo.event.topic.unsubscribe(this.containerId + "-addChild", this, "onAddChild");
dojo.event.topic.unsubscribe(this.containerId + "-removeChild", this, "onRemoveChild");
dojo.event.topic.unsubscribe(this.containerId + "-selectChild", this, "onSelectChild");
dojo.widget.PageController.superclass.destroy.apply(this, arguments);
}, onAddChild:function (page) {
var button = dojo.widget.createWidget(this.buttonWidget, {label:page.label, closeButton:page.closable});
this.addChild(button);
this.domNode.appendChild(button.domNode);
this.pane2button[page] = button;
page.controlButton = button;
var _this = this;
dojo.event.connect(button, "onClick", function () {
_this.onButtonClick(page);
});
dojo.event.connect(button, "onCloseButtonClick", function () {
_this.onCloseButtonClick(page);
});
}, onRemoveChild:function (page) {
if (this._currentChild == page) {
this._currentChild = null;
}
var button = this.pane2button[page];
if (button) {
button.destroy();
}
this.pane2button[page] = null;
}, onSelectChild:function (page) {
if (this._currentChild) {
var oldButton = this.pane2button[this._currentChild];
oldButton.clearSelected();
}
var newButton = this.pane2button[page];
newButton.setSelected();
this._currentChild = page;
}, onButtonClick:function (page) {
var container = dojo.widget.byId(this.containerId);
container.selectChild(page, false, this);
}, onCloseButtonClick:function (page) {
var container = dojo.widget.byId(this.containerId);
container.closeChild(page);
}, onKey:function (evt) {
if ((evt.keyCode == evt.KEY_RIGHT_ARROW) || (evt.keyCode == evt.KEY_LEFT_ARROW)) {
var current = 0;
var next = null;
var current = dojo.lang.find(this.children, this.pane2button[this._currentChild]);
if (evt.keyCode == evt.KEY_RIGHT_ARROW) {
next = this.children[(current + 1) % this.children.length];
} else {
next = this.children[(current + (this.children.length - 1)) % this.children.length];
}
dojo.event.browser.stopEvent(evt);
next.onClick();
}
}});
dojo.widget.defineWidget("dojo.widget.PageButton", dojo.widget.HtmlWidget, {templateString:"<span class='item'>" + "<span dojoAttachEvent='onClick' dojoAttachPoint='titleNode' class='selectButton'>${this.label}</span>" + "<span dojoAttachEvent='onClick:onCloseButtonClick' class='closeButton'>[X]</span>" + "</span>", label:"foo", closeButton:false, onClick:function () {
this.focus();
}, onCloseButtonMouseOver:function () {
dojo.html.addClass(this.closeButtonNode, "closeHover");
}, onCloseButtonMouseOut:function () {
dojo.html.removeClass(this.closeButtonNode, "closeHover");
}, onCloseButtonClick:function (evt) {
}, setSelected:function () {
dojo.html.addClass(this.domNode, "current");
this.titleNode.setAttribute("tabIndex", "0");
}, clearSelected:function () {
dojo.html.removeClass(this.domNode, "current");
this.titleNode.setAttribute("tabIndex", "-1");
}, focus:function () {
if (this.titleNode.focus) {
this.titleNode.focus();
}
}});
dojo.lang.extend(dojo.widget.Widget, {label:"", selected:false, closable:false, onClose:function () {
return true;
}});
 
/trunk/api/js/dojo/src/widget/Toaster.js
New file
0,0 → 1,161
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Toaster");
dojo.require("dojo.widget.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.html.iframe");
dojo.widget.defineWidget("dojo.widget.Toaster", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"clipNode\"><div dojoAttachPoint=\"containerNode\" dojoAttachEvent=\"onClick:onSelect\"><div dojoAttachPoint=\"contentNode\"></div></div></div>", templateCssString:".dojoToasterClip {\n\tposition: absolute;\n\toverflow: hidden;\n}\n\n.dojoToasterContainer {\n\tdisplay: block;\n\tposition: absolute;\n\twidth: 17.5em;\n\tz-index: 5000;\n\tmargin: 0px;\n\tfont:0.75em Tahoma, Helvetica, Verdana, Arial;\n}\n\n.dojoToasterContent{\n\tpadding:1em;\n\tpadding-top:0.25em;\n\tbackground:#73c74a;\n}\n\n.dojoToasterMessage{ \n\tcolor:#fff;\n}\n.dojoToasterWarning{ }\n.dojoToasterError,\n.dojoToasterFatal{\n\tfont-weight:bold;\n\tcolor:#fff;\n}\n\n\n.dojoToasterWarning .dojoToasterContent{\n\tpadding:1em;\n\tpadding-top:0.25em;\n\tbackground:#d4d943;\n} \n\n.dojoToasterError .dojoToasterContent{\n\tpadding:1em;\n\tpadding-top:0.25em;\n\tbackground:#c46600;\n} \n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Toaster.css"), messageTopic:"", messageTypes:{MESSAGE:"MESSAGE", WARNING:"WARNING", ERROR:"ERROR", FATAL:"FATAL"}, defaultType:"MESSAGE", clipCssClass:"dojoToasterClip", containerCssClass:"dojoToasterContainer", contentCssClass:"dojoToasterContent", messageCssClass:"dojoToasterMessage", warningCssClass:"dojoToasterWarning", errorCssClass:"dojoToasterError", fatalCssClass:"dojoToasterFatal", positionDirection:"br-up", positionDirectionTypes:["br-up", "br-left", "bl-up", "bl-right", "tr-down", "tr-left", "tl-down", "tl-right"], showDelay:2000, postCreate:function () {
this.hide();
dojo.html.setClass(this.clipNode, this.clipCssClass);
dojo.html.addClass(this.containerNode, this.containerCssClass);
dojo.html.setClass(this.contentNode, this.contentCssClass);
if (this.messageTopic) {
dojo.event.topic.subscribe(this.messageTopic, this, "_handleMessage");
}
if (!this.positionDirection || !dojo.lang.inArray(this.positionDirectionTypes, this.positionDirection)) {
this.positionDirection = this.positionDirectionTypes.BRU;
}
}, _handleMessage:function (msg) {
if (dojo.lang.isString(msg)) {
this.setContent(msg);
} else {
this.setContent(msg["message"], msg["type"], msg["delay"]);
}
}, setContent:function (msg, messageType, delay) {
var delay = delay || this.showDelay;
if (this.slideAnim && this.slideAnim.status() == "playing") {
dojo.lang.setTimeout(50, dojo.lang.hitch(this, function () {
this.setContent(msg, messageType);
}));
return;
} else {
if (this.slideAnim) {
this.slideAnim.stop();
if (this.fadeAnim) {
this.fadeAnim.stop();
}
}
}
if (!msg) {
dojo.debug(this.widgetId + ".setContent() incoming content was null, ignoring.");
return;
}
if (!this.positionDirection || !dojo.lang.inArray(this.positionDirectionTypes, this.positionDirection)) {
dojo.raise(this.widgetId + ".positionDirection is an invalid value: " + this.positionDirection);
}
dojo.html.removeClass(this.containerNode, this.messageCssClass);
dojo.html.removeClass(this.containerNode, this.warningCssClass);
dojo.html.removeClass(this.containerNode, this.errorCssClass);
dojo.html.removeClass(this.containerNode, this.fatalCssClass);
dojo.html.clearOpacity(this.containerNode);
if (msg instanceof String || typeof msg == "string") {
this.contentNode.innerHTML = msg;
} else {
if (dojo.html.isNode(msg)) {
this.contentNode.innerHTML = dojo.html.getContentAsString(msg);
} else {
dojo.raise("Toaster.setContent(): msg is of unknown type:" + msg);
}
}
switch (messageType) {
case this.messageTypes.WARNING:
dojo.html.addClass(this.containerNode, this.warningCssClass);
break;
case this.messageTypes.ERROR:
dojo.html.addClass(this.containerNode, this.errorCssClass);
break;
case this.messageTypes.FATAL:
dojo.html.addClass(this.containerNode, this.fatalCssClass);
break;
case this.messageTypes.MESSAGE:
default:
dojo.html.addClass(this.containerNode, this.messageCssClass);
break;
}
this.show();
var nodeSize = dojo.html.getMarginBox(this.containerNode);
if (this.positionDirection.indexOf("-up") >= 0) {
this.containerNode.style.left = 0 + "px";
this.containerNode.style.top = nodeSize.height + 10 + "px";
} else {
if (this.positionDirection.indexOf("-left") >= 0) {
this.containerNode.style.left = nodeSize.width + 10 + "px";
this.containerNode.style.top = 0 + "px";
} else {
if (this.positionDirection.indexOf("-right") >= 0) {
this.containerNode.style.left = 0 - nodeSize.width - 10 + "px";
this.containerNode.style.top = 0 + "px";
} else {
if (this.positionDirection.indexOf("-down") >= 0) {
this.containerNode.style.left = 0 + "px";
this.containerNode.style.top = 0 - nodeSize.height - 10 + "px";
} else {
dojo.raise(this.widgetId + ".positionDirection is an invalid value: " + this.positionDirection);
}
}
}
}
this.slideAnim = dojo.lfx.html.slideTo(this.containerNode, {top:0, left:0}, 450, null, dojo.lang.hitch(this, function (nodes, anim) {
dojo.lang.setTimeout(dojo.lang.hitch(this, function (evt) {
if (this.bgIframe) {
this.bgIframe.hide();
}
this.fadeAnim = dojo.lfx.html.fadeOut(this.containerNode, 1000, null, dojo.lang.hitch(this, function (evt) {
this.hide();
})).play();
}), delay);
})).play();
}, _placeClip:function () {
var scroll = dojo.html.getScroll();
var view = dojo.html.getViewport();
var nodeSize = dojo.html.getMarginBox(this.containerNode);
this.clipNode.style.height = nodeSize.height + "px";
this.clipNode.style.width = nodeSize.width + "px";
if (this.positionDirection.match(/^t/)) {
this.clipNode.style.top = scroll.top + "px";
} else {
if (this.positionDirection.match(/^b/)) {
this.clipNode.style.top = (view.height - nodeSize.height - 2 + scroll.top) + "px";
}
}
if (this.positionDirection.match(/^[tb]r-/)) {
this.clipNode.style.left = (view.width - nodeSize.width - 1 - scroll.left) + "px";
} else {
if (this.positionDirection.match(/^[tb]l-/)) {
this.clipNode.style.left = 0 + "px";
}
}
this.clipNode.style.clip = "rect(0px, " + nodeSize.width + "px, " + nodeSize.height + "px, 0px)";
if (dojo.render.html.ie) {
if (!this.bgIframe) {
this.bgIframe = new dojo.html.BackgroundIframe(this.containerNode);
this.bgIframe.setZIndex(this.containerNode);
}
this.bgIframe.onResized();
this.bgIframe.show();
}
}, onSelect:function (e) {
}, show:function () {
dojo.widget.Toaster.superclass.show.call(this);
this._placeClip();
if (!this._scrollConnected) {
this._scrollConnected = true;
dojo.event.connect(window, "onscroll", this, "_placeClip");
}
}, hide:function () {
dojo.widget.Toaster.superclass.hide.call(this);
if (this._scrollConnected) {
this._scrollConnected = false;
dojo.event.disconnect(window, "onscroll", this, "_placeClip");
}
dojo.html.setOpacity(this.containerNode, 1);
}});
 
/trunk/api/js/dojo/src/widget/templates/ResizeHandle.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/ResizeHandle.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TreeDisableWrap.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TreeDisableWrap.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/FloatingPane.html
New file
0,0 → 1,18
<div id="${this.widgetId}" dojoAttachEvent="onMouseDown" class="dojoFloatingPane">
<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" 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>
/trunk/api/js/dojo/src/widget/templates/EditorToolbar.html
New file
0,0 → 1,153
<div dojoAttachPoint="domNode" class="EditorToolbarDomNode" unselectable="on">
<table cellpadding="3" cellspacing="0" border="0">
<!--
our toolbar should look something like:
 
+=======+=======+=======+=============================================+
| w w | style | copy | bo | it | un | le | ce | ri |
| w w w | style |=======|==============|==============|
| w w | style | paste | undo | redo | change style |
+=======+=======+=======+=============================================+
-->
<tbody>
<tr valign="top">
<td rowspan="2">
<div class="bigIcon" dojoAttachPoint="wikiWordButton"
dojoOnClick="wikiWordClick; buttonClick;">
<span style="font-size: 30px; margin-left: 5px;">
W
</span>
</div>
</td>
<td rowspan="2">
<div class="bigIcon" dojoAttachPoint="styleDropdownButton"
dojoOnClick="styleDropdownClick; buttonClick;">
<span unselectable="on"
style="font-size: 30px; margin-left: 5px;">
S
</span>
</div>
<div class="StyleDropdownContainer" style="display: none;"
dojoAttachPoint="styleDropdownContainer">
<table cellpadding="0" cellspacing="0" border="0"
height="100%" width="100%">
<tr valign="top">
<td rowspan="2">
<div style="height: 245px; overflow: auto;">
<div class="headingContainer"
unselectable="on"
dojoOnClick="normalTextClick">normal</div>
<h1 class="headingContainer"
unselectable="on"
dojoOnClick="h1TextClick">Heading 1</h1>
<h2 class="headingContainer"
unselectable="on"
dojoOnClick="h2TextClick">Heading 2</h2>
<h3 class="headingContainer"
unselectable="on"
dojoOnClick="h3TextClick">Heading 3</h3>
<h4 class="headingContainer"
unselectable="on"
dojoOnClick="h4TextClick">Heading 4</h4>
<div class="headingContainer"
unselectable="on"
dojoOnClick="blahTextClick">blah</div>
<div class="headingContainer"
unselectable="on"
dojoOnClick="blahTextClick">blah</div>
<div class="headingContainer"
unselectable="on"
dojoOnClick="blahTextClick">blah</div>
<div class="headingContainer">blah</div>
<div class="headingContainer">blah</div>
<div class="headingContainer">blah</div>
<div class="headingContainer">blah</div>
</div>
</td>
<!--
<td>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifyleft"
style="float: left;">&nbsp;</span>
</span>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifycenter"
style="float: left;">&nbsp;</span>
</span>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifyright"
style="float: left;">&nbsp;</span>
</span>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifyfull"
style="float: left;">&nbsp;</span>
</span>
</td>
-->
</tr>
<tr valign="top">
<td>
thud
</td>
</tr>
</table>
</div>
</td>
<td>
<!-- copy -->
<span class="iconContainer" dojoAttachPoint="copyButton"
unselectable="on"
dojoOnClick="copyClick; buttonClick;">
<span class="icon copy"
unselectable="on"
style="float: left;">&nbsp;</span> copy
</span>
<!-- "droppable" options -->
<span class="iconContainer" dojoAttachPoint="boldButton"
unselectable="on"
dojoOnClick="boldClick; buttonClick;">
<span class="icon bold" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="italicButton"
dojoOnClick="italicClick; buttonClick;">
<span class="icon italic" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="underlineButton"
dojoOnClick="underlineClick; buttonClick;">
<span class="icon underline" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="leftButton"
dojoOnClick="leftClick; buttonClick;">
<span class="icon justifyleft" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="fullButton"
dojoOnClick="fullClick; buttonClick;">
<span class="icon justifyfull" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="rightButton"
dojoOnClick="rightClick; buttonClick;">
<span class="icon justifyright" unselectable="on">&nbsp;</span>
</span>
</td>
</tr>
<tr>
<td>
<!-- paste -->
<span class="iconContainer" dojoAttachPoint="pasteButton"
dojoOnClick="pasteClick; buttonClick;" unselectable="on">
<span class="icon paste" style="float: left;" unselectable="on">&nbsp;</span> paste
</span>
<!-- "droppable" options -->
<span class="iconContainer" dojoAttachPoint="undoButton"
dojoOnClick="undoClick; buttonClick;" unselectable="on">
<span class="icon undo" style="float: left;" unselectable="on">&nbsp;</span> undo
</span>
<span class="iconContainer" dojoAttachPoint="redoButton"
dojoOnClick="redoClick; buttonClick;" unselectable="on">
<span class="icon redo" style="float: left;" unselectable="on">&nbsp;</span> redo
</span>
</td>
</tr>
</tbody>
</table>
</div>
/trunk/api/js/dojo/src/widget/templates/DocPane.html
New file
0,0 → 1,79
<div class="dojoDocPane">
<div dojoAttachPoint="containerNode" class="container"></div>
 
<div dojoAttachPoint="dialog" class="dialog">
<div class="container" dojoAttachPoint="dialogBg">
<div class="docDialog" dojoAttachPoint="dialogFg">
<h2>Log In</h2>
<p><input id="dojoDocUserName" dojoAttachPoint="userName"><label for="dojoDocUserName">User Name:</label></p>
<p><input id="dojoDocPassword" dojoAttachPoint="password" type="password"><label for="dojoDocPassword">Password:</label></p>
<p><input type="button" dojoAttachPoint="cancel" value="cancel"> <input type="button" dojoAttachPoint="logIn" value="Log In"></p>
<p></p>
</div>
</div>
</div>
 
<div dojoAttachPoint="nav" class="nav"><span>Detail</span> | <span>Source</span> | <span>Examples</span> | <span>Walkthrough</span></div>
 
<div dojoAttachPoint="detail" class="detail">
<h1>Detail: <span class="fn" dojoAttachPoint="fn">dojo.select</span></h1>
<div class="description" dojoAttachPoint="description">Description</div>
<div class="params" dojoAttachPoint="parameters">
<h2>Parameters</h2>
<div class="row" dojoAttachPoint="pRow">
<span dojoAttachPoint="pOpt"><em>optional</em> </span>
<span><span dojoAttachPoint="pType">type</span> </span>
<a href="#" dojoAttachPoint="pLink">variable</a>
<span> - <span dojoAttachPoint="pDesc"></span></span>
</div>
</div>
<div class="variables" dojoAttachPoint="variables">
<h2>Variables</h2>
<div class"row" dojoAttachPoint="vRow">
<a href="#" dojoAttachPoint="vLink">variable</a><span> - <span dojoAttachPoint="vDesc"></span></span>
</div>
</div>
<div class="signature">
<h2>Signature</h2>
<div class="source">
<span class="return" dojoAttachPoint="sType">returnType</span>
<span class="function" dojoAttachPoint="sName">foo</span>
(<span class="params" dojoAttachPoint="sParams">
<span class="type" dojoAttachPoint="sPType">type </span>
<span class="name" dojoAttachPoint="sPName">paramName</span>
</span>)
</div>
</div>
</div>
<div dojoAttachPoint="result" class="result">
<h1>Search Results: <span dojoAttachPoint="count">0</span> matches</h1>
<div class="row" dojoAttachPoint="row">
<a href="#" dojoAttachPoint="fnLink">dojo.fnLink</a>
<span> - <span class="summary" dojoAttachPoint="summary">summary</span></span>
</div>
</div>
 
<div dojoAttachPoint="packag" class="package">
<h1>Package:
<span class="pkg" dojoAttachPoint="pkg">dojo.package</span>
<span class="edit" dojoAttachPoint="edit">[edit]</span>
<span class="save" dojoAttachPoint="save">[save]</span>
</h1>
<div dojoAttachPoint="pkgDescription" class="description">Description</div>
<div class="methods" dojoAttachPoint="methods">
<h2>Methods</h2>
<div class="row" dojoAttachPoint="mRow">
<a href="#" dojoAttachPoint="mLink">method</a>
<span> - <span class="description" dojoAttachPoint="mDesc"></span></span>
</div>
</div>
<div class="requires" dojoAttachPoint="requires">
<h2>Requires</h2>
<div class="row" dojoAttachPoint="rRow">
<h3 dojoAttachPoint="rH3">Environment</h3>
<div dojoAttachPoint="rRow2"><a href="#" dojoAttachPoint="rLink" class="package">require</a></div>
</div>
</div>
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/Checkbox.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Checkbox.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/DemoEngine.html
New file
0,0 → 1,24
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="navigationNode">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" valign="top" class="navigationCell"><h1>Categories</h1><div dojoAttachPoint="menuNavigationNode"></div></td>
<td width="99%" valign="top">
<div dojoAttachPoint="demoNavigationNode">
</div>
</td>
</tr>
</table>
</div>
 
<div dojoAttachPoint="demoContainerNode">
 
<div dojoAttachPoint="demoPaneNode">
</div>
 
<div dojoAttachPoint="demoHeaderNode">
<span dojoAttachPoint="collapsedMenuNode" dojoAttachEvent="onclick: expandDemoNavigation"></span>
<div dojoAttachPoint="aboutNode">About this Demo</div>
</div>
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/TooltipTemplate.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TooltipTemplate.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/DatePicker.html
New file
0,0 → 1,95
<div class="datePickerContainer" dojoAttachPoint="datePickerContainerNode">
<table cellspacing="0" cellpadding="0" class="calendarContainer">
<thead>
<tr>
<td class="monthWrapper" valign="top">
<table class="monthContainer" cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="monthCurve monthCurveTL" valign="top"></td>
<td class="monthLabelContainer" valign="top">
<span dojoAttachPoint="increaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl increase">
<img src="${dojoWidgetModuleUri}templates/images/incrementMonth.png"
alt="&darr;" style="width:7px;height:5px;" />
</span>
<span
dojoAttachPoint="increaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl increase">
<img src="${dojoWidgetModuleUri}templates/images/incrementMonth.png"
alt="&darr;" dojoAttachPoint="incrementMonthImageNode">
</span>
<span
dojoAttachPoint="decreaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl decrease">
<img src="${dojoWidgetModuleUri}templates/images/decrementMonth.png" alt="&uarr;" style="width:7px;height:5px;" />
</span>
<span
dojoAttachPoint="decreaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl decrease">
<img src="${dojoWidgetModuleUri}templates/images/decrementMonth.png"
alt="&uarr;" dojoAttachPoint="decrementMonthImageNode">
</span>
<span dojoAttachPoint="monthLabelNode" class="month"></span>
</td>
<td class="monthCurve monthCurveTR" valign="top"></td>
</tr>
</table>
</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3">
<table class="calendarBodyContainer" cellspacing="0" cellpadding="0" border="0">
<thead>
<tr dojoAttachPoint="dayLabelsRow">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody dojoAttachPoint="calendarDatesContainerNode"
dojoAttachEvent="onClick: _handleUiClick;">
<tr dojoAttachPoint="calendarWeekTemplate">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3" class="yearWrapper">
<table cellspacing="0" cellpadding="0" border="0" class="yearContainer">
<tr>
<td class="curveBL" valign="top"></td>
<td valign="top">
<h3 class="yearLabel">
<span dojoAttachPoint="previousYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="previousYear"></span>
<span class="selectedYear" dojoAttachPoint="currentYearLabelNode"></span>
<span dojoAttachPoint="nextYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="nextYear"></span>
</h3>
</td>
<td class="curveBR" valign="top"></td>
</tr>
</table>
</td>
</tr>
</tfoot>
</table>
</div>
/trunk/api/js/dojo/src/widget/templates/SliderVertical.html
New file
0,0 → 1,3
<div class="sliderMainVertical">
<div class="sliderHandleVertical" dojoAttachPoint="sliderHandle"></div>
</div>
/trunk/api/js/dojo/src/widget/templates/decrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/decrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Validate.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Validate.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Slider.html
New file
0,0 → 1,56
<table _="weird end tag formatting is to prevent whitespace from becoming &nbsp;"
class="sliderMain"
dojoAttachPoint="focusNode"
dojoAttachEvent="onmousedown:_setFocus; onkey:_handleKeyEvents; onkeyup:_buttonReleased; onmouseup:_buttonReleased; onmousewheel:_mouseWheeled;"
tabindex="0" cols=3 cellpadding=0 cellspacing=0 style="">
<tr valign=middle align=center>
<td class="sliderComponent" colspan=3 dojoAttachPoint=topBorderNode style=""
><img class="sliderOutsetButton sliderButtonY"
dojoAttachPoint=topButtonNode
dojoAttachEvent="onmousedown:_topButtonPressed; onmousemove:_discardEvent; ondblclick:_topButtonDoubleClicked;"
src="${this.topButtonSrc}"
style="${this.buttonStyleY}"
></td>
</tr>
<tr valign=middle align=center>
<td class="sliderComponent" dojoAttachPoint=leftBorderNode style=""
><img class="sliderOutsetButton sliderButtonX"
dojoAttachPoint=leftButtonNode
dojoAttachEvent="onmousedown:_leftButtonPressed; onmousemove:_discardEvent; ondblclick:_leftButtonDoubleClicked;"
src="${this.leftButtonSrc}"
style="${this.buttonStyleX}"
></td>
<td dojoAttachPoint=constrainingContainerNode
class="sliderComponent sliderBackground"
style="${this.backgroundStyle}"
><img src="${this.handleSrc}"
class=sliderHandle
dojoAttachPoint=sliderHandleNode
style="${this.handleStyle}"
><img src="${this.progressBackgroundSrc}"
class="sliderBackgroundSizeOnly sliderProgressBackground"
dojoAttachPoint=progressBackgroundNode
style="${this.backgroundSize}"
><img src="${this.backgroundSrc}"
class=sliderBackgroundSizeOnly
dojoAttachPoint=sliderBackgroundNode
style="${this.backgroundSize}"
></td>
<td class="sliderComponent" dojoAttachPoint=rightBorderNode style=""
><img class="sliderOutsetButton sliderButtonX"
dojoAttachPoint=rightButtonNode
dojoAttachEvent="onmousedown:_rightButtonPressed; onmousemove:_discardEvent; ondblclick:_rightButtonDoubleClicked;"
src="${this.rightButtonSrc}"
style="${this.buttonStyleX}"
></td>
</tr>
<tr valign=middle align=center>
<td class="sliderComponent" colspan=3 dojoAttachPoint=bottomBorderNode style=""
><img class="sliderOutsetButton sliderButtonY"
dojoAttachPoint=bottomButtonNode
dojoAttachEvent="onmousedown:_bottomButtonPressed; onmousemove:_discardEvent; ondblclick:_bottomButtonDoubleClicked;"
src="${this.bottomButtonSrc}"
style="${this.buttonStyleY}"
></td>
</tr>
</table>
/trunk/api/js/dojo/src/widget/templates/PopUpButton.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/PopUpButton.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/grabCorner.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/grabCorner.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Toolbar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Toolbar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Menu.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Menu.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/subscript.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/subscript.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/justifyfull.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/justifyfull.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/outdent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/outdent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/list_bullet_indent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/list_bullet_indent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/superscript.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/superscript.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/underline.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/underline.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/aggregate.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/aggregate.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/sep.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/sep.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/list_num_indent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/list_num_indent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/cut.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/cut.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/space.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/space.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/justifycenter.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/justifycenter.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/save.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/save.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/backcolor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/backcolor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/wikiword.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/wikiword.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/italic.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/italic.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/insertorderedlist.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/insertorderedlist.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/undo.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/undo.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/removeformat.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/removeformat.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/insertimage.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/insertimage.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/copy.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/copy.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/paste.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/paste.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/hilitecolor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/hilitecolor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/bold.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/bold.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/indent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/indent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/createlink.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/createlink.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/list_bullet_outdent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/list_bullet_outdent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/cancel.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/cancel.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/left_to_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/left_to_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/redo.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/redo.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/right_to_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/right_to_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/forecolor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/forecolor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/justifyright.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/justifyright.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/list_num_outdent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/list_num_outdent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/strikethrough.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/strikethrough.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/delete.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/delete.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/bg-fade.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/bg-fade.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/inserthorizontalrule.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/inserthorizontalrule.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/insertunorderedlist.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/insertunorderedlist.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/justifyleft.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/justifyleft.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/buttons/inserttable.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/buttons/inserttable.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TimePicker.html
New file
0,0 → 1,98
<div class="timePickerContainer" dojoAttachPoint="timePickerContainerNode">
<table class="timeContainer" cellspacing="0" >
<thead>
<tr>
<td class="timeCorner cornerTopLeft" valign="top">&nbsp;</td>
<td class="timeLabelContainer hourSelector">${this.calendar.field-hour}</td>
<td class="timeLabelContainer minutesHeading">${this.calendar.field-minute}</td>
<td class="timeCorner cornerTopRight" valign="top">&nbsp;</td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" colspan="2" class="hours">
<table align="center">
<tbody dojoAttachPoint="hourContainerNode"
dojoAttachEvent="onClick: onSetSelectedHour;">
<tr>
<td>12</td>
<td>6</td>
</tr>
<tr>
<td>1</td>
<td>7</td>
</tr>
<tr>
<td>2</td>
<td>8</td>
</tr>
<tr>
<td>3</td>
<td>9</td>
</tr>
<tr>
<td>4</td>
<td>10</td>
</tr>
<tr>
<td>5</td>
<td>11</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" class="minutes" colspan="2">
<table align="center">
<tbody dojoAttachPoint="minuteContainerNode"
dojoAttachEvent="onClick: onSetSelectedMinute;">
<tr>
<td>00</td>
<td>30</td>
</tr>
<tr>
<td>05</td>
<td>35</td>
</tr>
<tr>
<td>10</td>
<td>40</td>
</tr>
<tr>
<td>15</td>
<td>45</td>
</tr>
<tr>
<td>20</td>
<td>50</td>
</tr>
<tr>
<td>25</td>
<td>55</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="cornerBottomLeft">&nbsp;</td>
<td valign="top" class="timeOptions">
<table class="amPmContainer">
<tbody dojoAttachPoint="amPmContainerNode"
dojoAttachEvent="onClick: onSetSelectedAmPm;">
<tr>
<td id="am">${this.calendar.am}</td>
<td id="pm">${this.calendar.pm}</td>
</tr>
</tbody>
</table>
</td>
<td class="timeOptions">
<div dojoAttachPoint="anyTimeContainerNode"
dojoAttachEvent="onClick: onSetSelectedAnyTime;"
class="anyTimeContainer">${this.widgetStrings.any}</div>
</td>
<td class="cornerBottomRight">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
/trunk/api/js/dojo/src/widget/templates/SliderHorizontal.html
New file
0,0 → 1,3
<div class="sliderMainHorizontal">
<div class="sliderHandleHorizontal" dojoAttachPoint="sliderHandle"></div>
</div>
/trunk/api/js/dojo/src/widget/templates/Wizard.html
New file
0,0 → 1,10
<div class="WizardContainer" dojoAttachPoint="wizardNode">
<div class="WizardText" dojoAttachPoint="wizardPanelContainerNode">
</div>
<div class="WizardButtonHolder" dojoAttachPoint="wizardControlContainerNode">
<input class="WizardButton" type="button" dojoAttachPoint="previousButton"/>
<input class="WizardButton" type="button" dojoAttachPoint="nextButton"/>
<input class="WizardButton" type="button" dojoAttachPoint="doneButton" style="display:none"/>
<input class="WizardButton" type="button" dojoAttachPoint="cancelButton"/>
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/incrementWeek.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/incrementWeek.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/SlideShow.html
New file
0,0 → 1,15
<div style="position: relative; padding: 3px;">
<div>
<input type="button" value="pause"
dojoAttachPoint="startStopButton"
dojoAttachEvent="onClick: togglePaused;">
</div>
<div style="position: relative; width: ${this.width}; height: ${this.height};"
dojoAttachPoint="imagesContainer"
dojoAttachEvent="onClick: togglePaused;">
<img dojoAttachPoint="img1" class="slideShowImg"
style="z-index: 1; width: ${this.width}; height: ${this.height};" />
<img dojoAttachPoint="img2" class="slideShowImg"
style="z-index: 0; width: ${this.width}; height: ${this.height};" />
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/TaskBarItemTemplate.html
New file
0,0 → 1,2
<div class="dojoTaskBarItem" dojoAttachEvent="onClick">
</div>
/trunk/api/js/dojo/src/widget/templates/Slider.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Slider.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/RemoteTabControl.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/RemoteTabControl.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/MonthlyCalendar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/MonthlyCalendar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Spinner.html
New file
0,0 → 1,25
<span _="weird end tag formatting is to prevent whitespace from becoming &nbsp;"
style='float:${this.htmlfloat};'
><table cellpadding=0 cellspacing=0 class="dojoSpinner">
<tr>
<td
><input
dojoAttachPoint='textbox' type='${this.type}'
dojoAttachEvent='onblur;onfocus;onkey:_handleKeyEvents;onKeyUp:_onSpinnerKeyUp;onresize:_resize'
id='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'
value='${this.value}' class='${this.className}' autocomplete="off"
></td>
<td
><img dojoAttachPoint="upArrowNode"
dojoAttachEvent="onDblClick: _upArrowDoubleClicked; onMouseDown: _upArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;"
src="${this.incrementSrc}" style="width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;"
><img dojoAttachPoint="downArrowNode"
dojoAttachEvent="onDblClick: _downArrowDoubleClicked; onMouseDown: _downArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;"
src="${this.decrementSrc}" style="width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;"
></td>
</tr>
</table
><span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span
><span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span
><span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span
></span>
/trunk/api/js/dojo/src/widget/templates/ResizableTextarea.html
New file
0,0 → 1,14
<div>
<div style="border: 2px solid black; width: 90%; height: 200px;"
dojoAttachPoint="rootLayoutNode">
<div dojoAttachPoint="textAreaContainerNode"
style="border: 0px; margin: 0px; overflow: hidden;">
</div>
<div dojoAttachPoint="statusBarContainerNode" class="statusBar">
<div dojoAttachPoint="statusLabelNode"
class="statusPanel"
style="padding-right: 0px; z-index: 1;">drag to resize</div>
<div dojoAttachPoint="resizeHandleNode"></div>
</div>
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/decrementWeek.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/decrementWeek.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TitlePane.html
New file
0,0 → 1,4
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="labelNode" dojoAttachEvent="onclick: onLabelClick"></div>
<div dojoAttachPoint="containerNode"></div>
</div>
/trunk/api/js/dojo/src/widget/templates/ProgressBar.html
New file
0,0 → 1,5
<div dojoAttachPoint="containerNode" style="position:relative;overflow:hidden">
<div style="position:absolute;display:none;width:100%;text-align:center" dojoAttachPoint="backPercentLabel" class="dojoBackPercentLabel"></div>
<div style="position:absolute;overflow:hidden;width:100%;height:100%" dojoAttachPoint="internalProgress">
<div style="position:absolute;display:none;width:100%;text-align:center" dojoAttachPoint="frontPercentLabel" class="dojoFrontPercentLabel"></div></div>
</div>
/trunk/api/js/dojo/src/widget/templates/incrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/incrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/ComboBox.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/ComboBox.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/EditorToolbar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/EditorToolbar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/DocPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/DocPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/InlineEditBox.html
New file
0,0 → 1,6
<form class="inlineEditBox" style="display: none" dojoAttachPoint="form" dojoAttachEvent="onSubmit:saveEdit; onReset:cancelEdit; onKeyUp: checkForValueChange;">
<input type="text" dojoAttachPoint="text" style="display: none;" />
<textarea dojoAttachPoint="textarea" style="display: none;"></textarea>
<input type="submit" value="Save" dojoAttachPoint="submitButton" />
<input type="reset" value="Cancel" dojoAttachPoint="cancelButton" />
</form>
/trunk/api/js/dojo/src/widget/templates/ShowSlide.html
New file
0,0 → 1,6
<div class="dojoShowSlide">
<div class="dojoShowSlideTitle">
<h1 dojoAttachPoint="htmlTitle">Title</h1>
</div>
<div class="dojoShowSlideBody" dojoAttachPoint="containerNode"></div>
</div>
/trunk/api/js/dojo/src/widget/templates/ResizableTextarea.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/ResizableTextarea.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Spinner.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Spinner.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Show.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Show.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Editor2/EditorToolbar_FontSize.html
New file
0,0 → 1,31
<div class="SC_Panel" style="width: 150px; height: 150px;">
<table width="100%" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
<tbody>
<tr>
<td nowrap="">
<div class="SC_Item" dropDownItemName="1">
<font size="1">xx-small</font>
</div>
<div class="SC_Item" dropDownItemName="2">
<font size="2">x-small</font>
</div>
<div class="SC_Item" dropDownItemName="3">
<font size="3">small</font>
</div>
<div class="SC_Item" dropDownItemName="4">
<font size="4">medium</font>
</div>
<div class="SC_Item" dropDownItemName="5">
<font size="5">large</font>
</div>
<div class="SC_Item" dropDownItemName="6">
<font size="6">x-large</font>
</div>
<div class="SC_Item" dropDownItemName="7">
<font size="7">xx-large</font>
</div>
</td>
</tr>
</tbody>
</table>
</div>
/trunk/api/js/dojo/src/widget/templates/Editor2/Dialog/find.html
New file
0,0 → 1,15
<table style="white-space: nowrap;">
<tr><td colspan='2'>Find: <input type="text" dojoAttachPoint="find_text" /></td></tr>
<tr><td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="find_option_casesens" />
<label for="find_option_casesens">Case Sensitive</label></td>
<td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="find_option_backwards" />
<label for="find_option_backwards">Search Backwards</label></td></tr>
<tr><td style="display: none;"><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="find_option_wholeword" />
<label for="find_option_wholeword">Whole Word</label></td>
<tr><td colspan="1">
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:find'>Find</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>
</tr></table>
</td></tr>
</table>
/trunk/api/js/dojo/src/widget/templates/Editor2/Dialog/createlink.html
New file
0,0 → 1,15
<table>
<tr><td>URL</td><td> <input type="text" dojoAttachPoint="link_href" name="dojo_createLink_href"/></td></tr>
<tr><td>Target </td><td><select dojoAttachPoint="link_target">
<option value="">Self</option>
<option value="_blank">New Window</option>
<option value="_top">Top Window</option>
</select></td></tr>
<tr><td>Class </td><td><input type="text" dojoAttachPoint="link_class" /></td></tr>
<tr><td colspan="2">
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>
</tr></table>
</td></tr>
</table>
/trunk/api/js/dojo/src/widget/templates/Editor2/Dialog/insertimage.html
New file
0,0 → 1,114
<table cellspacing="1" cellpadding="1" border="0" width="100%" height="100%">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td width="100%">
<span>URL</span>
</td>
<td style="display: none" nowrap="nowrap" rowspan="2">
<!--input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server"/-->
</td>
</tr>
<tr>
<td valign="top">
<input dojoAttachPoint="image_src" style="width: 100%" type="text" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<span>Alternative Text</span><br />
<input dojoAttachPoint="image_alt" style="width: 100%" type="text" /><br />
</td>
</tr>
<tr>
<td valign="top">
<table><tr><td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span>Width</span>&nbsp;</td>
<td>
<input type="text" size="3" dojoAttachPoint="image_width" /></td>
 
<td rowspan="2">
<!--div id="btnLockSizes" class="BtnLocked" onmouseover="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';"
onmouseout="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );" title="Lock Sizes"
onclick="SwitchLock(this);">
</div-->
</td>
<td rowspan="2">
<!--div id="btnResetSize" class="BtnReset" onmouseover="this.className='BtnReset BtnOver';"
onmouseout="this.className='BtnReset';" title="Reset Size" onclick="ResetSizes();">
</div-->
</td>
</tr>
 
<tr>
<td nowrap="nowrap">
<span>Height</span>&nbsp;</td>
<td>
<input type="text" size="3" dojoAttachPoint="image_height" /></td>
</tr>
</table>
</td><td>
 
<table cellspacing="0" cellpadding="0" border="0">
<tr>
 
<td nowrap="nowrap">
<span >HSpace</span>&nbsp;</td>
<td>
<input type="text" size="2" dojoAttachPoint="image_hspace"/></td>
</tr>
<tr>
<td nowrap="nowrap">
<span >VSpace</span>&nbsp;</td>
 
<td>
<input type="text" size="2" dojoAttachPoint="image_vspace" /></td>
</tr>
</table>
</td></tr>
<tr><td colspan="2">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span>Border</span>&nbsp;</td>
<td>
<input type="text" size="2" value="" dojoAttachPoint="image_border" /></td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td nowrap="nowrap">
<span >Align</span>&nbsp;</td>
<td>
<select dojoAttachPoint="image_align">
 
<option value="" selected="selected"></option>
<option value="left">Left</option>
<option value="absBottom">Abs Bottom</option>
<option value="absMiddle">Abs Middle</option>
<option value="baseline">Baseline</option>
<option value="bottom">Bottom</option>
 
<option value="middle">Middle</option>
<option value="right">Right</option>
<option value="textTop">Text Top</option>
<option value="top">Top</option>
</select>
</td>
</tr>
</table>
</td>
</tr></table>
</td>
</tr>
<tr><td>
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>
</tr></table>
</td></tr>
</table>
/trunk/api/js/dojo/src/widget/templates/Editor2/Dialog/replace.html
New file
0,0 → 1,15
<table style="white-space: nowrap;">
<tr><td>Find: </td><td> <input type="text" dojoAttachPoint="replace_text" /></td></tr>
<tr><td>Replace with: </td><td> <input type="text" dojoAttachPoint="replace_text" /></td></tr>
<tr><td colspan='2'><table><tr><td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="replace_option_casesens" id="dojo_replace_option_casesens" />
<label for="dojo_replace_option_casesens">Case Sensitive</label></td>
<td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="replace_option_backwards" id="dojo_replace_option_backwards" />
<label for="dojo_replace_option_backwards">Search Backwards</label></td></tr></table></td></tr>
<tr><td colspan=2">
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:replaceAll'>Replace All</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>
</tr></table>
</td></tr>
</table>
/trunk/api/js/dojo/src/widget/templates/Editor2/Dialog/inserttable.html
New file
0,0 → 1,91
<div>
<table cellSpacing="1" cellPadding="1" width="100%" border="0">
<tr>
<td valign="top">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
 
<td><span>Rows</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_rows" type="text" maxLength="3" size="2" value="3"></td>
</tr>
<tr>
<td><span>Columns</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_cols" type="text" maxLength="2" size="2" value="2"></td>
</tr>
 
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><span>Border size</span>:</td>
<td>&nbsp;<INPUT dojoAttachPoint="table_border" type="text" maxLength="2" size="2" value="1"></td>
</tr>
 
<tr>
<td><span>Alignment</span>:</td>
<td>&nbsp;<select dojoAttachPoint="table_align">
<option value="" selected>&lt;Not set&gt;</option>
<option value="left">Left</option>
<option value="center">Center</option>
<option value="right">Right</option>
</select></td>
</tr>
</table>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td align="right" valign="top">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td><span>Width</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_width" type="text" maxLength="4" size="3"></td>
<td>&nbsp;<select dojoAttachPoint="table_widthtype">
<option value="percent" selected>percent</option>
<option value="pixels">pixels</option>
</select></td>
 
</tr>
<tr>
<td><span>Height</span>:</td>
<td>&nbsp;<INPUT dojoAttachPoint="table_height" type="text" maxLength="4" size="3"></td>
<td>&nbsp;<span>pixels</span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td nowrap><span>Cell spacing</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_cellspacing" type="text" maxLength="2" size="2" value="1"></td>
<td>&nbsp;</td>
 
</tr>
<tr>
<td nowrap><span>Cell padding</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_cellpadding" type="text" maxLength="2" size="2" value="1"></td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td nowrap><span>Caption</span>:</td>
<td>&nbsp;</td>
<td width="100%" nowrap>&nbsp;
<input dojoAttachPoint="table_caption" type="text" style="WIDTH: 90%"></td>
</tr>
<tr>
<td nowrap><span>Summary</span>:</td>
<td>&nbsp;</td>
<td width="100%" nowrap>&nbsp;
<input dojoAttachPoint="table_summary" type="text" style="WIDTH: 90%"></td>
</tr>
</table>
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>Ok</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>
</tr></table>
</div>
/trunk/api/js/dojo/src/widget/templates/Editor2/EditorToolbar_FormatBlock.html
New file
0,0 → 1,52
<div class="SC_Panel" style="width: 190px; height: 150px;">
<div class="SC_Item" dropDownItemName="p">
<div class="BaseFont">
<p>Normal</p>
</div>
</div>
<div class="SC_Item" dropDownItemName="div">
<div class="BaseFont">
<div>Normal (DIV)</div>
</div>
</div>
<div class="SC_Item" dropDownItemName="pre">
<div class="BaseFont">
<pre>Formatted</pre>
</div>
</div>
<div class="SC_Item" dropDownItemName="address">
<div class="BaseFont">
<address>Address</address>
</div>
</div>
<div class="SC_Item" dropDownItemName="h1">
<div class="BaseFont">
<h1>Heading 1</h1>
</div>
</div>
<div class="SC_Item" dropDownItemName="h2">
<div class="BaseFont">
<h2>Heading 2</h2>
</div>
</div>
<div class="SC_Item" dropDownItemName="h3">
<div class="BaseFont">
<h3>Heading 3</h3>
</div>
</div>
<div class="SC_Item" dropDownItemName="h4">
<div class="BaseFont">
<h4>Heading 4</h4>
</div>
</div>
<div class="SC_Item" dropDownItemName="h5">
<div class="BaseFont">
<h5>Heading 5</h5>
</div>
</div>
<div class="SC_Item" dropDownItemName="h6">
<div class="BaseFont">
<h6>Heading 6</h6>
</div>
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/Editor2/EditorToolbar_FontName.html
New file
0,0 → 1,20
<div class="SC_Panel" style="width: 150px; height: 150px;">
<div class="SC_Item" dropDownItemName="Arial">
<font face="Arial" style="font-size: 12px;">Arial</font>
</div>
<div class="SC_Item" dropDownItemName="Comic Sans MS">
<font face="Comic Sans MS" style="font-size: 12px;">Comic Sans MS</font>
</div>
<div class="SC_Item" dropDownItemName="Courier New">
<font face="Courier New" style="font-size: 12px;">Courier New</font>
</div>
<div class="SC_Item" dropDownItemName="Tahoma">
<font face="Tahoma" style="font-size: 12px;">Tahoma</font>
</div>
<div class="SC_Item" dropDownItemName="Times New Roman">
<font face="Times New Roman" style="font-size: 12px;">Times New Roman</font>
</div>
<div class="SC_Item" dropDownItemName="Verdana">
<font face="Verdana" style="font-size: 12px;">Verdana</font>
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/Editor2/showtableborder_gecko.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Editor2/showtableborder_gecko.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Editor2/EditorDialog.html
New file
0,0 → 1,21
<div id="${this.widgetId}" class="dojoFloatingPane">
<span dojoattachpoint="tabStartOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabStart" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" style="display:none">
<img dojoAttachPoint="titleBarIcon" class="dojoFloatingPaneTitleBarIcon">
<div dojoAttachPoint="closeAction" dojoAttachEvent="onClick:hide"
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>
<span dojoattachpoint="tabEnd" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabEndOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar" style="display:none"></div>
</div>
/trunk/api/js/dojo/src/widget/templates/Editor2/showtableborder_ie.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Editor2/showtableborder_ie.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Toaster.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Toaster.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/AccordionPane.html
New file
0,0 → 1,4
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="labelNode" dojoAttachEvent="onclick: onLabelClick" class="${this.labelNodeClass}">${this.label}</div>
<div dojoAttachPoint="containerNode" style="overflow: hidden;" class="${this.containerNodeClass}"></div>
</div>
/trunk/api/js/dojo/src/widget/templates/TabContainer.html
New file
0,0 → 1,4
<div id="${this.widgetId}" class="dojoTabContainer">
<div dojoAttachPoint="tablistNode"></div>
<div class="dojoTabPaneWrapper" dojoAttachPoint="containerNode" dojoAttachEvent="onKey" waiRole="tabpanel"></div>
</div>
/trunk/api/js/dojo/src/widget/templates/Menu2.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Menu2.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TaskBar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TaskBar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/FisheyeList.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/FisheyeList.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/check.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/check.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/CheckboxA11y.html
New file
0,0 → 1,4
<span class='dojoHtmlCheckbox'>
<input type="checkbox" name="${this.name}" tabIndex="${this.tabIndex}" id="${this.id}" value="${this.value}"
dojoAttachEvent="onClick: _onClick;" dojoAttachPoint="inputNode">
</span>
/trunk/api/js/dojo/src/widget/templates/SplitContainer.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/SplitContainer.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Tree.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Tree.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/MonthlyCalendar.html
New file
0,0 → 1,110
<div class="datePickerContainer" dojoAttachPoint="datePickerContainerNode">
<h3 class="monthLabel">
<!--
<span
dojoAttachPoint="decreaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/decrementWeek.gif" alt="&uarr;" />
</span>
-->
<span
dojoAttachPoint="decreaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/decrementMonth.gif"
alt="&uarr;" dojoAttachPoint="decrementMonthImageNode">
</span>
<span dojoAttachPoint="monthLabelNode" class="month">July</span>
<span
dojoAttachPoint="increaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/incrementMonth.gif"
alt="&darr;" dojoAttachPoint="incrementMonthImageNode">
</span>
<!--
<span dojoAttachPoint="increaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/incrementWeek.gif"
alt="&darr;" />
</span>
-->
</h3>
<table class="calendarContainer">
<thead>
<tr dojoAttachPoint="dayLabelsRow">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody dojoAttachPoint="calendarDatesContainerNode"
dojoAttachEvent="onClick: onSetDate;">
<tr dojoAttachPoint="calendarRow0">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow1">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow2">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow3">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow4">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow5">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h3 class="yearLabel">
<span dojoAttachPoint="previousYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="previousYear"></span>
<span class="selectedYear" dojoAttachPoint="currentYearLabelNode"></span>
<span dojoAttachPoint="nextYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="nextYear"></span>
</h3>
</div>
/trunk/api/js/dojo/src/widget/templates/SlideShow.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/SlideShow.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/ComboButtonTemplate.html
New file
0,0 → 1,18
<div class="dojoButton" style="position:relative;top:0px;left:0px; text-align:none;" dojoAttachEvent="onKey;onFocus">
 
<div dojoAttachPoint="buttonNode" class="dojoButtonLeftPart" style="position:absolute;left:0px;top:0px;"
dojoAttachEvent="onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick;">
<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; onMouseDown:rightDown; onMouseUp:rightUp; onClick:rightClick;">
<img dojoAttachPoint="arrowBackgroundImage" style="position:absolute;top:0px;left:0px;z-index:1;">
<img src="${dojoWidgetModuleUri}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>
/trunk/api/js/dojo/src/widget/templates/TabContainerA11y.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TabContainerA11y.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TreeEditor.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TreeEditor.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/ButtonTemplate.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/ButtonTemplate.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TreeV3.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TreeV3.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider_right_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider_right_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider-bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider-bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/incrementMonth.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/incrementMonth.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpCurveBR.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpCurveBR.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/no.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/no.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/bdYearBg.1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/bdYearBg.1.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_right_r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_right_r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider_left_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider_left_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dateIcon.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dateIcon.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaActive-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaActive-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/incrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/incrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_close.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_close.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneClose.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneClose.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/combo_box_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/combo_box_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_left_r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_left_r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaActive-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaActive-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/bar.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/bar.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaActive-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaActive-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneMinimize.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneMinimize.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/submenu_on.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/submenu_on.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider-button.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider-button.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/clock.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/clock.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpVertLine.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpVertLine.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider_up_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider_up_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/bdYearBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/bdYearBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_expand_minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_expand_minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider-bg-vert.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider-bg-vert.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider-button-vert.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider-button-vert.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_p.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_p.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaButton-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaButton-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaAccordionOff.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaAccordionOff.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_t.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_t.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/verticalbar.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/verticalbar.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_v.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_v.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_x.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_x.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_y.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_y.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaButton-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaButton-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_z.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_grid_z.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/no.svg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/no.svg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/timeIcon.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/timeIcon.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaButton-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaButton-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/submenu_off.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/submenu_off.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaAccordionSelected.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaAccordionSelected.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_node.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_node.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaMenuBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaMenuBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneRestore.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneRestore.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_right_r_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_right_r_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_left_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_left_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/whiteDownArrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/whiteDownArrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpMonthBg2.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpMonthBg2.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaPressed-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaPressed-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_top_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_top_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpCurveTL.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpCurveTL.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider-bg-progress-vert.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider-bg-progress-vert.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/h-bar.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/h-bar.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_v.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_v.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/transparent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/transparent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_x.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_x.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_y.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_y.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_z.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_z.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_child.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_child.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/closed.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/closed.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.jpg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/document.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/document.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/Tree.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/Tree.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_p.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_p.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_t.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_t.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow-disabled.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow-disabled.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/decrementMonth.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/decrementMonth.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaPressed-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaPressed-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpCurveTR.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpCurveTR.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpMonthBg.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpMonthBg.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_top_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_top_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaPressed-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaPressed-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_right_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_bot_right_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/open.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/open.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/t.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/t.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_leaf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_leaf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i_long.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i_long.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/x.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/x.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/closed.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/closed.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_loading.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_loading.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/document.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/document.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i_half.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i_half.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i_bhalf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i_bhalf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/i.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/expand_minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/TreeV3/minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/submenu_disabled.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/submenu_disabled.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_child.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_child.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaBarBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaBarBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneMaximize.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/floatingPaneMaximize.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/decrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/decrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpYearBg.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpYearBg.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpHorizLineFoot.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpHorizLineFoot.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpMonthBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpMonthBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/spinnerIncrement.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/spinnerIncrement.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaDisabled-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaDisabled-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpHorizLine.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpHorizLine.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/toolbar-bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/toolbar-bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider-button-horz.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider-button-horz.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_left_r_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_left_r_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpYearBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpYearBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaDisabled-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaDisabled-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/transparent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/transparent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/slider_down_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/slider_down_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/tab_close_h.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/tab_close_h.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/soriaDisabled-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/soriaDisabled-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/dpCurveBL.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/dpCurveBL.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/spinnerDecrement.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/spinnerDecrement.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/scBackground.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/scBackground.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/images/treenode_expand_plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/images/treenode_expand_plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/richtextframe.html
New file
0,0 → 1,24
<!-- <?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';
try{
parentPageDomain = document.location.href.split('#')[1];
if(parentPageDomain){
document.domain = parentPageDomain;
}
}catch(e){ }
}
window.onload = init;
</script>
</head>
<body>
<br />
</body>
</html>
/trunk/api/js/dojo/src/widget/templates/ButtonTemplate.html
New file
0,0 → 1,6
<div dojoAttachPoint="buttonNode" class="dojoButton" style="position:relative;" dojoAttachEvent="onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick; onKey:onKey; onFocus;">
<div class="dojoButtonContents" align=center dojoAttachPoint="containerNode" style="position:absolute;z-index:2;"></div>
<img dojoAttachPoint="leftImage" style="position:absolute;left:0px;">
<img dojoAttachPoint="centerImage" style="position:absolute;z-index:1;">
<img dojoAttachPoint="rightImage" style="position:absolute;top:0px;right:0px;">
</div>
/trunk/api/js/dojo/src/widget/templates/ValidationTextbox.html
New file
0,0 → 1,8
<span style='float:${this.htmlfloat};'>
<input dojoAttachPoint='textbox' type='${this.type}' dojoAttachEvent='onblur;onfocus;onkeyup'
id='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'
class='${this.className}' style=''>
<span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span>
<span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span>
<span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span>
</span>
/trunk/api/js/dojo/src/widget/templates/ComboBox.html
New file
0,0 → 1,16
<span _="whitespace and CR's between tags adds &nbsp; in FF"
class="dojoComboBoxOuter"
><input style="display:none" tabindex="-1" name="" value=""
dojoAttachPoint="comboBoxValue"
><input style="display:none" tabindex="-1" name="" value=""
dojoAttachPoint="comboBoxSelectionValue"
><input type="text" autocomplete="off" class="dojoComboBox"
dojoAttachEvent="key:_handleKeyEvents; keyUp: onKeyUp; compositionEnd; onResize;"
dojoAttachPoint="textInputNode"
><img hspace="0"
vspace="0"
class="dojoComboBox"
dojoAttachPoint="downArrowNode"
dojoAttachEvent="onMouseUp: handleArrowClick; onResize;"
src="${this.buttonSrc}"
></span>
/trunk/api/js/dojo/src/widget/templates/ProgressBar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/ProgressBar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TimePicker.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TimePicker.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Show.html
New file
0,0 → 1,11
<div class="dojoShow">
<div dojoAttachPoint="contentNode"></div>
<div class="dojoShowNav" dojoAttachPoint="nav">
<div class="dojoShowHider" dojoAttachPoint="hider"></div>
<span unselectable="on" style="cursor: default;" dojoAttachEvent="onClick:previousSlide">&lt;</span>
<select dojoAttachEvent="onClick:gotoSlideByEvent" dojoAttachPoint="select">
<option dojoAttachPoint="option">Title</option>
</select>
<span unselectable="on" style="cursor: default;" dojoAttachEvent="onClick:nextSlide">&gt;</span>
</div>
</div>
/trunk/api/js/dojo/src/widget/templates/InlineEditBox.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/InlineEditBox.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TreeDocIcon.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TreeDocIcon.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/EditorToolbarOneline.html
New file
0,0 → 1,172
<div class="EditorToolbarDomNode EditorToolbarSmallBg">
<table cellpadding="1" cellspacing="0" border="0">
<tbody>
<tr valign="top" align="left">
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="htmltoggle">
<span class="dojoE2TBIcon"
style="background-image: none; width: 30px;" >&lt;h&gt;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="copy">
<span class="dojoE2TBIcon dojoE2TBIcon_Copy">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="paste">
<span class="dojoE2TBIcon dojoE2TBIcon_Paste">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="undo">
<!-- FIXME: should we have the text "undo" here? -->
<span class="dojoE2TBIcon dojoE2TBIcon_Undo">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="redo">
<span class="dojoE2TBIcon dojoE2TBIcon_Redo">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="createlink">
<span class="dojoE2TBIcon dojoE2TBIcon_Link">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="insertimage">
<span class="dojoE2TBIcon dojoE2TBIcon_Image">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="inserthorizontalrule">
<span class="dojoE2TBIcon dojoE2TBIcon_HorizontalLine ">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="bold">
<span class="dojoE2TBIcon dojoE2TBIcon_Bold">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="italic">
<span class="dojoE2TBIcon dojoE2TBIcon_Italic">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="underline">
<span class="dojoE2TBIcon dojoE2TBIcon_Underline">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="strikethrough">
<span
class="dojoE2TBIcon dojoE2TBIcon_StrikeThrough">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep"
style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="insertunorderedlist">
<span
class="dojoE2TBIcon dojoE2TBIcon_BulletedList">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="insertorderedlist">
<span
class="dojoE2TBIcon dojoE2TBIcon_NumberedList">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="indent">
<span class="dojoE2TBIcon dojoE2TBIcon_Indent"
unselectable="on">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="outdent">
<span class="dojoE2TBIcon dojoE2TBIcon_Outdent"
unselectable="on">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="forecolor">
<span class="dojoE2TBIcon dojoE2TBIcon_TextColor"
unselectable="on">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="hilitecolor">
<span class="dojoE2TBIcon dojoE2TBIcon_BackgroundColor"
unselectable="on">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifyleft">
<span class="dojoE2TBIcon dojoE2TBIcon_LeftJustify">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifycenter">
<span class="dojoE2TBIcon dojoE2TBIcon_CenterJustify">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifyright">
<span class="dojoE2TBIcon dojoE2TBIcon_RightJustify">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifyfull">
<span class="dojoE2TBIcon dojoE2TBIcon_BlockJustify">&nbsp;</span>
</span>
</td>
<td>
<select class="dojoEditorToolbarItem" dojoETItemName="plainformatblock">
<!-- FIXME: using "p" here inserts a paragraph in most cases! -->
<option value="">-- format --</option>
<option value="p">Normal</option>
<option value="pre">Fixed Font</option>
<option value="h1">Main Heading</option>
<option value="h2">Section Heading</option>
<option value="h3">Sub-Heading</option>
<!-- <option value="blockquote">Block Quote</option> -->
</select>
</td>
<td><!-- uncomment to enable save button -->
<!-- save -->
<!--span class="iconContainer dojoEditorToolbarItem" dojoETItemName="save">
<span class="dojoE2TBIcon dojoE2TBIcon_Save">&nbsp;</span>
</span-->
</td>
<td width="*">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
/trunk/api/js/dojo/src/widget/templates/Wizard.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/Wizard.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/DropDownButtonTemplate.html
New file
0,0 → 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>
/trunk/api/js/dojo/src/widget/templates/ShowSlide.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/ShowSlide.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Checkbox.html
New file
0,0 → 1,5
<span style="display: inline-block;" tabIndex="${this.tabIndex}" waiRole="checkbox" id="${this.id}">
<img dojoAttachPoint="imageNode" class="dojoHtmlCheckbox" src="${dojoWidgetModuleUri}templates/images/blank.gif" alt="" />
<input type="checkbox" name="${this.name}" style="display: none" value="${this.value}"
dojoAttachPoint="inputNode">
</span>
/trunk/api/js/dojo/src/widget/templates/CiviCrmDatePicker.html
New file
0,0 → 1,12
<table cellpadding="0" cellspacing="0" border="0" width="400">
<tr>
<td id="dateHolderTd" width="200">
</td>
<td id="timeHolderTd" width="200">
</td>
</tr>
<tr style="display: none;" id="formItemsTr">
<td id="formItemsTd">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
/trunk/api/js/dojo/src/widget/templates/AccordionPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/AccordionPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/FloatingPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/FloatingPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/TabContainer.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/TabContainer.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Textbox.html
New file
0,0 → 1,5
<span style='float:${this.htmlfloat};'>
<input dojoAttachPoint='textbox' dojoAttachEvent='onblur;onfocus'
id='${this.widgetId}' name='${this.name}'
class='${this.className}' type='${this.type}' >
</span>
/trunk/api/js/dojo/src/widget/templates/DatePicker.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/templates/DatePicker.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/templates/Dialog.html
New file
0,0 → 1,7
<div id="${this.widgetId}" class="dojoDialog" dojoattachpoint="wrapper">
<span dojoattachpoint="tabStartOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabStart" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<div dojoattachpoint="containerNode" style="position: relative; z-index: 2;"></div>
<span dojoattachpoint="tabEnd" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabEndOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
</div>
/trunk/api/js/dojo/src/widget/Widget.js
New file
0,0 → 1,310
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Widget");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.extras");
dojo.require("dojo.lang.declare");
dojo.require("dojo.ns");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.event.*");
dojo.require("dojo.a11y");
dojo.declare("dojo.widget.Widget", null, function () {
this.children = [];
this.extraArgs = {};
}, {parent:null, isTopLevel:false, disabled:false, isContainer:false, widgetId:"", widgetType:"Widget", ns:"dojo", getNamespacedType:function () {
return (this.ns ? this.ns + ":" + this.widgetType : this.widgetType).toLowerCase();
}, toString:function () {
return "[Widget " + this.getNamespacedType() + ", " + (this.widgetId || "NO ID") + "]";
}, repr:function () {
return this.toString();
}, enable:function () {
this.disabled = false;
}, disable:function () {
this.disabled = true;
}, onResized:function () {
this.notifyChildrenOfResize();
}, notifyChildrenOfResize:function () {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child.onResized) {
child.onResized();
}
}
}, create:function (args, fragment, parent, ns) {
if (ns) {
this.ns = ns;
}
this.satisfyPropertySets(args, fragment, parent);
this.mixInProperties(args, fragment, parent);
this.postMixInProperties(args, fragment, parent);
dojo.widget.manager.add(this);
this.buildRendering(args, fragment, parent);
this.initialize(args, fragment, parent);
this.postInitialize(args, fragment, parent);
this.postCreate(args, fragment, parent);
return this;
}, destroy:function (finalize) {
if (this.parent) {
this.parent.removeChild(this);
}
this.destroyChildren();
this.uninitialize();
this.destroyRendering(finalize);
dojo.widget.manager.removeById(this.widgetId);
}, destroyChildren:function () {
var widget;
var i = 0;
while (this.children.length > i) {
widget = this.children[i];
if (widget instanceof dojo.widget.Widget) {
this.removeChild(widget);
widget.destroy();
continue;
}
i++;
}
}, getChildrenOfType:function (type, recurse) {
var ret = [];
var isFunc = dojo.lang.isFunction(type);
if (!isFunc) {
type = type.toLowerCase();
}
for (var x = 0; x < this.children.length; x++) {
if (isFunc) {
if (this.children[x] instanceof type) {
ret.push(this.children[x]);
}
} else {
if (this.children[x].widgetType.toLowerCase() == type) {
ret.push(this.children[x]);
}
}
if (recurse) {
ret = ret.concat(this.children[x].getChildrenOfType(type, recurse));
}
}
return ret;
}, getDescendants:function () {
var result = [];
var stack = [this];
var elem;
while ((elem = stack.pop())) {
result.push(elem);
if (elem.children) {
dojo.lang.forEach(elem.children, function (elem) {
stack.push(elem);
});
}
}
return result;
}, isFirstChild:function () {
return this === this.parent.children[0];
}, isLastChild:function () {
return this === this.parent.children[this.parent.children.length - 1];
}, satisfyPropertySets:function (args) {
return args;
}, mixInProperties:function (args, frag) {
if ((args["fastMixIn"]) || (frag["fastMixIn"])) {
for (var x in args) {
this[x] = args[x];
}
return;
}
var undef;
var lcArgs = dojo.widget.lcArgsCache[this.widgetType];
if (lcArgs == null) {
lcArgs = {};
for (var y in this) {
lcArgs[((new String(y)).toLowerCase())] = y;
}
dojo.widget.lcArgsCache[this.widgetType] = lcArgs;
}
var visited = {};
for (var x in args) {
if (!this[x]) {
var y = lcArgs[(new String(x)).toLowerCase()];
if (y) {
args[y] = args[x];
x = y;
}
}
if (visited[x]) {
continue;
}
visited[x] = true;
if ((typeof this[x]) != (typeof undef)) {
if (typeof args[x] != "string") {
this[x] = args[x];
} else {
if (dojo.lang.isString(this[x])) {
this[x] = args[x];
} else {
if (dojo.lang.isNumber(this[x])) {
this[x] = new Number(args[x]);
} else {
if (dojo.lang.isBoolean(this[x])) {
this[x] = (args[x].toLowerCase() == "false") ? false : true;
} else {
if (dojo.lang.isFunction(this[x])) {
if (args[x].search(/[^\w\.]+/i) == -1) {
this[x] = dojo.evalObjPath(args[x], false);
} else {
var tn = dojo.lang.nameAnonFunc(new Function(args[x]), this);
dojo.event.kwConnect({srcObj:this, srcFunc:x, adviceObj:this, adviceFunc:tn});
}
} else {
if (dojo.lang.isArray(this[x])) {
this[x] = args[x].split(";");
} else {
if (this[x] instanceof Date) {
this[x] = new Date(Number(args[x]));
} else {
if (typeof this[x] == "object") {
if (this[x] instanceof dojo.uri.Uri) {
this[x] = dojo.uri.dojoUri(args[x]);
} else {
var pairs = args[x].split(";");
for (var y = 0; y < pairs.length; y++) {
var si = pairs[y].indexOf(":");
if ((si != -1) && (pairs[y].length > si)) {
this[x][pairs[y].substr(0, si).replace(/^\s+|\s+$/g, "")] = pairs[y].substr(si + 1);
}
}
}
} else {
this[x] = args[x];
}
}
}
}
}
}
}
}
} else {
this.extraArgs[x.toLowerCase()] = args[x];
}
}
}, postMixInProperties:function (args, frag, parent) {
}, initialize:function (args, frag, parent) {
return false;
}, postInitialize:function (args, frag, parent) {
return false;
}, postCreate:function (args, frag, parent) {
return false;
}, uninitialize:function () {
return false;
}, buildRendering:function (args, frag, parent) {
dojo.unimplemented("dojo.widget.Widget.buildRendering, on " + this.toString() + ", ");
return false;
}, destroyRendering:function () {
dojo.unimplemented("dojo.widget.Widget.destroyRendering");
return false;
}, addedTo:function (parent) {
}, addChild:function (child) {
dojo.unimplemented("dojo.widget.Widget.addChild");
return false;
}, removeChild:function (widget) {
for (var x = 0; x < this.children.length; x++) {
if (this.children[x] === widget) {
this.children.splice(x, 1);
widget.parent = null;
break;
}
}
return widget;
}, getPreviousSibling:function () {
var idx = this.getParentIndex();
if (idx <= 0) {
return null;
}
return this.parent.children[idx - 1];
}, getSiblings:function () {
return this.parent.children;
}, getParentIndex:function () {
return dojo.lang.indexOf(this.parent.children, this, true);
}, getNextSibling:function () {
var idx = this.getParentIndex();
if (idx == this.parent.children.length - 1) {
return null;
}
if (idx < 0) {
return null;
}
return this.parent.children[idx + 1];
}});
dojo.widget.lcArgsCache = {};
dojo.widget.tags = {};
dojo.widget.tags.addParseTreeHandler = function (type) {
dojo.deprecated("addParseTreeHandler", ". ParseTreeHandlers are now reserved for components. Any unfiltered DojoML tag without a ParseTreeHandler is assumed to be a widget", "0.5");
};
dojo.widget.tags["dojo:propertyset"] = function (fragment, widgetParser, parentComp) {
var properties = widgetParser.parseProperties(fragment["dojo:propertyset"]);
};
dojo.widget.tags["dojo:connect"] = function (fragment, widgetParser, parentComp) {
var properties = widgetParser.parseProperties(fragment["dojo:connect"]);
};
dojo.widget.buildWidgetFromParseTree = function (type, frag, parser, parentComp, insertionIndex, localProps) {
dojo.a11y.setAccessibleMode();
var stype = type.split(":");
stype = (stype.length == 2) ? stype[1] : type;
var localProperties = localProps || parser.parseProperties(frag[frag["ns"] + ":" + stype]);
var twidget = dojo.widget.manager.getImplementation(stype, null, null, frag["ns"]);
if (!twidget) {
throw new Error("cannot find \"" + type + "\" widget");
} else {
if (!twidget.create) {
throw new Error("\"" + type + "\" widget object has no \"create\" method and does not appear to implement *Widget");
}
}
localProperties["dojoinsertionindex"] = insertionIndex;
var ret = twidget.create(localProperties, frag, parentComp, frag["ns"]);
return ret;
};
dojo.widget.defineWidget = function (widgetClass, renderer, superclasses, init, props) {
if (dojo.lang.isString(arguments[3])) {
dojo.widget._defineWidget(arguments[0], arguments[3], arguments[1], arguments[4], arguments[2]);
} else {
var args = [arguments[0]], p = 3;
if (dojo.lang.isString(arguments[1])) {
args.push(arguments[1], arguments[2]);
} else {
args.push("", arguments[1]);
p = 2;
}
if (dojo.lang.isFunction(arguments[p])) {
args.push(arguments[p], arguments[p + 1]);
} else {
args.push(null, arguments[p]);
}
dojo.widget._defineWidget.apply(this, args);
}
};
dojo.widget.defineWidget.renderers = "html|svg|vml";
dojo.widget._defineWidget = function (widgetClass, renderer, superclasses, init, props) {
var module = widgetClass.split(".");
var type = module.pop();
var regx = "\\.(" + (renderer ? renderer + "|" : "") + dojo.widget.defineWidget.renderers + ")\\.";
var r = widgetClass.search(new RegExp(regx));
module = (r < 0 ? module.join(".") : widgetClass.substr(0, r));
dojo.widget.manager.registerWidgetPackage(module);
var pos = module.indexOf(".");
var nsName = (pos > -1) ? module.substring(0, pos) : module;
props = (props) || {};
props.widgetType = type;
if ((!init) && (props["classConstructor"])) {
init = props.classConstructor;
delete props.classConstructor;
}
dojo.declare(widgetClass, superclasses, init, props);
};
 
/trunk/api/js/dojo/src/widget/SortableTable.js
New file
0,0 → 1,498
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SortableTable");
dojo.deprecated("SortableTable will be removed in favor of FilteringTable.", "0.5");
dojo.require("dojo.lang.common");
dojo.require("dojo.date.format");
dojo.require("dojo.html.*");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.util");
dojo.require("dojo.html.style");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.SortableTable", dojo.widget.HtmlWidget, function () {
this.data = [];
this.selected = [];
this.columns = [];
}, {enableMultipleSelect:false, maximumNumberOfSelections:0, enableAlternateRows:false, minRows:0, defaultDateFormat:"%D", sortIndex:0, sortDirection:0, valueField:"Id", headClass:"", tbodyClass:"", headerClass:"", headerSortUpClass:"selected", headerSortDownClass:"selected", rowClass:"", rowAlternateClass:"alt", rowSelectedClass:"selected", columnSelected:"sorted-column", isContainer:false, templatePath:null, templateCssPath:null, getTypeFromString:function (s) {
var parts = s.split("."), i = 0, obj = dj_global;
do {
obj = obj[parts[i++]];
} while (i < parts.length && obj);
return (obj != dj_global) ? obj : null;
}, compare:function (o1, o2) {
for (var p in o1) {
if (!(p in o2)) {
return false;
}
if (o1[p].valueOf() != o2[p].valueOf()) {
return false;
}
}
return true;
}, isSelected:function (o) {
for (var i = 0; i < this.selected.length; i++) {
if (this.compare(this.selected[i], o)) {
return true;
}
}
return false;
}, removeFromSelected:function (o) {
var idx = -1;
for (var i = 0; i < this.selected.length; i++) {
if (this.compare(this.selected[i], o)) {
idx = i;
break;
}
}
if (idx >= 0) {
this.selected.splice(idx, 1);
}
}, getSelection:function () {
return this.selected;
}, getValue:function () {
var a = [];
for (var i = 0; i < this.selected.length; i++) {
if (this.selected[i][this.valueField]) {
a.push(this.selected[i][this.valueField]);
}
}
return a.join();
}, reset:function () {
this.columns = [];
this.data = [];
this.resetSelections(this.domNode.getElementsByTagName("tbody")[0]);
}, resetSelections:function (body) {
this.selected = [];
var idx = 0;
var rows = body.getElementsByTagName("tr");
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
rows[i].removeAttribute("selected");
if (this.enableAlternateRows && idx % 2 == 1) {
rows[i].className = this.rowAlternateClass;
} else {
rows[i].className = "";
}
idx++;
}
}
}, getObjectFromRow:function (row) {
var cells = row.getElementsByTagName("td");
var o = {};
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].sortType == "__markup__") {
o[this.columns[i].getField()] = cells[i].innerHTML;
} else {
var text = dojo.html.renderedTextContent(cells[i]);
var val = text;
if (this.columns[i].getType() != String) {
var val = new (this.columns[i].getType())(text);
}
o[this.columns[i].getField()] = val;
}
}
if (dojo.html.hasAttribute(row, "value")) {
o[this.valueField] = dojo.html.getAttribute(row, "value");
}
return o;
}, setSelectionByRow:function (row) {
var o = this.getObjectFromRow(row);
var b = false;
for (var i = 0; i < this.selected.length; i++) {
if (this.compare(this.selected[i], o)) {
b = true;
break;
}
}
if (!b) {
this.selected.push(o);
}
}, parseColumns:function (node) {
this.reset();
var row = node.getElementsByTagName("tr")[0];
var cells = row.getElementsByTagName("td");
if (cells.length == 0) {
cells = row.getElementsByTagName("th");
}
for (var i = 0; i < cells.length; i++) {
var o = {field:null, format:null, noSort:false, sortType:"String", dataType:String, sortFunction:null, label:null, align:"left", valign:"middle", getField:function () {
return this.field || this.label;
}, getType:function () {
return this.dataType;
}};
if (dojo.html.hasAttribute(cells[i], "align")) {
o.align = dojo.html.getAttribute(cells[i], "align");
}
if (dojo.html.hasAttribute(cells[i], "valign")) {
o.valign = dojo.html.getAttribute(cells[i], "valign");
}
if (dojo.html.hasAttribute(cells[i], "nosort")) {
o.noSort = dojo.html.getAttribute(cells[i], "nosort") == "true";
}
if (dojo.html.hasAttribute(cells[i], "sortusing")) {
var trans = dojo.html.getAttribute(cells[i], "sortusing");
var f = this.getTypeFromString(trans);
if (f != null && f != window && typeof (f) == "function") {
o.sortFunction = f;
}
}
if (dojo.html.hasAttribute(cells[i], "field")) {
o.field = dojo.html.getAttribute(cells[i], "field");
}
if (dojo.html.hasAttribute(cells[i], "format")) {
o.format = dojo.html.getAttribute(cells[i], "format");
}
if (dojo.html.hasAttribute(cells[i], "dataType")) {
var sortType = dojo.html.getAttribute(cells[i], "dataType");
if (sortType.toLowerCase() == "html" || sortType.toLowerCase() == "markup") {
o.sortType = "__markup__";
o.noSort = true;
} else {
var type = this.getTypeFromString(sortType);
if (type) {
o.sortType = sortType;
o.dataType = type;
}
}
}
o.label = dojo.html.renderedTextContent(cells[i]);
this.columns.push(o);
if (dojo.html.hasAttribute(cells[i], "sort")) {
this.sortIndex = i;
var dir = dojo.html.getAttribute(cells[i], "sort");
if (!isNaN(parseInt(dir))) {
dir = parseInt(dir);
this.sortDirection = (dir != 0) ? 1 : 0;
} else {
this.sortDirection = (dir.toLowerCase() == "desc") ? 1 : 0;
}
}
}
}, parseData:function (data) {
this.data = [];
this.selected = [];
for (var i = 0; i < data.length; i++) {
var o = {};
for (var j = 0; j < this.columns.length; j++) {
var field = this.columns[j].getField();
if (this.columns[j].sortType == "__markup__") {
o[field] = String(data[i][field]);
} else {
var type = this.columns[j].getType();
var val = data[i][field];
var t = this.columns[j].sortType.toLowerCase();
if (type == String) {
o[field] = val;
} else {
if (val != null) {
o[field] = new type(val);
} else {
o[field] = new type();
}
}
}
}
if (data[i][this.valueField] && !o[this.valueField]) {
o[this.valueField] = data[i][this.valueField];
}
this.data.push(o);
}
}, parseDataFromTable:function (tbody) {
this.data = [];
this.selected = [];
var rows = tbody.getElementsByTagName("tr");
for (var i = 0; i < rows.length; i++) {
if (dojo.html.getAttribute(rows[i], "ignoreIfParsed") == "true") {
continue;
}
var o = {};
var cells = rows[i].getElementsByTagName("td");
for (var j = 0; j < this.columns.length; j++) {
var field = this.columns[j].getField();
if (this.columns[j].sortType == "__markup__") {
o[field] = cells[j].innerHTML;
} else {
var type = this.columns[j].getType();
var val = dojo.html.renderedTextContent(cells[j]);
if (type == String) {
o[field] = val;
} else {
if (val != null) {
o[field] = new type(val);
} else {
o[field] = new type();
}
}
}
}
if (dojo.html.hasAttribute(rows[i], "value") && !o[this.valueField]) {
o[this.valueField] = dojo.html.getAttribute(rows[i], "value");
}
this.data.push(o);
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
this.selected.push(o);
}
}
}, showSelections:function () {
var body = this.domNode.getElementsByTagName("tbody")[0];
var rows = body.getElementsByTagName("tr");
var idx = 0;
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
rows[i].className = this.rowSelectedClass;
} else {
if (this.enableAlternateRows && idx % 2 == 1) {
rows[i].className = this.rowAlternateClass;
} else {
rows[i].className = "";
}
}
idx++;
}
}
}, render:function (bDontPreserve) {
var data = [];
var body = this.domNode.getElementsByTagName("tbody")[0];
if (!bDontPreserve) {
this.parseDataFromTable(body);
}
for (var i = 0; i < this.data.length; i++) {
data.push(this.data[i]);
}
var col = this.columns[this.sortIndex];
if (!col.noSort) {
var field = col.getField();
if (col.sortFunction) {
var sort = col.sortFunction;
} else {
var sort = function (a, b) {
if (a[field] > b[field]) {
return 1;
}
if (a[field] < b[field]) {
return -1;
}
return 0;
};
}
data.sort(sort);
if (this.sortDirection != 0) {
data.reverse();
}
}
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
for (var i = 0; i < data.length; i++) {
var row = document.createElement("tr");
dojo.html.disableSelection(row);
if (data[i][this.valueField]) {
row.setAttribute("value", data[i][this.valueField]);
}
if (this.isSelected(data[i])) {
row.className = this.rowSelectedClass;
row.setAttribute("selected", "true");
} else {
if (this.enableAlternateRows && i % 2 == 1) {
row.className = this.rowAlternateClass;
}
}
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.setAttribute("align", this.columns[j].align);
cell.setAttribute("valign", this.columns[j].valign);
dojo.html.disableSelection(cell);
if (this.sortIndex == j) {
cell.className = this.columnSelected;
}
if (this.columns[j].sortType == "__markup__") {
cell.innerHTML = data[i][this.columns[j].getField()];
for (var k = 0; k < cell.childNodes.length; k++) {
var node = cell.childNodes[k];
if (node && node.nodeType == dojo.html.ELEMENT_NODE) {
dojo.html.disableSelection(node);
}
}
} else {
if (this.columns[j].getType() == Date) {
var format = this.defaultDateFormat;
if (this.columns[j].format) {
format = this.columns[j].format;
}
cell.appendChild(document.createTextNode(dojo.date.strftime(data[i][this.columns[j].getField()], format)));
} else {
cell.appendChild(document.createTextNode(data[i][this.columns[j].getField()]));
}
}
row.appendChild(cell);
}
body.appendChild(row);
dojo.event.connect(row, "onclick", this, "onUISelect");
}
var minRows = parseInt(this.minRows);
if (!isNaN(minRows) && minRows > 0 && data.length < minRows) {
var mod = 0;
if (data.length % 2 == 0) {
mod = 1;
}
var nRows = minRows - data.length;
for (var i = 0; i < nRows; i++) {
var row = document.createElement("tr");
row.setAttribute("ignoreIfParsed", "true");
if (this.enableAlternateRows && i % 2 == mod) {
row.className = this.rowAlternateClass;
}
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.appendChild(document.createTextNode("\xa0"));
row.appendChild(cell);
}
body.appendChild(row);
}
}
}, onSelect:function (e) {
}, onUISelect:function (e) {
var row = dojo.html.getParentByType(e.target, "tr");
var body = dojo.html.getParentByType(row, "tbody");
if (this.enableMultipleSelect) {
if (e.metaKey || e.ctrlKey) {
if (this.isSelected(this.getObjectFromRow(row))) {
this.removeFromSelected(this.getObjectFromRow(row));
row.removeAttribute("selected");
} else {
this.setSelectionByRow(row);
row.setAttribute("selected", "true");
}
} else {
if (e.shiftKey) {
var startRow;
var rows = body.getElementsByTagName("tr");
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
if (rows[i] == row) {
break;
}
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
startRow = rows[i];
}
}
}
if (!startRow) {
startRow = row;
for (; i < rows.length; i++) {
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
row = rows[i];
break;
}
}
}
this.resetSelections(body);
if (startRow == row) {
row.setAttribute("selected", "true");
this.setSelectionByRow(row);
} else {
var doSelect = false;
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
rows[i].removeAttribute("selected");
if (rows[i] == startRow) {
doSelect = true;
}
if (doSelect) {
this.setSelectionByRow(rows[i]);
rows[i].setAttribute("selected", "true");
}
if (rows[i] == row) {
doSelect = false;
}
}
}
}
} else {
this.resetSelections(body);
row.setAttribute("selected", "true");
this.setSelectionByRow(row);
}
}
} else {
this.resetSelections(body);
row.setAttribute("selected", "true");
this.setSelectionByRow(row);
}
this.showSelections();
this.onSelect(e);
e.stopPropagation();
e.preventDefault();
}, onHeaderClick:function (e) {
var oldIndex = this.sortIndex;
var oldDirection = this.sortDirection;
var source = e.target;
var row = dojo.html.getParentByType(source, "tr");
var cellTag = "td";
if (row.getElementsByTagName(cellTag).length == 0) {
cellTag = "th";
}
var headers = row.getElementsByTagName(cellTag);
var header = dojo.html.getParentByType(source, cellTag);
for (var i = 0; i < headers.length; i++) {
if (headers[i] == header) {
if (i != oldIndex) {
this.sortIndex = i;
this.sortDirection = 0;
headers[i].className = this.headerSortDownClass;
} else {
this.sortDirection = (oldDirection == 0) ? 1 : 0;
if (this.sortDirection == 0) {
headers[i].className = this.headerSortDownClass;
} else {
headers[i].className = this.headerSortUpClass;
}
}
} else {
headers[i].className = this.headerClass;
}
}
this.render();
}, postCreate:function () {
var thead = this.domNode.getElementsByTagName("thead")[0];
if (this.headClass.length > 0) {
thead.className = this.headClass;
}
dojo.html.disableSelection(this.domNode);
this.parseColumns(thead);
var header = "td";
if (thead.getElementsByTagName(header).length == 0) {
header = "th";
}
var headers = thead.getElementsByTagName(header);
for (var i = 0; i < headers.length; i++) {
if (!this.columns[i].noSort) {
dojo.event.connect(headers[i], "onclick", this, "onHeaderClick");
}
if (this.sortIndex == i) {
if (this.sortDirection == 0) {
headers[i].className = this.headerSortDownClass;
} else {
headers[i].className = this.headerSortUpClass;
}
}
}
var tbody = this.domNode.getElementsByTagName("tbody")[0];
if (this.tbodyClass.length > 0) {
tbody.className = this.tbodyClass;
}
this.parseDataFromTable(tbody);
this.render(true);
}});
 
/trunk/api/js/dojo/src/widget/MonthlyCalendar.js
New file
0,0 → 1,147
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.MonthlyCalendar");
dojo.require("dojo.date.common");
dojo.require("dojo.date.format");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DatePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.MonthlyCalendar");
dojo.widget.defineWidget("dojo.widget.MonthlyCalendar", dojo.widget.DatePicker, {dayWidth:"wide", templateString:"<div class=\"datePickerContainer\" dojoAttachPoint=\"datePickerContainerNode\">\n\t<h3 class=\"monthLabel\">\n\t<!--\n\t<span \n\t\tdojoAttachPoint=\"decreaseWeekNode\" \n\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\tclass=\"incrementControl\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/decrementWeek.gif\" alt=\"&uarr;\" />\n\t</span>\n\t-->\n\t<span \n\t\tdojoAttachPoint=\"decreaseMonthNode\" \n\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/decrementMonth.gif\" \n\t\t\talt=\"&uarr;\" dojoAttachPoint=\"decrementMonthImageNode\">\n\t</span>\n\t<span dojoAttachPoint=\"monthLabelNode\" class=\"month\">July</span>\n\t<span \n\t\tdojoAttachPoint=\"increaseMonthNode\" \n\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/incrementMonth.gif\" \n\t\t\talt=\"&darr;\" dojoAttachPoint=\"incrementMonthImageNode\">\n\t</span>\n\t<!--\n\t\t<span dojoAttachPoint=\"increaseWeekNode\" \n\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\tclass=\"incrementControl\">\n\t\t\t<img src=\"${dojoWidgetModuleUri}templates/incrementWeek.gif\" \n\t\t\talt=\"&darr;\" />\n\t\t</span>\n\t-->\n\t</h3>\n\t<table class=\"calendarContainer\">\n\t\t<thead>\n\t\t\t<tr dojoAttachPoint=\"dayLabelsRow\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody dojoAttachPoint=\"calendarDatesContainerNode\" \n\t\t\tdojoAttachEvent=\"onClick: onSetDate;\">\n\t\t\t<tr dojoAttachPoint=\"calendarRow0\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow1\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow3\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow4\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow5\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<h3 class=\"yearLabel\">\n\t\t<span dojoAttachPoint=\"previousYearLabelNode\"\n\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"previousYear\"></span>\n\t\t<span class=\"selectedYear\" dojoAttachPoint=\"currentYearLabelNode\"></span>\n\t\t<span dojoAttachPoint=\"nextYearLabelNode\" \n\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"nextYear\"></span>\n\t</h3>\n</div>\n", templateCssString:".datePickerContainer {\n\tmargin:0.5em 2em 0.5em 0;\n\t/*width:10em;*/\n\tfloat:left;\n}\n\n.previousMonth {\n\tbackground-color:#bbbbbb;\n}\n\n.currentMonth {\n\tbackground-color:#8f8f8f;\n}\n\n.nextMonth {\n\tbackground-color:#eeeeee;\n}\n\n.currentDate {\n\ttext-decoration:underline;\n\tfont-style:italic;\n}\n\n.selectedItem {\n\tbackground-color:#3a3a3a;\n\tcolor:#ffffff;\n}\n\n.calendarContainer {\n\tborder-collapse:collapse;\n\tborder-spacing:0;\n\tborder-bottom:1px solid #e6e6e6;\n\toverflow: hidden;\n\ttext-align: right;\n}\n\n.calendarContainer thead{\n\tborder-bottom:1px solid #e6e6e6;\n}\n\n.calendarContainer tbody * td {\n height: 100px;\n border: 1px solid gray;\n}\n\n.calendarContainer td {\n width: 100px;\n padding: 2px;\n\tvertical-align: top;\n}\n\n.monthLabel {\n\tfont-size:0.9em;\n\tfont-weight:400;\n\tmargin:0;\n\ttext-align:center;\n}\n\n.monthLabel .month {\n\tpadding:0 0.4em 0 0.4em;\n}\n\n.yearLabel {\n\tfont-size:0.9em;\n\tfont-weight:400;\n\tmargin:0.25em 0 0 0;\n\ttext-align:right;\n\tcolor:#a3a3a3;\n}\n\n.yearLabel .selectedYear {\n\tcolor:#000;\n\tpadding:0 0.2em;\n}\n\n.nextYear, .previousYear {\n\tcursor:pointer;cursor:hand;\n}\n\n.incrementControl {\n\tcursor:pointer;cursor:hand;\n\twidth:1em;\n}\n\n.dojoMonthlyCalendarEvent {\n\tfont-size:0.7em;\n\toverflow: hidden;\n\tfont-color: grey;\n\twhite-space: nowrap;\n\ttext-align: left;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/MonthlyCalendar.css"), initializer:function () {
this.iCalendars = [];
}, addCalendar:function (cal) {
dojo.debug("Adding Calendar");
this.iCalendars.push(cal);
dojo.debug("Starting init");
this.initUI();
dojo.debug("done init");
}, createDayContents:function (node, mydate) {
dojo.html.removeChildren(node);
node.appendChild(document.createTextNode(mydate.getDate()));
for (var x = 0; x < this.iCalendars.length; x++) {
var evts = this.iCalendars[x].getEvents(mydate);
if ((dojo.lang.isArray(evts)) && (evts.length > 0)) {
for (var y = 0; y < evts.length; y++) {
var el = document.createElement("div");
dojo.html.addClass(el, "dojoMonthlyCalendarEvent");
el.appendChild(document.createTextNode(evts[y].summary.value));
el.width = dojo.html.getContentBox(node).width;
node.appendChild(el);
}
}
}
}, initUI:function () {
var dayLabels = dojo.date.getNames("days", this.dayWidth, "standAlone", this.lang);
var dayLabelNodes = this.dayLabelsRow.getElementsByTagName("td");
for (var i = 0; i < 7; i++) {
dayLabelNodes.item(i).innerHTML = dayLabels[i];
}
this.selectedIsUsed = false;
this.currentIsUsed = false;
var currentClassName = "";
var previousDate = new Date();
var calendarNodes = this.calendarDatesContainerNode.getElementsByTagName("td");
var currentCalendarNode;
previousDate.setHours(8);
var nextDate = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date, 8);
var lastDay = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date + 42, 8);
if (this.iCalendars.length > 0) {
for (var x = 0; x < this.iCalendars.length; x++) {
this.iCalendars[x].preComputeRecurringEvents(lastDay);
}
}
if (this.firstSaturday.date < 7) {
var dayInWeek = 6;
for (var i = this.firstSaturday.date; i > 0; i--) {
currentCalendarNode = calendarNodes.item(dayInWeek);
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
dayInWeek--;
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, false);
}
for (var i = dayInWeek; i > -1; i--) {
currentCalendarNode = calendarNodes.item(i);
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "previous"));
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, false);
}
} else {
nextDate.setDate(1);
for (var i = 0; i < 7; i++) {
currentCalendarNode = calendarNodes.item(i);
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, true);
}
}
previousDate.setDate(this.firstSaturday.date);
previousDate.setMonth(this.firstSaturday.month);
previousDate.setFullYear(this.firstSaturday.year);
nextDate = this.incrementDate(previousDate, true);
var count = 7;
currentCalendarNode = calendarNodes.item(count);
while ((nextDate.getMonth() == previousDate.getMonth()) && (count < 42)) {
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
currentCalendarNode = calendarNodes.item(++count);
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, true);
}
while (count < 42) {
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "next"));
currentCalendarNode = calendarNodes.item(++count);
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, true);
}
this.setMonthLabel(this.firstSaturday.month);
this.setYearLabels(this.firstSaturday.year);
}});
dojo.widget.MonthlyCalendar.util = new function () {
this.toRfcDate = function (jsDate) {
if (!jsDate) {
jsDate = this.today;
}
var year = jsDate.getFullYear();
var month = jsDate.getMonth() + 1;
if (month < 10) {
month = "0" + month.toString();
}
var date = jsDate.getDate();
if (date < 10) {
date = "0" + date.toString();
}
return year + "-" + month + "-" + date + "T00:00:00+00:00";
};
this.fromRfcDate = function (rfcDate) {
var tempDate = rfcDate.split("-");
if (tempDate.length < 3) {
return new Date();
}
return new Date(parseInt(tempDate[0]), (parseInt(tempDate[1], 10) - 1), parseInt(tempDate[2].substr(0, 2), 10));
};
this.initFirstSaturday = function (month, year) {
if (!month) {
month = this.date.getMonth();
}
if (!year) {
year = this.date.getFullYear();
}
var firstOfMonth = new Date(year, month, 1);
return {year:year, month:month, date:7 - firstOfMonth.getDay()};
};
};
 
/trunk/api/js/dojo/src/widget/html/layout.js
New file
0,0 → 1,92
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.html.layout");
dojo.require("dojo.lang.common");
dojo.require("dojo.string.extras");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.widget.html.layout = function (container, children, layoutPriority) {
dojo.html.addClass(container, "dojoLayoutContainer");
children = dojo.lang.filter(children, function (child, idx) {
child.idx = idx;
return dojo.lang.inArray(["top", "bottom", "left", "right", "client", "flood"], child.layoutAlign);
});
if (layoutPriority && layoutPriority != "none") {
var rank = function (child) {
switch (child.layoutAlign) {
case "flood":
return 1;
case "left":
case "right":
return (layoutPriority == "left-right") ? 2 : 3;
case "top":
case "bottom":
return (layoutPriority == "left-right") ? 3 : 2;
default:
return 4;
}
};
children.sort(function (a, b) {
return (rank(a) - rank(b)) || (a.idx - b.idx);
});
}
var f = {top:dojo.html.getPixelValue(container, "padding-top", true), left:dojo.html.getPixelValue(container, "padding-left", true)};
dojo.lang.mixin(f, dojo.html.getContentBox(container));
dojo.lang.forEach(children, function (child) {
var elm = child.domNode;
var pos = child.layoutAlign;
with (elm.style) {
left = f.left + "px";
top = f.top + "px";
bottom = "auto";
right = "auto";
}
dojo.html.addClass(elm, "dojoAlign" + dojo.string.capitalize(pos));
if ((pos == "top") || (pos == "bottom")) {
dojo.html.setMarginBox(elm, {width:f.width});
var h = dojo.html.getMarginBox(elm).height;
f.height -= h;
if (pos == "top") {
f.top += h;
} else {
elm.style.top = f.top + f.height + "px";
}
if (child.onResized) {
child.onResized();
}
} else {
if (pos == "left" || pos == "right") {
var w = dojo.html.getMarginBox(elm).width;
if (child.resizeTo) {
child.resizeTo(w, f.height);
} else {
dojo.html.setMarginBox(elm, {width:w, height:f.height});
}
f.width -= w;
if (pos == "left") {
f.left += w;
} else {
elm.style.left = f.left + f.width + "px";
}
} else {
if (pos == "flood" || pos == "client") {
if (child.resizeTo) {
child.resizeTo(f.width, f.height);
} else {
dojo.html.setMarginBox(elm, {width:f.width, height:f.height});
}
}
}
}
});
};
dojo.html.insertCssText(".dojoLayoutContainer{ position: relative; display: block; overflow: hidden; }\n" + "body .dojoAlignTop, body .dojoAlignBottom, body .dojoAlignLeft, body .dojoAlignRight { position: absolute; overflow: hidden; }\n" + "body .dojoAlignClient { position: absolute }\n" + ".dojoAlignClient { overflow: auto; }\n");
 
/trunk/api/js/dojo/src/widget/html/stabile.js
New file
0,0 → 1,126
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.html.stabile");
dojo.widget.html.stabile = {_sqQuotables:new RegExp("([\\\\'])", "g"), _depth:0, _recur:false, depthLimit:2};
dojo.widget.html.stabile.getState = function (id) {
dojo.widget.html.stabile.setup();
return dojo.widget.html.stabile.widgetState[id];
};
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);
}
};
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 + ")") : {};
}
};
dojo.widget.html.stabile.commit = function (state) {
dojo.widget.html.stabile._getStorage().value = dojo.widget.html.stabile.description(state);
};
dojo.widget.html.stabile.description = function (v, showAll) {
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) {
var v1 = v.replace(dojo.widget.html.stabile._sqQuotables, "\\$1");
v1 = v1.replace(/\n/g, "\\n");
v1 = v1.replace(/\r/g, "\\r");
return "'" + v1 + "'";
}
if (v instanceof Date) {
return "new Date(" + d.getFullYear + "," + d.getMonth() + "," + d.getDate() + ")";
}
var d;
if (v instanceof Array || v.push) {
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++) {
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 "{ ... }";
}
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) {
if (v[key] == void (0) || typeof (v[key]) == "function") {
continue;
}
if (first) {
first = false;
} else {
d += ", ";
}
var kd = key;
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) {
var objectToString = Object.prototype.toString;
return objectToString.apply(v, []);
} else {
dojo.widget.html.stabile._recur = true;
return v.toString();
}
} else {
throw new Error("Unknown type: " + v);
return "'unknown'";
}
}
finally {
dojo.widget.html.stabile._depth = depth;
}
};
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:""};
};
 
/trunk/api/js/dojo/src/widget/html/loader.js
New file
0,0 → 1,620
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.html.loader");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.io.*");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.extras");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.html.loader");
dojo.widget.html.loader = new (function () {
this.toString = function () {
return "dojo.widget.html.loader";
};
var _loader = this;
dojo.addOnLoad(function () {
dojo.experimental(_loader.toString());
var undo = dojo.evalObjPath("dojo.undo.browser");
if (djConfig["preventBackButtonFix"] && undo && !undo.initialState) {
undo.setInitialState(new trackerObj);
}
});
var logger = {};
var trackerObj = function (id, data) {
this.id = id;
this.data = data;
};
trackerObj.prototype.handle = function (type) {
if (typeof dojo == "undefined") {
return;
}
var wg = dojo.widget.byId(this.id);
if (wg) {
wg.setContent(this.data, true);
}
};
this._log = function (widget, data) {
if (widget.trackHistory) {
if (!logger[widget.widgetId]) {
logger[widget.widgetId] = {childrenIds:[], stack:[data]};
}
var children = logger[widget.widgetId].childrenIds;
while (children && children.length) {
delete logger[children.pop()];
}
for (var child in widget.children) {
logger[widget.widgetId].childrenIds = child.widgetId;
}
dojo.undo.browser.addToHistory(new trackerObj(widget.widgetId, dojo.lang.shallowCopy(data, true)));
}
};
var undef = dojo.lang.isUndefined;
var isFunc = dojo.lang.isFunction;
function handleDefaults(e, handler, useAlert) {
if (!handler) {
handler = "onContentError";
}
if (dojo.lang.isString(e)) {
e = {_text:e};
}
if (!e._text) {
e._text = e.toString();
}
e.toString = function () {
return this._text;
};
if (typeof e.returnValue != "boolean") {
e.returnValue = true;
}
if (typeof e.preventDefault != "function") {
e.preventDefault = function () {
this.returnValue = false;
};
}
this[handler](e);
if (e.returnValue) {
if (useAlert) {
alert(e.toString());
} else {
this.loader.callOnUnLoad.call(this, false);
this.onSetContent(e.toString());
}
}
}
function downloader(bindArgs) {
for (var x in this.bindArgs) {
bindArgs[x] = (undef(bindArgs[x]) ? this.bindArgs[x] : undefined);
}
var cache = this.cacheContent;
if (undef(bindArgs.useCache)) {
bindArgs.useCache = cache;
}
if (undef(bindArgs.preventCache)) {
bindArgs.preventCache = !cache;
}
if (undef(bindArgs.mimetype)) {
bindArgs.mimetype = "text/html";
}
this.loader.bindObj = dojo.io.bind(bindArgs);
}
function stackRunner(st) {
var err = "", func = null;
var scope = this.scriptScope || dojo.global();
while (st.length) {
func = st.shift();
try {
func.call(scope);
}
catch (e) {
err += "\n" + func + " failed: " + e;
}
}
if (err.length) {
var name = (st == this.loader.addOnLoads) ? "addOnLoad" : "addOnUnLoad";
handleDefaults.call(this, name + " failure\n " + err, "onExecError", true);
}
}
function stackPusher(st, obj, func) {
if (typeof func == "undefined") {
st.push(obj);
} else {
st.push(function () {
obj[func]();
});
}
}
function refreshed() {
this.onResized();
this.onLoad();
this.isLoaded = true;
}
function asyncParse(data) {
if (this.executeScripts) {
this.onExecScript.call(this, data.scripts);
}
if (this.parseContent) {
this.onContentParse.call(this);
}
refreshed.call(this);
}
function runHandler() {
if (dojo.lang.isFunction(this.handler)) {
this.handler(this, this.containerNode || this.domNode);
refreshed.call(this);
return false;
}
return true;
}
this.htmlContentBasicFix = function (s, url) {
var titles = [], styles = [];
var regex = /<title[^>]*>([\s\S]*?)<\/title>/i;
var match, attr;
while (match = regex.exec(s)) {
titles.push(match[1]);
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
regex = /(?:<(style)[^>]*>([\s\S]*?)<\/style>|<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>)/i;
while (match = regex.exec(s)) {
if (match[1] && match[1].toLowerCase() == "style") {
styles.push(dojo.html.fixPathsInCssText(match[2], url));
} else {
if (attr = match[3].match(/href=(['"]?)([^'">]*)\1/i)) {
styles.push({path:attr[2]});
}
}
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
return {"s":s, "titles":titles, "styles":styles};
};
this.htmlContentAdjustPaths = function (s, url) {
var tag = "", str = "", tagFix = "", path = "";
var attr = [], origPath = "", fix = "";
var regexFindTag = /<[a-z][a-z0-9]*[^>]*\s(?:(?:src|href|style)=[^>])+[^>]*>/i;
var regexFindAttr = /\s(src|href|style)=(['"]?)([\w()\[\]\/.,\\'"-:;#=&?\s@]+?)\2/i;
var regexProtocols = /^(?:[#]|(?:(?:https?|ftps?|file|javascript|mailto|news):))/;
while (tag = regexFindTag.exec(s)) {
str += s.substring(0, tag.index);
s = s.substring((tag.index + tag[0].length), s.length);
tag = tag[0];
tagFix = "";
while (attr = regexFindAttr.exec(tag)) {
path = "";
origPath = attr[3];
switch (attr[1].toLowerCase()) {
case "src":
case "href":
if (regexProtocols.exec(origPath)) {
path = origPath;
} else {
path = (new dojo.uri.Uri(url, origPath).toString());
}
break;
case "style":
path = dojo.html.fixPathsInCssText(origPath, url);
break;
default:
path = origPath;
}
fix = " " + attr[1] + "=" + attr[2] + path + attr[2];
tagFix += tag.substring(0, attr.index) + fix;
tag = tag.substring((attr.index + attr[0].length), tag.length);
}
str += tagFix + tag;
}
return str + s;
};
this.htmlContentScripts = function (s, collectScripts) {
var scripts = [], requires = [], match = [];
var attr = "", tmp = null, tag = "", sc = "", str = "";
var regex = /<script([^>]*)>([\s\S]*?)<\/script>/i;
var regexSrc = /src=(['"]?)([^"']*)\1/i;
var regexDojoJs = /.*(\bdojo\b\.js(?:\.uncompressed\.js)?)$/;
var regexInvalid = /(?:var )?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g;
var regexRequires = /dojo\.(?:(?:require(?:After)?(?:If)?)|(?:widget\.(?:manager\.)?registerWidgetPackage)|(?:(?:hostenv\.)?setModulePrefix)|defineNamespace)\((['"]).*?\1\)\s*;?/;
while (match = regex.exec(s)) {
if (this.executeScripts && match[1]) {
if (attr = regexSrc.exec(match[1])) {
if (regexDojoJs.exec(attr[2])) {
dojo.debug("Security note! inhibit:" + attr[2] + " from beeing loaded again.");
} else {
scripts.push({path:attr[2]});
}
}
}
if (match[2]) {
sc = match[2].replace(regexInvalid, "");
if (!sc) {
continue;
}
while (tmp = regexRequires.exec(sc)) {
requires.push(tmp[0]);
sc = sc.substring(0, tmp.index) + sc.substr(tmp.index + tmp[0].length);
}
if (collectScripts) {
scripts.push(sc);
}
}
s = s.substr(0, match.index) + s.substr(match.index + match[0].length);
}
if (collectScripts) {
var regex = /(<[a-zA-Z][a-zA-Z0-9]*\s[^>]*\S=(['"])[^>]*[^\.\]])scriptScope([^>]*>)/;
str = "";
while (tag = regex.exec(s)) {
tmp = ((tag[2] == "'") ? "\"" : "'");
str += s.substring(0, tag.index);
s = s.substr(tag.index).replace(regex, "$1dojo.widget.byId(" + tmp + this.widgetId + tmp + ").scriptScope$3");
}
s = str + s;
}
return {"s":s, "requires":requires, "scripts":scripts};
};
this.splitAndFixPaths = function (args) {
if (!args.url) {
args.url = "./";
}
url = new dojo.uri.Uri(location, args.url).toString();
var ret = {"xml":"", "styles":[], "titles":[], "requires":[], "scripts":[], "url":url};
if (args.content) {
var tmp = null, content = args.content;
if (args.adjustPaths) {
content = _loader.htmlContentAdjustPaths.call(this, content, url);
}
tmp = _loader.htmlContentBasicFix.call(this, content, url);
content = tmp.s;
ret.styles = tmp.styles;
ret.titles = tmp.titles;
if (args.collectRequires || args.collectScripts) {
tmp = _loader.htmlContentScripts.call(this, content, args.collectScripts);
content = tmp.s;
ret.requires = tmp.requires;
ret.scripts = tmp.scripts;
}
var match = [];
if (args.bodyExtract) {
match = content.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if (match) {
content = match[1];
}
}
ret.xml = content;
}
return ret;
};
this.hookUp = function (args) {
var widget = args.widget;
if (dojo.lang.isString(widget)) {
if (args.mixin) {
dojo.raise(this.toString() + ", cant use mixin when widget is a string");
}
widget = dojo.evalObjPath(widget);
}
if (!widget || !(widget instanceof dojo.widget.HtmlWidget)) {
dojo.raise(this.toString() + " Widget isn't defined or isn't a HtmlWidget instance");
}
if (widget.loader && widget.setUrl) {
return;
}
var widgetProto = (args.mixin) ? widget : widget.constructor.prototype;
widget.loader = {isLoaded:false, styleNodes:[], addOnLoads:[], addOnUnLoads:[], callOnUnLoad:(function (canCall) {
return function (after) {
this.abort();
if (canCall) {
this.onUnLoad();
}
canCall = after;
};
})(false), bindObj:null, unHook:(function (w, wg) {
var oldProps = {isContainer:w.isContainer, adjustPats:w.adjustPaths, href:w.href, extractContent:w.extractContent, parseContent:w.parseContent, cacheContent:w.cacheContent, bindArgs:w.bindArgs, preload:w.preload, refreshOnShow:w.refreshOnShow, handler:w.handler, trackHistory:w.trackHistory, executeScripts:w.executeScripts, scriptScope:w.scriptScope, postCreate:w.postCreate, show:w.show, refresh:w.refresh, loadContents:w.loadContents, abort:w.abort, destroy:w.destroy, onLoad:w.onLoad, onUnLoad:w.onUnLoad, addOnLoad:w.addOnLoad, addOnUnLoad:w.addOnUnLoad, onDownloadStart:w.onDownloadStart, onDownloadEnd:w.onDownloadEnd, onDownloadError:w.onDownloadError, onContentError:w.onContentError, onExecError:w.onExecError, onSetContent:w.onSetContent, setUrl:w.setUrl, setContent:w.setContent, onContentParse:w.onContentParse, onExecScript:w.onExecScript, setHandler:w.setHandler};
return function () {
if (wg.abort) {
wg.abort();
}
if ((w != wg) && (dojo.widget.byType(wg.widgetType).length > 1)) {
return;
}
for (var x in oldProps) {
if (oldProps[x] === undefined) {
delete w[x];
continue;
}
w[x] = oldProps[x];
}
delete wg._loader_defined;
delete wg.loader;
};
})(widgetProto, widget)};
if (widgetProto._loader_defined || widget._loader_defined) {
return;
}
dojo.mixin(widgetProto, {isContainer:true, adjustPaths:undef(widgetProto.adjustPaths) ? true : widgetProto.adjustPaths, href:undef(widgetProto.href) ? "" : widgetProto.href, extractContent:undef(widgetProto.extractContent) ? true : widgetProto.extractContent, parseContent:undef(widgetProto.parseContent) ? true : widgetProto.parseContent, cacheContent:undef(widgetProto.cacheContent) ? true : widgetProto.cacheContent, bindArgs:undef(widgetProto.bindArgs) ? {} : widgetProto.bindArgs, preload:undef(widgetProto.preload) ? false : widgetProto.preload, refreshOnShow:undef(widgetProto.refreshOnShow) ? false : widgetProto.refreshOnShow, handler:undef(widgetProto.handler) ? "" : widgetProto.handler, executeScripts:undef(widgetProto.executeScripts) ? false : widgetProto.executeScripts, trackHistory:undef(widgetProto.tracHistory) ? false : widgetProto.trackHistory, scriptScope:null});
widgetProto.postCreate = (function (postCreate) {
return function () {
if (widgetProto.constructor.superclass.postCreate != postCreate) {
postCreate.apply(this, arguments);
} else {
widgetProto.constructor.superclass.postCreate.apply(this, arguments);
}
if (this.handler !== "") {
this.setHandler(this.handler);
}
if (this.isShowing() || this.preload) {
this.loadContents();
if (!this.href) {
_loader._log(this, (this.domNode || this.containerNode).innerHTML);
}
}
};
})(widgetProto.postCreate);
widgetProto.show = (function (show) {
return function () {
if (this.refreshOnShow) {
this.refresh();
} else {
this.loadContents();
}
if ((widgetProto.constructor.superclass.show == show) || !isFunc(show)) {
widgetProto.constructor.superclass.show.apply(this, arguments);
} else {
show.apply(this, arguments);
}
};
})(widgetProto.show);
widgetProto.destroy = (function (destroy) {
return function (destroy) {
this.onUnLoad();
this.abort();
this.loader.unHook();
if ((widgetProto.constructor.superclass.destroy != destroy) && isFunc(destroy)) {
destroy.apply(this, arguments);
} else {
widgetProto.constructor.superclass.destroy.apply(this, arguments);
}
};
})(widgetProto.destroy);
if (!widgetProto.refresh) {
widgetProto.refresh = function () {
this.loader.isLoaded = false;
this.loadContents();
};
}
if (!widgetProto.loadContents) {
widgetProto.loadContents = function () {
if (this.loader.isLoaded) {
return;
}
if (isFunc(this.handler)) {
runHandler.call(this);
} else {
if (this.href !== "") {
handleDefaults.call(this, "Loading...", "onDownloadStart");
var self = this, url = this.href;
downloader.call(this, {url:url, load:function (type, data, xhr) {
self.onDownloadEnd.call(self, url, data);
}, error:function (type, err, xhr) {
var e = {responseText:xhr.responseText, status:xhr.status, statusText:xhr.statusText, responseHeaders:(xhr.getAllResponseHeaders) ? xhr.getAllResponseHeaders() : [], _text:"Error loading '" + url + "' (" + xhr.status + " " + xhr.statusText + ")"};
handleDefaults.call(self, e, "onDownloadError");
self.onLoad();
}});
}
}
};
}
if (!widgetProto.abort) {
widgetProto.abort = function () {
if (!this.loader || !this.loader.bindObj || !this.loader.bindObj.abort) {
return;
}
this.loader.bindObj.abort();
this.loader.bindObj = null;
};
}
if (!widgetProto.onLoad) {
widgetProto.onLoad = function () {
stackRunner.call(this, this.loader.addOnLoads);
this.loader.isLoaded = true;
};
}
if (!widgetProto.onUnLoad) {
widgetProto.onUnLoad = function () {
stackRunner.call(this, this.loader.addOnUnLoads);
delete this.scriptScope;
};
}
if (!widgetProto.addOnLoad) {
widgetProto.addOnLoad = function (obj, func) {
stackPusher.call(this, this.loader.addOnLoads, obj, func);
};
}
if (!widgetProto.addOnUnLoad) {
widgetProto.addOnUnLoad = function (obj, func) {
stackPusher.call(this, this.loader.addOnUnLoads, obj, func);
};
}
if (!widgetProto.onExecError) {
widgetProto.onExecError = function () {
};
}
if (!widgetProto.onContentError) {
widgetProto.onContentError = function () {
};
}
if (!widgetProto.onDownloadError) {
widgetProto.onDownloadError = function () {
};
}
if (!widgetProto.onDownloadStart) {
widgetProto.onDownloadStart = function (onDownloadStart) {
};
}
if (!widgetProto.onDownloadEnd) {
widgetProto.onDownloadEnd = function (url, data) {
var args = {content:data, url:url, adjustPaths:this.adjustPaths, collectScripts:this.executeScripts, collectRequires:this.parseContent, bodyExtract:this.extractContent};
data = _loader.splitAndFixPaths.call(this, args);
this.setContent(data);
};
}
if (!widgetProto.onSetContent) {
widgetProto.onSetContent = function (cont) {
this.destroyChildren();
var styleNodes = this.loader.styleNodes;
while (styleNodes.length) {
var st = styleNodes.pop();
if (st && st.parentNode) {
st.parentNode.removeChild(st);
}
}
var node = this.containerNode || this.domNode;
while (node.firstChild) {
try {
dojo.event.browser.clean(node.firstChild);
}
catch (e) {
}
node.removeChild(node.firstChild);
}
try {
if (typeof cont != "string") {
node.appendChild(cont);
} else {
try {
node.innerHTML = cont;
}
catch (e) {
var tmp;
(tmp = dojo.doc().createElement("div")).innerHTML = cont;
while (tmp.firstChild) {
node.appendChild(tmp.removeChild(tmp.firstChild));
}
}
}
}
catch (e) {
e._text = "Could'nt load content: " + e;
var useAlert = (this.loader._onSetContent_err == e._text);
this.loader._onSetContent_err = e._text;
handleDefaults.call(this, e, "onContentError", useAlert);
}
};
}
if (!widgetProto.setUrl) {
widgetProto.setUrl = function (url) {
this.href = url;
this.loader.isLoaded = false;
if (this.preload || this.isShowing()) {
this.loadContents();
}
};
}
if (!widgetProto.setContent) {
widgetProto.setContent = function (data, dontLog) {
this.loader.callOnUnLoad.call(this, true);
if (!data || dojo.html.isNode(data)) {
this.onSetContent(data);
refreshed.call(this);
} else {
if (typeof data.xml != "string") {
this.href = "";
var args = {content:data, url:this.href, adjustPaths:this.adjustPaths, collectScripts:this.executeScripts, collectRequires:this.parseContent, bodyExtract:this.extractContent};
data = _loader.splitAndFixPaths.call(this, args);
} else {
if (data.url != "./") {
this.url = data.url;
}
}
this.onSetContent(data.xml);
for (var i = 0, styles = data.styles; i < styles.length; i++) {
if (styles[i].path) {
this.loader.styleNodes.push(dojo.html.insertCssFile(styles[i].path));
} else {
this.loader.styleNodes.push(dojo.html.insertCssText(styles[i]));
}
}
if (this.parseContent) {
for (var i = 0, requires = data.requires; i < requires.length; i++) {
try {
eval(requires[i]);
}
catch (e) {
e._text = "dojo.widget.html.loader.hookUp: error in package loading calls, " + (e.description || e);
handleDefaults.call(this, e, "onContentError", true);
}
}
}
if (dojo.hostenv.isXDomain && data.requires.length) {
dojo.addOnLoad(function () {
asyncParse.call(this, data);
if (!dontLog) {
_loader._log(this, data);
}
});
dontLog = true;
} else {
asyncParse.call(this, data);
}
}
if (!dontLog) {
}
};
}
if (!widgetProto.onContentParse) {
widgetProto.onContentParse = function () {
var node = this.containerNode || this.domNode;
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(node, null, true);
dojo.widget.getParser().createSubComponents(frag, this);
};
}
if (!widgetProto.onExecScript) {
widgetProto.onExecScript = function (scripts) {
var self = this, tmp = "", code = "";
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].path) {
var url = scripts[i].path;
downloader.call(this, {"url":url, "load":function (type, scriptStr) {
(function () {
tmp = scriptStr;
scripts[i] = scriptStr;
}).call(self);
}, "error":function (type, error) {
error._text = type + " downloading remote script";
handleDefaults.call(self, error, "onExecError", true);
}, "mimetype":"text/plain", "sync":true});
code += tmp;
} else {
code += scripts[i];
}
}
try {
delete this.scriptScope;
this.scriptScope = new (new Function("_container_", code + "; return this;"))(self);
}
catch (e) {
e._text = "Error running scripts from content:\n" + (e.description || e.toString());
handleDefaults.call(this, e, "onExecError", true);
}
};
}
if (!widgetProto.setHandler) {
widgetProto.setHandler = function (handler) {
var fcn = dojo.lang.isFunction(handler) ? handler : window[handler];
if (!isFunc(fcn)) {
handleDefaults.call(this, "Unable to set handler, '" + handler + "' not a function.", "onExecError", true);
return;
}
this.handler = function () {
return fcn.apply(this, arguments);
};
};
}
widgetProto._loader_defined = true;
};
})();
 
/trunk/api/js/dojo/src/widget/RichText.js
New file
0,0 → 1,1165
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RichText");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.event.*");
dojo.require("dojo.string.extras");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.Deferred");
if (!djConfig["useXDomain"] || djConfig["allowXdRichTextSave"]) {
if (dojo.hostenv.post_load_) {
(function () {
var savetextarea = dojo.doc().createElement("textarea");
savetextarea.id = "dojo.widget.RichText.savedContent";
savetextarea.style = "display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;";
dojo.body().appendChild(savetextarea);
})();
} else {
try {
dojo.doc().write("<textarea id=\"dojo.widget.RichText.savedContent\" " + "style=\"display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;\"></textarea>");
}
catch (e) {
}
}
}
dojo.widget.defineWidget("dojo.widget.RichText", dojo.widget.HtmlWidget, function () {
this.contentPreFilters = [];
this.contentPostFilters = [];
this.contentDomPreFilters = [];
this.contentDomPostFilters = [];
this.editingAreaStyleSheets = [];
if (dojo.render.html.moz) {
this.contentPreFilters.push(this._fixContentForMoz);
}
this._keyHandlers = {};
if (dojo.Deferred) {
this.onLoadDeferred = new dojo.Deferred();
}
}, {inheritWidth:false, focusOnLoad:false, saveName:"", styleSheets:"", _content:"", height:"", minHeight:"1em", isClosed:true, isLoaded:false, useActiveX:false, relativeImageUrls:false, _SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@", onLoadDeferred:null, fillInTemplate:function () {
dojo.event.topic.publish("dojo.widget.RichText::init", this);
this.open();
dojo.event.connect(this, "onKeyPressed", this, "afterKeyPress");
dojo.event.connect(this, "onKeyPress", this, "keyPress");
dojo.event.connect(this, "onKeyDown", this, "keyDown");
dojo.event.connect(this, "onKeyUp", this, "keyUp");
this.setupDefaultShortcuts();
}, setupDefaultShortcuts:function () {
var ctrl = this.KEY_CTRL;
var exec = function (cmd, arg) {
return arguments.length == 1 ? function () {
this.execCommand(cmd);
} : function () {
this.execCommand(cmd, arg);
};
};
this.addKeyHandler("b", ctrl, exec("bold"));
this.addKeyHandler("i", ctrl, exec("italic"));
this.addKeyHandler("u", ctrl, exec("underline"));
this.addKeyHandler("a", ctrl, exec("selectall"));
this.addKeyHandler("s", ctrl, function () {
this.save(true);
});
this.addKeyHandler("1", ctrl, exec("formatblock", "h1"));
this.addKeyHandler("2", ctrl, exec("formatblock", "h2"));
this.addKeyHandler("3", ctrl, exec("formatblock", "h3"));
this.addKeyHandler("4", ctrl, exec("formatblock", "h4"));
this.addKeyHandler("\\", ctrl, exec("insertunorderedlist"));
if (!dojo.render.html.ie) {
this.addKeyHandler("Z", ctrl, exec("redo"));
}
}, events:["onBlur", "onFocus", "onKeyPress", "onKeyDown", "onKeyUp", "onClick"], open:function (element) {
if (this.onLoadDeferred.fired >= 0) {
this.onLoadDeferred = new dojo.Deferred();
}
var h = dojo.render.html;
if (!this.isClosed) {
this.close();
}
dojo.event.topic.publish("dojo.widget.RichText::open", this);
this._content = "";
if ((arguments.length == 1) && (element["nodeName"])) {
this.domNode = element;
}
if ((this.domNode["nodeName"]) && (this.domNode.nodeName.toLowerCase() == "textarea")) {
this.textarea = this.domNode;
var html = this._preFilterContent(this.textarea.value);
this.domNode = dojo.doc().createElement("div");
dojo.html.copyStyle(this.domNode, this.textarea);
var tmpFunc = dojo.lang.hitch(this, function () {
with (this.textarea.style) {
display = "block";
position = "absolute";
left = top = "-1000px";
if (h.ie) {
this.__overflow = overflow;
overflow = "hidden";
}
}
});
if (h.ie) {
setTimeout(tmpFunc, 10);
} else {
tmpFunc();
}
if (!h.safari) {
dojo.html.insertBefore(this.domNode, this.textarea);
}
if (this.textarea.form) {
dojo.event.connect("before", this.textarea.form, "onsubmit", dojo.lang.hitch(this, function () {
this.textarea.value = this.getEditorContent();
}));
}
var editor = this;
dojo.event.connect(this, "postCreate", function () {
dojo.html.insertAfter(editor.textarea, editor.domNode);
});
} else {
var html = this._preFilterContent(dojo.string.trim(this.domNode.innerHTML));
}
if (html == "") {
html = "&nbsp;";
}
var content = dojo.html.getContentBox(this.domNode);
this._oldHeight = content.height;
this._oldWidth = content.width;
this._firstChildContributingMargin = this._getContributingMargin(this.domNode, "top");
this._lastChildContributingMargin = this._getContributingMargin(this.domNode, "bottom");
this.savedContent = html;
this.domNode.innerHTML = "";
this.editingArea = dojo.doc().createElement("div");
this.domNode.appendChild(this.editingArea);
if ((this.domNode["nodeName"]) && (this.domNode.nodeName == "LI")) {
this.domNode.innerHTML = " <br>";
}
if (this.saveName != "" && (!djConfig["useXDomain"] || djConfig["allowXdRichTextSave"])) {
var saveTextarea = dojo.doc().getElementById("dojo.widget.RichText.savedContent");
if (saveTextarea.value != "") {
var datas = saveTextarea.value.split(this._SEPARATOR);
for (var i = 0; i < datas.length; i++) {
var data = datas[i].split(":");
if (data[0] == this.saveName) {
html = data[1];
datas.splice(i, 1);
break;
}
}
}
dojo.event.connect("before", window, "onunload", this, "_saveContent");
}
if (h.ie70 && this.useActiveX) {
dojo.debug("activeX in ie70 is not currently supported, useActiveX is ignored for now.");
this.useActiveX = false;
}
if (this.useActiveX && h.ie) {
var self = this;
setTimeout(function () {
self._drawObject(html);
}, 0);
} else {
if (h.ie || this._safariIsLeopard() || h.opera) {
this.iframe = dojo.doc().createElement("iframe");
this.iframe.src = "javascript:void(0)";
this.editorObject = this.iframe;
with (this.iframe.style) {
border = "0";
width = "100%";
}
this.iframe.frameBorder = 0;
this.editingArea.appendChild(this.iframe);
this.window = this.iframe.contentWindow;
this.document = this.window.document;
this.document.open();
this.document.write("<html><head><style>body{margin:0;padding:0;border:0;overflow:hidden;}</style></head><body><div></div></body></html>");
this.document.close();
this.editNode = this.document.body.firstChild;
this.editNode.contentEditable = true;
with (this.iframe.style) {
if (h.ie70) {
if (this.height) {
height = this.height;
}
if (this.minHeight) {
minHeight = this.minHeight;
}
} else {
height = this.height ? this.height : this.minHeight;
}
}
var formats = ["p", "pre", "address", "h1", "h2", "h3", "h4", "h5", "h6", "ol", "div", "ul"];
var localhtml = "";
for (var i in formats) {
if (formats[i].charAt(1) != "l") {
localhtml += "<" + formats[i] + "><span>content</span></" + formats[i] + ">";
} else {
localhtml += "<" + formats[i] + "><li>content</li></" + formats[i] + ">";
}
}
with (this.editNode.style) {
position = "absolute";
left = "-2000px";
top = "-2000px";
}
this.editNode.innerHTML = localhtml;
var node = this.editNode.firstChild;
while (node) {
dojo.withGlobal(this.window, "selectElement", dojo.html.selection, [node.firstChild]);
var nativename = node.tagName.toLowerCase();
this._local2NativeFormatNames[nativename] = this.queryCommandValue("formatblock");
this._native2LocalFormatNames[this._local2NativeFormatNames[nativename]] = nativename;
node = node.nextSibling;
}
with (this.editNode.style) {
position = "";
left = "";
top = "";
}
this.editNode.innerHTML = html;
if (this.height) {
this.document.body.style.overflowY = "scroll";
}
dojo.lang.forEach(this.events, function (e) {
dojo.event.connect(this.editNode, e.toLowerCase(), this, e);
}, this);
this.onLoad();
} else {
this._drawIframe(html);
this.editorObject = this.iframe;
}
}
if (this.domNode.nodeName == "LI") {
this.domNode.lastChild.style.marginTop = "-1.2em";
}
dojo.html.addClass(this.domNode, "RichTextEditable");
this.isClosed = false;
}, _hasCollapseableMargin:function (element, side) {
if (dojo.html.getPixelValue(element, "border-" + side + "-width", false)) {
return false;
} else {
if (dojo.html.getPixelValue(element, "padding-" + side, false)) {
return false;
} else {
return true;
}
}
}, _getContributingMargin:function (element, topOrBottom) {
if (topOrBottom == "top") {
var siblingAttr = "previousSibling";
var childSiblingAttr = "nextSibling";
var childAttr = "firstChild";
var marginProp = "margin-top";
var siblingMarginProp = "margin-bottom";
} else {
var siblingAttr = "nextSibling";
var childSiblingAttr = "previousSibling";
var childAttr = "lastChild";
var marginProp = "margin-bottom";
var siblingMarginProp = "margin-top";
}
var elementMargin = dojo.html.getPixelValue(element, marginProp, false);
function isSignificantNode(element) {
return !(element.nodeType == 3 && dojo.string.isBlank(element.data)) && dojo.html.getStyle(element, "display") != "none" && !dojo.html.isPositionAbsolute(element);
}
var childMargin = 0;
var child = element[childAttr];
while (child) {
while ((!isSignificantNode(child)) && child[childSiblingAttr]) {
child = child[childSiblingAttr];
}
childMargin = Math.max(childMargin, dojo.html.getPixelValue(child, marginProp, false));
if (!this._hasCollapseableMargin(child, topOrBottom)) {
break;
}
child = child[childAttr];
}
if (!this._hasCollapseableMargin(element, topOrBottom)) {
return parseInt(childMargin);
}
var contextMargin = 0;
var sibling = element[siblingAttr];
while (sibling) {
if (isSignificantNode(sibling)) {
contextMargin = dojo.html.getPixelValue(sibling, siblingMarginProp, false);
break;
}
sibling = sibling[siblingAttr];
}
if (!sibling) {
contextMargin = dojo.html.getPixelValue(element.parentNode, marginProp, false);
}
if (childMargin > elementMargin) {
return parseInt(Math.max((childMargin - elementMargin) - contextMargin, 0));
} else {
return 0;
}
}, _drawIframe:function (html) {
var oldMoz = Boolean(dojo.render.html.moz && (typeof window.XML == "undefined"));
if (!this.iframe) {
var currentDomain = (new dojo.uri.Uri(dojo.doc().location)).host;
this.iframe = dojo.doc().createElement("iframe");
with (this.iframe) {
style.border = "none";
style.lineHeight = "0";
style.verticalAlign = "bottom";
scrolling = this.height ? "auto" : "no";
}
}
if (djConfig["useXDomain"] && !djConfig["dojoRichTextFrameUrl"]) {
dojo.debug("dojo.widget.RichText: When using cross-domain Dojo builds," + " please save src/widget/templates/richtextframe.html to your domain and set djConfig.dojoRichTextFrameUrl" + " to the path on your domain to richtextframe.html");
}
this.iframe.src = (djConfig["dojoRichTextFrameUrl"] || dojo.uri.moduleUri("dojo.widget", "templates/richtextframe.html")) + ((dojo.doc().domain != currentDomain) ? ("#" + dojo.doc().domain) : "");
this.iframe.width = this.inheritWidth ? this._oldWidth : "100%";
if (this.height) {
this.iframe.style.height = this.height;
} else {
var height = this._oldHeight;
if (this._hasCollapseableMargin(this.domNode, "top")) {
height += this._firstChildContributingMargin;
}
if (this._hasCollapseableMargin(this.domNode, "bottom")) {
height += this._lastChildContributingMargin;
}
this.iframe.height = height;
}
var tmpContent = dojo.doc().createElement("div");
tmpContent.innerHTML = html;
this.editingArea.appendChild(tmpContent);
if (this.relativeImageUrls) {
var imgs = tmpContent.getElementsByTagName("img");
for (var i = 0; i < imgs.length; i++) {
imgs[i].src = (new dojo.uri.Uri(dojo.global().location, imgs[i].src)).toString();
}
html = tmpContent.innerHTML;
}
var firstChild = dojo.html.firstElement(tmpContent);
var lastChild = dojo.html.lastElement(tmpContent);
if (firstChild) {
firstChild.style.marginTop = this._firstChildContributingMargin + "px";
}
if (lastChild) {
lastChild.style.marginBottom = this._lastChildContributingMargin + "px";
}
this.editingArea.appendChild(this.iframe);
if (dojo.render.html.safari) {
this.iframe.src = this.iframe.src;
}
var _iframeInitialized = false;
var ifrFunc = dojo.lang.hitch(this, function () {
if (!_iframeInitialized) {
_iframeInitialized = true;
} else {
return;
}
if (!this.editNode) {
if (this.iframe.contentWindow) {
this.window = this.iframe.contentWindow;
this.document = this.iframe.contentWindow.document;
} else {
if (this.iframe.contentDocument) {
this.window = this.iframe.contentDocument.window;
this.document = this.iframe.contentDocument;
}
}
var getStyle = (function (domNode) {
return function (style) {
return dojo.html.getStyle(domNode, style);
};
})(this.domNode);
var font = getStyle("font-weight") + " " + getStyle("font-size") + " " + getStyle("font-family");
var lineHeight = "1.0";
var lineHeightStyle = dojo.html.getUnitValue(this.domNode, "line-height");
if (lineHeightStyle.value && lineHeightStyle.units == "") {
lineHeight = lineHeightStyle.value;
}
dojo.html.insertCssText("body,html{background:transparent;padding:0;margin:0;}" + "body{top:0;left:0;right:0;" + (((this.height) || (dojo.render.html.opera)) ? "" : "position:fixed;") + "font:" + font + ";" + "min-height:" + this.minHeight + ";" + "line-height:" + lineHeight + "}" + "p{margin: 1em 0 !important;}" + "body > *:first-child{padding-top:0 !important;margin-top:" + this._firstChildContributingMargin + "px !important;}" + "body > *:last-child{padding-bottom:0 !important;margin-bottom:" + this._lastChildContributingMargin + "px !important;}" + "li > ul:-moz-first-node, li > ol:-moz-first-node{padding-top:1.2em;}\n" + "li{min-height:1.2em;}" + "", this.document);
dojo.html.removeNode(tmpContent);
this.document.body.innerHTML = html;
if (oldMoz || dojo.render.html.safari) {
this.document.designMode = "on";
}
this.onLoad();
} else {
dojo.html.removeNode(tmpContent);
this.editNode.innerHTML = html;
this.onDisplayChanged();
}
});
if (this.editNode) {
ifrFunc();
} else {
if (dojo.render.html.moz) {
this.iframe.onload = function () {
setTimeout(ifrFunc, 250);
};
} else {
this.iframe.onload = ifrFunc;
}
}
}, _applyEditingAreaStyleSheets:function () {
var files = [];
if (this.styleSheets) {
files = this.styleSheets.split(";");
this.styleSheets = "";
}
files = files.concat(this.editingAreaStyleSheets);
this.editingAreaStyleSheets = [];
if (files.length > 0) {
for (var i = 0; i < files.length; i++) {
var url = files[i];
if (url) {
this.addStyleSheet(dojo.uri.dojoUri(url));
}
}
}
}, addStyleSheet:function (uri) {
var url = uri.toString();
if (dojo.lang.find(this.editingAreaStyleSheets, url) > -1) {
dojo.debug("dojo.widget.RichText.addStyleSheet: Style sheet " + url + " is already applied to the editing area!");
return;
}
if (url.charAt(0) == "." || (url.charAt(0) != "/" && !uri.host)) {
url = (new dojo.uri.Uri(dojo.global().location, url)).toString();
}
this.editingAreaStyleSheets.push(url);
if (this.document.createStyleSheet) {
this.document.createStyleSheet(url);
} else {
var head = this.document.getElementsByTagName("head")[0];
var stylesheet = this.document.createElement("link");
with (stylesheet) {
rel = "stylesheet";
type = "text/css";
href = url;
}
head.appendChild(stylesheet);
}
}, removeStyleSheet:function (uri) {
var url = uri.toString();
if (url.charAt(0) == "." || (url.charAt(0) != "/" && !uri.host)) {
url = (new dojo.uri.Uri(dojo.global().location, url)).toString();
}
var index = dojo.lang.find(this.editingAreaStyleSheets, url);
if (index == -1) {
dojo.debug("dojo.widget.RichText.removeStyleSheet: Style sheet " + url + " is not applied to the editing area so it can not be removed!");
return;
}
delete this.editingAreaStyleSheets[index];
var links = this.document.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
if (links[i].href == url) {
if (dojo.render.html.ie) {
links[i].href = "";
}
dojo.html.removeNode(links[i]);
break;
}
}
}, _drawObject:function (html) {
this.object = dojo.html.createExternalElement(dojo.doc(), "object");
with (this.object) {
classid = "clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";
width = this.inheritWidth ? this._oldWidth : "100%";
style.height = this.height ? this.height : (this._oldHeight + "px");
Scrollbars = this.height ? true : false;
Appearance = this._activeX.appearance.flat;
}
this.editorObject = this.object;
this.editingArea.appendChild(this.object);
this.object.attachEvent("DocumentComplete", dojo.lang.hitch(this, "onLoad"));
dojo.lang.forEach(this.events, function (e) {
this.object.attachEvent(e.toLowerCase(), dojo.lang.hitch(this, e));
}, this);
this.object.DocumentHTML = "<!doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" + "<html><title></title>" + "<style type=\"text/css\">" + " body,html { padding: 0; margin: 0; }" + (this.height ? "" : " body, { overflow: hidden; }") + "</style>" + "<body><div>" + html + "<div></body></html>";
this._cacheLocalBlockFormatNames();
}, _local2NativeFormatNames:{}, _native2LocalFormatNames:{}, _cacheLocalBlockFormatNames:function () {
if (!this._native2LocalFormatNames["p"]) {
var obj = this.object;
var error = false;
if (!obj) {
try {
obj = dojo.html.createExternalElement(dojo.doc(), "object");
obj.classid = "clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";
dojo.body().appendChild(obj);
obj.DocumentHTML = "<html><head></head><body></body></html>";
}
catch (e) {
error = true;
}
}
try {
var oNamesParm = new ActiveXObject("DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam");
obj.ExecCommand(this._activeX.command["getblockformatnames"], 0, oNamesParm);
var vbNamesArray = new VBArray(oNamesParm.Names);
var localFormats = vbNamesArray.toArray();
var nativeFormats = ["p", "pre", "address", "h1", "h2", "h3", "h4", "h5", "h6", "ol", "ul", "", "", "", "", "div"];
for (var i = 0; i < nativeFormats.length; ++i) {
if (nativeFormats[i].length > 0) {
this._local2NativeFormatNames[localFormats[i]] = nativeFormats[i];
this._native2LocalFormatNames[nativeFormats[i]] = localFormats[i];
}
}
}
catch (e) {
error = true;
}
if (obj && !this.object) {
dojo.body().removeChild(obj);
}
}
return !error;
}, _isResized:function () {
return false;
}, onLoad:function (e) {
this.isLoaded = true;
if (this.object) {
this.document = this.object.DOM;
this.window = this.document.parentWindow;
this.editNode = this.document.body.firstChild;
this.editingArea.style.height = this.height ? this.height : this.minHeight;
if (!this.height) {
this.connect(this, "onDisplayChanged", "_updateHeight");
}
this.window._frameElement = this.object;
} else {
if (this.iframe && !dojo.render.html.ie) {
this.editNode = this.document.body;
if (!this.height) {
this.connect(this, "onDisplayChanged", "_updateHeight");
}
try {
this.document.execCommand("useCSS", false, true);
this.document.execCommand("styleWithCSS", false, false);
}
catch (e2) {
}
if (dojo.render.html.safari) {
this.connect(this.editNode, "onblur", "onBlur");
this.connect(this.editNode, "onfocus", "onFocus");
this.connect(this.editNode, "onclick", "onFocus");
this.interval = setInterval(dojo.lang.hitch(this, "onDisplayChanged"), 750);
} else {
if (dojo.render.html.mozilla || dojo.render.html.opera) {
var doc = this.document;
var addListener = dojo.event.browser.addListener;
var self = this;
dojo.lang.forEach(this.events, function (e) {
var l = addListener(self.document, e.substr(2).toLowerCase(), dojo.lang.hitch(self, e));
if (e == "onBlur") {
var unBlur = {unBlur:function (e) {
dojo.event.browser.removeListener(doc, "blur", l);
}};
dojo.event.connect("before", self, "close", unBlur, "unBlur");
}
});
}
}
} else {
if (dojo.render.html.ie) {
if (!this.height) {
this.connect(this, "onDisplayChanged", "_updateHeight");
}
this.editNode.style.zoom = 1;
}
}
}
this._applyEditingAreaStyleSheets();
if (this.focusOnLoad) {
this.focus();
}
this.onDisplayChanged(e);
if (this.onLoadDeferred) {
this.onLoadDeferred.callback(true);
}
}, onKeyDown:function (e) {
if ((!e) && (this.object)) {
e = dojo.event.browser.fixEvent(this.window.event);
}
if ((dojo.render.html.ie) && (e.keyCode == e.KEY_TAB)) {
e.preventDefault();
e.stopPropagation();
this.execCommand((e.shiftKey ? "outdent" : "indent"));
} else {
if (dojo.render.html.ie) {
if ((65 <= e.keyCode) && (e.keyCode <= 90)) {
e.charCode = e.keyCode;
this.onKeyPress(e);
}
}
}
}, onKeyUp:function (e) {
return;
}, KEY_CTRL:1, onKeyPress:function (e) {
if ((!e) && (this.object)) {
e = dojo.event.browser.fixEvent(this.window.event);
}
var modifiers = e.ctrlKey ? this.KEY_CTRL : 0;
if (this._keyHandlers[e.key]) {
var handlers = this._keyHandlers[e.key], i = 0, handler;
while (handler = handlers[i++]) {
if (modifiers == handler.modifiers) {
e.preventDefault();
handler.handler.call(this);
break;
}
}
}
dojo.lang.setTimeout(this, this.onKeyPressed, 1, e);
}, addKeyHandler:function (key, modifiers, handler) {
if (!(this._keyHandlers[key] instanceof Array)) {
this._keyHandlers[key] = [];
}
this._keyHandlers[key].push({modifiers:modifiers || 0, handler:handler});
}, onKeyPressed:function (e) {
this.onDisplayChanged();
}, onClick:function (e) {
this.onDisplayChanged(e);
}, onBlur:function (e) {
}, _initialFocus:true, onFocus:function (e) {
if ((dojo.render.html.mozilla) && (this._initialFocus)) {
this._initialFocus = false;
if (dojo.string.trim(this.editNode.innerHTML) == "&nbsp;") {
this.placeCursorAtStart();
}
}
}, blur:function () {
if (this.iframe) {
this.window.blur();
} else {
if (this.object) {
this.document.body.blur();
} else {
if (this.editNode) {
this.editNode.blur();
}
}
}
}, focus:function () {
if (this.iframe && !dojo.render.html.ie) {
this.window.focus();
} else {
if (this.object) {
this.document.focus();
} else {
if (this.editNode && this.editNode.focus) {
this.editNode.focus();
} else {
dojo.debug("Have no idea how to focus into the editor!");
}
}
}
}, onDisplayChanged:function (e) {
}, _activeX:{command:{bold:5000, italic:5023, underline:5048, justifycenter:5024, justifyleft:5025, justifyright:5026, cut:5003, copy:5002, paste:5032, "delete":5004, undo:5049, redo:5033, removeformat:5034, selectall:5035, unlink:5050, indent:5018, outdent:5031, insertorderedlist:5030, insertunorderedlist:5051, inserttable:5022, insertcell:5019, insertcol:5020, insertrow:5021, deletecells:5005, deletecols:5006, deleterows:5007, mergecells:5029, splitcell:5047, setblockformat:5043, getblockformat:5011, getblockformatnames:5012, setfontname:5044, getfontname:5013, setfontsize:5045, getfontsize:5014, setbackcolor:5042, getbackcolor:5010, setforecolor:5046, getforecolor:5015, findtext:5008, font:5009, hyperlink:5016, image:5017, lockelement:5027, makeabsolute:5028, sendbackward:5036, bringforward:5037, sendbelowtext:5038, bringabovetext:5039, sendtoback:5040, bringtofront:5041, properties:5052}, ui:{"default":0, prompt:1, noprompt:2}, status:{notsupported:0, disabled:1, enabled:3, latched:7, ninched:11}, appearance:{flat:0, inset:1}, state:{unchecked:0, checked:1, gray:2}}, _normalizeCommand:function (cmd) {
var drh = dojo.render.html;
var command = cmd.toLowerCase();
if (command == "formatblock") {
if (drh.safari) {
command = "heading";
}
} else {
if (this.object) {
switch (command) {
case "createlink":
command = "hyperlink";
break;
case "insertimage":
command = "image";
break;
}
} else {
if (command == "hilitecolor" && !drh.mozilla) {
command = "backcolor";
}
}
}
return command;
}, _safariIsLeopard:function () {
var gt420 = false;
if (dojo.render.html.safari) {
var tmp = dojo.render.html.UA.split("AppleWebKit/")[1];
var ver = parseFloat(tmp.split(" ")[0]);
if (ver >= 420) {
gt420 = true;
}
}
return gt420;
}, queryCommandAvailable:function (command) {
var ie = 1;
var mozilla = 1 << 1;
var safari = 1 << 2;
var opera = 1 << 3;
var safari420 = 1 << 4;
var gt420 = this._safariIsLeopard();
function isSupportedBy(browsers) {
return {ie:Boolean(browsers & ie), mozilla:Boolean(browsers & mozilla), safari:Boolean(browsers & safari), safari420:Boolean(browsers & safari420), opera:Boolean(browsers & opera)};
}
var supportedBy = null;
switch (command.toLowerCase()) {
case "bold":
case "italic":
case "underline":
case "subscript":
case "superscript":
case "fontname":
case "fontsize":
case "forecolor":
case "hilitecolor":
case "justifycenter":
case "justifyfull":
case "justifyleft":
case "justifyright":
case "delete":
case "selectall":
supportedBy = isSupportedBy(mozilla | ie | safari | opera);
break;
case "createlink":
case "unlink":
case "removeformat":
case "inserthorizontalrule":
case "insertimage":
case "insertorderedlist":
case "insertunorderedlist":
case "indent":
case "outdent":
case "formatblock":
case "inserthtml":
case "undo":
case "redo":
case "strikethrough":
supportedBy = isSupportedBy(mozilla | ie | opera | safari420);
break;
case "blockdirltr":
case "blockdirrtl":
case "dirltr":
case "dirrtl":
case "inlinedirltr":
case "inlinedirrtl":
supportedBy = isSupportedBy(ie);
break;
case "cut":
case "copy":
case "paste":
supportedBy = isSupportedBy(ie | mozilla | safari420);
break;
case "inserttable":
supportedBy = isSupportedBy(mozilla | (this.object ? ie : 0));
break;
case "insertcell":
case "insertcol":
case "insertrow":
case "deletecells":
case "deletecols":
case "deleterows":
case "mergecells":
case "splitcell":
supportedBy = isSupportedBy(this.object ? ie : 0);
break;
default:
return false;
}
return (dojo.render.html.ie && supportedBy.ie) || (dojo.render.html.mozilla && supportedBy.mozilla) || (dojo.render.html.safari && supportedBy.safari) || (gt420 && supportedBy.safari420) || (dojo.render.html.opera && supportedBy.opera);
}, execCommand:function (command, argument) {
var returnValue;
this.focus();
command = this._normalizeCommand(command);
if (argument != undefined) {
if (command == "heading") {
throw new Error("unimplemented");
} else {
if (command == "formatblock") {
if (this.object) {
argument = this._native2LocalFormatNames[argument];
} else {
if (dojo.render.html.ie) {
argument = "<" + argument + ">";
}
}
}
}
}
if (this.object) {
switch (command) {
case "hilitecolor":
command = "setbackcolor";
break;
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
command = "set" + command;
break;
case "formatblock":
command = "setblockformat";
}
if (command == "strikethrough") {
command = "inserthtml";
var range = this.document.selection.createRange();
if (!range.htmlText) {
return;
}
argument = range.htmlText.strike();
} else {
if (command == "inserthorizontalrule") {
command = "inserthtml";
argument = "<hr>";
}
}
if (command == "inserthtml") {
var range = this.document.selection.createRange();
if (this.document.selection.type.toUpperCase() == "CONTROL") {
for (var i = 0; i < range.length; i++) {
range.item(i).outerHTML = argument;
}
} else {
range.pasteHTML(argument);
range.select();
}
returnValue = true;
} else {
if (arguments.length == 1) {
returnValue = this.object.ExecCommand(this._activeX.command[command], this._activeX.ui.noprompt);
} else {
returnValue = this.object.ExecCommand(this._activeX.command[command], this._activeX.ui.noprompt, argument);
}
}
} else {
if (command == "inserthtml") {
if (dojo.render.html.ie) {
var insertRange = this.document.selection.createRange();
insertRange.pasteHTML(argument);
insertRange.select();
return true;
} else {
return this.document.execCommand(command, false, argument);
}
} else {
if ((command == "unlink") && (this.queryCommandEnabled("unlink")) && (dojo.render.html.mozilla)) {
var selection = this.window.getSelection();
var selectionRange = selection.getRangeAt(0);
var selectionStartContainer = selectionRange.startContainer;
var selectionStartOffset = selectionRange.startOffset;
var selectionEndContainer = selectionRange.endContainer;
var selectionEndOffset = selectionRange.endOffset;
var a = dojo.withGlobal(this.window, "getAncestorElement", dojo.html.selection, ["a"]);
dojo.withGlobal(this.window, "selectElement", dojo.html.selection, [a]);
returnValue = this.document.execCommand("unlink", false, null);
var selectionRange = this.document.createRange();
selectionRange.setStart(selectionStartContainer, selectionStartOffset);
selectionRange.setEnd(selectionEndContainer, selectionEndOffset);
selection.removeAllRanges();
selection.addRange(selectionRange);
return returnValue;
} else {
if ((command == "hilitecolor") && (dojo.render.html.mozilla)) {
this.document.execCommand("useCSS", false, false);
returnValue = this.document.execCommand(command, false, argument);
this.document.execCommand("useCSS", false, true);
} else {
if ((dojo.render.html.ie) && ((command == "backcolor") || (command == "forecolor"))) {
argument = arguments.length > 1 ? argument : null;
returnValue = this.document.execCommand(command, false, argument);
} else {
argument = arguments.length > 1 ? argument : null;
if (argument || command != "createlink") {
returnValue = this.document.execCommand(command, false, argument);
}
}
}
}
}
}
this.onDisplayChanged();
return returnValue;
}, queryCommandEnabled:function (command) {
command = this._normalizeCommand(command);
if (this.object) {
switch (command) {
case "hilitecolor":
command = "setbackcolor";
break;
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
command = "set" + command;
break;
case "formatblock":
command = "setblockformat";
break;
case "strikethrough":
command = "bold";
break;
case "inserthorizontalrule":
return true;
}
if (typeof this._activeX.command[command] == "undefined") {
return false;
}
var status = this.object.QueryStatus(this._activeX.command[command]);
return ((status != this._activeX.status.notsupported) && (status != this._activeX.status.disabled));
} else {
if (dojo.render.html.mozilla) {
if (command == "unlink") {
return dojo.withGlobal(this.window, "hasAncestorElement", dojo.html.selection, ["a"]);
} else {
if (command == "inserttable") {
return true;
}
}
}
var elem = (dojo.render.html.ie) ? this.document.selection.createRange() : this.document;
return elem.queryCommandEnabled(command);
}
}, queryCommandState:function (command) {
command = this._normalizeCommand(command);
if (this.object) {
if (command == "forecolor") {
command = "setforecolor";
} else {
if (command == "backcolor") {
command = "setbackcolor";
} else {
if (command == "strikethrough") {
return dojo.withGlobal(this.window, "hasAncestorElement", dojo.html.selection, ["strike"]);
} else {
if (command == "inserthorizontalrule") {
return false;
}
}
}
}
if (typeof this._activeX.command[command] == "undefined") {
return null;
}
var status = this.object.QueryStatus(this._activeX.command[command]);
return ((status == this._activeX.status.latched) || (status == this._activeX.status.ninched));
} else {
return this.document.queryCommandState(command);
}
}, queryCommandValue:function (command) {
command = this._normalizeCommand(command);
if (this.object) {
switch (command) {
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
command = "get" + command;
return this.object.execCommand(this._activeX.command[command], this._activeX.ui.noprompt);
case "formatblock":
var retvalue = this.object.execCommand(this._activeX.command["getblockformat"], this._activeX.ui.noprompt);
if (retvalue) {
return this._local2NativeFormatNames[retvalue];
}
}
} else {
if (dojo.render.html.ie && command == "formatblock") {
return this._local2NativeFormatNames[this.document.queryCommandValue(command)] || this.document.queryCommandValue(command);
}
return this.document.queryCommandValue(command);
}
}, placeCursorAtStart:function () {
this.focus();
if (dojo.render.html.moz && this.editNode.firstChild && this.editNode.firstChild.nodeType != dojo.dom.TEXT_NODE) {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode.firstChild]);
} else {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode]);
}
dojo.withGlobal(this.window, "collapse", dojo.html.selection, [true]);
}, placeCursorAtEnd:function () {
this.focus();
if (dojo.render.html.moz && this.editNode.lastChild && this.editNode.lastChild.nodeType != dojo.dom.TEXT_NODE) {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode.lastChild]);
} else {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode]);
}
dojo.withGlobal(this.window, "collapse", dojo.html.selection, [false]);
}, replaceEditorContent:function (html) {
html = this._preFilterContent(html);
if (this.isClosed) {
this.domNode.innerHTML = html;
} else {
if (this.window && this.window.getSelection && !dojo.render.html.moz) {
this.editNode.innerHTML = html;
} else {
if ((this.window && this.window.getSelection) || (this.document && this.document.selection)) {
this.execCommand("selectall");
if (dojo.render.html.moz && !html) {
html = "&nbsp;";
}
this.execCommand("inserthtml", html);
}
}
}
}, _preFilterContent:function (html) {
var ec = html;
dojo.lang.forEach(this.contentPreFilters, function (ef) {
ec = ef(ec);
});
if (this.contentDomPreFilters.length > 0) {
var dom = dojo.doc().createElement("div");
dom.style.display = "none";
dojo.body().appendChild(dom);
dom.innerHTML = ec;
dojo.lang.forEach(this.contentDomPreFilters, function (ef) {
dom = ef(dom);
});
ec = dom.innerHTML;
dojo.body().removeChild(dom);
}
return ec;
}, _postFilterContent:function (html) {
var ec = html;
if (this.contentDomPostFilters.length > 0) {
var dom = this.document.createElement("div");
dom.innerHTML = ec;
dojo.lang.forEach(this.contentDomPostFilters, function (ef) {
dom = ef(dom);
});
ec = dom.innerHTML;
}
dojo.lang.forEach(this.contentPostFilters, function (ef) {
ec = ef(ec);
});
return ec;
}, _lastHeight:0, _updateHeight:function () {
if (!this.isLoaded) {
return;
}
if (this.height) {
return;
}
var height = dojo.html.getBorderBox(this.editNode).height;
if (!height) {
height = dojo.html.getBorderBox(this.document.body).height;
}
if (height == 0) {
dojo.debug("Can not figure out the height of the editing area!");
return;
}
this._lastHeight = height;
this.editorObject.style.height = this._lastHeight + "px";
this.window.scrollTo(0, 0);
}, _saveContent:function (e) {
var saveTextarea = dojo.doc().getElementById("dojo.widget.RichText.savedContent");
saveTextarea.value += this._SEPARATOR + this.saveName + ":" + this.getEditorContent();
}, getEditorContent:function () {
var ec = "";
try {
ec = (this._content.length > 0) ? this._content : this.editNode.innerHTML;
if (dojo.string.trim(ec) == "&nbsp;") {
ec = "";
}
}
catch (e) {
}
if (dojo.render.html.ie && !this.object) {
var re = new RegExp("(?:<p>&nbsp;</p>[\n\r]*)+$", "i");
ec = ec.replace(re, "");
}
ec = this._postFilterContent(ec);
if (this.relativeImageUrls) {
var siteBase = dojo.global().location.protocol + "//" + dojo.global().location.host;
var pathBase = dojo.global().location.pathname;
if (pathBase.match(/\/$/)) {
} else {
var pathParts = pathBase.split("/");
if (pathParts.length) {
pathParts.pop();
}
pathBase = pathParts.join("/") + "/";
}
var sameSite = new RegExp("(<img[^>]* src=[\"'])(" + siteBase + "(" + pathBase + ")?)", "ig");
ec = ec.replace(sameSite, "$1");
}
return ec;
}, close:function (save, force) {
if (this.isClosed) {
return false;
}
if (arguments.length == 0) {
save = true;
}
this._content = this._postFilterContent(this.editNode.innerHTML);
var changed = (this.savedContent != this._content);
if (this.interval) {
clearInterval(this.interval);
}
if (dojo.render.html.ie && !this.object) {
dojo.event.browser.clean(this.editNode);
}
if (this.iframe) {
delete this.iframe;
}
if (this.textarea) {
with (this.textarea.style) {
position = "";
left = top = "";
if (dojo.render.html.ie) {
overflow = this.__overflow;
this.__overflow = null;
}
}
if (save) {
this.textarea.value = this._content;
} else {
this.textarea.value = this.savedContent;
}
dojo.html.removeNode(this.domNode);
this.domNode = this.textarea;
} else {
if (save) {
if (dojo.render.html.moz) {
var nc = dojo.doc().createElement("span");
this.domNode.appendChild(nc);
nc.innerHTML = this.editNode.innerHTML;
} else {
this.domNode.innerHTML = this._content;
}
} else {
this.domNode.innerHTML = this.savedContent;
}
}
dojo.html.removeClass(this.domNode, "RichTextEditable");
this.isClosed = true;
this.isLoaded = false;
delete this.editNode;
if (this.window._frameElement) {
this.window._frameElement = null;
}
this.window = null;
this.document = null;
this.object = null;
this.editingArea = null;
this.editorObject = null;
return changed;
}, destroyRendering:function () {
}, destroy:function () {
this.destroyRendering();
if (!this.isClosed) {
this.close(false);
}
dojo.widget.RichText.superclass.destroy.call(this);
}, connect:function (targetObj, targetFunc, thisFunc) {
dojo.event.connect(targetObj, targetFunc, this, thisFunc);
}, disconnect:function (targetObj, targetFunc, thisFunc) {
dojo.event.disconnect(targetObj, targetFunc, this, thisFunc);
}, disconnectAllWithRoot:function (targetObj) {
dojo.deprecated("disconnectAllWithRoot", "is deprecated. No need to disconnect manually", "0.5");
}, _fixContentForMoz:function (html) {
html = html.replace(/<strong([ \>])/gi, "<b$1");
html = html.replace(/<\/strong>/gi, "</b>");
html = html.replace(/<em([ \>])/gi, "<i$1");
html = html.replace(/<\/em>/gi, "</i>");
return html;
}});
 
/trunk/api/js/dojo/src/widget/Clock.js
New file
0,0 → 1,140
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Clock");
dojo.require("dojo.widget.*");
dojo.require("dojo.gfx.*");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.timing.Timer");
dojo.widget.defineWidget("dojo.widget.Clock", dojo.widget.HtmlWidget, function () {
var self = this;
this.timeZoneOffset = 0;
this.label = "";
this.date = new Date();
this.handColor = "#788598";
this.handStroke = "#6f7b8c";
this.secondHandColor = [201, 4, 5, 0.8];
this.topLabelColor = "#efefef";
this.labelColor = "#fff";
this.timer = new dojo.lang.timing.Timer(1000);
this.center = {x:75, y:75};
this.hands = {hour:null, minute:null, second:null};
this.shadows = {hour:{shadow:null, shift:{dx:2, dy:2}}, minute:{shadow:null, shift:{dx:2, dy:3}}, second:{shadow:null, shift:{dx:4, dy:4}}};
this.image = dojo.uri.moduleUri("dojo.widget", "templates/images/clock.png");
this.surface = null;
this.labelNode = null;
this.topLabelNode = null;
this.draw = function () {
self.date = new Date();
var h = (self.date.getHours() + self.timeZoneOffset) % 12;
var m = self.date.getMinutes();
var s = self.date.getSeconds();
self.placeHour(h, m, s);
self.placeMinute(m, s);
self.placeSecond(s);
self.topLabelNode.innerHTML = ((self.date.getHours() + self.timeZoneOffset) > 11) ? "PM" : "AM";
};
this.timer.onTick = self.draw;
}, {set:function (dt) {
this.date = dt;
if (!this.timer.isRunning) {
this.draw();
}
}, start:function () {
this.timer.start();
}, stop:function () {
this.timer.stop();
}, _initPoly:function (parent, points) {
var path = parent.createPath();
var first = true;
dojo.lang.forEach(points, function (c) {
if (first) {
path.moveTo(c.x, c.y);
first = false;
} else {
path.lineTo(c.x, c.y);
}
});
return path;
}, _placeHand:function (shape, angle, shift) {
var move = {dx:this.center.x + (shift ? shift.dx : 0), dy:this.center.y + (shift ? shift.dy : 0)};
return shape.setTransform([move, dojo.gfx.matrix.rotateg(-angle)]);
}, placeHour:function (h, m, s) {
var angle = 30 * (h + m / 60 + s / 3600);
this._placeHand(this.hands.hour, angle);
this._placeHand(this.shadows.hour.shadow, angle, this.shadows.hour.shift);
}, placeMinute:function (m, s) {
var angle = 6 * (m + s / 60);
this._placeHand(this.hands.minute, angle);
this._placeHand(this.shadows.minute.shadow, angle, this.shadows.minute.shift);
}, placeSecond:function (s) {
var angle = 6 * s;
this._placeHand(this.hands.second, angle);
this._placeHand(this.shadows.second.shadow, angle, this.shadows.second.shift);
}, init:function () {
if (this.domNode.style.position != "absolute") {
this.domNode.style.position = "relative";
}
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes[0]);
}
this.domNode.style.width = "150px";
this.domNode.style.height = "150px";
this.surface = dojo.gfx.createSurface(this.domNode, 150, 150);
this.surface.createRect({width:150, height:150});
this.surface.createImage({width:150, height:150, src:this.image + ""});
var hP = [{x:-3, y:-4}, {x:3, y:-4}, {x:1, y:-27}, {x:-1, y:-27}, {x:-3, y:-4}];
var mP = [{x:-3, y:-4}, {x:3, y:-4}, {x:1, y:-38}, {x:-1, y:-38}, {x:-3, y:-4}];
var sP = [{x:-2, y:-2}, {x:2, y:-2}, {x:1, y:-45}, {x:-1, y:-45}, {x:-2, y:-2}];
this.shadows.hour.shadow = this._initPoly(this.surface, hP).setFill([0, 0, 0, 0.1]);
this.hands.hour = this._initPoly(this.surface, hP).setStroke({color:this.handStroke, width:1}).setFill({type:"linear", x1:0, y1:0, x2:0, y2:-27, colors:[{offset:0, color:"#fff"}, {offset:0.33, color:this.handColor}]});
this.shadows.minute.shadow = this._initPoly(this.surface, mP).setFill([0, 0, 0, 0.1]);
this.hands.minute = this._initPoly(this.surface, mP).setStroke({color:this.handStroke, width:1}).setFill({type:"linear", x1:0, y1:0, x2:0, y2:-38, colors:[{offset:0, color:"#fff"}, {offset:0.33, color:this.handColor}]});
this.surface.createCircle({r:6}).setStroke({color:this.handStroke, width:2}).setFill("#fff").setTransform({dx:75, dy:75});
this.shadows.second.shadow = this._initPoly(this.surface, sP).setFill([0, 0, 0, 0.1]);
this.hands.second = this._initPoly(this.surface, sP).setFill(this.secondHandColor);
this.surface.createCircle({r:4}).setFill(this.secondHandColor).setTransform({dx:75, dy:75});
this.topLabelNode = document.createElement("div");
with (this.topLabelNode.style) {
position = "absolute";
top = "3px";
left = "0px";
color = this.topLabelColor;
textAlign = "center";
width = "150px";
fontFamily = "sans-serif";
fontSize = "11px";
textTransform = "uppercase";
fontWeight = "bold";
}
this.topLabelNode.innerHTML = ((this.date.getHours() + this.timeZoneOffset) > 11) ? "PM" : "AM";
this.domNode.appendChild(this.topLabelNode);
this.labelNode = document.createElement("div");
with (this.labelNode.style) {
position = "absolute";
top = "134px";
left = "0px";
color = this.labelColor;
textAlign = "center";
width = "150px";
fontFamily = "sans-serif";
fontSize = "10px";
textTransform = "uppercase";
fontWeight = "bold";
}
this.labelNode.innerHTML = this.label || "&nbsp;";
this.domNode.appendChild(this.labelNode);
this.draw();
}, postCreate:function () {
this.init();
this.start();
}});
 
/trunk/api/js/dojo/src/widget/TreeControllerExtension.js
New file
0,0 → 1,58
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeControllerExtension");
dojo.declare("dojo.widget.TreeControllerExtension", null, {saveExpandedIndices:function (node, field) {
var obj = {};
for (var i = 0; i < node.children.length; i++) {
if (node.children[i].isExpanded) {
var key = dojo.lang.isUndefined(field) ? i : node.children[i][field];
obj[key] = this.saveExpandedIndices(node.children[i], field);
}
}
return obj;
}, restoreExpandedIndices:function (node, savedIndices, field) {
var _this = this;
var handler = function (node, savedIndices) {
this.node = node;
this.savedIndices = savedIndices;
this.process = function () {
_this.restoreExpandedIndices(this.node, this.savedIndices, field);
};
};
for (var i = 0; i < node.children.length; i++) {
var child = node.children[i];
var found = false;
var key = -1;
if (dojo.lang.isUndefined(field) && savedIndices[i]) {
found = true;
key = i;
}
if (field) {
for (var key in savedIndices) {
if (key == child[field]) {
found = true;
break;
}
}
}
if (found) {
var h = new handler(child, savedIndices[key]);
_this.expand(child, false, h, h.process);
} else {
if (child.isExpanded) {
dojo.lang.forEach(child.getDescendants(), function (elem) {
_this.collapse(elem);
});
}
}
}
}});
 
/trunk/api/js/dojo/src/widget/SlideShow.js
New file
0,0 → 1,75
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SlideShow");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.html.display");
dojo.widget.defineWidget("dojo.widget.SlideShow", dojo.widget.HtmlWidget, {templateString:"<div style=\"position: relative; padding: 3px;\">\n\t\t<div>\n\t\t\t<input type=\"button\" value=\"pause\" \n\t\t\t\tdojoAttachPoint=\"startStopButton\"\n\t\t\t\tdojoAttachEvent=\"onClick: togglePaused;\">\n\t\t</div>\n\t\t<div style=\"position: relative; width: ${this.width}; height: ${this.height};\"\n\t\t\tdojoAttachPoint=\"imagesContainer\"\n\t\t\tdojoAttachEvent=\"onClick: togglePaused;\">\n\t\t\t<img dojoAttachPoint=\"img1\" class=\"slideShowImg\" \n\t\t\t\tstyle=\"z-index: 1; width: ${this.width}; height: ${this.height};\" />\n\t\t\t<img dojoAttachPoint=\"img2\" class=\"slideShowImg\" \n\t\t\t\tstyle=\"z-index: 0; width: ${this.width}; height: ${this.height};\" />\n\t\t</div>\t\n</div>\n", templateCssString:".slideShowImg {\n\tposition: absolute;\n\tleft: 0px;\n\ttop: 0px; \n\tborder: 2px solid #4d4d4d;\n\tpadding: 0px;\n\tmargin: 0px;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/SlideShow.css"), imgUrls:[], imgUrlBase:"", delay:4000, transitionInterval:2000, imgWidth:800, imgHeight:600, preventCache:false, stopped:false, _urlsIdx:0, _background:"img2", _foreground:"img1", fadeAnim:null, startStopButton:null, img1:null, img2:null, postMixInProperties:function () {
this.width = this.imgWidth + "px";
this.height = this.imgHeight + "px";
}, fillInTemplate:function () {
if (dojo.render.html.safari && this.imgUrls.length == 2) {
this.preventCache = true;
}
dojo.html.setOpacity(this.img1, 0.9999);
dojo.html.setOpacity(this.img2, 0.9999);
if (this.imgUrls.length > 1) {
this.img2.src = this.imgUrlBase + this.imgUrls[this._urlsIdx++] + this._getUrlSuffix();
this._endTransition();
} else {
this.img1.src = this.imgUrlBase + this.imgUrls[this._urlsIdx++] + this._getUrlSuffix();
}
}, _getUrlSuffix:function () {
if (this.preventCache) {
return "?ts=" + (new Date()).getTime();
} else {
return "";
}
}, togglePaused:function () {
if (this.stopped) {
this.stopped = false;
this._backgroundImageLoaded();
this.startStopButton.value = "pause";
} else {
this.stopped = true;
this.startStopButton.value = "play";
}
}, _backgroundImageLoaded:function () {
if (this.stopped) {
return;
}
if (this.fadeAnim) {
this.fadeAnim.stop();
}
this.fadeAnim = dojo.lfx.fadeOut(this[this._foreground], this.transitionInterval, null);
dojo.event.connect(this.fadeAnim, "onEnd", this, "_endTransition");
this.fadeAnim.play();
}, _endTransition:function () {
with (this[this._background].style) {
zIndex = parseInt(zIndex) + 1;
}
with (this[this._foreground].style) {
zIndex = parseInt(zIndex) - 1;
}
var tmp = this._foreground;
this._foreground = this._background;
this._background = tmp;
this._loadNextImage();
}, _loadNextImage:function () {
dojo.event.kwConnect({srcObj:this[this._background], srcFunc:"onload", adviceObj:this, adviceFunc:"_backgroundImageLoaded", once:true, delay:this.delay});
dojo.html.setOpacity(this[this._background], 1);
this[this._background].src = this.imgUrlBase + this.imgUrls[this._urlsIdx++];
if (this._urlsIdx > (this.imgUrls.length - 1)) {
this._urlsIdx = 0;
}
}});
 
/trunk/api/js/dojo/src/widget/TreeWithNode.js
New file
0,0 → 1,113
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.lang.declare");
dojo.provide("dojo.widget.TreeWithNode");
dojo.declare("dojo.widget.TreeWithNode", null, function () {
}, {loadStates:{UNCHECKED:"UNCHECKED", LOADING:"LOADING", LOADED:"LOADED"}, state:"UNCHECKED", objectId:"", isContainer:true, lockLevel:0, lock:function () {
this.lockLevel++;
}, unlock:function () {
if (!this.lockLevel) {
dojo.raise(this.widgetType + " unlock: not locked");
}
this.lockLevel--;
}, expandLevel:0, loadLevel:0, hasLock:function () {
return this.lockLevel > 0;
}, isLocked:function () {
var node = this;
while (true) {
if (node.lockLevel) {
return true;
}
if (!node.parent || node.isTree) {
break;
}
node = node.parent;
}
return false;
}, flushLock:function () {
this.lockLevel = 0;
}, actionIsDisabled:function (action) {
var disabled = false;
if (dojo.lang.inArray(this.actionsDisabled, action)) {
disabled = true;
}
if (this.isTreeNode) {
if (!this.tree.allowAddChildToLeaf && action == this.actions.ADDCHILD && !this.isFolder) {
disabled = true;
}
}
return disabled;
}, actionIsDisabledNow:function (action) {
return this.actionIsDisabled(action) || this.isLocked();
}, setChildren:function (childrenArray) {
if (this.isTreeNode && !this.isFolder) {
this.setFolder();
} else {
if (this.isTreeNode) {
this.state = this.loadStates.LOADED;
}
}
var hadChildren = this.children.length > 0;
if (hadChildren && childrenArray) {
this.destroyChildren();
}
if (childrenArray) {
this.children = childrenArray;
}
var hasChildren = this.children.length > 0;
if (this.isTreeNode && hasChildren != hadChildren) {
this.viewSetHasChildren();
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (!(child instanceof dojo.widget.Widget)) {
child = this.children[i] = this.tree.createNode(child);
var childWidgetCreated = true;
} else {
var childWidgetCreated = false;
}
if (!child.parent) {
child.parent = this;
if (this.tree !== child.tree) {
child.updateTree(this.tree);
}
child.viewAddLayout();
this.containerNode.appendChild(child.domNode);
var message = {child:child, index:i, parent:this, childWidgetCreated:childWidgetCreated};
delete dojo.widget.manager.topWidgets[child.widgetId];
dojo.event.topic.publish(this.tree.eventNames.afterAddChild, message);
}
if (this.tree.eagerWidgetInstantiation) {
dojo.lang.forEach(this.children, function (child) {
child.setChildren();
});
}
}
}, doAddChild:function (child, index) {
return this.addChild(child, index, true);
}, addChild:function (child, index, dontPublishEvent) {
if (dojo.lang.isUndefined(index)) {
index = this.children.length;
}
if (!child.isTreeNode) {
dojo.raise("You can only add TreeNode widgets to a " + this.widgetType + " widget!");
return;
}
this.children.splice(index, 0, child);
child.parent = this;
child.addedTo(this, index, dontPublishEvent);
delete dojo.widget.manager.topWidgets[child.widgetId];
}, onShow:function () {
this.animationInProgress = false;
}, onHide:function () {
this.animationInProgress = false;
}});
 
/trunk/api/js/dojo/src/widget/TreeDemo.js
New file
0,0 → 1,83
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDemo");
dojo.require("dojo.Deferred");
dojo.widget.TreeDemo = {reportIfDefered:function (res) {
if (res instanceof dojo.Deferred) {
res.addCallbacks(function (res) {
return res;
}, function (err) {
dojo.debug("Error");
dojo.debugShallow(err);
});
}
}, resetRandomChildren:function (maxCount) {
this.randomChildrenMaxCount = maxCount;
this.randomChildrenCount = 0;
this.randomChildrenDepth = 0;
}, makeRandomChildren:function (title) {
this.randomChildrenDepth++;
var children = [];
for (var i = 1; i <= 5; i++) {
var t = title + (this.randomChildrenDepth == 1 ? "" : ".") + i;
var node = {title:t};
children.push(node);
this.randomChildrenCount++;
if (this.randomChildrenCount >= this.randomChildrenMaxCount) {
break;
}
}
var i = 1;
var _this = this;
dojo.lang.forEach(children, function (child) {
var t = title + (_this.randomChildrenDepth == 1 ? "" : ".") + i;
i++;
if (_this.randomChildrenCount < _this.randomChildrenMaxCount && (_this.randomChildrenDepth == 1 && child === children[0] || _this.randomChildrenDepth < 5 && Math.random() > 0.3)) {
child.children = _this.makeRandomChildren(t);
}
});
this.randomChildrenDepth--;
return children;
}, bindDemoMenu:function (controller) {
var _t = this;
dojo.event.topic.subscribe("treeContextMenuDestroy/engage", function (menuItem) {
var node = menuItem.getTreeNode();
_t.reportIfDefered(controller.destroyChild(node));
});
dojo.event.topic.subscribe("treeContextMenuRefresh/engage", function (menuItem) {
var node = menuItem.getTreeNode();
_t.reportIfDefered(controller.refreshChildren(node));
});
dojo.event.topic.subscribe("treeContextMenuCreate/engage", function (menuItem) {
var node = menuItem.getTreeNode();
var d = controller.createAndEdit(node, 0);
_t.reportIfDefered(d);
});
dojo.event.topic.subscribe("treeContextMenuUp/engage", function (menuItem) {
var node = menuItem.getTreeNode();
if (node.isFirstChild()) {
return;
}
_t.reportIfDefered(controller.move(node, node.parent, node.getParentIndex() - 1));
});
dojo.event.topic.subscribe("treeContextMenuDown/engage", function (menuItem) {
var node = menuItem.getTreeNode();
if (node.isLastChild()) {
return;
}
_t.reportIfDefered(controller.move(node, node.parent, node.getParentIndex() + 1));
});
dojo.event.topic.subscribe("treeContextMenuEdit/engage", function (menuItem) {
var node = menuItem.getTreeNode();
_t.reportIfDefered(controller.editLabelStart(node));
});
}};
 
/trunk/api/js/dojo/src/widget/UsTextbox.js
New file
0,0 → 1,34
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.UsTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.validate.us");
dojo.widget.defineWidget("dojo.widget.UsStateTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties) {
dojo.widget.UsStateTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.allowterritories) {
this.flags.allowTerritories = (localProperties.allowterritories == "true");
}
if (localProperties.allowmilitary) {
this.flags.allowMilitary = (localProperties.allowmilitary == "true");
}
}, isValid:function () {
return dojo.validate.us.isState(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.UsZipTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
return dojo.validate.us.isZipCode(this.textbox.value);
}});
dojo.widget.defineWidget("dojo.widget.UsSocialSecurityNumberTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
return dojo.validate.us.isSocialSecurityNumber(this.textbox.value);
}});
dojo.widget.defineWidget("dojo.widget.UsPhoneNumberTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
return dojo.validate.us.isPhoneNumber(this.textbox.value);
}});
 
/trunk/api/js/dojo/src/widget/TreeNode.js
New file
0,0 → 1,244
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeNode");
dojo.require("dojo.html.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeNode", dojo.widget.HtmlWidget, function () {
this.actionsDisabled = [];
}, {widgetType:"TreeNode", loadStates:{UNCHECKED:"UNCHECKED", LOADING:"LOADING", LOADED:"LOADED"}, actions:{MOVE:"MOVE", REMOVE:"REMOVE", EDIT:"EDIT", ADDCHILD:"ADDCHILD"}, isContainer:true, lockLevel:0, templateString:("<div class=\"dojoTreeNode\"> " + "<span treeNode=\"${this.widgetId}\" class=\"dojoTreeNodeLabel\" dojoAttachPoint=\"labelNode\"> " + "\t\t<span dojoAttachPoint=\"titleNode\" dojoAttachEvent=\"onClick: onTitleClick\" class=\"dojoTreeNodeLabelTitle\">${this.title}</span> " + "</span> " + "<span class=\"dojoTreeNodeAfterLabel\" dojoAttachPoint=\"afterLabelNode\">${this.afterLabel}</span> " + "<div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div> " + "</div>").replace(/(>|<)\s+/g, "$1"), childIconSrc:"", childIconFolderSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/closed.gif"), childIconDocumentSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/document.gif"), childIcon:null, isTreeNode:true, objectId:"", afterLabel:"", afterLabelNode:null, expandIcon:null, title:"", object:"", isFolder:false, labelNode:null, titleNode:null, imgs:null, expandLevel:"", tree:null, depth:0, isExpanded:false, state:null, domNodeInitialized:false, isFirstChild:function () {
return this.getParentIndex() == 0 ? true : false;
}, isLastChild:function () {
return this.getParentIndex() == this.parent.children.length - 1 ? true : false;
}, lock:function () {
return this.tree.lock.apply(this, arguments);
}, unlock:function () {
return this.tree.unlock.apply(this, arguments);
}, isLocked:function () {
return this.tree.isLocked.apply(this, arguments);
}, cleanLock:function () {
return this.tree.cleanLock.apply(this, arguments);
}, actionIsDisabled:function (action) {
var _this = this;
var disabled = false;
if (this.tree.strictFolders && action == this.actions.ADDCHILD && !this.isFolder) {
disabled = true;
}
if (dojo.lang.inArray(_this.actionsDisabled, action)) {
disabled = true;
}
if (this.isLocked()) {
disabled = true;
}
return disabled;
}, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId, index:this.getParentIndex(), isFolder:this.isFolder};
return info;
}, initialize:function (args, frag) {
this.state = this.loadStates.UNCHECKED;
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
this.expandLevel = parseInt(this.expandLevel);
}, adjustDepth:function (depthDiff) {
for (var i = 0; i < this.children.length; i++) {
this.children[i].adjustDepth(depthDiff);
}
this.depth += depthDiff;
if (depthDiff > 0) {
for (var i = 0; i < depthDiff; i++) {
var img = this.tree.makeBlankImg();
this.imgs.unshift(img);
dojo.html.insertBefore(this.imgs[0], this.domNode.firstChild);
}
}
if (depthDiff < 0) {
for (var i = 0; i < -depthDiff; i++) {
this.imgs.shift();
dojo.html.removeNode(this.domNode.firstChild);
}
}
}, markLoading:function () {
this._markLoadingSavedIcon = this.expandIcon.src;
this.expandIcon.src = this.tree.expandIconSrcLoading;
}, unMarkLoading:function () {
if (!this._markLoadingSavedIcon) {
return;
}
var im = new Image();
im.src = this.tree.expandIconSrcLoading;
if (this.expandIcon.src == im.src) {
this.expandIcon.src = this._markLoadingSavedIcon;
}
this._markLoadingSavedIcon = null;
}, setFolder:function () {
dojo.event.connect(this.expandIcon, "onclick", this, "onTreeClick");
this.expandIcon.src = this.isExpanded ? this.tree.expandIconSrcMinus : this.tree.expandIconSrcPlus;
this.isFolder = true;
}, createDOMNode:function (tree, depth) {
this.tree = tree;
this.depth = depth;
this.imgs = [];
for (var i = 0; i < this.depth + 1; i++) {
var img = this.tree.makeBlankImg();
this.domNode.insertBefore(img, this.labelNode);
this.imgs.push(img);
}
this.expandIcon = this.imgs[this.imgs.length - 1];
this.childIcon = this.tree.makeBlankImg();
this.imgs.push(this.childIcon);
dojo.html.insertBefore(this.childIcon, this.titleNode);
if (this.children.length || this.isFolder) {
this.setFolder();
} else {
this.state = this.loadStates.LOADED;
}
dojo.event.connect(this.childIcon, "onclick", this, "onIconClick");
for (var i = 0; i < this.children.length; i++) {
this.children[i].parent = this;
var node = this.children[i].createDOMNode(this.tree, this.depth + 1);
this.containerNode.appendChild(node);
}
if (this.children.length) {
this.state = this.loadStates.LOADED;
}
this.updateIcons();
this.domNodeInitialized = true;
dojo.event.topic.publish(this.tree.eventNames.createDOMNode, {source:this});
return this.domNode;
}, onTreeClick:function (e) {
dojo.event.topic.publish(this.tree.eventNames.treeClick, {source:this, event:e});
}, onIconClick:function (e) {
dojo.event.topic.publish(this.tree.eventNames.iconClick, {source:this, event:e});
}, onTitleClick:function (e) {
dojo.event.topic.publish(this.tree.eventNames.titleClick, {source:this, event:e});
}, markSelected:function () {
dojo.html.addClass(this.titleNode, "dojoTreeNodeLabelSelected");
}, unMarkSelected:function () {
dojo.html.removeClass(this.titleNode, "dojoTreeNodeLabelSelected");
}, updateExpandIcon:function () {
if (this.isFolder) {
this.expandIcon.src = this.isExpanded ? this.tree.expandIconSrcMinus : this.tree.expandIconSrcPlus;
} else {
this.expandIcon.src = this.tree.blankIconSrc;
}
}, updateExpandGrid:function () {
if (this.tree.showGrid) {
if (this.depth) {
this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcL : this.tree.gridIconSrcT);
} else {
if (this.isFirstChild()) {
this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcX : this.tree.gridIconSrcY);
} else {
this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcL : this.tree.gridIconSrcT);
}
}
} else {
this.setGridImage(-2, this.tree.blankIconSrc);
}
}, updateChildGrid:function () {
if ((this.depth || this.tree.showRootGrid) && this.tree.showGrid) {
this.setGridImage(-1, (this.children.length && this.isExpanded) ? this.tree.gridIconSrcP : this.tree.gridIconSrcC);
} else {
if (this.tree.showGrid && !this.tree.showRootGrid) {
this.setGridImage(-1, (this.children.length && this.isExpanded) ? this.tree.gridIconSrcZ : this.tree.blankIconSrc);
} else {
this.setGridImage(-1, this.tree.blankIconSrc);
}
}
}, updateParentGrid:function () {
var parent = this.parent;
for (var i = 0; i < this.depth; i++) {
var idx = this.imgs.length - (3 + i);
var img = (this.tree.showGrid && !parent.isLastChild()) ? this.tree.gridIconSrcV : this.tree.blankIconSrc;
this.setGridImage(idx, img);
parent = parent.parent;
}
}, updateExpandGridColumn:function () {
if (!this.tree.showGrid) {
return;
}
var _this = this;
var icon = this.isLastChild() ? this.tree.blankIconSrc : this.tree.gridIconSrcV;
dojo.lang.forEach(_this.getDescendants(), function (node) {
node.setGridImage(_this.depth, icon);
});
this.updateExpandGrid();
}, updateIcons:function () {
this.imgs[0].style.display = this.tree.showRootGrid ? "inline" : "none";
this.buildChildIcon();
this.updateExpandGrid();
this.updateChildGrid();
this.updateParentGrid();
dojo.profile.stop("updateIcons");
}, buildChildIcon:function () {
if (this.childIconSrc) {
this.childIcon.src = this.childIconSrc;
}
this.childIcon.style.display = this.childIconSrc ? "inline" : "none";
}, setGridImage:function (idx, src) {
if (idx < 0) {
idx = this.imgs.length + idx;
}
this.imgs[idx].style.backgroundImage = "url(" + src + ")";
}, updateIconTree:function () {
this.tree.updateIconTree.call(this);
}, expand:function () {
if (this.isExpanded) {
return;
}
if (this.children.length) {
this.showChildren();
}
this.isExpanded = true;
this.updateExpandIcon();
dojo.event.topic.publish(this.tree.eventNames.expand, {source:this});
}, collapse:function () {
if (!this.isExpanded) {
return;
}
this.hideChildren();
this.isExpanded = false;
this.updateExpandIcon();
dojo.event.topic.publish(this.tree.eventNames.collapse, {source:this});
}, hideChildren:function () {
this.tree.toggleObj.hide(this.containerNode, this.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onHide"));
if (dojo.exists(dojo, "dnd.dragManager.dragObjects") && dojo.dnd.dragManager.dragObjects.length) {
dojo.dnd.dragManager.cacheTargetLocations();
}
}, showChildren:function () {
this.tree.toggleObj.show(this.containerNode, this.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onShow"));
if (dojo.exists(dojo, "dnd.dragManager.dragObjects") && dojo.dnd.dragManager.dragObjects.length) {
dojo.dnd.dragManager.cacheTargetLocations();
}
}, addChild:function () {
return this.tree.addChild.apply(this, arguments);
}, doAddChild:function () {
return this.tree.doAddChild.apply(this, arguments);
}, edit:function (props) {
dojo.lang.mixin(this, props);
if (props.title) {
this.titleNode.innerHTML = this.title;
}
if (props.afterLabel) {
this.afterLabelNode.innerHTML = this.afterLabel;
}
if (props.childIconSrc) {
this.buildChildIcon();
}
}, removeNode:function () {
return this.tree.removeNode.apply(this, arguments);
}, doRemoveNode:function () {
return this.tree.doRemoveNode.apply(this, arguments);
}, toString:function () {
return "[" + this.widgetType + " Tree:" + this.tree + " ID:" + this.widgetId + " Title:" + this.title + "]";
}});
 
/trunk/api/js/dojo/src/widget/TreeExpandToNodeOnSelect.js
New file
0,0 → 1,20
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeExpandToNodeOnSelect");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.TreeExpandToNodeOnSelect", dojo.widget.HtmlWidget, {selector:"", controller:"", withSelected:false, initialize:function () {
this.selector = dojo.widget.byId(this.selector);
this.controller = dojo.widget.byId(this.controller);
dojo.event.topic.subscribe(this.selector.eventNames.select, this, "onSelect");
}, onSelectEvent:function (message) {
this.controller.expandToNode(message.node, this.withSelected);
}});
 
/trunk/api/js/dojo/src/widget/PopupContainer.js
New file
0,0 → 1,295
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.PopupContainer");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.iframe");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.declare("dojo.widget.PopupContainerBase", null, function () {
this.queueOnAnimationFinish = [];
}, {isShowingNow:false, currentSubpopup:null, beginZIndex:1000, parentPopup:null, parent:null, popupIndex:0, aroundBox:dojo.html.boxSizing.BORDER_BOX, openedForWindow:null, processKey:function (evt) {
return false;
}, applyPopupBasicStyle:function () {
with (this.domNode.style) {
display = "none";
position = "absolute";
}
}, aboutToShow:function () {
}, open:function (x, y, parent, explodeSrc, orient, padding) {
if (this.isShowingNow) {
return;
}
if (this.animationInProgress) {
this.queueOnAnimationFinish.push(this.open, arguments);
return;
}
this.aboutToShow();
var around = false, node, aroundOrient;
if (typeof x == "object") {
node = x;
aroundOrient = explodeSrc;
explodeSrc = parent;
parent = y;
around = true;
}
this.parent = parent;
dojo.body().appendChild(this.domNode);
explodeSrc = explodeSrc || parent["domNode"] || [];
var parentPopup = null;
this.isTopLevel = true;
while (parent) {
if (parent !== this && (parent.setOpenedSubpopup != undefined && parent.applyPopupBasicStyle != undefined)) {
parentPopup = parent;
this.isTopLevel = false;
parentPopup.setOpenedSubpopup(this);
break;
}
parent = parent.parent;
}
this.parentPopup = parentPopup;
this.popupIndex = parentPopup ? parentPopup.popupIndex + 1 : 1;
if (this.isTopLevel) {
var button = dojo.html.isNode(explodeSrc) ? explodeSrc : null;
dojo.widget.PopupManager.opened(this, button);
}
if (this.isTopLevel && !dojo.withGlobal(this.openedForWindow || dojo.global(), dojo.html.selection.isCollapsed)) {
this._bookmark = dojo.withGlobal(this.openedForWindow || dojo.global(), dojo.html.selection.getBookmark);
} else {
this._bookmark = null;
}
if (explodeSrc instanceof Array) {
explodeSrc = {left:explodeSrc[0], top:explodeSrc[1], width:0, height:0};
}
with (this.domNode.style) {
display = "";
zIndex = this.beginZIndex + this.popupIndex;
}
if (around) {
this.move(node, padding, aroundOrient);
} else {
this.move(x, y, padding, orient);
}
this.domNode.style.display = "none";
this.explodeSrc = explodeSrc;
this.show();
this.isShowingNow = true;
}, move:function (x, y, padding, orient) {
var around = (typeof x == "object");
if (around) {
var aroundOrient = padding;
var node = x;
padding = y;
if (!aroundOrient) {
aroundOrient = {"BL":"TL", "TL":"BL"};
}
dojo.html.placeOnScreenAroundElement(this.domNode, node, padding, this.aroundBox, aroundOrient);
} else {
if (!orient) {
orient = "TL,TR,BL,BR";
}
dojo.html.placeOnScreen(this.domNode, x, y, padding, true, orient);
}
}, close:function (force) {
if (force) {
this.domNode.style.display = "none";
}
if (this.animationInProgress) {
this.queueOnAnimationFinish.push(this.close, []);
return;
}
this.closeSubpopup(force);
this.hide();
if (this.bgIframe) {
this.bgIframe.hide();
this.bgIframe.size({left:0, top:0, width:0, height:0});
}
if (this.isTopLevel) {
dojo.widget.PopupManager.closed(this);
}
this.isShowingNow = false;
if (this.parent) {
setTimeout(dojo.lang.hitch(this, function () {
try {
if (this.parent["focus"]) {
this.parent.focus();
} else {
this.parent.domNode.focus();
}
}
catch (e) {
dojo.debug("No idea how to focus to parent", e);
}
}), 10);
}
if (this._bookmark && dojo.withGlobal(this.openedForWindow || dojo.global(), dojo.html.selection.isCollapsed)) {
if (this.openedForWindow) {
this.openedForWindow.focus();
}
try {
dojo.withGlobal(this.openedForWindow || dojo.global(), "moveToBookmark", dojo.html.selection, [this._bookmark]);
}
catch (e) {
}
}
this._bookmark = null;
}, closeAll:function (force) {
if (this.parentPopup) {
this.parentPopup.closeAll(force);
} else {
this.close(force);
}
}, setOpenedSubpopup:function (popup) {
this.currentSubpopup = popup;
}, closeSubpopup:function (force) {
if (this.currentSubpopup == null) {
return;
}
this.currentSubpopup.close(force);
this.currentSubpopup = null;
}, onShow:function () {
dojo.widget.PopupContainer.superclass.onShow.apply(this, arguments);
this.openedSize = {w:this.domNode.style.width, h:this.domNode.style.height};
if (dojo.render.html.ie) {
if (!this.bgIframe) {
this.bgIframe = new dojo.html.BackgroundIframe();
this.bgIframe.setZIndex(this.domNode);
}
this.bgIframe.size(this.domNode);
this.bgIframe.show();
}
this.processQueue();
}, processQueue:function () {
if (!this.queueOnAnimationFinish.length) {
return;
}
var func = this.queueOnAnimationFinish.shift();
var args = this.queueOnAnimationFinish.shift();
func.apply(this, args);
}, onHide:function () {
dojo.widget.HtmlWidget.prototype.onHide.call(this);
if (this.openedSize) {
with (this.domNode.style) {
width = this.openedSize.w;
height = this.openedSize.h;
}
}
this.processQueue();
}});
dojo.widget.defineWidget("dojo.widget.PopupContainer", [dojo.widget.HtmlWidget, dojo.widget.PopupContainerBase], {isContainer:true, fillInTemplate:function () {
this.applyPopupBasicStyle();
dojo.widget.PopupContainer.superclass.fillInTemplate.apply(this, arguments);
}});
dojo.widget.PopupManager = new function () {
this.currentMenu = null;
this.currentButton = null;
this.currentFocusMenu = null;
this.focusNode = null;
this.registeredWindows = [];
this.registerWin = function (win) {
if (!win.__PopupManagerRegistered) {
dojo.event.connect(win.document, "onmousedown", this, "onClick");
dojo.event.connect(win, "onscroll", this, "onClick");
dojo.event.connect(win.document, "onkey", this, "onKey");
win.__PopupManagerRegistered = true;
this.registeredWindows.push(win);
}
};
this.registerAllWindows = function (targetWindow) {
if (!targetWindow) {
targetWindow = dojo.html.getDocumentWindow(window.top && window.top.document || window.document);
}
this.registerWin(targetWindow);
for (var i = 0; i < targetWindow.frames.length; i++) {
try {
var win = dojo.html.getDocumentWindow(targetWindow.frames[i].document);
if (win) {
this.registerAllWindows(win);
}
}
catch (e) {
}
}
};
this.unRegisterWin = function (win) {
if (win.__PopupManagerRegistered) {
dojo.event.disconnect(win.document, "onmousedown", this, "onClick");
dojo.event.disconnect(win, "onscroll", this, "onClick");
dojo.event.disconnect(win.document, "onkey", this, "onKey");
win.__PopupManagerRegistered = false;
}
};
this.unRegisterAllWindows = function () {
for (var i = 0; i < this.registeredWindows.length; ++i) {
this.unRegisterWin(this.registeredWindows[i]);
}
this.registeredWindows = [];
};
dojo.addOnLoad(this, "registerAllWindows");
dojo.addOnUnload(this, "unRegisterAllWindows");
this.closed = function (menu) {
if (this.currentMenu == menu) {
this.currentMenu = null;
this.currentButton = null;
this.currentFocusMenu = null;
}
};
this.opened = function (menu, button) {
if (menu == this.currentMenu) {
return;
}
if (this.currentMenu) {
this.currentMenu.close();
}
this.currentMenu = menu;
this.currentFocusMenu = menu;
this.currentButton = button;
};
this.setFocusedMenu = function (menu) {
this.currentFocusMenu = menu;
};
this.onKey = function (e) {
if (!e.key) {
return;
}
if (!this.currentMenu || !this.currentMenu.isShowingNow) {
return;
}
var m = this.currentFocusMenu;
while (m) {
if (m.processKey(e)) {
e.preventDefault();
e.stopPropagation();
break;
}
m = m.parentPopup || m.parentMenu;
}
}, this.onClick = function (e) {
if (!this.currentMenu) {
return;
}
var scrolloffset = dojo.html.getScroll().offset;
var m = this.currentMenu;
while (m) {
if (dojo.html.overElement(m.domNode, e) || dojo.html.isDescendantOf(e.target, m.domNode)) {
return;
}
m = m.currentSubpopup;
}
if (this.currentButton && dojo.html.overElement(this.currentButton, e)) {
return;
}
this.currentMenu.closeAll(true);
};
};
 
/trunk/api/js/dojo/src/widget/ValidationTextbox.js
New file
0,0 → 1,122
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ValidationTextbox");
dojo.require("dojo.widget.Textbox");
dojo.require("dojo.i18n.common");
dojo.widget.defineWidget("dojo.widget.ValidationTextbox", dojo.widget.Textbox, function () {
this.flags = {};
}, {required:false, rangeClass:"range", invalidClass:"invalid", missingClass:"missing", classPrefix:"dojoValidate", size:"", maxlength:"", promptMessage:"", invalidMessage:"", missingMessage:"", rangeMessage:"", listenOnKeyPress:true, htmlfloat:"none", lastCheckedValue:null, templateString:"<span style='float:${this.htmlfloat};'>\n\t<input dojoAttachPoint='textbox' type='${this.type}' dojoAttachEvent='onblur;onfocus;onkeyup'\n\t\tid='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'\n\t\tclass='${this.className}' style=''>\n\t<span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span>\n\t<span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span>\n\t<span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span>\n</span>\n", templateCssString:".dojoValidateEmpty{\n\tbackground-color: #00FFFF;\n}\n.dojoValidateValid{\n\tbackground-color: #cfc;\n}\n.dojoValidateInvalid{\n\tbackground-color: #fcc;\n}\n.dojoValidateRange{\n\tbackground-color: #ccf;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Validate.css"), invalidSpan:null, missingSpan:null, rangeSpan:null, getValue:function () {
return this.textbox.value;
}, setValue:function (value) {
this.textbox.value = value;
this.update();
}, isValid:function () {
return true;
}, isInRange:function () {
return true;
}, isEmpty:function () {
return (/^\s*$/.test(this.textbox.value));
}, isMissing:function () {
return (this.required && this.isEmpty());
}, update:function () {
this.lastCheckedValue = this.textbox.value;
this.missingSpan.style.display = "none";
this.invalidSpan.style.display = "none";
this.rangeSpan.style.display = "none";
var empty = this.isEmpty();
var valid = true;
if (this.promptMessage != this.textbox.value) {
valid = this.isValid();
}
var missing = this.isMissing();
if (missing) {
this.missingSpan.style.display = "";
} else {
if (!empty && !valid) {
this.invalidSpan.style.display = "";
} else {
if (!empty && !this.isInRange()) {
this.rangeSpan.style.display = "";
}
}
}
this.highlight();
}, updateClass:function (className) {
var pre = this.classPrefix;
dojo.html.removeClass(this.textbox, pre + "Empty");
dojo.html.removeClass(this.textbox, pre + "Valid");
dojo.html.removeClass(this.textbox, pre + "Invalid");
dojo.html.addClass(this.textbox, pre + className);
}, highlight:function () {
if (this.isEmpty()) {
this.updateClass("Empty");
} else {
if (this.isValid() && this.isInRange()) {
this.updateClass("Valid");
} else {
if (this.textbox.value != this.promptMessage) {
this.updateClass("Invalid");
} else {
this.updateClass("Empty");
}
}
}
}, onfocus:function (evt) {
if (!this.listenOnKeyPress) {
this.updateClass("Empty");
}
}, onblur:function (evt) {
this.filter();
this.update();
}, onkeyup:function (evt) {
if (this.listenOnKeyPress) {
this.update();
} else {
if (this.textbox.value != this.lastCheckedValue) {
this.updateClass("Empty");
}
}
}, postMixInProperties:function (localProperties, frag) {
dojo.widget.ValidationTextbox.superclass.postMixInProperties.apply(this, arguments);
this.messages = dojo.i18n.getLocalization("dojo.widget", "validate", this.lang);
dojo.lang.forEach(["invalidMessage", "missingMessage", "rangeMessage"], function (prop) {
if (this[prop]) {
this.messages[prop] = this[prop];
}
}, this);
}, fillInTemplate:function () {
dojo.widget.ValidationTextbox.superclass.fillInTemplate.apply(this, arguments);
this.textbox.isValid = function () {
this.isValid.call(this);
};
this.textbox.isMissing = function () {
this.isMissing.call(this);
};
this.textbox.isInRange = function () {
this.isInRange.call(this);
};
dojo.html.setClass(this.invalidSpan, this.invalidClass);
this.update();
this.filter();
if (dojo.render.html.ie) {
dojo.html.addClass(this.domNode, "ie");
}
if (dojo.render.html.moz) {
dojo.html.addClass(this.domNode, "moz");
}
if (dojo.render.html.opera) {
dojo.html.addClass(this.domNode, "opera");
}
if (dojo.render.html.safari) {
dojo.html.addClass(this.domNode, "safari");
}
}});
 
/trunk/api/js/dojo/src/widget/ComboBox.js
New file
0,0 → 1,556
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ComboBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.html.*");
dojo.require("dojo.string");
dojo.require("dojo.widget.html.stabile");
dojo.require("dojo.widget.PopupContainer");
dojo.declare("dojo.widget.incrementalComboBoxDataProvider", null, function (options) {
this.searchUrl = options.dataUrl;
this._cache = {};
this._inFlight = false;
this._lastRequest = null;
this.allowCache = false;
}, {_addToCache:function (keyword, data) {
if (this.allowCache) {
this._cache[keyword] = data;
}
}, startSearch:function (searchStr, callback) {
if (this._inFlight) {
}
var tss = encodeURIComponent(searchStr);
var realUrl = dojo.string.substituteParams(this.searchUrl, {"searchString":tss});
var _this = this;
var request = this._lastRequest = dojo.io.bind({url:realUrl, method:"get", mimetype:"text/json", load:function (type, data, evt) {
_this._inFlight = false;
if (!dojo.lang.isArray(data)) {
var arrData = [];
for (var key in data) {
arrData.push([data[key], key]);
}
data = arrData;
}
_this._addToCache(searchStr, data);
if (request == _this._lastRequest) {
callback(data);
}
}});
this._inFlight = true;
}});
dojo.declare("dojo.widget.basicComboBoxDataProvider", null, function (options, node) {
this._data = [];
this.searchLimit = 30;
this.searchType = "STARTSTRING";
this.caseSensitive = false;
if (!dj_undef("dataUrl", options) && !dojo.string.isBlank(options.dataUrl)) {
this._getData(options.dataUrl);
} else {
if ((node) && (node.nodeName.toLowerCase() == "select")) {
var opts = node.getElementsByTagName("option");
var ol = opts.length;
var data = [];
for (var x = 0; x < ol; x++) {
var text = opts[x].textContent || opts[x].innerText || opts[x].innerHTML;
var keyValArr = [String(text), String(opts[x].value)];
data.push(keyValArr);
if (opts[x].selected) {
options.setAllValues(keyValArr[0], keyValArr[1]);
}
}
this.setData(data);
}
}
}, {_getData:function (url) {
dojo.io.bind({url:url, load:dojo.lang.hitch(this, function (type, data, evt) {
if (!dojo.lang.isArray(data)) {
var arrData = [];
for (var key in data) {
arrData.push([data[key], key]);
}
data = arrData;
}
this.setData(data);
}), mimetype:"text/json"});
}, startSearch:function (searchStr, callback) {
this._performSearch(searchStr, callback);
}, _performSearch:function (searchStr, callback) {
var st = this.searchType;
var ret = [];
if (!this.caseSensitive) {
searchStr = searchStr.toLowerCase();
}
for (var x = 0; x < this._data.length; x++) {
if ((this.searchLimit > 0) && (ret.length >= this.searchLimit)) {
break;
}
var dataLabel = new String((!this.caseSensitive) ? this._data[x][0].toLowerCase() : this._data[x][0]);
if (dataLabel.length < searchStr.length) {
continue;
}
if (st == "STARTSTRING") {
if (searchStr == dataLabel.substr(0, searchStr.length)) {
ret.push(this._data[x]);
}
} else {
if (st == "SUBSTRING") {
if (dataLabel.indexOf(searchStr) >= 0) {
ret.push(this._data[x]);
}
} else {
if (st == "STARTWORD") {
var idx = dataLabel.indexOf(searchStr);
if (idx == 0) {
ret.push(this._data[x]);
}
if (idx <= 0) {
continue;
}
var matches = false;
while (idx != -1) {
if (" ,/(".indexOf(dataLabel.charAt(idx - 1)) != -1) {
matches = true;
break;
}
idx = dataLabel.indexOf(searchStr, idx + 1);
}
if (!matches) {
continue;
} else {
ret.push(this._data[x]);
}
}
}
}
}
callback(ret);
}, setData:function (pdata) {
this._data = pdata;
}});
dojo.widget.defineWidget("dojo.widget.ComboBox", dojo.widget.HtmlWidget, {forceValidOption:false, searchType:"stringstart", dataProvider:null, autoComplete:true, searchDelay:100, dataUrl:"", fadeTime:200, maxListLength:8, mode:"local", selectedResult:null, dataProviderClass:"", buttonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/combo_box_arrow.png"), dropdownToggle:"fade", templateString:"<span _=\"whitespace and CR's between tags adds &nbsp; in FF\"\n\tclass=\"dojoComboBoxOuter\"\n\t><input style=\"display:none\" tabindex=\"-1\" name=\"\" value=\"\" \n\t\tdojoAttachPoint=\"comboBoxValue\"\n\t><input style=\"display:none\" tabindex=\"-1\" name=\"\" value=\"\" \n\t\tdojoAttachPoint=\"comboBoxSelectionValue\"\n\t><input type=\"text\" autocomplete=\"off\" class=\"dojoComboBox\"\n\t\tdojoAttachEvent=\"key:_handleKeyEvents; keyUp: onKeyUp; compositionEnd; onResize;\"\n\t\tdojoAttachPoint=\"textInputNode\"\n\t><img hspace=\"0\"\n\t\tvspace=\"0\"\n\t\tclass=\"dojoComboBox\"\n\t\tdojoAttachPoint=\"downArrowNode\"\n\t\tdojoAttachEvent=\"onMouseUp: handleArrowClick; onResize;\"\n\t\tsrc=\"${this.buttonSrc}\"\n></span>\n", templateCssString:".dojoComboBoxOuter {\n\tborder: 0px !important;\n\tmargin: 0px !important;\n\tpadding: 0px !important;\n\tbackground: transparent !important;\n\twhite-space: nowrap !important;\n}\n\n.dojoComboBox {\n\tborder: 1px inset #afafaf;\n\tmargin: 0px;\n\tpadding: 0px;\n\tvertical-align: middle !important;\n\tfloat: none !important;\n\tposition: static !important;\n\tdisplay: inline !important;\n}\n\n/* the input box */\ninput.dojoComboBox {\n\tborder-right-width: 0px !important; \n\tmargin-right: 0px !important;\n\tpadding-right: 0px !important;\n}\n\n/* the down arrow */\nimg.dojoComboBox {\n\tborder-left-width: 0px !important;\n\tpadding-left: 0px !important;\n\tmargin-left: 0px !important;\n}\n\n/* IE vertical-alignment calculations can be off by +-1 but these margins are collapsed away */\n.dj_ie img.dojoComboBox {\n\tmargin-top: 1px; \n\tmargin-bottom: 1px; \n}\n\n/* the drop down */\n.dojoComboBoxOptions {\n\tfont-family: Verdana, Helvetica, Garamond, sans-serif;\n\t/* font-size: 0.7em; */\n\tbackground-color: white;\n\tborder: 1px solid #afafaf;\n\tposition: absolute;\n\tz-index: 1000; \n\toverflow: auto;\n\tcursor: default;\n}\n\n.dojoComboBoxItem {\n\tpadding-left: 2px;\n\tpadding-top: 2px;\n\tmargin: 0px;\n}\n\n.dojoComboBoxItemEven {\n\tbackground-color: #f4f4f4;\n}\n\n.dojoComboBoxItemOdd {\n\tbackground-color: white;\n}\n\n.dojoComboBoxItemHighlight {\n\tbackground-color: #63709A;\n\tcolor: white;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ComboBox.css"), setValue:function (value) {
this.comboBoxValue.value = value;
if (this.textInputNode.value != value) {
this.textInputNode.value = value;
dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
this.onValueChanged(value);
}
}, onValueChanged:function (value) {
}, getValue:function () {
return this.comboBoxValue.value;
}, getState:function () {
return {value:this.getValue()};
}, setState:function (state) {
this.setValue(state.value);
}, enable:function () {
this.disabled = false;
this.textInputNode.removeAttribute("disabled");
}, disable:function () {
this.disabled = true;
this.textInputNode.setAttribute("disabled", true);
}, _getCaretPos:function (element) {
if (dojo.lang.isNumber(element.selectionStart)) {
return element.selectionStart;
} else {
if (dojo.render.html.ie) {
var tr = document.selection.createRange().duplicate();
var ntr = element.createTextRange();
tr.move("character", 0);
ntr.move("character", 0);
try {
ntr.setEndPoint("EndToEnd", tr);
return String(ntr.text).replace(/\r/g, "").length;
}
catch (e) {
return 0;
}
}
}
}, _setCaretPos:function (element, location) {
location = parseInt(location);
this._setSelectedRange(element, location, location);
}, _setSelectedRange:function (element, start, end) {
if (!end) {
end = element.value.length;
}
if (element.setSelectionRange) {
element.focus();
element.setSelectionRange(start, end);
} else {
if (element.createTextRange) {
var range = element.createTextRange();
with (range) {
collapse(true);
moveEnd("character", end);
moveStart("character", start);
select();
}
} else {
element.value = element.value;
element.blur();
element.focus();
var dist = parseInt(element.value.length) - end;
var tchar = String.fromCharCode(37);
var tcc = tchar.charCodeAt(0);
for (var x = 0; x < dist; x++) {
var te = document.createEvent("KeyEvents");
te.initKeyEvent("keypress", true, true, null, false, false, false, false, tcc, tcc);
element.dispatchEvent(te);
}
}
}
}, _handleKeyEvents:function (evt) {
if (evt.ctrlKey || evt.altKey || !evt.key) {
return;
}
this._prev_key_backspace = false;
this._prev_key_esc = false;
var k = dojo.event.browser.keys;
var doSearch = true;
switch (evt.key) {
case k.KEY_DOWN_ARROW:
if (!this.popupWidget.isShowingNow) {
this._startSearchFromInput();
}
this._highlightNextOption();
dojo.event.browser.stopEvent(evt);
return;
case k.KEY_UP_ARROW:
this._highlightPrevOption();
dojo.event.browser.stopEvent(evt);
return;
case k.KEY_TAB:
if (!this.autoComplete && this.popupWidget.isShowingNow && this._highlighted_option) {
dojo.event.browser.stopEvent(evt);
this._selectOption({"target":this._highlighted_option, "noHide":false});
this._setSelectedRange(this.textInputNode, this.textInputNode.value.length, null);
} else {
this._selectOption();
return;
}
break;
case k.KEY_ENTER:
if (this.popupWidget.isShowingNow) {
dojo.event.browser.stopEvent(evt);
}
if (this.autoComplete) {
this._selectOption();
return;
}
case " ":
if (this.popupWidget.isShowingNow && this._highlighted_option) {
dojo.event.browser.stopEvent(evt);
this._selectOption();
this._hideResultList();
return;
}
break;
case k.KEY_ESCAPE:
this._hideResultList();
this._prev_key_esc = true;
return;
case k.KEY_BACKSPACE:
this._prev_key_backspace = true;
if (!this.textInputNode.value.length) {
this.setAllValues("", "");
this._hideResultList();
doSearch = false;
}
break;
case k.KEY_RIGHT_ARROW:
case k.KEY_LEFT_ARROW:
doSearch = false;
break;
default:
if (evt.charCode == 0) {
doSearch = false;
}
}
if (this.searchTimer) {
clearTimeout(this.searchTimer);
}
if (doSearch) {
this._blurOptionNode();
this.searchTimer = setTimeout(dojo.lang.hitch(this, this._startSearchFromInput), this.searchDelay);
}
}, compositionEnd:function (evt) {
evt.key = evt.keyCode;
this._handleKeyEvents(evt);
}, onKeyUp:function (evt) {
this.setValue(this.textInputNode.value);
}, setSelectedValue:function (value) {
this.comboBoxSelectionValue.value = value;
}, setAllValues:function (value1, value2) {
this.setSelectedValue(value2);
this.setValue(value1);
}, _focusOptionNode:function (node) {
if (this._highlighted_option != node) {
this._blurOptionNode();
this._highlighted_option = node;
dojo.html.addClass(this._highlighted_option, "dojoComboBoxItemHighlight");
}
}, _blurOptionNode:function () {
if (this._highlighted_option) {
dojo.html.removeClass(this._highlighted_option, "dojoComboBoxItemHighlight");
this._highlighted_option = null;
}
}, _highlightNextOption:function () {
if ((!this._highlighted_option) || !this._highlighted_option.parentNode) {
this._focusOptionNode(this.optionsListNode.firstChild);
} else {
if (this._highlighted_option.nextSibling) {
this._focusOptionNode(this._highlighted_option.nextSibling);
}
}
dojo.html.scrollIntoView(this._highlighted_option);
}, _highlightPrevOption:function () {
if (this._highlighted_option && this._highlighted_option.previousSibling) {
this._focusOptionNode(this._highlighted_option.previousSibling);
} else {
this._highlighted_option = null;
this._hideResultList();
return;
}
dojo.html.scrollIntoView(this._highlighted_option);
}, _itemMouseOver:function (evt) {
if (evt.target === this.optionsListNode) {
return;
}
this._focusOptionNode(evt.target);
dojo.html.addClass(this._highlighted_option, "dojoComboBoxItemHighlight");
}, _itemMouseOut:function (evt) {
if (evt.target === this.optionsListNode) {
return;
}
this._blurOptionNode();
}, onResize:function () {
var inputSize = dojo.html.getContentBox(this.textInputNode);
if (inputSize.height <= 0) {
dojo.lang.setTimeout(this, "onResize", 100);
return;
}
var buttonSize = {width:inputSize.height, height:inputSize.height};
dojo.html.setContentBox(this.downArrowNode, buttonSize);
}, fillInTemplate:function (args, frag) {
dojo.html.applyBrowserClass(this.domNode);
var source = this.getFragNodeRef(frag);
if (!this.name && source.name) {
this.name = source.name;
}
this.comboBoxValue.name = this.name;
this.comboBoxSelectionValue.name = this.name + "_selected";
dojo.html.copyStyle(this.domNode, source);
dojo.html.copyStyle(this.textInputNode, source);
dojo.html.copyStyle(this.downArrowNode, source);
with (this.downArrowNode.style) {
width = "0px";
height = "0px";
}
var dpClass;
if (this.dataProviderClass) {
if (typeof this.dataProviderClass == "string") {
dpClass = dojo.evalObjPath(this.dataProviderClass);
} else {
dpClass = this.dataProviderClass;
}
} else {
if (this.mode == "remote") {
dpClass = dojo.widget.incrementalComboBoxDataProvider;
} else {
dpClass = dojo.widget.basicComboBoxDataProvider;
}
}
this.dataProvider = new dpClass(this, this.getFragNodeRef(frag));
this.popupWidget = new dojo.widget.createWidget("PopupContainer", {toggle:this.dropdownToggle, toggleDuration:this.toggleDuration});
dojo.event.connect(this, "destroy", this.popupWidget, "destroy");
this.optionsListNode = this.popupWidget.domNode;
this.domNode.appendChild(this.optionsListNode);
dojo.html.addClass(this.optionsListNode, "dojoComboBoxOptions");
dojo.event.connect(this.optionsListNode, "onclick", this, "_selectOption");
dojo.event.connect(this.optionsListNode, "onmouseover", this, "_onMouseOver");
dojo.event.connect(this.optionsListNode, "onmouseout", this, "_onMouseOut");
dojo.event.connect(this.optionsListNode, "onmouseover", this, "_itemMouseOver");
dojo.event.connect(this.optionsListNode, "onmouseout", this, "_itemMouseOut");
}, _openResultList:function (results) {
if (this.disabled) {
return;
}
this._clearResultList();
if (!results.length) {
this._hideResultList();
}
if ((this.autoComplete) && (results.length) && (!this._prev_key_backspace) && (this.textInputNode.value.length > 0)) {
var cpos = this._getCaretPos(this.textInputNode);
if ((cpos + 1) > this.textInputNode.value.length) {
this.textInputNode.value += results[0][0].substr(cpos);
this._setSelectedRange(this.textInputNode, cpos, this.textInputNode.value.length);
}
}
var even = true;
while (results.length) {
var tr = results.shift();
if (tr) {
var td = document.createElement("div");
td.appendChild(document.createTextNode(tr[0]));
td.setAttribute("resultName", tr[0]);
td.setAttribute("resultValue", tr[1]);
td.className = "dojoComboBoxItem " + ((even) ? "dojoComboBoxItemEven" : "dojoComboBoxItemOdd");
even = (!even);
this.optionsListNode.appendChild(td);
}
}
this._showResultList();
}, _onFocusInput:function () {
this._hasFocus = true;
}, _onBlurInput:function () {
this._hasFocus = false;
this._handleBlurTimer(true, 500);
}, _handleBlurTimer:function (clear, millisec) {
if (this.blurTimer && (clear || millisec)) {
clearTimeout(this.blurTimer);
}
if (millisec) {
this.blurTimer = dojo.lang.setTimeout(this, "_checkBlurred", millisec);
}
}, _onMouseOver:function (evt) {
if (!this._mouseover_list) {
this._handleBlurTimer(true, 0);
this._mouseover_list = true;
}
}, _onMouseOut:function (evt) {
var relTarget = evt.relatedTarget;
try {
if (!relTarget || relTarget.parentNode != this.optionsListNode) {
this._mouseover_list = false;
this._handleBlurTimer(true, 100);
this._tryFocus();
}
}
catch (e) {
}
}, _isInputEqualToResult:function (result) {
var input = this.textInputNode.value;
if (!this.dataProvider.caseSensitive) {
input = input.toLowerCase();
result = result.toLowerCase();
}
return (input == result);
}, _isValidOption:function () {
var tgt = dojo.html.firstElement(this.optionsListNode);
var isValidOption = false;
while (!isValidOption && tgt) {
if (this._isInputEqualToResult(tgt.getAttribute("resultName"))) {
isValidOption = true;
} else {
tgt = dojo.html.nextElement(tgt);
}
}
return isValidOption;
}, _checkBlurred:function () {
if (!this._hasFocus && !this._mouseover_list) {
this._hideResultList();
if (!this.textInputNode.value.length) {
this.setAllValues("", "");
return;
}
var isValidOption = this._isValidOption();
if (this.forceValidOption && !isValidOption) {
this.setAllValues("", "");
return;
}
if (!isValidOption) {
this.setSelectedValue("");
}
}
}, _selectOption:function (evt) {
var tgt = null;
if (!evt) {
evt = {target:this._highlighted_option};
}
if (!dojo.html.isDescendantOf(evt.target, this.optionsListNode)) {
if (!this.textInputNode.value.length) {
return;
}
tgt = dojo.html.firstElement(this.optionsListNode);
if (!tgt || !this._isInputEqualToResult(tgt.getAttribute("resultName"))) {
return;
}
} else {
tgt = evt.target;
}
while ((tgt.nodeType != 1) || (!tgt.getAttribute("resultName"))) {
tgt = tgt.parentNode;
if (tgt === dojo.body()) {
return false;
}
}
this.selectedResult = [tgt.getAttribute("resultName"), tgt.getAttribute("resultValue")];
this.setAllValues(tgt.getAttribute("resultName"), tgt.getAttribute("resultValue"));
if (!evt.noHide) {
this._hideResultList();
this._setSelectedRange(this.textInputNode, 0, null);
}
this._tryFocus();
}, _clearResultList:function () {
if (this.optionsListNode.innerHTML) {
this.optionsListNode.innerHTML = "";
}
}, _hideResultList:function () {
this.popupWidget.close();
}, _showResultList:function () {
var childs = this.optionsListNode.childNodes;
if (childs.length) {
var visibleCount = Math.min(childs.length, this.maxListLength);
with (this.optionsListNode.style) {
display = "";
if (visibleCount == childs.length) {
height = "";
} else {
height = visibleCount * dojo.html.getMarginBox(childs[0]).height + "px";
}
width = (dojo.html.getMarginBox(this.domNode).width - 2) + "px";
}
this.popupWidget.open(this.domNode, this, this.downArrowNode);
} else {
this._hideResultList();
}
}, handleArrowClick:function () {
this._handleBlurTimer(true, 0);
this._tryFocus();
if (this.popupWidget.isShowingNow) {
this._hideResultList();
} else {
this._startSearch("");
}
}, _tryFocus:function () {
try {
this.textInputNode.focus();
}
catch (e) {
}
}, _startSearchFromInput:function () {
this._startSearch(this.textInputNode.value);
}, _startSearch:function (key) {
this.dataProvider.startSearch(key, dojo.lang.hitch(this, "_openResultList"));
}, postCreate:function () {
this.onResize();
dojo.event.connect(this.textInputNode, "onblur", this, "_onBlurInput");
dojo.event.connect(this.textInputNode, "onfocus", this, "_onFocusInput");
if (this.disabled) {
this.disable();
}
var s = dojo.widget.html.stabile.getState(this.widgetId);
if (s) {
this.setState(s);
}
}});
 
/trunk/api/js/dojo/src/widget/GoogleMap.js
New file
0,0 → 1,167
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.GoogleMap");
dojo.require("dojo.event.*");
dojo.require("dojo.math");
dojo.require("dojo.widget.*");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.widget.HtmlWidget");
(function () {
var gkey = djConfig["gMapKey"] || djConfig["googleMapKey"];
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_) {
if (!gkey || gkey == "") {
dojo.raise("dojo.widget.GoogleMap: The Google Map widget requires a proper API key in order to be used.");
}
var tag = "<scr" + "ipt src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=" + gkey + "'></scri" + "pt>";
if (!dj_global["GMap2"]) {
document.write(tag);
}
} else {
dojo.debug("Cannot initialize Google 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.defineWidget("dojo.widget.GoogleMap", dojo.widget.HtmlWidget, function () {
this.map = null;
this.geocoder = null;
this.data = [];
this.datasrc = "";
this.controls = ["largemap", "scale", "maptype"];
}, {templatePath:null, templateCssPath:null, isContainer:false, _defaultPoint:{lat:39.10662, lng:-94.578209}, setControls:function () {
var methodmap = {largemap:GLargeMapControl, smallmap:GSmallMapControl, smallzoom:GSmallZoomControl, scale:GScaleControl, maptype:GMapTypeControl, overview:GOverviewMapControl};
for (var i = 0; i < this.controls.length; i++) {
this.map.addControl(new (methodmap[this.controls[i].toLowerCase()])());
}
}, findCenter:function (bounds) {
if (this.data.length == 1) {
return (new GLatLng(this.data[0].lat, this.data[0].lng));
}
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;
}, plot:function (obj) {
var p = new GLatLng(obj.lat, obj.lng);
var d = obj.description || null;
var m = this.createPinpoint(p, d);
this.map.addOverlay(m);
}, plotAddress:function (address) {
var self = this;
this.geocoder.getLocations(address, function (response) {
if (!response || response.Status.code != 200) {
alert("The address \"" + address + "\" was not found.");
return;
}
var obj = {lat:response.Placemark[0].Point.coordinates[1], lng:response.Placemark[0].Point.coordinates[0], description:response.Placemark[0].address};
self.data.push(obj);
self.render();
});
}, parse:function (table) {
this.data = [];
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);
}
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 () {
if (this.data.length == 0) {
this.map.setCenter(new GLatLng(this._defaultPoint.lat, this._defaultPoint.lng), 4);
return;
}
this.map.clearOverlays();
var bounds = new GLatLngBounds();
var d = this.data;
for (var i = 0; i < d.length; i++) {
bounds.extend(new GLatLng(d[i].lat, d[i].lng));
}
var zoom = Math.min((this.map.getBoundsZoomLevel(bounds) - 1), 14);
this.map.setCenter(this.findCenter(bounds), zoom);
for (var i = 0; i < this.data.length; i++) {
this.plot(this.data[i]);
}
}, initialize:function (args, frag) {
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 () {
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes[0]);
}
if (this.domNode.style.position != "absolute") {
this.domNode.style.position = "relative";
}
this.map = new GMap2(this.domNode);
try {
this.geocoder = new GClientGeocoder();
}
catch (ex) {
}
this.render();
this.setControls();
}});
 
/trunk/api/js/dojo/src/widget/TreeLoadingControllerV3.js
New file
0,0 → 1,248
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeLoadingControllerV3");
dojo.require("dojo.widget.TreeBasicControllerV3");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.Deferred");
dojo.require("dojo.DeferredList");
dojo.declare("dojo.Error", Error, function (message, extra) {
this.message = message;
this.extra = extra;
this.stack = (new Error()).stack;
});
dojo.declare("dojo.CommunicationError", dojo.Error, function () {
this.name = "CommunicationError";
});
dojo.declare("dojo.LockedError", dojo.Error, function () {
this.name = "LockedError";
});
dojo.declare("dojo.FormatError", dojo.Error, function () {
this.name = "FormatError";
});
dojo.declare("dojo.RpcError", dojo.Error, function () {
this.name = "RpcError";
});
dojo.widget.defineWidget("dojo.widget.TreeLoadingControllerV3", dojo.widget.TreeBasicControllerV3, {RpcUrl:"", RpcActionParam:"action", preventCache:true, checkValidRpcResponse:function (type, obj) {
if (type != "load") {
var extra = {};
for (var i = 1; i < arguments.length; i++) {
dojo.lang.mixin(extra, arguments[i]);
}
return new dojo.CommunicationError(obj, extra);
}
if (typeof obj != "object") {
return new dojo.FormatError("Wrong server answer format " + (obj && obj.toSource ? obj.toSource() : obj) + " type " + (typeof obj), obj);
}
if (!dojo.lang.isUndefined(obj.error)) {
return new dojo.RpcError(obj.error, obj);
}
return false;
}, getDeferredBindHandler:function (deferred) {
return dojo.lang.hitch(this, function (type, obj) {
var error = this.checkValidRpcResponse.apply(this, arguments);
if (error) {
deferred.errback(error);
return;
}
deferred.callback(obj);
});
}, getRpcUrl:function (action) {
if (this.RpcUrl == "local") {
var dir = document.location.href.substr(0, document.location.href.lastIndexOf("/"));
var localUrl = dir + "/local/" + action;
return localUrl;
}
if (!this.RpcUrl) {
dojo.raise("Empty RpcUrl: can't load");
}
var url = this.RpcUrl;
if (url.indexOf("/") != 0) {
var protocol = document.location.href.replace(/:\/\/.*/, "");
var prefix = document.location.href.substring(protocol.length + 3);
if (prefix.lastIndexOf("/") != prefix.length - 1) {
prefix = prefix.replace(/\/[^\/]+$/, "/");
}
if (prefix.lastIndexOf("/") != prefix.length - 1) {
prefix = prefix + "/";
}
url = protocol + "://" + prefix + url;
}
return url + (url.indexOf("?") > -1 ? "&" : "?") + this.RpcActionParam + "=" + action;
}, loadProcessResponse:function (node, result) {
if (!dojo.lang.isArray(result)) {
throw new dojo.FormatError("loadProcessResponse: Not array loaded: " + result);
}
node.setChildren(result);
}, runRpc:function (kw) {
var _this = this;
var deferred = new dojo.Deferred();
dojo.io.bind({url:kw.url, handle:this.getDeferredBindHandler(deferred), mimetype:"text/javascript", preventCache:this.preventCache, sync:kw.sync, content:{data:dojo.json.serialize(kw.params)}});
return deferred;
}, loadRemote:function (node, sync) {
var _this = this;
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("getChildren"), sync:sync, params:params});
deferred.addCallback(function (res) {
return _this.loadProcessResponse(node, res);
});
return deferred;
}, batchExpandTimeout:0, recurseToLevel:function (widget, level, callFunc, callObj, skipFirst, sync) {
if (level == 0) {
return;
}
if (!skipFirst) {
var deferred = callFunc.call(callObj, widget, sync);
} else {
var deferred = dojo.Deferred.prototype.makeCalled();
}
var _this = this;
var recurseOnExpand = function () {
var children = widget.children;
var deferreds = [];
for (var i = 0; i < children.length; i++) {
deferreds.push(_this.recurseToLevel(children[i], level - 1, callFunc, callObj, sync));
}
return new dojo.DeferredList(deferreds);
};
deferred.addCallback(recurseOnExpand);
return deferred;
}, expandToLevel:function (nodeOrTree, level, sync) {
return this.recurseToLevel(nodeOrTree, nodeOrTree.isTree ? level + 1 : level, this.expand, this, nodeOrTree.isTree, sync);
}, loadToLevel:function (nodeOrTree, level, sync) {
return this.recurseToLevel(nodeOrTree, nodeOrTree.isTree ? level + 1 : level, this.loadIfNeeded, this, nodeOrTree.isTree, sync);
}, loadAll:function (nodeOrTree, sync) {
return this.loadToLevel(nodeOrTree, Number.POSITIVE_INFINITY, sync);
}, expand:function (node, sync) {
var _this = this;
var deferred = this.startProcessing(node);
deferred.addCallback(function () {
return _this.loadIfNeeded(node, sync);
});
deferred.addCallback(function (res) {
dojo.widget.TreeBasicControllerV3.prototype.expand(node);
return res;
});
deferred.addBoth(function (res) {
_this.finishProcessing(node);
return res;
});
return deferred;
}, loadIfNeeded:function (node, sync) {
var deferred;
if (node.state == node.loadStates.UNCHECKED && node.isFolder && !node.children.length) {
deferred = this.loadRemote(node, sync);
} else {
deferred = new dojo.Deferred();
deferred.callback();
}
return deferred;
}, runStages:function (check, prepare, make, finalize, expose, args) {
var _this = this;
if (check && !check.apply(this, args)) {
return false;
}
var deferred = dojo.Deferred.prototype.makeCalled();
if (prepare) {
deferred.addCallback(function () {
return prepare.apply(_this, args);
});
}
if (make) {
deferred.addCallback(function () {
var res = make.apply(_this, args);
return res;
});
}
if (finalize) {
deferred.addBoth(function (res) {
finalize.apply(_this, args);
return res;
});
}
if (expose) {
deferred.addCallback(function (res) {
expose.apply(_this, args);
return res;
});
}
return deferred;
}, startProcessing:function (nodesArray) {
var deferred = new dojo.Deferred();
var nodes = dojo.lang.isArray(nodesArray) ? nodesArray : arguments;
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].isLocked()) {
deferred.errback(new dojo.LockedError("item locked " + nodes[i], nodes[i]));
return deferred;
}
if (nodes[i].isTreeNode) {
nodes[i].markProcessing();
}
nodes[i].lock();
}
deferred.callback();
return deferred;
}, finishProcessing:function (nodesArray) {
var nodes = dojo.lang.isArray(nodesArray) ? nodesArray : arguments;
for (var i = 0; i < nodes.length; i++) {
if (!nodes[i].hasLock()) {
continue;
}
nodes[i].unlock();
if (nodes[i].isTreeNode) {
nodes[i].unmarkProcessing();
}
}
}, refreshChildren:function (nodeOrTree, sync) {
return this.runStages(null, this.prepareRefreshChildren, this.doRefreshChildren, this.finalizeRefreshChildren, this.exposeRefreshChildren, arguments);
}, prepareRefreshChildren:function (nodeOrTree, sync) {
var deferred = this.startProcessing(nodeOrTree);
nodeOrTree.destroyChildren();
nodeOrTree.state = nodeOrTree.loadStates.UNCHECKED;
return deferred;
}, doRefreshChildren:function (nodeOrTree, sync) {
return this.loadRemote(nodeOrTree, sync);
}, finalizeRefreshChildren:function (nodeOrTree, sync) {
this.finishProcessing(nodeOrTree);
}, exposeRefreshChildren:function (nodeOrTree, sync) {
nodeOrTree.expand();
}, move:function (child, newParent, index) {
return this.runStages(this.canMove, this.prepareMove, this.doMove, this.finalizeMove, this.exposeMove, arguments);
}, doMove:function (child, newParent, index) {
child.tree.move(child, newParent, index);
return true;
}, prepareMove:function (child, newParent, index, sync) {
var deferred = this.startProcessing(newParent);
deferred.addCallback(dojo.lang.hitch(this, function () {
return this.loadIfNeeded(newParent, sync);
}));
return deferred;
}, finalizeMove:function (child, newParent) {
this.finishProcessing(newParent);
}, prepareCreateChild:function (parent, index, data, sync) {
var deferred = this.startProcessing(parent);
deferred.addCallback(dojo.lang.hitch(this, function () {
return this.loadIfNeeded(parent, sync);
}));
return deferred;
}, finalizeCreateChild:function (parent) {
this.finishProcessing(parent);
}, prepareClone:function (child, newParent, index, deep, sync) {
var deferred = this.startProcessing(child, newParent);
deferred.addCallback(dojo.lang.hitch(this, function () {
return this.loadIfNeeded(newParent, sync);
}));
return deferred;
}, finalizeClone:function (child, newParent) {
this.finishProcessing(child, newParent);
}});
 
/trunk/api/js/dojo/src/widget/IntegerTextbox.js
New file
0,0 → 1,40
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.IntegerTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.validate.common");
dojo.widget.defineWidget("dojo.widget.IntegerTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
if ((localProperties.signed == "true") || (localProperties.signed == "always")) {
this.flags.signed = true;
} else {
if ((localProperties.signed == "false") || (localProperties.signed == "never")) {
this.flags.signed = false;
this.flags.min = 0;
} else {
this.flags.signed = [true, false];
}
}
if (localProperties.separator) {
this.flags.separator = localProperties.separator;
}
if (localProperties.min) {
this.flags.min = parseInt(localProperties.min);
}
if (localProperties.max) {
this.flags.max = parseInt(localProperties.max);
}
}, isValid:function () {
return dojo.validate.isInteger(this.textbox.value, this.flags);
}, isInRange:function () {
return dojo.validate.isInRange(this.textbox.value, this.flags);
}});
 
/trunk/api/js/dojo/src/widget/YahooMap.js
New file
0,0 → 1,143
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.YahooMap");
dojo.require("dojo.event.*");
dojo.require("dojo.math");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
(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.defineWidget("dojo.widget.YahooMap", dojo.widget.HtmlWidget, function () {
this.map = null;
this.datasrc = "";
this.data = [];
this.width = 0;
this.height = 0;
this.controls = ["zoomlong", "maptype", "pan"];
}, {isContainer:false, 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 methodmap = {maptype:"addTypeControl", pan:"addPanControl", zoomlong:"addZoomLong", zoomshort:"addZoomShort"};
var c = this.controls;
for (var i = 0; i < c.length; i++) {
var controlMethod = methodmap[c[i].toLowerCase()];
if (this.map[controlMethod]) {
this.map[controlMethod]();
}
}
}, parse:function (table) {
this.data = [];
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);
}
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 () {
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();
}});
 
/trunk/api/js/dojo/src/widget/Show.js
New file
0,0 → 1,209
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Show");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.event.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.math.curves");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
dojo.widget.defineWidget("dojo.widget.Show", dojo.widget.HtmlWidget, function () {
this._slides = [];
}, {isContainer:true, _slide:-1, body:null, nav:null, hider:null, select:null, option:null, inNav:false, debugPane:null, noClick:false, templateString:"<div class=\"dojoShow\">\n\t<div dojoAttachPoint=\"contentNode\"></div>\n\t<div class=\"dojoShowNav\" dojoAttachPoint=\"nav\">\n\t\t<div class=\"dojoShowHider\" dojoAttachPoint=\"hider\"></div>\n\t\t<span unselectable=\"on\" style=\"cursor: default;\" dojoAttachEvent=\"onClick:previousSlide\">&lt;</span>\n\t\t<select dojoAttachEvent=\"onClick:gotoSlideByEvent\" dojoAttachPoint=\"select\">\n\t\t\t<option dojoAttachPoint=\"option\">Title</option>\n\t\t</select>\n\t\t<span unselectable=\"on\" style=\"cursor: default;\" dojoAttachEvent=\"onClick:nextSlide\">&gt;</span>\n\t</div>\n</div>\n", templateCssString:"@media screen {\n\thtml, body {\n\t\tmargin: 0px;\n\t\tpadding: 0px;\n\t\twidth: 100%;\n\t}\n\th1 {\n\t\tfont-size: 50px;\n\t}\n\tp, li {\n\t\tfont-size: 30px;\n\t}\n\t.dojoShowNav {\n\t\tbackground: #369;\n\t\toverflow: hidden;\n\t\tposition: absolute;\n\t\theight: 5px;\n\t\tbottom: 0px;\n\t\tleft: 0px;\n\t\twidth: 100%;\n\t\ttext-align: center;\n\t}\n\t.dojoShowNav input {\n\t\tmargin: 0px;\n\t}\n\t.dojoShowHider {\n\t\theight: 5px;\n\t\toverflow: hidden;\n\t\twidth: 100%;\n\t}\n\t.dojoShowPrint {\n\t\tposition: absolute;\n\t\tleft: 5px;\n\t\ttop: 0px;\n\t}\n\t.dojoShow {\n\t\tdisplay: none;\n\t}\n}\n@media print {\n\t.dojoShow {\n\t\tdisplay: none !important;\n\t}\n\t.dojoShowPrint {\n\t\tdisplay: block !important;\n\t}\n\t.dojoShowPrintSlide {\n\t\tborder: 1px solid #aaa;\n\t\tpadding: 10px;\n\t\tmargin-bottom: 15px;\n\t}\n\t.dojoShowPrintSlide, ul {\n\tpage-break-inside: avoid;\n\t}\n\th1 {\n\t\tmargin-top: 0;\n\t\tpage-break-after: avoid;\n\t}\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Show.css"), fillInTemplate:function (args, frag) {
if (args.debugPane) {
var dp = this.debugPane = dojo.widget.byId(args.debugPane);
dp.hide();
dojo.event.connect(dp, "closeWindow", dojo.lang.hitch(this, function () {
this.debugPane = false;
}));
}
var source = this.getFragNodeRef(frag);
this.sourceNode = dojo.body().appendChild(source.cloneNode(true));
for (var i = 0, child; child = this.sourceNode.childNodes[i]; i++) {
if (child.tagName && child.getAttribute("dojotype").toLowerCase() == "showslide") {
child.className = "dojoShowPrintSlide";
child.innerHTML = "<h1>" + child.title + "</h1>" + child.innerHTML;
}
}
this.sourceNode.className = "dojoShowPrint";
this.sourceNode.style.display = "none";
dojo.event.connect(document, "onclick", this, "gotoSlideByEvent");
if (dojo.render.html.ie) {
dojo.event.connect(document, "onkeydown", this, "gotoSlideByEvent");
} else {
dojo.event.connect(document, "onkeypress", this, "gotoSlideByEvent");
}
dojo.event.connect(window, "onresize", this, "resizeWindow");
dojo.event.connect(this.nav, "onmousemove", this, "popUpNav");
}, postCreate:function () {
this._slides = [];
for (var i = 0, child; child = this.children[i]; i++) {
if (child.widgetType == "ShowSlide") {
this._slides.push(child);
this.option.text = child.title + " (" + (i + 1) + ")";
this.option.parentNode.insertBefore(this.option.cloneNode(true), this.option);
}
}
this.option.parentNode.removeChild(this.option);
this.domNode.style.display = "block";
this.resizeWindow();
this.gotoSlide(0, true);
dojo.addOnLoad(dojo.lang.hitch(this, function () {
var th = window.location.hash;
if (th.length) {
var parts = ("" + window.location).split(this.widgetId + "_SlideNo_");
if (parts.length > 1) {
setTimeout(dojo.lang.hitch(this, function () {
this.gotoSlide(parseInt(parts[1]), true);
}), 300);
}
}
}));
}, gotoSlide:function (slide, preventSetHash) {
if (slide == this._slide) {
return;
}
if (!this._slides[slide]) {
for (var i = 0, child; child = this._slides[i]; i++) {
if (child.title == slide) {
slide = i;
break;
}
}
}
if (!this._slides[slide]) {
return;
}
if (this.debugPane) {
if (this._slides[slide].debug) {
this.debugPane.show();
} else {
this.debugPane.hide();
}
}
if (this._slide != -1) {
while (this._slides[this._slide].previousAction()) {
}
}
if (!preventSetHash) {
window.location.href = "#" + this.widgetId + "_SlideNo_" + slide;
}
if (this._slides[this._slide]) {
this._slides[this._slide].hide();
}
this._slide = slide;
this.select.selectedIndex = slide;
var cn = this.contentNode;
while (cn.firstChild) {
cn.removeChild(cn.firstChild);
}
cn.appendChild(this._slides[slide].domNode);
this._slides[slide].show();
}, gotoSlideByEvent:function (event) {
var node = event.target;
var type = event.type;
if (type == "click") {
if (node.tagName == "OPTION" && node.parentNode == this.select) {
this.gotoSlide(node.index);
} else {
if (node == this.select) {
this.gotoSlide(node.selectedIndex);
} else {
this.nextSlide(event);
}
}
} else {
if (type == "keydown" || type == "keypress") {
var key = event.keyCode;
var ch = event.charCode;
if (key == 63234 || key == 37) {
this.previousSlide(event);
} else {
if (key == 63235 || key == 39 || ch == 32) {
this.nextSlide(event);
}
}
}
}
}, nextSlide:function (event) {
if (!this.stopEvent(event)) {
return false;
}
if (!this._slides[this._slide].nextAction(event)) {
if ((this._slide + 1) != this._slides.length) {
this.gotoSlide(this._slide + 1);
return true;
}
return false;
}
}, previousSlide:function (event) {
if (!this.stopEvent(event)) {
return false;
}
if (!this._slides[this._slide].previousAction(event)) {
if ((this._slide - 1) != -1) {
this.gotoSlide(this._slide - 1);
return true;
}
return false;
}
}, stopEvent:function (ev) {
if (!ev) {
return true;
}
if (ev.type == "click" && (this._slides[this._slide].noClick || this.noClick)) {
return false;
}
var target = ev.target;
while (target != null) {
if (target == this.domNode) {
target = ev.target;
break;
}
target = target.parentNode;
}
if (!dojo.dom.isDescendantOf(target, this.nav)) {
while (target && target != this.domNode) {
if (target.tagName == "A" || target.tagName == "INPUT" || target.tagName == "TEXTAREA" || target.tagName == "SELECT") {
return false;
}
if (typeof target.onclick == "function" || typeof target.onkeypress == "function") {
return false;
}
target = target.parentNode;
}
}
if (window.event) {
ev.returnValue = false;
ev.cancelBubble = true;
} else {
ev.preventDefault();
ev.stopPropagation();
}
return true;
}, popUpNav:function () {
if (!this.inNav) {
dojo.lfx.propertyAnimation(this.nav, {"height":{start:5, end:30}}, 250).play();
}
clearTimeout(this.inNav);
this.inNav = setTimeout(dojo.lang.hitch(this, "hideNav"), 2000);
}, hideNav:function () {
clearTimeout(this.inNav);
this.inNav = false;
dojo.lfx.propertyAnimation(this.nav, {"height":{start:30, end:5}}, 250).play();
}, resizeWindow:function (ev) {
dojo.body().style.height = "auto";
var h = Math.max(document.documentElement.scrollHeight || dojo.body().scrollHeight, dojo.html.getViewport().height);
dojo.body().style.height = h + "px";
}});
 
/trunk/api/js/dojo/src/widget/TreeTimeoutIterator.js
New file
0,0 → 1,86
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeTimeoutIterator");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeCommon");
dojo.declare("dojo.widget.TreeTimeoutIterator", null, function (elem, callFunc, callObj) {
var _this = this;
this.currentParent = elem;
this.callFunc = callFunc;
this.callObj = callObj ? callObj : this;
this.stack = [];
}, {maxStackDepth:Number.POSITIVE_INFINITY, stack:null, currentParent:null, currentIndex:0, filterFunc:function () {
return true;
}, finishFunc:function () {
return true;
}, setFilter:function (func, obj) {
this.filterFunc = func;
this.filterObj = obj;
}, setMaxLevel:function (level) {
this.maxStackDepth = level - 2;
}, forward:function (timeout) {
var _this = this;
if (this.timeout) {
var tid = setTimeout(function () {
_this.processNext();
clearTimeout(tid);
}, _this.timeout);
} else {
return this.processNext();
}
}, start:function (processFirst) {
if (processFirst) {
return this.callFunc.call(this.callObj, this.currentParent, this);
}
return this.processNext();
}, processNext:function () {
var handler;
var _this = this;
var found;
var next;
if (this.maxStackDepth == -2) {
return;
}
while (true) {
var children = this.currentParent.children;
if (children && children.length) {
do {
next = children[this.currentIndex];
} while (this.currentIndex++ < children.length && !(found = this.filterFunc.call(this.filterObj, next)));
if (found) {
if (next.isFolder && this.stack.length <= this.maxStackDepth) {
this.moveParent(next, 0);
}
return this.callFunc.call(this.callObj, next, this);
}
}
if (this.stack.length) {
this.popParent();
continue;
}
break;
}
return this.finishFunc.call(this.finishObj);
}, setFinish:function (func, obj) {
this.finishFunc = func;
this.finishObj = obj;
}, popParent:function () {
var p = this.stack.pop();
this.currentParent = p[0];
this.currentIndex = p[1];
}, moveParent:function (nextParent, nextIndex) {
this.stack.push([this.currentParent, this.currentIndex]);
this.currentParent = nextParent;
this.currentIndex = nextIndex;
}});
 
/trunk/api/js/dojo/src/widget/nls/DropdownDatePicker.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"selectDate":"Select a date"})
/trunk/api/js/dojo/src/widget/nls/DropdownTimePicker.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"selectTime":"Select time"})
/trunk/api/js/dojo/src/widget/nls/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* This value is out of range.", "invalidMessage":"* The value entered is not valid.", "missingMessage":"* This value is required."})
/trunk/api/js/dojo/src/widget/nls/TimePicker.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"any":"any"})
/trunk/api/js/dojo/src/widget/nls/fr/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* Cette valeur est hors limites.", "invalidMessage":"* La valeur saisie est incorrecte.", "missingMessage":"* Cette valeur est obligatoire."})
/trunk/api/js/dojo/src/widget/nls/ja/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* \u5165\u529b\u3057\u305f\u6570\u5024\u306f\u9078\u629e\u7bc4\u56f2\u5916\u3067\u3059\u3002", "invalidMessage":"* \u5165\u529b\u3057\u305f\u30c7\u30fc\u30bf\u306b\u8a72\u5f53\u3059\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u305b\u3093\u3002", "missingMessage":"* \u5165\u529b\u304c\u5fc5\u9808\u3067\u3059\u3002"})
/trunk/api/js/dojo/src/widget/nls/zh-cn/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* \u8f93\u5165\u6570\u636e\u8d85\u51fa\u503c\u57df\u3002", "invalidMessage":"* \u975e\u6cd5\u7684\u8f93\u5165\u503c\u3002", "missingMessage":"* \u6b64\u503c\u662f\u5fc5\u987b\u7684\u3002"})
/trunk/api/js/dojo/src/widget/DomWidget.js
New file
0,0 → 1,505
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DomWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.Widget");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.require("dojo.xml.Parse");
dojo.require("dojo.uri.*");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.extras");
dojo.widget._cssFiles = {};
dojo.widget._cssStrings = {};
dojo.widget._templateCache = {};
dojo.widget.defaultStrings = {dojoRoot:dojo.hostenv.getBaseScriptUri(), dojoWidgetModuleUri:dojo.uri.moduleUri("dojo.widget"), baseScriptUri:dojo.hostenv.getBaseScriptUri()};
dojo.widget.fillFromTemplateCache = function (obj, templatePath, templateString, avoidCache) {
var tpath = templatePath || obj.templatePath;
var tmplts = dojo.widget._templateCache;
if (!tpath && !obj["widgetType"]) {
do {
var dummyName = "__dummyTemplate__" + dojo.widget._templateCache.dummyCount++;
} while (tmplts[dummyName]);
obj.widgetType = dummyName;
}
var wt = tpath ? tpath.toString() : obj.widgetType;
var ts = tmplts[wt];
if (!ts) {
tmplts[wt] = {"string":null, "node":null};
if (avoidCache) {
ts = {};
} else {
ts = tmplts[wt];
}
}
if ((!obj.templateString) && (!avoidCache)) {
obj.templateString = templateString || ts["string"];
}
if (obj.templateString) {
obj.templateString = this._sanitizeTemplateString(obj.templateString);
}
if ((!obj.templateNode) && (!avoidCache)) {
obj.templateNode = ts["node"];
}
if ((!obj.templateNode) && (!obj.templateString) && (tpath)) {
var tstring = this._sanitizeTemplateString(dojo.hostenv.getText(tpath));
obj.templateString = tstring;
if (!avoidCache) {
tmplts[wt]["string"] = tstring;
}
}
if ((!ts["string"]) && (!avoidCache)) {
ts.string = obj.templateString;
}
};
dojo.widget._sanitizeTemplateString = function (tString) {
if (tString) {
tString = tString.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
var matches = tString.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if (matches) {
tString = matches[1];
}
} else {
tString = "";
}
return tString;
};
dojo.widget._templateCache.dummyCount = 0;
dojo.widget.attachProperties = ["dojoAttachPoint", "id"];
dojo.widget.eventAttachProperty = "dojoAttachEvent";
dojo.widget.onBuildProperty = "dojoOnBuild";
dojo.widget.waiNames = ["waiRole", "waiState"];
dojo.widget.wai = {waiRole:{name:"waiRole", "namespace":"http://www.w3.org/TR/xhtml2", alias:"x2", prefix:"wairole:"}, waiState:{name:"waiState", "namespace":"http://www.w3.org/2005/07/aaa", alias:"aaa", prefix:""}, setAttr:function (node, ns, attr, value) {
if (dojo.render.html.ie) {
node.setAttribute(this[ns].alias + ":" + attr, this[ns].prefix + value);
} else {
node.setAttributeNS(this[ns]["namespace"], attr, this[ns].prefix + value);
}
}, getAttr:function (node, ns, attr) {
if (dojo.render.html.ie) {
return node.getAttribute(this[ns].alias + ":" + attr);
} else {
return node.getAttributeNS(this[ns]["namespace"], attr);
}
}, removeAttr:function (node, ns, attr) {
var success = true;
if (dojo.render.html.ie) {
success = node.removeAttribute(this[ns].alias + ":" + attr);
} else {
node.removeAttributeNS(this[ns]["namespace"], attr);
}
return success;
}};
dojo.widget.attachTemplateNodes = function (rootNode, targetObj, events) {
var elementNodeType = dojo.dom.ELEMENT_NODE;
function trim(str) {
return str.replace(/^\s+|\s+$/g, "");
}
if (!rootNode) {
rootNode = targetObj.domNode;
}
if (rootNode.nodeType != elementNodeType) {
return;
}
var nodes = rootNode.all || rootNode.getElementsByTagName("*");
var _this = targetObj;
for (var x = -1; x < nodes.length; x++) {
var baseNode = (x == -1) ? rootNode : nodes[x];
var attachPoint = [];
if (!targetObj.widgetsInTemplate || !baseNode.getAttribute("dojoType")) {
for (var y = 0; y < this.attachProperties.length; y++) {
var tmpAttachPoint = baseNode.getAttribute(this.attachProperties[y]);
if (tmpAttachPoint) {
attachPoint = tmpAttachPoint.split(";");
for (var z = 0; z < attachPoint.length; z++) {
if (dojo.lang.isArray(targetObj[attachPoint[z]])) {
targetObj[attachPoint[z]].push(baseNode);
} else {
targetObj[attachPoint[z]] = baseNode;
}
}
break;
}
}
var attachEvent = baseNode.getAttribute(this.eventAttachProperty);
if (attachEvent) {
var evts = attachEvent.split(";");
for (var y = 0; y < evts.length; y++) {
if ((!evts[y]) || (!evts[y].length)) {
continue;
}
var thisFunc = null;
var tevt = trim(evts[y]);
if (evts[y].indexOf(":") >= 0) {
var funcNameArr = tevt.split(":");
tevt = trim(funcNameArr[0]);
thisFunc = trim(funcNameArr[1]);
}
if (!thisFunc) {
thisFunc = tevt;
}
var tf = function () {
var ntf = new String(thisFunc);
return function (evt) {
if (_this[ntf]) {
_this[ntf](dojo.event.browser.fixEvent(evt, this));
}
};
}();
dojo.event.browser.addListener(baseNode, tevt, tf, false, true);
}
}
for (var y = 0; y < events.length; y++) {
var evtVal = baseNode.getAttribute(events[y]);
if ((evtVal) && (evtVal.length)) {
var thisFunc = null;
var domEvt = events[y].substr(4);
thisFunc = trim(evtVal);
var funcs = [thisFunc];
if (thisFunc.indexOf(";") >= 0) {
funcs = dojo.lang.map(thisFunc.split(";"), trim);
}
for (var z = 0; z < funcs.length; z++) {
if (!funcs[z].length) {
continue;
}
var tf = function () {
var ntf = new String(funcs[z]);
return function (evt) {
if (_this[ntf]) {
_this[ntf](dojo.event.browser.fixEvent(evt, this));
}
};
}();
dojo.event.browser.addListener(baseNode, domEvt, tf, false, true);
}
}
}
}
var tmpltPoint = baseNode.getAttribute(this.templateProperty);
if (tmpltPoint) {
targetObj[tmpltPoint] = baseNode;
}
dojo.lang.forEach(dojo.widget.waiNames, function (name) {
var wai = dojo.widget.wai[name];
var val = baseNode.getAttribute(wai.name);
if (val) {
if (val.indexOf("-") == -1) {
dojo.widget.wai.setAttr(baseNode, wai.name, "role", val);
} else {
var statePair = val.split("-");
dojo.widget.wai.setAttr(baseNode, wai.name, statePair[0], statePair[1]);
}
}
}, this);
var onBuild = baseNode.getAttribute(this.onBuildProperty);
if (onBuild) {
eval("var node = baseNode; var widget = targetObj; " + onBuild);
}
}
};
dojo.widget.getDojoEventsFromStr = function (str) {
var re = /(dojoOn([a-z]+)(\s?))=/gi;
var evts = str ? str.match(re) || [] : [];
var ret = [];
var lem = {};
for (var x = 0; x < evts.length; x++) {
if (evts[x].length < 1) {
continue;
}
var cm = evts[x].replace(/\s/, "");
cm = (cm.slice(0, cm.length - 1));
if (!lem[cm]) {
lem[cm] = true;
ret.push(cm);
}
}
return ret;
};
dojo.declare("dojo.widget.DomWidget", dojo.widget.Widget, function () {
if ((arguments.length > 0) && (typeof arguments[0] == "object")) {
this.create(arguments[0]);
}
}, {templateNode:null, templateString:null, templateCssString:null, preventClobber:false, domNode:null, containerNode:null, widgetsInTemplate:false, addChild:function (widget, overrideContainerNode, pos, ref, insertIndex) {
if (!this.isContainer) {
dojo.debug("dojo.widget.DomWidget.addChild() attempted on non-container widget");
return null;
} else {
if (insertIndex == undefined) {
insertIndex = this.children.length;
}
this.addWidgetAsDirectChild(widget, overrideContainerNode, pos, ref, insertIndex);
this.registerChild(widget, insertIndex);
}
return widget;
}, addWidgetAsDirectChild:function (widget, overrideContainerNode, pos, ref, insertIndex) {
if ((!this.containerNode) && (!overrideContainerNode)) {
this.containerNode = this.domNode;
}
var cn = (overrideContainerNode) ? overrideContainerNode : this.containerNode;
if (!pos) {
pos = "after";
}
if (!ref) {
if (!cn) {
cn = dojo.body();
}
ref = cn.lastChild;
}
if (!insertIndex) {
insertIndex = 0;
}
widget.domNode.setAttribute("dojoinsertionindex", insertIndex);
if (!ref) {
cn.appendChild(widget.domNode);
} else {
if (pos == "insertAtIndex") {
dojo.dom.insertAtIndex(widget.domNode, ref.parentNode, insertIndex);
} else {
if ((pos == "after") && (ref === cn.lastChild)) {
cn.appendChild(widget.domNode);
} else {
dojo.dom.insertAtPosition(widget.domNode, cn, pos);
}
}
}
}, registerChild:function (widget, insertionIndex) {
widget.dojoInsertionIndex = insertionIndex;
var idx = -1;
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].dojoInsertionIndex <= insertionIndex) {
idx = i;
}
}
this.children.splice(idx + 1, 0, widget);
widget.parent = this;
widget.addedTo(this, idx + 1);
delete dojo.widget.manager.topWidgets[widget.widgetId];
}, removeChild:function (widget) {
dojo.dom.removeNode(widget.domNode);
return dojo.widget.DomWidget.superclass.removeChild.call(this, widget);
}, getFragNodeRef:function (frag) {
if (!frag) {
return null;
}
if (!frag[this.getNamespacedType()]) {
dojo.raise("Error: no frag for widget type " + this.getNamespacedType() + ", id " + this.widgetId + " (maybe a widget has set it's type incorrectly)");
}
return frag[this.getNamespacedType()]["nodeRef"];
}, postInitialize:function (args, frag, parentComp) {
var sourceNodeRef = this.getFragNodeRef(frag);
if (parentComp && (parentComp.snarfChildDomOutput || !sourceNodeRef)) {
parentComp.addWidgetAsDirectChild(this, "", "insertAtIndex", "", args["dojoinsertionindex"], sourceNodeRef);
} else {
if (sourceNodeRef) {
if (this.domNode && (this.domNode !== sourceNodeRef)) {
this._sourceNodeRef = dojo.dom.replaceNode(sourceNodeRef, this.domNode);
}
}
}
if (parentComp) {
parentComp.registerChild(this, args.dojoinsertionindex);
} else {
dojo.widget.manager.topWidgets[this.widgetId] = this;
}
if (this.widgetsInTemplate) {
var parser = new dojo.xml.Parse();
var subContainerNode;
var subnodes = this.domNode.getElementsByTagName("*");
for (var i = 0; i < subnodes.length; i++) {
if (subnodes[i].getAttribute("dojoAttachPoint") == "subContainerWidget") {
subContainerNode = subnodes[i];
}
if (subnodes[i].getAttribute("dojoType")) {
subnodes[i].setAttribute("isSubWidget", true);
}
}
if (this.isContainer && !this.containerNode) {
if (subContainerNode) {
var src = this.getFragNodeRef(frag);
if (src) {
dojo.dom.moveChildren(src, subContainerNode);
frag["dojoDontFollow"] = true;
}
} else {
dojo.debug("No subContainerWidget node can be found in template file for widget " + this);
}
}
var templatefrag = parser.parseElement(this.domNode, null, true);
dojo.widget.getParser().createSubComponents(templatefrag, this);
var subwidgets = [];
var stack = [this];
var w;
while ((w = stack.pop())) {
for (var i = 0; i < w.children.length; i++) {
var cwidget = w.children[i];
if (cwidget._processedSubWidgets || !cwidget.extraArgs["issubwidget"]) {
continue;
}
subwidgets.push(cwidget);
if (cwidget.isContainer) {
stack.push(cwidget);
}
}
}
for (var i = 0; i < subwidgets.length; i++) {
var widget = subwidgets[i];
if (widget._processedSubWidgets) {
dojo.debug("This should not happen: widget._processedSubWidgets is already true!");
return;
}
widget._processedSubWidgets = true;
if (widget.extraArgs["dojoattachevent"]) {
var evts = widget.extraArgs["dojoattachevent"].split(";");
for (var j = 0; j < evts.length; j++) {
var thisFunc = null;
var tevt = dojo.string.trim(evts[j]);
if (tevt.indexOf(":") >= 0) {
var funcNameArr = tevt.split(":");
tevt = dojo.string.trim(funcNameArr[0]);
thisFunc = dojo.string.trim(funcNameArr[1]);
}
if (!thisFunc) {
thisFunc = tevt;
}
if (dojo.lang.isFunction(widget[tevt])) {
dojo.event.kwConnect({srcObj:widget, srcFunc:tevt, targetObj:this, targetFunc:thisFunc});
} else {
alert(tevt + " is not a function in widget " + widget);
}
}
}
if (widget.extraArgs["dojoattachpoint"]) {
this[widget.extraArgs["dojoattachpoint"]] = widget;
}
}
}
if (this.isContainer && !frag["dojoDontFollow"]) {
dojo.widget.getParser().createSubComponents(frag, this);
}
}, buildRendering:function (args, frag) {
var ts = dojo.widget._templateCache[this.widgetType];
if (args["templatecsspath"]) {
args["templateCssPath"] = args["templatecsspath"];
}
var cpath = args["templateCssPath"] || this.templateCssPath;
if (cpath && !dojo.widget._cssFiles[cpath.toString()]) {
if ((!this.templateCssString) && (cpath)) {
this.templateCssString = dojo.hostenv.getText(cpath);
this.templateCssPath = null;
}
dojo.widget._cssFiles[cpath.toString()] = true;
}
if ((this["templateCssString"]) && (!dojo.widget._cssStrings[this.templateCssString])) {
dojo.html.insertCssText(this.templateCssString, null, cpath);
dojo.widget._cssStrings[this.templateCssString] = true;
}
if ((!this.preventClobber) && ((this.templatePath) || (this.templateNode) || ((this["templateString"]) && (this.templateString.length)) || ((typeof ts != "undefined") && ((ts["string"]) || (ts["node"]))))) {
this.buildFromTemplate(args, frag);
} else {
this.domNode = this.getFragNodeRef(frag);
}
this.fillInTemplate(args, frag);
}, buildFromTemplate:function (args, frag) {
var avoidCache = false;
if (args["templatepath"]) {
args["templatePath"] = args["templatepath"];
}
dojo.widget.fillFromTemplateCache(this, args["templatePath"], null, avoidCache);
var ts = dojo.widget._templateCache[this.templatePath ? this.templatePath.toString() : this.widgetType];
if ((ts) && (!avoidCache)) {
if (!this.templateString.length) {
this.templateString = ts["string"];
}
if (!this.templateNode) {
this.templateNode = ts["node"];
}
}
var matches = false;
var node = null;
var tstr = this.templateString;
if ((!this.templateNode) && (this.templateString)) {
matches = this.templateString.match(/\$\{([^\}]+)\}/g);
if (matches) {
var hash = this.strings || {};
for (var key in dojo.widget.defaultStrings) {
if (dojo.lang.isUndefined(hash[key])) {
hash[key] = dojo.widget.defaultStrings[key];
}
}
for (var i = 0; i < matches.length; i++) {
var key = matches[i];
key = key.substring(2, key.length - 1);
var kval = (key.substring(0, 5) == "this.") ? dojo.lang.getObjPathValue(key.substring(5), this) : hash[key];
var value;
if ((kval) || (dojo.lang.isString(kval))) {
value = new String((dojo.lang.isFunction(kval)) ? kval.call(this, key, this.templateString) : kval);
while (value.indexOf("\"") > -1) {
value = value.replace("\"", "&quot;");
}
tstr = tstr.replace(matches[i], value);
}
}
} else {
this.templateNode = this.createNodesFromText(this.templateString, true)[0];
if (!avoidCache) {
ts.node = this.templateNode;
}
}
}
if ((!this.templateNode) && (!matches)) {
dojo.debug("DomWidget.buildFromTemplate: could not create template");
return false;
} else {
if (!matches) {
node = this.templateNode.cloneNode(true);
if (!node) {
return false;
}
} else {
node = this.createNodesFromText(tstr, true)[0];
}
}
this.domNode = node;
this.attachTemplateNodes();
if (this.isContainer && this.containerNode) {
var src = this.getFragNodeRef(frag);
if (src) {
dojo.dom.moveChildren(src, this.containerNode);
}
}
}, attachTemplateNodes:function (baseNode, targetObj) {
if (!baseNode) {
baseNode = this.domNode;
}
if (!targetObj) {
targetObj = this;
}
return dojo.widget.attachTemplateNodes(baseNode, targetObj, dojo.widget.getDojoEventsFromStr(this.templateString));
}, fillInTemplate:function () {
}, destroyRendering:function () {
try {
dojo.dom.destroyNode(this.domNode);
delete this.domNode;
}
catch (e) {
}
if (this._sourceNodeRef) {
try {
dojo.dom.destroyNode(this._sourceNodeRef);
}
catch (e) {
}
}
}, createNodesFromText:function () {
dojo.unimplemented("dojo.widget.DomWidget.createNodesFromText");
}});
 
/trunk/api/js/dojo/src/widget/svg/Chart.js
New file
0,0 → 1,470
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.svg.Chart");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Chart");
dojo.require("dojo.html.layout");
dojo.require("dojo.math");
dojo.require("dojo.svg");
dojo.require("dojo.gfx.color");
dojo.require("dojo.json");
dojo.widget.defineWidget("dojo.widget.svg.Chart", [dojo.widget.HtmlWidget, dojo.widget.Chart], function () {
this.templatePath = null;
this.templateCssPath = null;
this._isInitialize = false;
this.hasData = false;
this.vectorNode = null;
this.plotArea = null;
this.dataGroup = null;
this.axisGroup = null;
this.properties = {height:0, width:0, defaultWidth:600, defaultHeight:400, 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}}}};
}, {parseProperties:function (node) {
var bRangeX = false;
var bRangeY = false;
if (node.getAttribute("width")) {
this.properties.width = node.getAttribute("width");
}
if (node.getAttribute("height")) {
this.properties.height = node.getAttribute("height");
}
if (node.getAttribute("plotType")) {
this.properties.plotType = node.getAttribute("plotType");
}
if (node.getAttribute("padding")) {
if (node.getAttribute("padding").indexOf(",") > -1) {
var p = node.getAttribute("padding").split(",");
} else {
var p = node.getAttribute("padding").split(" ");
}
if (p.length == 1) {
var pad = parseFloat(p[0]);
this.properties.padding.top = pad;
this.properties.padding.right = pad;
this.properties.padding.bottom = pad;
this.properties.padding.left = pad;
} else {
if (p.length == 2) {
var padV = parseFloat(p[0]);
var padH = parseFloat(p[1]);
this.properties.padding.top = padV;
this.properties.padding.right = padH;
this.properties.padding.bottom = padV;
this.properties.padding.left = padH;
} else {
if (p.length == 4) {
this.properties.padding.top = parseFloat(p[0]);
this.properties.padding.right = parseFloat(p[1]);
this.properties.padding.bottom = parseFloat(p[2]);
this.properties.padding.left = parseFloat(p[3]);
}
}
}
}
if (node.getAttribute("rangeX")) {
var p = node.getAttribute("rangeX");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.x.range.min = parseFloat(p[0]);
this.properties.axes.x.range.max = parseFloat(p[1]);
bRangeX = true;
}
if (node.getAttribute("rangeY")) {
var p = node.getAttribute("rangeY");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.y.range.min = parseFloat(p[0]);
this.properties.axes.y.range.max = parseFloat(p[1]);
bRangeY = true;
}
return {rangeX:bRangeX, rangeY:bRangeY};
}, setAxesPlot:function (table) {
if (table.getAttribute("axisAt")) {
var p = table.getAttribute("axisAt");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
if (!isNaN(parseFloat(p[0]))) {
this.properties.axes.x.plotAt = parseFloat(p[0]);
} else {
if (p[0].toLowerCase() == "ymin") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
} else {
if (p[0].toLowerCase() == "ymax") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.max;
}
}
}
if (!isNaN(parseFloat(p[1]))) {
this.properties.axes.y.plotAt = parseFloat(p[1]);
} else {
if (p[1].toLowerCase() == "xmin") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
} else {
if (p[1].toLowerCase() == "xmax") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.max;
}
}
}
} else {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
}
}, drawVectorNode:function () {
dojo.svg.g.suspend();
if (this.vectorNode) {
this.destroy();
}
this.vectorNode = document.createElementNS(dojo.svg.xmlns.svg, "svg");
this.vectorNode.setAttribute("width", this.properties.width);
this.vectorNode.setAttribute("height", this.properties.height);
dojo.svg.g.resume();
}, drawPlotArea:function () {
dojo.svg.g.suspend();
if (this.plotArea) {
this.plotArea.parentNode.removeChild(this.plotArea);
this.plotArea = null;
}
var defs = document.createElementNS(dojo.svg.xmlns.svg, "defs");
var clip = document.createElementNS(dojo.svg.xmlns.svg, "clipPath");
clip.setAttribute("id", "plotClip" + this.widgetId);
var rect = document.createElementNS(dojo.svg.xmlns.svg, "rect");
rect.setAttribute("x", this.properties.padding.left);
rect.setAttribute("y", this.properties.padding.top);
rect.setAttribute("width", this.properties.width - this.properties.padding.left - this.properties.padding.right);
rect.setAttribute("height", this.properties.height - this.properties.padding.top - this.properties.padding.bottom);
clip.appendChild(rect);
defs.appendChild(clip);
this.vectorNode.appendChild(defs);
this.plotArea = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.vectorNode.appendChild(this.plotArea);
var rect = document.createElementNS(dojo.svg.xmlns.svg, "rect");
rect.setAttribute("x", this.properties.padding.left);
rect.setAttribute("y", this.properties.padding.top);
rect.setAttribute("width", this.properties.width - this.properties.padding.left - this.properties.padding.right);
rect.setAttribute("height", this.properties.height - this.properties.padding.top - this.properties.padding.bottom);
rect.setAttribute("fill", "#fff");
this.plotArea.appendChild(rect);
dojo.svg.g.resume();
}, drawDataGroup:function () {
dojo.svg.g.suspend();
if (this.dataGroup) {
this.dataGroup.parentNode.removeChild(this.dataGroup);
this.dataGroup = null;
}
this.dataGroup = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.dataGroup.setAttribute("style", "clip-path:url(#plotClip" + this.widgetId + ");");
this.plotArea.appendChild(this.dataGroup);
dojo.svg.g.resume();
}, drawAxes:function () {
dojo.svg.g.suspend();
if (this.axisGroup) {
this.axisGroup.parentNode.removeChild(this.axisGroup);
this.axisGroup = null;
}
this.axisGroup = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.plotArea.appendChild(this.axisGroup);
var stroke = 1;
var line = document.createElementNS(dojo.svg.xmlns.svg, "line");
var y = dojo.widget.svg.Chart.Plotter.getY(this.properties.axes.x.plotAt, this);
line.setAttribute("y1", y);
line.setAttribute("y2", y);
line.setAttribute("x1", this.properties.padding.left - stroke);
line.setAttribute("x2", this.properties.width - this.properties.padding.right);
line.setAttribute("style", "stroke:#000;stroke-width:" + stroke + ";");
this.axisGroup.appendChild(line);
var textSize = 10;
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.padding.left);
text.setAttribute("y", this.properties.height - this.properties.padding.bottom + textSize + 2);
text.setAttribute("style", "text-anchor:middle;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.x.range.min), 2)));
this.axisGroup.appendChild(text);
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.width - this.properties.padding.right - (textSize / 2));
text.setAttribute("y", this.properties.height - this.properties.padding.bottom + textSize + 2);
text.setAttribute("style", "text-anchor:middle;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.x.range.max), 2)));
this.axisGroup.appendChild(text);
var line = document.createElementNS(dojo.svg.xmlns.svg, "line");
var x = dojo.widget.svg.Chart.Plotter.getX(this.properties.axes.y.plotAt, this);
line.setAttribute("x1", x);
line.setAttribute("x2", x);
line.setAttribute("y1", this.properties.padding.top);
line.setAttribute("y2", this.properties.height - this.properties.padding.bottom);
line.setAttribute("style", "stroke:#000;stroke-width:" + stroke + ";");
this.axisGroup.appendChild(line);
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.padding.left - 4);
text.setAttribute("y", this.properties.height - this.properties.padding.bottom);
text.setAttribute("style", "text-anchor:end;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.y.range.min), 2)));
this.axisGroup.appendChild(text);
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.padding.left - 4);
text.setAttribute("y", this.properties.padding.top + (textSize / 2));
text.setAttribute("style", "text-anchor:end;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.y.range.max), 2)));
this.axisGroup.appendChild(text);
dojo.svg.g.resume();
}, init:function () {
if (!this.properties.width || !this.properties.height) {
var box = dojo.html.getContentBox(this.domNode);
if (!this.properties.width) {
this.properties.width = (box.width < 32) ? this.properties.defaultWidth : box.width;
}
if (!this.properties.height) {
this.properties.height = (box.height < 32) ? this.properties.defaultHeight : box.height;
}
}
this.drawVectorNode();
this.drawPlotArea();
this.drawDataGroup();
this.drawAxes();
this.domNode.appendChild(this.vectorNode);
this.assignColors();
this._isInitialized = true;
}, destroy:function () {
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes.item(0));
}
this.vectorNode = this.plotArea = this.dataGroup = this.axisGroup = null;
}, render:function () {
dojo.svg.g.suspend();
if (this.dataGroup) {
while (this.dataGroup.childNodes.length > 0) {
this.dataGroup.removeChild(this.dataGroup.childNodes.item(0));
}
} else {
this.init();
}
for (var i = 0; i < this.series.length; i++) {
dojo.widget.svg.Chart.Plotter.plot(this.series[i], this);
}
dojo.svg.g.resume();
}, postCreate:function () {
var table = this.domNode.getElementsByTagName("table")[0];
if (table) {
var ranges = this.parseProperties(table);
var bRangeX = false;
var bRangeY = false;
var axisValues = this.parseData(table);
if (!bRangeX) {
this.properties.axes.x.range = {min:axisValues.x.min, max:axisValues.x.max};
}
if (!bRangeY) {
this.properties.axes.y.range = {min:axisValues.y.min, max:axisValues.y.max};
}
this.setAxesPlot(table);
this.domNode.removeChild(table);
}
if (this.series.length > 0) {
this.render();
}
}});
dojo.widget.svg.Chart.Plotter = new function () {
var self = 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);
}
}
};
plotters["bar"] = function (series, chart) {
var space = 1;
var lastW = 0;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var w;
if (i == series.values.length - 1) {
w = lastW;
} else {
w = self.getX(series.values[i + 1].x, chart) - x - space;
lastW = w;
}
x -= (w / 2);
var yA = self.getY(chart.properties.axes.x.plotAt, chart);
var y = self.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.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", series.color);
bar.setAttribute("title", series.label + ": " + series.values[i].value);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", h);
bar.setAttribute("fill-opacity", "0.9");
chart.dataGroup.appendChild(bar);
}
};
plotters["line"] = function (series, chart) {
var tension = 1.5;
var line = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.setAttribute("fill", "none");
line.setAttribute("stroke", series.color);
line.setAttribute("stroke-width", "2");
line.setAttribute("stroke-opacity", "0.85");
line.setAttribute("title", series.label);
chart.dataGroup.appendChild(line);
var path = [];
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.getY(series.values[i].value, chart);
var dx = chart.properties.padding.left + 1;
var dy = chart.properties.height - chart.properties.padding.bottom;
if (i > 0) {
dx = x - self.getX(series.values[i - 1].x, chart);
dy = self.getY(series.values[i - 1].value, chart);
}
if (i == 0) {
path.push("M");
} else {
path.push("C");
var cx = x - (tension - 1) * (dx / tension);
path.push(cx + "," + dy);
cx = x - (dx / tension);
path.push(cx + "," + y);
}
path.push(x + "," + y);
}
line.setAttribute("d", path.join(" "));
};
plotters["area"] = function (series, chart) {
var tension = 1.5;
var line = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.setAttribute("fill", series.color);
line.setAttribute("fill-opacity", "0.4");
line.setAttribute("stroke", series.color);
line.setAttribute("stroke-width", "1");
line.setAttribute("stroke-opacity", "0.8");
line.setAttribute("title", series.label);
chart.dataGroup.appendChild(line);
var path = [];
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.getY(series.values[i].value, chart);
var dx = chart.properties.padding.left + 1;
var dy = chart.properties.height - chart.properties.padding.bottom;
if (i > 0) {
dx = x - self.getX(series.values[i - 1].x, chart);
dy = self.getY(series.values[i - 1].value, chart);
}
if (i == 0) {
path.push("M");
} else {
path.push("C");
var cx = x - (tension - 1) * (dx / tension);
path.push(cx + "," + dy);
cx = x - (dx / tension);
path.push(cx + "," + y);
}
path.push(x + "," + y);
}
path.push("L");
path.push(x + "," + self.getY(0, chart));
path.push("L");
path.push(self.getX(0, chart) + "," + self.getY(0, chart));
path.push("Z");
line.setAttribute("d", path.join(" "));
}, plotters["scatter"] = function (series, chart) {
var r = 7;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.getY(series.values[i].value, chart);
var point = document.createElementNS(dojo.svg.xmlns.svg, "path");
point.setAttribute("fill", series.color);
point.setAttribute("stroke-width", "0");
point.setAttribute("title", series.label + ": " + series.values[i].value);
point.setAttribute("d", "M " + x + "," + (y - r) + " " + "Q " + x + "," + y + " " + (x + r) + "," + y + " " + "Q " + x + "," + y + " " + x + "," + (y + r) + " " + "Q " + x + "," + y + " " + (x - r) + "," + y + " " + "Q " + x + "," + y + " " + x + "," + (y - r) + " " + "Z");
chart.dataGroup.appendChild(point);
}
};
plotters["bubble"] = function (series, chart) {
var minR = 1;
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 point = document.createElementNS(dojo.svg.xmlns.svg, "circle");
point.setAttribute("stroke-width", 0);
point.setAttribute("fill", series.color);
point.setAttribute("fill-opacity", "0.8");
point.setAttribute("r", (parseFloat(size) * factor) / 2);
point.setAttribute("cx", self.getX(series.values[i].x, chart));
point.setAttribute("cy", self.getY(series.values[i].value, chart));
point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
chart.dataGroup.appendChild(point);
}
};
}();
 
/trunk/api/js/dojo/src/widget/TitlePane.js
New file
0,0 → 1,41
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TitlePane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html.style");
dojo.require("dojo.lfx.*");
dojo.widget.defineWidget("dojo.widget.TitlePane", dojo.widget.ContentPane, {labelNodeClass:"", containerNodeClass:"", label:"", open:true, templateString:"<div dojoAttachPoint=\"domNode\">\n<div dojoAttachPoint=\"labelNode\" dojoAttachEvent=\"onclick: onLabelClick\"></div>\n<div dojoAttachPoint=\"containerNode\"></div>\n</div>\n", 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.html.hide(this.containerNode);
}
dojo.widget.TitlePane.superclass.postCreate.apply(this, arguments);
}, 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;
}
}, setLabel:function (label) {
this.labelNode.innerHTML = label;
}});
 
/trunk/api/js/dojo/src/widget/Checkbox.js
New file
0,0 → 1,101
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Checkbox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.html.style");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.Checkbox", dojo.widget.HtmlWidget, {templateString:"<span style=\"display: inline-block;\" tabIndex=\"${this.tabIndex}\" waiRole=\"checkbox\" id=\"${this.id}\">\n\t<img dojoAttachPoint=\"imageNode\" class=\"dojoHtmlCheckbox\" src=\"${dojoWidgetModuleUri}templates/images/blank.gif\" alt=\"\" />\n\t<input type=\"checkbox\" name=\"${this.name}\" style=\"display: none\" value=\"${this.value}\"\n\t\tdojoAttachPoint=\"inputNode\">\n</span>\n", templateCssString:".dojoHtmlCheckbox {\n\tborder: 0px;\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px;\n\tvertical-align: middle;\n}\n\n.dojoHtmlCheckboxOn {\n\tbackground: url(check.gif) 0px 0px;\n}\n.dojoHtmlCheckboxOff {\n\tbackground: url(check.gif) -16px 0px;\n}\n.dojoHtmlCheckboxDisabledOn {\n\tbackground: url(check.gif) -32px 0px;\n}\n.dojoHtmlCheckboxDisabledOff {\n\tbackground: url(check.gif) -48px 0px;\n}\n.dojoHtmlCheckboxOnHover {\n\tbackground: url(check.gif) -64px 0px;\n}\n.dojoHtmlCheckboxOffHover {\n\tbackground: url(check.gif) -80px 0px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Checkbox.css"), name:"", id:"", checked:false, tabIndex:"", value:"on", postMixInProperties:function () {
dojo.widget.Checkbox.superclass.postMixInProperties.apply(this, arguments);
if (!this.disabled && this.tabIndex == "") {
this.tabIndex = "0";
}
}, fillInTemplate:function () {
this._setInfo();
}, postCreate:function () {
var notcon = true;
this.id = this.id != "" ? this.id : this.widgetId;
if (this.id != "") {
var labels = document.getElementsByTagName("label");
if (labels != null && labels.length > 0) {
for (var i = 0; i < labels.length; i++) {
if (labels[i].htmlFor == this.id) {
labels[i].id = (labels[i].htmlFor + "label");
this._connectEvents(labels[i]);
dojo.widget.wai.setAttr(this.domNode, "waiState", "labelledby", labels[i].id);
break;
}
}
}
}
this._connectEvents(this.domNode);
this.inputNode.checked = this.checked;
}, _connectEvents:function (node) {
dojo.event.connect(node, "onmouseover", this, "mouseOver");
dojo.event.connect(node, "onmouseout", this, "mouseOut");
dojo.event.connect(node, "onkey", this, "onKey");
dojo.event.connect(node, "onclick", this, "_onClick");
dojo.html.disableSelection(node);
}, _onClick:function (e) {
if (this.disabled == false) {
this.checked = !this.checked;
this._setInfo();
}
e.preventDefault();
e.stopPropagation();
this.onClick();
}, setValue:function (bool) {
if (this.disabled == false) {
this.checked = bool;
this._setInfo();
}
}, onClick:function () {
}, onKey:function (e) {
var k = dojo.event.browser.keys;
if (e.key == " ") {
this._onClick(e);
}
}, mouseOver:function (e) {
this._hover(e, true);
}, mouseOut:function (e) {
this._hover(e, false);
}, _hover:function (e, isOver) {
if (this.disabled == false) {
var state = this.checked ? "On" : "Off";
var style = "dojoHtmlCheckbox" + state + "Hover";
if (isOver) {
dojo.html.addClass(this.imageNode, style);
} else {
dojo.html.removeClass(this.imageNode, style);
}
}
}, _setInfo:function () {
var state = "dojoHtmlCheckbox" + (this.disabled ? "Disabled" : "") + (this.checked ? "On" : "Off");
dojo.html.setClass(this.imageNode, "dojoHtmlCheckbox " + state);
this.inputNode.checked = this.checked;
if (this.disabled) {
this.inputNode.setAttribute("disabled", true);
} else {
this.inputNode.removeAttribute("disabled");
}
dojo.widget.wai.setAttr(this.domNode, "waiState", "checked", this.checked);
}});
dojo.widget.defineWidget("dojo.widget.a11y.Checkbox", dojo.widget.Checkbox, {templateString:"<span class='dojoHtmlCheckbox'>\n\t<input type=\"checkbox\" name=\"${this.name}\" tabIndex=\"${this.tabIndex}\" id=\"${this.id}\" value=\"${this.value}\"\n\t\t dojoAttachEvent=\"onClick: _onClick;\" dojoAttachPoint=\"inputNode\"> \n</span>\n", fillInTemplate:function () {
}, postCreate:function (args, frag) {
this.inputNode.checked = this.checked;
if (this.disabled) {
this.inputNode.setAttribute("disabled", true);
}
}, _onClick:function () {
this.onClick();
}});
 
/trunk/api/js/dojo/src/widget/FisheyeList.js
New file
0,0 → 1,444
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.FisheyeList");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.html.style");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.util");
dojo.require("dojo.event.*");
dojo.widget.defineWidget("dojo.widget.FisheyeList", dojo.widget.HtmlWidget, function () {
this.pos = {x:-1, y:-1};
this.EDGE = {CENTER:0, LEFT:1, RIGHT:2, TOP:3, BOTTOM:4};
this.timerScale = 1;
}, {templateString:"<div class=\"dojoHtmlFisheyeListBar\"></div>", templateCssString:".dojoHtmlFisheyeListItemLabel {\n\tfont-family: Arial, Helvetica, sans-serif;\n\tbackground-color: #eee;\n\tborder: 2px solid #666;\n\tpadding: 2px;\n\ttext-align: center;\n\tposition: absolute;\n\tdisplay: none;\n}\n\n.dojoHtmlFisheyeListItemLabel.selected {\n\tdisplay: block;\n}\n\n.dojoHtmlFisheyeListItemImage {\n\tborder: 0px;\n\tposition: absolute;\n}\n\n.dojoHtmlFisheyeListItem {\n\tposition: absolute;\n\tz-index: 2;\n}\n\n.dojoHtmlFisheyeListBar {\n\tposition: relative;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/FisheyeList.css"), isContainer:true, snarfChildDomOutput:true, itemWidth:40, itemHeight:40, itemMaxWidth:150, itemMaxHeight:150, orientation:"horizontal", conservativeTrigger:false, effectUnits:2, itemPadding:10, attachEdge:"center", labelEdge:"bottom", enableCrappySvgSupport:false, fillInTemplate:function () {
dojo.html.disableSelection(this.domNode);
this.isHorizontal = (this.orientation == "horizontal");
this.selectedNode = -1;
this.isOver = false;
this.hitX1 = -1;
this.hitY1 = -1;
this.hitX2 = -1;
this.hitY2 = -1;
this.anchorEdge = this._toEdge(this.attachEdge, this.EDGE.CENTER);
this.labelEdge = this._toEdge(this.labelEdge, this.EDGE.TOP);
if (this.isHorizontal && (this.anchorEdge == this.EDGE.LEFT)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (this.isHorizontal && (this.anchorEdge == this.EDGE.RIGHT)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (!this.isHorizontal && (this.anchorEdge == this.EDGE.TOP)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (!this.isHorizontal && (this.anchorEdge == this.EDGE.BOTTOM)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (this.labelEdge == this.EDGE.CENTER) {
this.labelEdge = this.EDGE.TOP;
}
if (this.isHorizontal && (this.labelEdge == this.EDGE.LEFT)) {
this.labelEdge = this.EDGE.TOP;
}
if (this.isHorizontal && (this.labelEdge == this.EDGE.RIGHT)) {
this.labelEdge = this.EDGE.TOP;
}
if (!this.isHorizontal && (this.labelEdge == this.EDGE.TOP)) {
this.labelEdge = this.EDGE.LEFT;
}
if (!this.isHorizontal && (this.labelEdge == this.EDGE.BOTTOM)) {
this.labelEdge = this.EDGE.LEFT;
}
this.proximityLeft = this.itemWidth * (this.effectUnits - 0.5);
this.proximityRight = this.itemWidth * (this.effectUnits - 0.5);
this.proximityTop = this.itemHeight * (this.effectUnits - 0.5);
this.proximityBottom = this.itemHeight * (this.effectUnits - 0.5);
if (this.anchorEdge == this.EDGE.LEFT) {
this.proximityLeft = 0;
}
if (this.anchorEdge == this.EDGE.RIGHT) {
this.proximityRight = 0;
}
if (this.anchorEdge == this.EDGE.TOP) {
this.proximityTop = 0;
}
if (this.anchorEdge == this.EDGE.BOTTOM) {
this.proximityBottom = 0;
}
if (this.anchorEdge == this.EDGE.CENTER) {
this.proximityLeft /= 2;
this.proximityRight /= 2;
this.proximityTop /= 2;
this.proximityBottom /= 2;
}
}, postCreate:function () {
this._initializePositioning();
if (!this.conservativeTrigger) {
dojo.event.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
}
dojo.event.connect(document.documentElement, "onmouseout", this, "_onBodyOut");
dojo.event.connect(this, "addChild", this, "_initializePositioning");
}, _initializePositioning:function () {
this.itemCount = this.children.length;
this.barWidth = (this.isHorizontal ? this.itemCount : 1) * this.itemWidth;
this.barHeight = (this.isHorizontal ? 1 : this.itemCount) * this.itemHeight;
this.totalWidth = this.proximityLeft + this.proximityRight + this.barWidth;
this.totalHeight = this.proximityTop + this.proximityBottom + this.barHeight;
for (var i = 0; i < this.children.length; i++) {
this.children[i].posX = this.itemWidth * (this.isHorizontal ? i : 0);
this.children[i].posY = this.itemHeight * (this.isHorizontal ? 0 : i);
this.children[i].cenX = this.children[i].posX + (this.itemWidth / 2);
this.children[i].cenY = this.children[i].posY + (this.itemHeight / 2);
var isz = this.isHorizontal ? this.itemWidth : this.itemHeight;
var r = this.effectUnits * isz;
var c = this.isHorizontal ? this.children[i].cenX : this.children[i].cenY;
var lhs = this.isHorizontal ? this.proximityLeft : this.proximityTop;
var rhs = this.isHorizontal ? this.proximityRight : this.proximityBottom;
var siz = this.isHorizontal ? this.barWidth : this.barHeight;
var range_lhs = r;
var range_rhs = r;
if (range_lhs > c + lhs) {
range_lhs = c + lhs;
}
if (range_rhs > (siz - c + rhs)) {
range_rhs = siz - c + rhs;
}
this.children[i].effectRangeLeft = range_lhs / isz;
this.children[i].effectRangeRght = range_rhs / isz;
}
this.domNode.style.width = this.barWidth + "px";
this.domNode.style.height = this.barHeight + "px";
for (var i = 0; i < this.children.length; i++) {
var itm = this.children[i];
var elm = itm.domNode;
elm.style.left = itm.posX + "px";
elm.style.top = itm.posY + "px";
elm.style.width = this.itemWidth + "px";
elm.style.height = this.itemHeight + "px";
if (itm.svgNode) {
itm.svgNode.style.position = "absolute";
itm.svgNode.style.left = this.itemPadding + "%";
itm.svgNode.style.top = this.itemPadding + "%";
itm.svgNode.style.width = (100 - 2 * this.itemPadding) + "%";
itm.svgNode.style.height = (100 - 2 * this.itemPadding) + "%";
itm.svgNode.style.zIndex = 1;
itm.svgNode.setSize(this.itemWidth, this.itemHeight);
} else {
itm.imgNode.style.left = this.itemPadding + "%";
itm.imgNode.style.top = this.itemPadding + "%";
itm.imgNode.style.width = (100 - 2 * this.itemPadding) + "%";
itm.imgNode.style.height = (100 - 2 * this.itemPadding) + "%";
}
}
this._calcHitGrid();
}, _onBodyOut:function (e) {
if (dojo.html.overElement(dojo.body(), e)) {
return;
}
this._setDormant(e);
}, _setDormant:function (e) {
if (!this.isOver) {
return;
}
this.isOver = false;
if (this.conservativeTrigger) {
dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");
}
this._onGridMouseMove(-1, -1);
}, _setActive:function (e) {
if (this.isOver) {
return;
}
this.isOver = true;
if (this.conservativeTrigger) {
dojo.event.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
this.timerScale = 0;
this._onMouseMove(e);
this._expandSlowly();
}
}, _onMouseMove:function (e) {
if ((e.pageX >= this.hitX1) && (e.pageX <= this.hitX2) && (e.pageY >= this.hitY1) && (e.pageY <= this.hitY2)) {
if (!this.isOver) {
this._setActive(e);
}
this._onGridMouseMove(e.pageX - this.hitX1, e.pageY - this.hitY1);
} else {
if (this.isOver) {
this._setDormant(e);
}
}
}, onResized:function () {
this._calcHitGrid();
}, _onGridMouseMove:function (x, y) {
this.pos = {x:x, y:y};
this._paint();
}, _paint:function () {
var x = this.pos.x;
var y = this.pos.y;
if (this.itemCount <= 0) {
return;
}
var pos = this.isHorizontal ? x : y;
var prx = this.isHorizontal ? this.proximityLeft : this.proximityTop;
var siz = this.isHorizontal ? this.itemWidth : this.itemHeight;
var sim = this.isHorizontal ? (1 - this.timerScale) * this.itemWidth + this.timerScale * this.itemMaxWidth : (1 - this.timerScale) * this.itemHeight + this.timerScale * this.itemMaxHeight;
var cen = ((pos - prx) / siz) - 0.5;
var max_off_cen = (sim / siz) - 0.5;
if (max_off_cen > this.effectUnits) {
max_off_cen = this.effectUnits;
}
var off_weight = 0;
if (this.anchorEdge == this.EDGE.BOTTOM) {
var cen2 = (y - this.proximityTop) / this.itemHeight;
off_weight = (cen2 > 0.5) ? 1 : y / (this.proximityTop + (this.itemHeight / 2));
}
if (this.anchorEdge == this.EDGE.TOP) {
var cen2 = (y - this.proximityTop) / this.itemHeight;
off_weight = (cen2 < 0.5) ? 1 : (this.totalHeight - y) / (this.proximityBottom + (this.itemHeight / 2));
}
if (this.anchorEdge == this.EDGE.RIGHT) {
var cen2 = (x - this.proximityLeft) / this.itemWidth;
off_weight = (cen2 > 0.5) ? 1 : x / (this.proximityLeft + (this.itemWidth / 2));
}
if (this.anchorEdge == this.EDGE.LEFT) {
var cen2 = (x - this.proximityLeft) / this.itemWidth;
off_weight = (cen2 < 0.5) ? 1 : (this.totalWidth - x) / (this.proximityRight + (this.itemWidth / 2));
}
if (this.anchorEdge == this.EDGE.CENTER) {
if (this.isHorizontal) {
off_weight = y / (this.totalHeight);
} else {
off_weight = x / (this.totalWidth);
}
if (off_weight > 0.5) {
off_weight = 1 - off_weight;
}
off_weight *= 2;
}
for (var i = 0; i < this.itemCount; i++) {
var weight = this._weighAt(cen, i);
if (weight < 0) {
weight = 0;
}
this._setItemSize(i, weight * off_weight);
}
var main_p = Math.round(cen);
var offset = 0;
if (cen < 0) {
main_p = 0;
} else {
if (cen > this.itemCount - 1) {
main_p = this.itemCount - 1;
} else {
offset = (cen - main_p) * ((this.isHorizontal ? this.itemWidth : this.itemHeight) - this.children[main_p].sizeMain);
}
}
this._positionElementsFrom(main_p, offset);
}, _weighAt:function (cen, i) {
var dist = Math.abs(cen - i);
var limit = ((cen - i) > 0) ? this.children[i].effectRangeRght : this.children[i].effectRangeLeft;
return (dist > limit) ? 0 : (1 - dist / limit);
}, _setItemSize:function (p, scale) {
scale *= this.timerScale;
var w = Math.round(this.itemWidth + ((this.itemMaxWidth - this.itemWidth) * scale));
var h = Math.round(this.itemHeight + ((this.itemMaxHeight - this.itemHeight) * scale));
if (this.isHorizontal) {
this.children[p].sizeW = w;
this.children[p].sizeH = h;
this.children[p].sizeMain = w;
this.children[p].sizeOff = h;
var y = 0;
if (this.anchorEdge == this.EDGE.TOP) {
y = (this.children[p].cenY - (this.itemHeight / 2));
} else {
if (this.anchorEdge == this.EDGE.BOTTOM) {
y = (this.children[p].cenY - (h - (this.itemHeight / 2)));
} else {
y = (this.children[p].cenY - (h / 2));
}
}
this.children[p].usualX = Math.round(this.children[p].cenX - (w / 2));
this.children[p].domNode.style.top = y + "px";
this.children[p].domNode.style.left = this.children[p].usualX + "px";
} else {
this.children[p].sizeW = w;
this.children[p].sizeH = h;
this.children[p].sizeOff = w;
this.children[p].sizeMain = h;
var x = 0;
if (this.anchorEdge == this.EDGE.LEFT) {
x = this.children[p].cenX - (this.itemWidth / 2);
} else {
if (this.anchorEdge == this.EDGE.RIGHT) {
x = this.children[p].cenX - (w - (this.itemWidth / 2));
} else {
x = this.children[p].cenX - (w / 2);
}
}
this.children[p].domNode.style.left = x + "px";
this.children[p].usualY = Math.round(this.children[p].cenY - (h / 2));
this.children[p].domNode.style.top = this.children[p].usualY + "px";
}
this.children[p].domNode.style.width = w + "px";
this.children[p].domNode.style.height = h + "px";
if (this.children[p].svgNode) {
this.children[p].svgNode.setSize(w, h);
}
}, _positionElementsFrom:function (p, offset) {
var pos = 0;
if (this.isHorizontal) {
pos = Math.round(this.children[p].usualX + offset);
this.children[p].domNode.style.left = pos + "px";
} else {
pos = Math.round(this.children[p].usualY + offset);
this.children[p].domNode.style.top = pos + "px";
}
this._positionLabel(this.children[p]);
var bpos = pos;
for (var i = p - 1; i >= 0; i--) {
bpos -= this.children[i].sizeMain;
if (this.isHorizontal) {
this.children[i].domNode.style.left = bpos + "px";
} else {
this.children[i].domNode.style.top = bpos + "px";
}
this._positionLabel(this.children[i]);
}
var apos = pos;
for (var i = p + 1; i < this.itemCount; i++) {
apos += this.children[i - 1].sizeMain;
if (this.isHorizontal) {
this.children[i].domNode.style.left = apos + "px";
} else {
this.children[i].domNode.style.top = apos + "px";
}
this._positionLabel(this.children[i]);
}
}, _positionLabel:function (itm) {
var x = 0;
var y = 0;
var mb = dojo.html.getMarginBox(itm.lblNode);
if (this.labelEdge == this.EDGE.TOP) {
x = Math.round((itm.sizeW / 2) - (mb.width / 2));
y = -mb.height;
}
if (this.labelEdge == this.EDGE.BOTTOM) {
x = Math.round((itm.sizeW / 2) - (mb.width / 2));
y = itm.sizeH;
}
if (this.labelEdge == this.EDGE.LEFT) {
x = -mb.width;
y = Math.round((itm.sizeH / 2) - (mb.height / 2));
}
if (this.labelEdge == this.EDGE.RIGHT) {
x = itm.sizeW;
y = Math.round((itm.sizeH / 2) - (mb.height / 2));
}
itm.lblNode.style.left = x + "px";
itm.lblNode.style.top = y + "px";
}, _calcHitGrid:function () {
var pos = dojo.html.getAbsolutePosition(this.domNode, true);
this.hitX1 = pos.x - this.proximityLeft;
this.hitY1 = pos.y - this.proximityTop;
this.hitX2 = this.hitX1 + this.totalWidth;
this.hitY2 = this.hitY1 + this.totalHeight;
}, _toEdge:function (inp, def) {
return this.EDGE[inp.toUpperCase()] || def;
}, _expandSlowly:function () {
if (!this.isOver) {
return;
}
this.timerScale += 0.2;
this._paint();
if (this.timerScale < 1) {
dojo.lang.setTimeout(this, "_expandSlowly", 10);
}
}, destroy:function () {
dojo.event.disconnect(document.documentElement, "onmouseout", this, "_onBodyOut");
dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");
dojo.widget.FisheyeList.superclass.destroy.call(this);
}});
dojo.widget.defineWidget("dojo.widget.FisheyeListItem", dojo.widget.HtmlWidget, {iconSrc:"", svgSrc:"", caption:"", id:"", _blankImgPath:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), templateString:"<div class=\"dojoHtmlFisheyeListItem\">" + " <img class=\"dojoHtmlFisheyeListItemImage\" dojoAttachPoint=\"imgNode\" dojoAttachEvent=\"onMouseOver;onMouseOut;onClick\">" + " <div class=\"dojoHtmlFisheyeListItemLabel\" dojoAttachPoint=\"lblNode\"></div>" + "</div>", fillInTemplate:function () {
if (this.svgSrc != "") {
this.svgNode = this._createSvgNode(this.svgSrc);
this.domNode.appendChild(this.svgNode);
this.imgNode.style.display = "none";
} else {
if ((this.iconSrc.toLowerCase().substring(this.iconSrc.length - 4) == ".png") && (dojo.render.html.ie) && (!dojo.render.html.ie70)) {
if (dojo.dom.hasParent(this.imgNode) && this.id != "") {
var parent = this.imgNode.parentNode;
parent.setAttribute("id", this.id);
}
this.imgNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.iconSrc + "', sizingMethod='scale')";
this.imgNode.src = this._blankImgPath.toString();
} else {
if (dojo.dom.hasParent(this.imgNode) && this.id != "") {
var parent = this.imgNode.parentNode;
parent.setAttribute("id", this.id);
}
this.imgNode.src = this.iconSrc;
}
}
if (this.lblNode) {
this.lblNode.appendChild(document.createTextNode(this.caption));
}
dojo.html.disableSelection(this.domNode);
}, _createSvgNode:function (src) {
var elm = document.createElement("embed");
elm.src = src;
elm.type = "image/svg+xml";
elm.style.width = "1px";
elm.style.height = "1px";
elm.loaded = 0;
elm.setSizeOnLoad = false;
elm.onload = function () {
this.svgRoot = this.getSVGDocument().rootElement;
this.svgDoc = this.getSVGDocument().documentElement;
this.zeroWidth = this.svgRoot.width.baseVal.value;
this.zeroHeight = this.svgRoot.height.baseVal.value;
this.loaded = true;
if (this.setSizeOnLoad) {
this.setSize(this.setWidth, this.setHeight);
}
};
elm.setSize = function (w, h) {
if (!this.loaded) {
this.setWidth = w;
this.setHeight = h;
this.setSizeOnLoad = true;
return;
}
this.style.width = w + "px";
this.style.height = h + "px";
this.svgRoot.width.baseVal.value = w;
this.svgRoot.height.baseVal.value = h;
var scale_x = w / this.zeroWidth;
var scale_y = h / this.zeroHeight;
for (var i = 0; i < this.svgDoc.childNodes.length; i++) {
if (this.svgDoc.childNodes[i].setAttribute) {
this.svgDoc.childNodes[i].setAttribute("transform", "scale(" + scale_x + "," + scale_y + ")");
}
}
};
return elm;
}, onMouseOver:function (e) {
if (!this.parent.isOver) {
this.parent._setActive(e);
}
if (this.caption != "") {
dojo.html.addClass(this.lblNode, "selected");
this.parent._positionLabel(this);
}
}, onMouseOut:function (e) {
dojo.html.removeClass(this.lblNode, "selected");
}, onClick:function (e) {
}});
 
/trunk/api/js/dojo/src/widget/ProgressBar.js
New file
0,0 → 1,185
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ProgressBar");
dojo.require("dojo.widget.*");
dojo.require("dojo.event");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.require("dojo.string.*");
dojo.require("dojo.lfx.*");
dojo.widget.defineWidget("dojo.widget.ProgressBar", dojo.widget.HtmlWidget, {progressValue:0, maxProgressValue:100, width:300, height:30, frontPercentClass:"frontPercent", backPercentClass:"backPercent", frontBarClass:"frontBar", backBarClass:"backBar", hasText:false, isVertical:false, showOnlyIntegers:false, dataSource:"", pollInterval:3000, duration:1000, templateString:"<div dojoAttachPoint=\"containerNode\" style=\"position:relative;overflow:hidden\">\n\t<div style=\"position:absolute;display:none;width:100%;text-align:center\" dojoAttachPoint=\"backPercentLabel\" class=\"dojoBackPercentLabel\"></div>\n\t<div style=\"position:absolute;overflow:hidden;width:100%;height:100%\" dojoAttachPoint=\"internalProgress\">\n\t<div style=\"position:absolute;display:none;width:100%;text-align:center\" dojoAttachPoint=\"frontPercentLabel\" class=\"dojoFrontPercentLabel\"></div></div>\n</div>\n", templateCssString:".backBar{\n\tborder:1px solid #84a3d1;\n}\n.frontBar{\n\tbackground:url(\"images/bar.gif\") repeat bottom left;\n\tbackground-attachment: fixed;\n}\n.h-frontBar{\n\tbackground:url(\"images/h-bar.gif\") repeat bottom left;\n\tbackground-attachment: fixed;\n}\n.simpleFrontBar{\n\tbackground: red;\n}\n.frontPercent,.backPercent{\n\tfont:bold 13px helvetica;\n}\n.backPercent{\n\tcolor:#293a4b;\n}\n.frontPercent{\n\tcolor:#fff;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ProgressBar.css"), containerNode:null, internalProgress:null, _pixelUnitRatio:0, _pixelPercentRatio:0, _unitPercentRatio:0, _unitPixelRatio:0, _floatDimension:0, _intDimension:0, _progressPercentValue:"0%", _floatMaxProgressValue:0, _dimension:"width", _pixelValue:0, _oInterval:null, _animation:null, _animationStopped:true, _progressValueBak:false, _hasTextBak:false, fillInTemplate:function (args, frag) {
this.internalProgress.className = this.frontBarClass;
this.containerNode.className = this.backBarClass;
if (this.isVertical) {
this.internalProgress.style.bottom = "0px";
this.internalProgress.style.left = "0px";
this._dimension = "height";
} else {
this.internalProgress.style.top = "0px";
this.internalProgress.style.left = "0px";
this._dimension = "width";
}
this.frontPercentLabel.className = this.frontPercentClass;
this.backPercentLabel.className = this.backPercentClass;
this.progressValue = "" + this.progressValue;
this.domNode.style.height = this.height + "px";
this.domNode.style.width = this.width + "px";
this._intDimension = parseInt("0" + eval("this." + this._dimension));
this._floatDimension = parseFloat("0" + eval("this." + this._dimension));
this._pixelPercentRatio = this._floatDimension / 100;
this.setMaxProgressValue(this.maxProgressValue, true);
this.setProgressValue(dojo.string.trim(this.progressValue), true);
dojo.debug("float dimension: " + this._floatDimension);
dojo.debug("this._unitPixelRatio: " + this._unitPixelRatio);
this.showText(this.hasText);
}, showText:function (visible) {
if (visible) {
this.backPercentLabel.style.display = "block";
this.frontPercentLabel.style.display = "block";
} else {
this.backPercentLabel.style.display = "none";
this.frontPercentLabel.style.display = "none";
}
this.hasText = visible;
}, postCreate:function (args, frag) {
this.render();
}, _backupValues:function () {
this._progressValueBak = this.progressValue;
this._hasTextBak = this.hasText;
}, _restoreValues:function () {
this.setProgressValue(this._progressValueBak);
this.showText(this._hasTextBak);
}, _setupAnimation:function () {
var _self = this;
dojo.debug("internalProgress width: " + this.internalProgress.style.width);
this._animation = dojo.lfx.html.slideTo(this.internalProgress, {top:0, left:parseInt(this.width) - parseInt(this.internalProgress.style.width)}, parseInt(this.duration), null, function () {
var _backAnim = dojo.lfx.html.slideTo(_self.internalProgress, {top:0, left:0}, parseInt(_self.duration));
dojo.event.connect(_backAnim, "onEnd", function () {
if (!_self._animationStopped) {
_self._animation.play();
}
});
if (!_self._animationStopped) {
_backAnim.play();
}
_backAnim = null;
});
}, getMaxProgressValue:function () {
return this.maxProgressValue;
}, setMaxProgressValue:function (maxValue, noRender) {
if (!this._animationStopped) {
return;
}
this.maxProgressValue = maxValue;
this._floatMaxProgressValue = parseFloat("0" + this.maxProgressValue);
this._pixelUnitRatio = this._floatDimension / this.maxProgressValue;
this._unitPercentRatio = this._floatMaxProgressValue / 100;
this._unitPixelRatio = this._floatMaxProgressValue / this._floatDimension;
this.setProgressValue(this.progressValue, true);
if (!noRender) {
this.render();
}
}, setProgressValue:function (value, noRender) {
if (!this._animationStopped) {
return;
}
this._progressPercentValue = "0%";
var _value = dojo.string.trim("" + value);
var _floatValue = parseFloat("0" + _value);
var _intValue = parseInt("0" + _value);
var _pixelValue = 0;
if (dojo.string.endsWith(_value, "%", false)) {
this._progressPercentValue = Math.min(_floatValue.toFixed(1), 100) + "%";
_value = Math.min((_floatValue) * this._unitPercentRatio, this.maxProgressValue);
_pixelValue = Math.min((_floatValue) * this._pixelPercentRatio, eval("this." + this._dimension));
} else {
this.progressValue = Math.min(_floatValue, this.maxProgressValue);
this._progressPercentValue = Math.min((_floatValue / this._unitPercentRatio).toFixed(1), 100) + "%";
_pixelValue = Math.min(_floatValue / this._unitPixelRatio, eval("this." + this._dimension));
}
this.progressValue = dojo.string.trim(_value);
this._pixelValue = _pixelValue;
if (!noRender) {
this.render();
}
}, getProgressValue:function () {
return this.progressValue;
}, getProgressPercentValue:function () {
return this._progressPercentValue;
}, setDataSource:function (dataSource) {
this.dataSource = dataSource;
}, setPollInterval:function (pollInterval) {
this.pollInterval = pollInterval;
}, start:function () {
var _showFunction = dojo.lang.hitch(this, this._showRemoteProgress);
this._oInterval = setInterval(_showFunction, this.pollInterval);
}, startAnimation:function () {
if (this._animationStopped) {
this._backupValues();
this.setProgressValue("10%");
this._animationStopped = false;
this._setupAnimation();
this.showText(false);
this.internalProgress.style.height = "105%";
this._animation.play();
}
}, stopAnimation:function () {
if (this._animation) {
this._animationStopped = true;
this._animation.stop();
this.internalProgress.style.height = "100%";
this.internalProgress.style.left = "0px";
this._restoreValues();
this._setLabelPosition();
}
}, _showRemoteProgress:function () {
var _self = this;
if ((this.getMaxProgressValue() == this.getProgressValue()) && this._oInterval) {
clearInterval(this._oInterval);
this._oInterval = null;
this.setProgressValue("100%");
return;
}
var bArgs = {url:_self.dataSource, method:"POST", mimetype:"text/json", error:function (type, errorObj) {
dojo.debug("[ProgressBar] showRemoteProgress error");
}, load:function (type, data, evt) {
_self.setProgressValue((_self._oInterval ? data["progress"] : "100%"));
}};
dojo.io.bind(bArgs);
}, render:function () {
this._setPercentLabel(dojo.string.trim(this._progressPercentValue));
this._setPixelValue(this._pixelValue);
this._setLabelPosition();
}, _setLabelPosition:function () {
var _widthFront = dojo.html.getContentBox(this.frontPercentLabel).width;
var _heightFront = dojo.html.getContentBox(this.frontPercentLabel).height;
var _widthBack = dojo.html.getContentBox(this.backPercentLabel).width;
var _heightBack = dojo.html.getContentBox(this.backPercentLabel).height;
var _leftFront = (parseInt(this.width) - _widthFront) / 2 + "px";
var _bottomFront = (parseInt(this.height) - parseInt(_heightFront)) / 2 + "px";
var _leftBack = (parseInt(this.width) - _widthBack) / 2 + "px";
var _bottomBack = (parseInt(this.height) - parseInt(_heightBack)) / 2 + "px";
this.frontPercentLabel.style.left = _leftFront;
this.backPercentLabel.style.left = _leftBack;
this.frontPercentLabel.style.bottom = _bottomFront;
this.backPercentLabel.style.bottom = _bottomBack;
}, _setPercentLabel:function (percentValue) {
dojo.dom.removeChildren(this.frontPercentLabel);
dojo.dom.removeChildren(this.backPercentLabel);
var _percentValue = this.showOnlyIntegers == false ? percentValue : parseInt(percentValue) + "%";
this.frontPercentLabel.appendChild(document.createTextNode(_percentValue));
this.backPercentLabel.appendChild(document.createTextNode(_percentValue));
}, _setPixelValue:function (value) {
eval("this.internalProgress.style." + this._dimension + " = " + value + " + 'px'");
this.onChange();
}, onChange:function () {
}});
 
/trunk/api/js/dojo/src/widget/DateTextbox.js
New file
0,0 → 1,45
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DateTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.date.format");
dojo.require("dojo.validate.datetime");
dojo.widget.defineWidget("dojo.widget.DateTextbox", dojo.widget.ValidationTextbox, {displayFormat:"", formatLength:"short", mixInProperties:function (localProperties) {
dojo.widget.DateTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.format) {
this.flags.format = localProperties.format;
}
}, isValid:function () {
if (this.flags.format) {
dojo.deprecated("dojo.widget.DateTextbox", "format attribute is deprecated; use displayFormat or formatLength instead", "0.5");
return dojo.validate.isValidDate(this.textbox.value, this.flags.format);
}
return dojo.date.parse(this.textbox.value, {formatLength:this.formatLength, selector:"dateOnly", locale:this.lang, datePattern:this.displayFormat});
}});
dojo.widget.defineWidget("dojo.widget.TimeTextbox", dojo.widget.ValidationTextbox, {displayFormat:"", formatLength:"short", mixInProperties:function (localProperties) {
dojo.widget.TimeTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.format) {
this.flags.format = localProperties.format;
}
if (localProperties.amsymbol) {
this.flags.amSymbol = localProperties.amsymbol;
}
if (localProperties.pmsymbol) {
this.flags.pmSymbol = localProperties.pmsymbol;
}
}, isValid:function () {
if (this.flags.format) {
dojo.deprecated("dojo.widget.TimeTextbox", "format attribute is deprecated; use displayFormat or formatLength instead", "0.5");
return dojo.validate.isValidTime(this.textbox.value, this.flags);
}
return dojo.date.parse(this.textbox.value, {formatLength:this.formatLength, selector:"timeOnly", locale:this.lang, timePattern:this.displayFormat});
}});
 
/trunk/api/js/dojo/src/widget/TreeExtension.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeCommon");
dojo.widget.defineWidget("dojo.widget.TreeExtension", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.listenedTrees = {};
}, {});
 
/trunk/api/js/dojo/src/widget/InlineEditBox.js
New file
0,0 → 1,154
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.InlineEditBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.gfx.color");
dojo.require("dojo.string");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.widget.defineWidget("dojo.widget.InlineEditBox", dojo.widget.HtmlWidget, function () {
this.history = [];
}, {templateString:"<form class=\"inlineEditBox\" style=\"display: none\" dojoAttachPoint=\"form\" dojoAttachEvent=\"onSubmit:saveEdit; onReset:cancelEdit; onKeyUp: checkForValueChange;\">\n\t<input type=\"text\" dojoAttachPoint=\"text\" style=\"display: none;\" />\n\t<textarea dojoAttachPoint=\"textarea\" style=\"display: none;\"></textarea>\n\t<input type=\"submit\" value=\"Save\" dojoAttachPoint=\"submitButton\" />\n\t<input type=\"reset\" value=\"Cancel\" dojoAttachPoint=\"cancelButton\" />\n</form>\n", templateCssString:".editLabel {\n\tfont-size : small;\n\tpadding : 0 5px;\n\tdisplay : none;\n}\n\n.editableRegionDisabled {\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion {\n\tbackground-color : #ffc !important;\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion .editLabel {\n\tdisplay : inline;\n}\n\n.editableTextareaRegion .editLabel {\n\tdisplay : block;\n}\n\n.inlineEditBox {\n\t/*background-color : #ffc;*/\n\tdisplay : inline;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/InlineEditBox.css"), mode:"text", name:"", minWidth:100, minHeight:200, editing:false, value:"", textValue:"", defaultText:"", postMixInProperties:function () {
if (this.textValue) {
dojo.deprecated("InlineEditBox: Use value parameter instead of textValue; will be removed in 0.5");
this.value = this.textValue;
}
if (this.defaultText) {
dojo.deprecated("InlineEditBox: Use value parameter instead of defaultText; will be removed in 0.5");
this.value = this.defaultText;
}
}, postCreate:function (args, frag) {
this.editable = this.getFragNodeRef(frag);
dojo.html.insertAfter(this.editable, this.form);
dojo.event.connect(this.editable, "onmouseover", this, "onMouseOver");
dojo.event.connect(this.editable, "onmouseout", this, "onMouseOut");
dojo.event.connect(this.editable, "onclick", this, "_beginEdit");
if (this.value) {
this.editable.innerHTML = this.value;
return;
} else {
this.value = dojo.string.trim(this.editable.innerHTML);
this.editable.innerHTML = this.value;
}
}, onMouseOver:function () {
if (!this.editing) {
if (this.disabled) {
dojo.html.addClass(this.editable, "editableRegionDisabled");
} else {
dojo.html.addClass(this.editable, "editableRegion");
if (this.mode == "textarea") {
dojo.html.addClass(this.editable, "editableTextareaRegion");
}
}
}
}, onMouseOut:function () {
if (!this.editing) {
dojo.html.removeClass(this.editable, "editableRegion");
dojo.html.removeClass(this.editable, "editableTextareaRegion");
dojo.html.removeClass(this.editable, "editableRegionDisabled");
}
}, _beginEdit:function (e) {
if (this.editing || this.disabled) {
return;
}
this.onMouseOut();
this.editing = true;
var ee = this[this.mode.toLowerCase()];
ee.value = dojo.string.trim(this.value);
ee.style.fontSize = dojo.html.getStyle(this.editable, "font-size");
ee.style.fontWeight = dojo.html.getStyle(this.editable, "font-weight");
ee.style.fontStyle = dojo.html.getStyle(this.editable, "font-style");
var bb = dojo.html.getBorderBox(this.editable);
ee.style.width = Math.max(bb.width, this.minWidth) + "px";
if (this.mode.toLowerCase() == "textarea") {
ee.style.display = "block";
ee.style.height = Math.max(bb.height, this.minHeight) + "px";
} else {
ee.style.display = "";
}
this.form.style.display = "";
this.editable.style.display = "none";
ee.focus();
ee.select();
this.submitButton.disabled = true;
}, saveEdit:function (e) {
e.preventDefault();
e.stopPropagation();
var ee = this[this.mode.toLowerCase()];
if ((this.value != ee.value) && (dojo.string.trim(ee.value) != "")) {
this.doFade = true;
this.history.push(this.value);
this.onSave(ee.value, this.value, this.name);
this.value = ee.value;
this.editable.innerHTML = "";
var textNode = document.createTextNode(this.value);
this.editable.appendChild(textNode);
} else {
this.doFade = false;
}
this._finishEdit(e);
}, _stopEditing:function () {
this.editing = false;
this.form.style.display = "none";
this.editable.style.display = "";
return true;
}, cancelEdit:function (e) {
this._stopEditing();
this.onCancel();
return true;
}, _finishEdit:function (e) {
this._stopEditing();
if (this.doFade) {
dojo.lfx.highlight(this.editable, dojo.gfx.color.hex2rgb("#ffc"), 700).play(300);
}
this.doFade = false;
}, setText:function (txt) {
dojo.deprecated("setText() is deprecated, call setValue() instead, will be removed in 0.5");
this.setValue(txt);
}, setValue:function (txt) {
txt = "" + txt;
var tt = dojo.string.trim(txt);
this.value = tt;
this.editable.innerHTML = tt;
}, undo:function () {
if (this.history.length > 0) {
var curValue = this.value;
var value = this.history.pop();
this.editable.innerHTML = value;
this.value = value;
this.onUndo(value);
this.onSave(value, curValue, this.name);
}
}, onChange:function (newValue, oldValue) {
}, onSave:function (newValue, oldValue, name) {
}, onCancel:function () {
}, checkForValueChange:function () {
var ee = this[this.mode.toLowerCase()];
if ((this.value != ee.value) && (dojo.string.trim(ee.value) != "")) {
this.submitButton.disabled = false;
}
this.onChange(this.value, ee.value);
}, disable:function () {
this.submitButton.disabled = true;
this.cancelButton.disabled = true;
var ee = this[this.mode.toLowerCase()];
ee.disabled = true;
dojo.widget.InlineEditBox.superclass.disable.apply(this, arguments);
}, enable:function () {
this.checkForValueChange();
this.cancelButton.disabled = false;
var ee = this[this.mode.toLowerCase()];
ee.disabled = false;
dojo.widget.InlineEditBox.superclass.enable.apply(this, arguments);
}});
 
/trunk/api/js/dojo/src/widget/TreeToggleOnSelect.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeToggleOnSelect");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.TreeToggleOnSelect", dojo.widget.HtmlWidget, {selector:"", controller:"", selectEvent:"select", initialize:function () {
this.selector = dojo.widget.byId(this.selector);
this.controller = dojo.widget.byId(this.controller);
dojo.event.topic.subscribe(this.selector.eventNames[this.selectEvent], this, "onSelectEvent");
}, onSelectEvent:function (message) {
var node = message.node;
node.isExpanded ? this.controller.collapse(node) : this.controller.expand(node);
}});
 
/trunk/api/js/dojo/src/widget/DropdownContainer.js
New file
0,0 → 1,63
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.PopupContainer");
dojo.require("dojo.event.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.html.iframe");
dojo.require("dojo.html.util");
dojo.widget.defineWidget("dojo.widget.DropdownContainer", dojo.widget.HtmlWidget, {inputWidth:"7em", id:"", inputId:"", inputName:"", iconURL:dojo.uri.moduleUri("dojo.widget", "templates/images/combo_box_arrow.png"), copyClasses:false, iconAlt:"", containerToggle:"plain", containerToggleDuration:150, templateString:"<span style=\"white-space:nowrap\"><input type=\"hidden\" name=\"\" value=\"\" dojoAttachPoint=\"valueNode\" /><input name=\"\" type=\"text\" value=\"\" style=\"vertical-align:middle;\" dojoAttachPoint=\"inputNode\" autocomplete=\"off\" /> <img src=\"${this.iconURL}\" alt=\"${this.iconAlt}\" dojoAttachEvent=\"onclick:onIconClick\" dojoAttachPoint=\"buttonNode\" style=\"vertical-align:middle; cursor:pointer; cursor:hand\" /></span>", templateCssPath:"", isContainer:true, attachTemplateNodes:function () {
dojo.widget.DropdownContainer.superclass.attachTemplateNodes.apply(this, arguments);
this.popup = dojo.widget.createWidget("PopupContainer", {toggle:this.containerToggle, toggleDuration:this.containerToggleDuration});
this.containerNode = this.popup.domNode;
}, fillInTemplate:function (args, frag) {
this.domNode.appendChild(this.popup.domNode);
if (this.id) {
this.domNode.id = this.id;
}
if (this.inputId) {
this.inputNode.id = this.inputId;
}
if (this.inputName) {
this.inputNode.name = this.inputName;
}
this.inputNode.style.width = this.inputWidth;
this.inputNode.disabled = this.disabled;
if (this.copyClasses) {
this.inputNode.style = "";
this.inputNode.className = this.getFragNodeRef(frag).className;
}
dojo.event.connect(this.inputNode, "onchange", this, "onInputChange");
}, onIconClick:function (evt) {
if (this.disabled) {
return;
}
if (!this.popup.isShowingNow) {
this.popup.open(this.inputNode, this, this.buttonNode);
} else {
this.popup.close();
}
}, hideContainer:function () {
if (this.popup.isShowingNow) {
this.popup.close();
}
}, onInputChange:function () {
}, enable:function () {
this.inputNode.disabled = false;
dojo.widget.DropdownContainer.superclass.enable.apply(this, arguments);
}, disable:function () {
this.inputNode.disabled = true;
dojo.widget.DropdownContainer.superclass.disable.apply(this, arguments);
}});
 
/trunk/api/js/dojo/src/widget/Rounded.js
New file
0,0 → 1,527
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Rounded");
dojo.widget.tags.addParseTreeHandler("dojo:rounded");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html.style");
dojo.require("dojo.html.display");
dojo.require("dojo.gfx.color");
dojo.deprecated("dojo.widget.Rounded will be removed in version 0.5; you can now apply rounded corners to any block element using dojo.lfx.rounded.", "0.5");
dojo.widget.defineWidget("dojo.widget.Rounded", dojo.widget.ContentPane, {isSafari:dojo.render.html.safari, boxMargin:"50px", radius:14, domNode:"", corners:"TR,TL,BR,BL", antiAlias:true, fillInTemplate:function (args, frag) {
dojo.widget.Rounded.superclass.fillInTemplate.call(this, args, frag);
dojo.html.insertCssFile(this.templateCssPath);
if (this.domNode.style.height <= 0) {
var minHeight = (this.radius * 1) + this.domNode.clientHeight;
this.domNode.style.height = minHeight + "px";
}
if (this.domNode.style.width <= 0) {
var minWidth = (this.radius * 1) + this.domNode.clientWidth;
this.domNode.style.width = minWidth + "px";
}
var cornersAvailable = ["TR", "TL", "BR", "BL"];
var cornersPassed = this.corners.split(",");
this.settings = {antiAlias:this.antiAlias};
var setCorner = function (currentCorner) {
var val = currentCorner.toLowerCase();
if (dojo.lang.inArray(cornersPassed, currentCorner)) {
this.settings[val] = {radius:this.radius, enabled:true};
} else {
this.settings[val] = {radius:0};
}
};
dojo.lang.forEach(cornersAvailable, setCorner, this);
this.domNode.style.margin = this.boxMargin;
this.curvyCorners(this.settings);
this.applyCorners();
}, curvyCorners:function (settings) {
this.box = this.domNode;
this.topContainer = null;
this.bottomContainer = null;
this.masterCorners = [];
var boxHeight = dojo.html.getStyle(this.box, "height");
if (boxHeight == "") {
boxHeight = "0px";
}
var boxWidth = dojo.html.getStyle(this.box, "width");
var borderWidth = dojo.html.getStyle(this.box, "borderTopWidth");
if (borderWidth == "") {
borderWidth = "0px";
}
var borderColour = dojo.html.getStyle(this.box, "borderTopColor");
if (borderWidth > 0) {
this.antiAlias = true;
}
var boxColour = dojo.html.getStyle(this.box, "backgroundColor");
var backgroundImage = dojo.html.getStyle(this.box, "backgroundImage");
var boxPosition = dojo.html.getStyle(this.box, "position");
this.boxHeight = parseInt(((boxHeight != "" && boxHeight != "auto" && boxHeight.indexOf("%") == -1) ? boxHeight.substring(0, boxHeight.indexOf("px")) : this.box.scrollHeight));
this.boxWidth = parseInt(((boxWidth != "" && boxWidth != "auto" && boxWidth.indexOf("%") == -1) ? boxWidth.substring(0, boxWidth.indexOf("px")) : this.box.scrollWidth));
this.borderWidth = parseInt(((borderWidth != "" && borderWidth.indexOf("px") !== -1) ? borderWidth.slice(0, borderWidth.indexOf("px")) : 0));
var test = new dojo.gfx.color.Color(boxColour);
this.boxColour = ((boxColour != "" && boxColour != "transparent") ? ((boxColour.substr(0, 3) == "rgb") ? this.rgb2Hex(boxColour) : boxColour) : "#ffffff");
this.borderColour = ((borderColour != "" && borderColour != "transparent" && this.borderWidth > 0) ? ((borderColour.substr(0, 3) == "rgb") ? this.rgb2Hex(borderColour) : borderColour) : this.boxColour);
this.borderString = this.borderWidth + "px" + " solid " + this.borderColour;
this.backgroundImage = ((backgroundImage != "none") ? backgroundImage : "");
if (boxPosition != "absolute") {
this.box.style.position = "relative";
}
this.applyCorners = function () {
for (var t = 0; t < 2; t++) {
switch (t) {
case 0:
if (this.settings.tl.enabled || this.settings.tr.enabled) {
var newMainContainer = document.createElement("DIV");
with (newMainContainer.style) {
width = "100%";
fontSize = "1px";
overflow = "hidden";
position = "absolute";
paddingLeft = this.borderWidth + "px";
paddingRight = this.borderWidth + "px";
var topMaxRadius = Math.max(this.settings.tl ? this.settings.tl.radius : 0, this.settings.tr ? this.settings.tr.radius : 0);
height = topMaxRadius + "px";
top = 0 - topMaxRadius + "px";
left = 0 - this.borderWidth + "px";
}
this.topContainer = this.box.appendChild(newMainContainer);
}
break;
case 1:
if (this.settings.bl.enabled || this.settings.br.enabled) {
var newMainContainer = document.createElement("DIV");
with (newMainContainer.style) {
width = "100%";
fontSize = "1px";
overflow = "hidden";
position = "absolute";
paddingLeft = this.borderWidth + "px";
paddingRight = this.borderWidth + "px";
var botMaxRadius = Math.max(this.settings.bl ? this.settings.bl.radius : 0, this.settings.br ? this.settings.br.radius : 0);
height = botMaxRadius + "px";
bottom = 0 - botMaxRadius + "px";
left = 0 - this.borderWidth + "px";
}
this.bottomContainer = this.box.appendChild(newMainContainer);
}
break;
}
}
if (this.topContainer) {
this.box.style.borderTopWidth = "0px";
}
if (this.bottomContainer) {
this.box.style.borderBottomWidth = "0px";
}
var corners = ["tr", "tl", "br", "bl"];
for (var i in corners) {
var cc = corners[i];
if (!this.settings[cc]) {
if (((cc == "tr" || cc == "tl") && this.topContainer != null) || ((cc == "br" || cc == "bl") && this.bottomContainer != null)) {
var newCorner = document.createElement("DIV");
newCorner.style.position = "relative";
newCorner.style.fontSize = "1px";
newCorner.style.overflow = "hidden";
if (this.backgroundImage == "") {
newCorner.style.backgroundColor = this.boxColour;
} else {
newCorner.style.backgroundImage = this.backgroundImage;
}
switch (cc) {
case "tl":
with (newCorner.style) {
height = topMaxRadius - this.borderWidth + "px";
marginRight = this.settings.tr.radius - (this.borderWidth * 2) + "px";
borderLeft = this.borderString;
borderTop = this.borderString;
left = -this.borderWidth + "px";
}
break;
case "tr":
with (newCorner.style) {
height = topMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.tl.radius - (this.borderWidth * 2) + "px";
borderRight = this.borderString;
borderTop = this.borderString;
backgroundPosition = "-" + this.boxWidth + "px 0px";
left = this.borderWidth + "px";
}
break;
case "bl":
with (newCorner.style) {
height = botMaxRadius - this.borderWidth + "px";
marginRight = this.settings.br.radius - (this.borderWidth * 2) + "px";
borderLeft = this.borderString;
borderBottom = this.borderString;
left = -this.borderWidth + "px";
}
break;
case "br":
with (newCorner.style) {
height = botMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.bl.radius - (this.borderWidth * 2) + "px";
borderRight = this.borderString;
borderBottom = this.borderString;
left = this.borderWidth + "px";
}
break;
}
}
} else {
if (this.masterCorners[this.settings[cc].radius]) {
var newCorner = this.masterCorners[this.settings[cc].radius].cloneNode(true);
} else {
var newCorner = document.createElement("DIV");
with (newCorner.style) {
height = this.settings[cc].radius + "px";
width = this.settings[cc].radius + "px";
position = "absolute";
fontSize = "1px";
overflow = "hidden";
}
var borderRadius = parseInt(this.settings[cc].radius - this.borderWidth);
for (var intx = 0, j = this.settings[cc].radius; intx < j; intx++) {
if ((intx + 1) >= borderRadius) {
var y1 = -1;
} else {
var y1 = (Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((intx + 1), 2))) - 1);
}
if (borderRadius != j) {
if ((intx) >= borderRadius) {
var y2 = -1;
} else {
var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow(intx, 2)));
}
if ((intx + 1) >= j) {
var y3 = -1;
} else {
var y3 = (Math.floor(Math.sqrt(Math.pow(j, 2) - Math.pow((intx + 1), 2))) - 1);
}
}
if ((intx) >= j) {
var y4 = -1;
} else {
var y4 = Math.ceil(Math.sqrt(Math.pow(j, 2) - Math.pow(intx, 2)));
}
if (y1 > -1) {
this.drawPixel(intx, 0, this.boxColour, 100, (y1 + 1), newCorner, -1, this.settings[cc].radius);
}
if (borderRadius != j) {
if (this.antiAlias) {
for (var inty = (y1 + 1); inty < y2; inty++) {
if (this.backgroundImage != "") {
var borderFract = (this.pixelFraction(intx, inty, borderRadius) * 100);
if (borderFract < 30) {
this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, 0, this.settings[cc].radius);
} else {
this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, -1, this.settings[cc].radius);
}
} else {
var pixelcolour = dojo.gfx.color.blend(this.boxColour, this.borderColour, this.pixelFraction(intx, inty, borderRadius));
this.drawPixel(intx, inty, pixelcolour, 100, 1, newCorner, 0, this.settings[cc].radius);
}
}
}
if (y3 >= y2) {
if (y1 == -1) {
y1 = 0;
}
this.drawPixel(intx, y2, this.borderColour, 100, (y3 - y2 + 1), newCorner, 0, this.settings[cc].radius);
}
var outsideColour = this.borderColour;
} else {
var outsideColour = this.boxColour;
var y3 = y1;
}
if (this.antiAlias) {
for (var inty = (y3 + 1); inty < y4; inty++) {
this.drawPixel(intx, inty, outsideColour, (this.pixelFraction(intx, inty, j) * 100), 1, newCorner, ((this.borderWidth > 0) ? 0 : -1), this.settings[cc].radius);
}
}
}
this.masterCorners[this.settings[cc].radius] = newCorner.cloneNode(true);
}
if (cc != "br") {
for (var t = 0, k = newCorner.childNodes.length; t < k; t++) {
var pixelBar = newCorner.childNodes[t];
var pixelBarTop = parseInt(pixelBar.style.top.substring(0, pixelBar.style.top.indexOf("px")));
var pixelBarLeft = parseInt(pixelBar.style.left.substring(0, pixelBar.style.left.indexOf("px")));
var pixelBarHeight = parseInt(pixelBar.style.height.substring(0, pixelBar.style.height.indexOf("px")));
if (cc == "tl" || cc == "bl") {
pixelBar.style.left = this.settings[cc].radius - pixelBarLeft - 1 + "px";
}
if (cc == "tr" || cc == "tl") {
pixelBar.style.top = this.settings[cc].radius - pixelBarHeight - pixelBarTop + "px";
}
var value;
switch (cc) {
case "tr":
value = (-1 * (Math.abs((this.boxWidth - this.settings[cc].radius + this.borderWidth) + pixelBarLeft) - (Math.abs(this.settings[cc].radius - pixelBarHeight - pixelBarTop - this.borderWidth))));
pixelBar.style.backgroundPosition = value + "px";
break;
case "tl":
value = (-1 * (Math.abs((this.settings[cc].radius - pixelBarLeft - 1) - this.borderWidth) - (Math.abs(this.settings[cc].radius - pixelBarHeight - pixelBarTop - this.borderWidth))));
pixelBar.style.backgroundPosition = value + "px";
break;
case "bl":
value = (-1 * (Math.abs((this.settings[cc].radius - pixelBarLeft - 1) - this.borderWidth) - (Math.abs((this.boxHeight + this.settings[cc].radius + pixelBarTop) - this.borderWidth))));
pixelBar.style.backgroundPosition = value + "px";
break;
}
}
}
}
if (newCorner) {
switch (cc) {
case "tl":
if (newCorner.style.position == "absolute") {
newCorner.style.top = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.left = "0px";
}
if (this.topContainer) {
this.topContainer.appendChild(newCorner);
}
break;
case "tr":
if (newCorner.style.position == "absolute") {
newCorner.style.top = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.right = "0px";
}
if (this.topContainer) {
this.topContainer.appendChild(newCorner);
}
break;
case "bl":
if (newCorner.style.position == "absolute") {
newCorner.style.bottom = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.left = "0px";
}
if (this.bottomContainer) {
this.bottomContainer.appendChild(newCorner);
}
break;
case "br":
if (newCorner.style.position == "absolute") {
newCorner.style.bottom = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.right = "0px";
}
if (this.bottomContainer) {
this.bottomContainer.appendChild(newCorner);
}
break;
}
}
}
var radiusDiff = [];
radiusDiff["t"] = this.settings.tl.enabled && this.settings.tr.enabled ? Math.abs(this.settings.tl.radius - this.settings.tr.radius) : 0;
radiusDiff["b"] = this.settings.bl.enabled && this.settings.br.enabled ? Math.abs(this.settings.bl.radius - this.settings.br.radius) : 0;
for (var z in radiusDiff) {
if (radiusDiff[z]) {
var smallerCornerType = ((this.settings[z + "l"].radius < this.settings[z + "r"].radius) ? z + "l" : z + "r");
var newFiller = document.createElement("DIV");
with (newFiller.style) {
height = radiusDiff[z] + "px";
width = this.settings[smallerCornerType].radius + "px";
position = "absolute";
fontSize = "1px";
overflow = "hidden";
backgroundColor = this.boxColour;
}
switch (smallerCornerType) {
case "tl":
with (newFiller.style) {
bottom = "0px";
left = "0px";
borderLeft = this.borderString;
}
this.topContainer.appendChild(newFiller);
break;
case "tr":
with (newFiller.style) {
bottom = "0px";
right = "0px";
borderRight = this.borderString;
}
this.topContainer.appendChild(newFiller);
break;
case "bl":
with (newFiller.style) {
top = "0px";
left = "0px";
borderLeft = this.borderString;
}
this.bottomContainer.appendChild(newFiller);
break;
case "br":
with (newFiller.style) {
top = "0px";
right = "0px";
borderRight = this.borderString;
}
this.bottomContainer.appendChild(newFiller);
break;
}
}
var newFillerBar = document.createElement("DIV");
with (newFillerBar.style) {
position = "relative";
fontSize = "1px";
overflow = "hidden";
backgroundColor = this.boxColour;
}
switch (z) {
case "t":
if (this.topContainer) {
with (newFillerBar.style) {
height = topMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.tl.radius - this.borderWidth + "px";
marginRight = this.settings.tr.radius - this.borderWidth + "px";
borderTop = this.borderString;
}
this.topContainer.appendChild(newFillerBar);
}
break;
case "b":
if (this.bottomContainer) {
with (newFillerBar.style) {
height = botMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.bl.radius - this.borderWidth + "px";
marginRight = this.settings.br.radius - this.borderWidth + "px";
borderBottom = this.borderString;
}
this.bottomContainer.appendChild(newFillerBar);
}
break;
}
}
};
this.drawPixel = function (intx, inty, colour, transAmount, height, newCorner, image, cornerRadius) {
var pixel = document.createElement("DIV");
pixel.style.height = height + "px";
pixel.style.width = "1px";
pixel.style.position = "absolute";
pixel.style.fontSize = "1px";
pixel.style.overflow = "hidden";
if (image == -1 && this.backgroundImage != "") {
pixel.style.backgroundImage = this.backgroundImage;
pixel.style.backgroundPosition = "-" + (this.boxWidth - (cornerRadius - intx) + this.borderWidth) + "px -" + ((this.boxHeight + cornerRadius + inty) - this.borderWidth) + "px";
} else {
pixel.style.backgroundColor = colour;
}
if (transAmount != 100) {
dojo.html.setOpacity(pixel, transAmount);
}
pixel.style.top = inty + "px";
pixel.style.left = intx + "px";
newCorner.appendChild(pixel);
};
}, pixelFraction:function (x, y, r) {
var pixelfraction = 0;
var xvalues = [];
var yvalues = [];
var point = 0;
var whatsides = "";
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x, 2)));
if ((intersect >= y) && (intersect < (y + 1))) {
whatsides = "Left";
xvalues[point] = 0;
yvalues[point] = intersect - y;
point = point + 1;
}
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y + 1, 2)));
if ((intersect >= x) && (intersect < (x + 1))) {
whatsides = whatsides + "Top";
xvalues[point] = intersect - x;
yvalues[point] = 1;
point = point + 1;
}
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x + 1, 2)));
if ((intersect >= y) && (intersect < (y + 1))) {
whatsides = whatsides + "Right";
xvalues[point] = 1;
yvalues[point] = intersect - y;
point = point + 1;
}
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y, 2)));
if ((intersect >= x) && (intersect < (x + 1))) {
whatsides = whatsides + "Bottom";
xvalues[point] = intersect - x;
yvalues[point] = 0;
}
switch (whatsides) {
case "LeftRight":
pixelfraction = Math.min(yvalues[0], yvalues[1]) + ((Math.max(yvalues[0], yvalues[1]) - Math.min(yvalues[0], yvalues[1])) / 2);
break;
case "TopRight":
pixelfraction = 1 - (((1 - xvalues[0]) * (1 - yvalues[1])) / 2);
break;
case "TopBottom":
pixelfraction = Math.min(xvalues[0], xvalues[1]) + ((Math.max(xvalues[0], xvalues[1]) - Math.min(xvalues[0], xvalues[1])) / 2);
break;
case "LeftBottom":
pixelfraction = (yvalues[0] * xvalues[1]) / 2;
break;
default:
pixelfraction = 1;
}
return pixelfraction;
}, rgb2Hex:function (rgbColour) {
try {
var rgbArray = this.rgb2Array(rgbColour);
var red = parseInt(rgbArray[0]);
var green = parseInt(rgbArray[1]);
var blue = parseInt(rgbArray[2]);
var hexColour = "#" + this.intToHex(red) + this.intToHex(green) + this.intToHex(blue);
}
catch (e) {
alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");
}
return hexColour;
}, intToHex:function (strNum) {
var base = strNum / 16;
var rem = strNum % 16;
var base = base - (rem / 16);
var baseS = this.makeHex(base);
var remS = this.makeHex(rem);
return baseS + "" + remS;
}, makeHex:function (x) {
if ((x >= 0) && (x <= 9)) {
return x;
} else {
switch (x) {
case 10:
return "A";
case 11:
return "B";
case 12:
return "C";
case 13:
return "D";
case 14:
return "E";
case 15:
return "F";
}
}
}, rgb2Array:function (rgbColour) {
var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")"));
var rgbArray = rgbValues.split(", ");
return rgbArray;
}});
 
/trunk/api/js/dojo/src/widget/ShowSlide.js
New file
0,0 → 1,199
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ShowSlide");
dojo.require("dojo.widget.*");
dojo.require("dojo.lang.common");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.lfx.html");
dojo.require("dojo.html.display");
dojo.require("dojo.html.layout");
dojo.require("dojo.animation.Animation");
dojo.require("dojo.gfx.color");
dojo.widget.defineWidget("dojo.widget.ShowSlide", dojo.widget.HtmlWidget, {title:"", _action:-1, isContainer:true, _components:{}, _actions:[], gotoAction:function (action) {
this._action = action;
}, _nextAction:function (event) {
if ((this._action + 1) != this._actions.length) {
++this._action;
return true;
}
return false;
}, _previousAction:function (event) {
if ((this._action - 1) != -1) {
--this._action;
return true;
}
return false;
}, htmlTitle:null, debug:false, noClick:false, templateString:"<div class=\"dojoShowSlide\">\n\t<div class=\"dojoShowSlideTitle\">\n\t\t<h1 dojoAttachPoint=\"htmlTitle\">Title</h1>\n\t</div>\n\t<div class=\"dojoShowSlideBody\" dojoAttachPoint=\"containerNode\"></div>\n</div>\n", templateCssString:".dojoShowSlideTitle {\n\theight: 100px;\n\tbackground: #369;\n}\n.dojoShowSlideTitle h1 {\n\tmargin-top: 0;\n\tline-height: 100px;\n\tmargin-left: 30px;\n}\n.dojoShowSlideBody {\n\tmargin: 15px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ShowSlide.css"), postCreate:function () {
this.htmlTitle.innerHTML = this.title;
var actions = this.getChildrenOfType("ShowAction", false);
var atypes = {};
dojo.lang.forEach(actions, function (act) {
atypes[act.on] = true;
});
this._components = {};
var cn = this.containerNode;
var nodes = dojo.render.html.ie ? cn.all : cn.getElementsByTagName("*");
dojo.lang.forEach(nodes, function (node) {
var as = node.getAttribute("as");
if (as) {
if (!this._components[as]) {
this._components[as] = [];
}
this._components[as].push(node);
if (!atypes[as]) {
var tmpAction = dojo.widget.createWidget("ShowAction", {on:as});
this.addChild(tmpAction);
atypes[as] = true;
}
}
}, this);
this._actions = [];
actions = this.getChildrenOfType("ShowAction", false);
dojo.lang.forEach(actions, function (child) {
this._actions.push(child);
var components = this._components[child.on];
for (var j = 0, component; component = components[j]; j++) {
if (child["action"] && ((child.action != "remove") && (child.action != "fadeout") && (child.action != "wipeout"))) {
this.hideComponent(component);
}
}
}, this);
}, previousAction:function (event) {
if (!this.parent.stopEvent(event)) {
return false;
}
var action = this._actions[this._action];
if (!action) {
return false;
}
var on = action.on;
while (action.on == on) {
var components = this._components[on];
for (var i = 0, component; component = components[i]; i++) {
if ((action.action == "remove") || (action.action == "fadeout") || (action.action == "wipeout")) {
if (component.style.display == "none") {
component.style.display = "";
component.style.visibility = "visible";
var exits = true;
}
dojo.html.setOpacity(component, 1);
} else {
if (action.action) {
this.hideComponent(component);
}
}
}
--this._action;
if (exits) {
return true;
}
if (action.auto == "true") {
on = this._actions[this._action].on;
}
action = this._actions[this._action];
if (!action) {
return false;
}
}
return true;
}, hideComponent:function (component) {
component.style.visibility = "hidden";
component.style.backgroundColor = "transparent";
var parent = component.parentNode;
if ((parent) && (parent.tagName.toLowerCase() == "li")) {
parent.oldType = parent.style.listStyleType;
parent.style.listStyleType = "none";
}
}, nextAction:function (event) {
if (!this.parent.stopEvent(event)) {
return false;
}
if (!this._nextAction(this)) {
return false;
}
var action = this._actions[this._action];
if (!action) {
return false;
}
var tmpAction = action["action"];
var components = this._components[action.on];
for (var i = 0, component; component = components[i]; i++) {
if (tmpAction) {
var duration = action.duration || 1000;
if ((tmpAction == "fade") || (tmpAction == "fadeIn")) {
dojo.html.setOpacity(component, 0);
dojo.lfx.html.fadeShow(component, duration).play(true);
} else {
if (tmpAction == "fadeout") {
dojo.lfx.html.fadeHide(component, duration).play(true);
} else {
if (tmpAction == "fly") {
var width = dojo.html.getMarginBox(component).width;
var position = dojo.html.getAbsolutePosition(component);
component.style.position = "relative";
component.style.left = -(width + position.x) + "px";
dojo.lfx.html.slideBy(component, {top:0, left:(width + position.x)}, duration, -1, this.callWith).play(true);
} else {
if ((tmpAction == "wipe") || (tmpAction == "wipein")) {
dojo.lfx.html.wipeIn(component, duration).play();
} else {
if (tmpAction == "wipeout") {
dojo.lfx.html.wipeOut(component, duration).play();
} else {
if (tmpAction == "color") {
var from = new dojo.gfx.color.Color(action.from).toRgb();
var to = new dojo.gfx.color.Color(action.to).toRgb();
var anim = new dojo.animation.Animation(new dojo.math.curves.Line(from, to), duration, 0);
var node = component;
dojo.event.connect(anim, "onAnimate", function (e) {
node.style.color = "rgb(" + e.coordsAsInts().join(",") + ")";
});
anim.play(true);
} else {
if (tmpAction == "bgcolor") {
dojo.lfx.html.unhighlight(component, action.to, duration).play();
} else {
if (tmpAction == "remove") {
component.style.display = "none";
}
}
}
}
}
}
}
}
if (tmpAction == "hide") {
component.style.visibility = "hidden";
} else {
component.style.visibility = "visible";
}
}
}
action = this._actions[this._action + 1];
if (action && action.auto == "true") {
this.nextAction();
}
return true;
}, callWith:function (node) {
if (!node) {
return;
}
if (dojo.lang.isArray(node)) {
dojo.lang.forEach(node, arguments.callee);
return;
}
var parent = node.parentNode;
if ((parent) && (parent.tagName.toLowerCase() == "li")) {
parent.style.listStyleType = parent.oldType;
}
}});
 
/trunk/api/js/dojo/src/widget/Chart.js
New file
0,0 → 1,231
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Chart");
dojo.require("dojo.widget.*");
dojo.require("dojo.gfx.color");
dojo.require("dojo.gfx.color.hsl");
dojo.declare("dojo.widget.Chart", null, function () {
this.series = [];
}, {isContainer:false, assignColors:function () {
var hue = 30;
var sat = 120;
var lum = 120;
var steps = Math.round(330 / this.series.length);
for (var i = 0; i < this.series.length; i++) {
var c = dojo.gfx.color.hsl2rgb(hue, sat, lum);
if (!this.series[i].color) {
this.series[i].color = dojo.gfx.color.rgb2hex(c[0], c[1], c[2]);
}
hue += steps;
}
}, parseData:function (table) {
var thead = table.getElementsByTagName("thead")[0];
var tbody = table.getElementsByTagName("tbody")[0];
if (!(thead && tbody)) {
dojo.raise("dojo.widget.Chart: supplied table must define a head and a body.");
}
var columns = thead.getElementsByTagName("tr")[0].getElementsByTagName("th");
for (var i = 1; i < columns.length; i++) {
var key = "column" + i;
var label = columns[i].innerHTML;
var plotType = columns[i].getAttribute("plotType") || "line";
var color = columns[i].getAttribute("color");
var ds = new dojo.widget.Chart.DataSeries(key, label, plotType, color);
this.series.push(ds);
}
var rows = tbody.rows;
var xMin = Number.MAX_VALUE, xMax = Number.MIN_VALUE;
var yMin = Number.MAX_VALUE, yMax = Number.MIN_VALUE;
var ignore = ["accesskey", "align", "bgcolor", "class", "colspan", "height", "id", "nowrap", "rowspan", "style", "tabindex", "title", "valign", "width"];
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
var cells = row.cells;
var x = Number.MIN_VALUE;
for (var j = 0; j < cells.length; j++) {
if (j == 0) {
x = parseFloat(cells[j].innerHTML);
xMin = Math.min(xMin, x);
xMax = Math.max(xMax, x);
} else {
var ds = this.series[j - 1];
var y = parseFloat(cells[j].innerHTML);
yMin = Math.min(yMin, y);
yMax = Math.max(yMax, y);
var o = {x:x, value:y};
var attrs = cells[j].attributes;
for (var k = 0; k < attrs.length; k++) {
var attr = attrs.item(k);
var bIgnore = false;
for (var l = 0; l < ignore.length; l++) {
if (attr.nodeName.toLowerCase() == ignore[l]) {
bIgnore = true;
break;
}
}
if (!bIgnore) {
o[attr.nodeName] = attr.nodeValue;
}
}
ds.add(o);
}
}
}
return {x:{min:xMin, max:xMax}, y:{min:yMin, max:yMax}};
}});
dojo.declare("dojo.widget.Chart.DataSeries", null, function (key, label, plotType, color) {
this.id = "DataSeries" + dojo.widget.Chart.DataSeries.count++;
this.key = key;
this.label = label || this.id;
this.plotType = plotType || "line";
this.color = color;
this.values = [];
}, {add:function (v) {
if (v.x == null || v.value == null) {
dojo.raise("dojo.widget.Chart.DataSeries.add: v must have both an 'x' and 'value' property.");
}
this.values.push(v);
}, clear:function () {
this.values = [];
}, createRange:function (len) {
var idx = this.values.length - 1;
var length = (len || this.values.length);
return {"index":idx, "length":length, "start":Math.max(idx - length, 0)};
}, getMean:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
var c = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t += n;
c++;
}
}
t /= Math.max(c, 1);
return t;
}, getMovingAverage:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
var c = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t += n;
c++;
}
}
t /= Math.max(c, 1);
return t;
}, getVariance:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
var s = 0;
var c = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t += n;
s += Math.pow(n, 2);
c++;
}
}
return (s / c) - Math.pow(t / c, 2);
}, getStandardDeviation:function (len) {
return Math.sqrt(this.getVariance(len));
}, getMax:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t = Math.max(n, t);
}
}
return t;
}, getMin:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t = Math.min(n, t);
}
}
return t;
}, getMedian:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var a = [];
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
var b = false;
for (var j = 0; j < a.length && !b; j++) {
if (n == a[j]) {
b = true;
}
}
if (!b) {
a.push(n);
}
}
}
a.sort();
if (a.length > 0) {
return a[Math.ceil(a.length / 2)];
}
return 0;
}, getMode:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var o = {};
var ret = 0;
var m = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
if (!o[this.values[i].value]) {
o[this.values[i].value] = 1;
} else {
o[this.values[i].value]++;
}
}
}
for (var p in o) {
if (m < o[p]) {
m = o[p];
ret = p;
}
}
return parseFloat(ret);
}});
dojo.requireIf(dojo.render.svg.capable, "dojo.widget.svg.Chart");
dojo.requireIf(!dojo.render.svg.capable && dojo.render.vml.capable, "dojo.widget.vml.Chart");
 
/trunk/api/js/dojo/src/widget/TreeLoadingController.js
New file
0,0 → 1,92
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeLoadingController");
dojo.require("dojo.widget.TreeBasicController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeLoadingController", dojo.widget.TreeBasicController, {RPCUrl:"", RPCActionParam:"action", RPCErrorHandler:function (type, obj, evt) {
alert("RPC Error: " + (obj.message || "no message"));
}, preventCache:true, getRPCUrl:function (action) {
if (this.RPCUrl == "local") {
var dir = document.location.href.substr(0, document.location.href.lastIndexOf("/"));
var localUrl = dir + "/" + action;
return localUrl;
}
if (!this.RPCUrl) {
dojo.raise("Empty RPCUrl: can't load");
}
return this.RPCUrl + (this.RPCUrl.indexOf("?") > -1 ? "&" : "?") + this.RPCActionParam + "=" + action;
}, loadProcessResponse:function (node, result, callObj, callFunc) {
if (!dojo.lang.isUndefined(result.error)) {
this.RPCErrorHandler("server", result.error);
return false;
}
var newChildren = result;
if (!dojo.lang.isArray(newChildren)) {
dojo.raise("loadProcessResponse: Not array loaded: " + newChildren);
}
for (var i = 0; i < newChildren.length; i++) {
newChildren[i] = dojo.widget.createWidget(node.widgetType, newChildren[i]);
node.addChild(newChildren[i]);
}
node.state = node.loadStates.LOADED;
if (dojo.lang.isFunction(callFunc)) {
callFunc.apply(dojo.lang.isUndefined(callObj) ? this : callObj, [node, newChildren]);
}
}, getInfo:function (obj) {
return obj.getInfo();
}, runRPC:function (kw) {
var _this = this;
var handle = function (type, data, evt) {
if (kw.lock) {
dojo.lang.forEach(kw.lock, function (t) {
t.unlock();
});
}
if (type == "load") {
kw.load.call(this, data);
} else {
this.RPCErrorHandler(type, data, evt);
}
};
if (kw.lock) {
dojo.lang.forEach(kw.lock, function (t) {
t.lock();
});
}
dojo.io.bind({url:kw.url, handle:dojo.lang.hitch(this, handle), mimetype:"text/json", preventCache:_this.preventCache, sync:kw.sync, content:{data:dojo.json.serialize(kw.params)}});
}, loadRemote:function (node, sync, callObj, callFunc) {
var _this = this;
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
this.runRPC({url:this.getRPCUrl("getChildren"), load:function (result) {
_this.loadProcessResponse(node, result, callObj, callFunc);
}, sync:sync, lock:[node], params:params});
}, expand:function (node, sync, callObj, callFunc) {
if (node.state == node.loadStates.UNCHECKED && node.isFolder) {
this.loadRemote(node, sync, this, function (node, newChildren) {
this.expand(node, sync, callObj, callFunc);
});
return;
}
dojo.widget.TreeBasicController.prototype.expand.apply(this, arguments);
}, doMove:function (child, newParent, index) {
if (newParent.isTreeNode && newParent.state == newParent.loadStates.UNCHECKED) {
this.loadRemote(newParent, true);
}
return dojo.widget.TreeBasicController.prototype.doMove.apply(this, arguments);
}, doCreateChild:function (parent, index, data, callObj, callFunc) {
if (parent.state == parent.loadStates.UNCHECKED) {
this.loadRemote(parent, true);
}
return dojo.widget.TreeBasicController.prototype.doCreateChild.apply(this, arguments);
}});
 
/trunk/api/js/dojo/src/widget/Toolbar.js
New file
0,0 → 1,722
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Toolbar");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.ToolbarContainer", dojo.widget.HtmlWidget, {isContainer:true, templateString:"<div class=\"toolbarContainer\" dojoAttachPoint=\"containerNode\"></div>", templateCssString:".toolbarContainer {\n\tborder-bottom : 0;\n\tbackground-color : #def;\n\tcolor : ButtonText;\n\tfont : Menu;\n\tbackground-image: url(images/toolbar-bg.gif);\n}\n\n.toolbar {\n\tpadding : 2px 4px;\n\tmin-height : 26px;\n\t_height : 26px;\n}\n\n.toolbarItem {\n\tfloat : left;\n\tpadding : 1px 2px;\n\tmargin : 0 2px 1px 0;\n\tcursor : pointer;\n}\n\n.toolbarItem.selected, .toolbarItem.down {\n\tmargin : 1px 1px 0 1px;\n\tpadding : 0px 1px;\n\tborder : 1px solid #bbf;\n\tbackground-color : #fafaff;\n}\n\n.toolbarButton img {\n\tvertical-align : bottom;\n}\n\n.toolbarButton span {\n\tline-height : 16px;\n\tvertical-align : middle;\n}\n\n.toolbarButton.hover {\n\tpadding : 0px 1px;\n\tborder : 1px solid #99c;\n}\n\n.toolbarItem.disabled {\n\topacity : 0.3;\n\tfilter : alpha(opacity=30);\n\tcursor : default;\n}\n\n.toolbarSeparator {\n\tcursor : default;\n}\n\n.toolbarFlexibleSpace {\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Toolbar.css"), getItem:function (name) {
if (name instanceof dojo.widget.ToolbarItem) {
return name;
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
var item = child.getItem(name);
if (item) {
return item;
}
}
}
return null;
}, getItems:function () {
var items = [];
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
items = items.concat(child.getItems());
}
}
return items;
}, enable:function () {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.enable.apply(child, arguments);
}
}
}, disable:function () {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.disable.apply(child, arguments);
}
}
}, select:function (name) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.select(arguments);
}
}
}, deselect:function (name) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.deselect(arguments);
}
}
}, getItemsState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
dojo.lang.mixin(values, child.getItemsState());
}
}
return values;
}, getItemsActiveState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
dojo.lang.mixin(values, child.getItemsActiveState());
}
}
return values;
}, getItemsSelectedState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
dojo.lang.mixin(values, child.getItemsSelectedState());
}
}
return values;
}});
dojo.widget.defineWidget("dojo.widget.Toolbar", dojo.widget.HtmlWidget, {isContainer:true, templateString:"<div class=\"toolbar\" dojoAttachPoint=\"containerNode\" unselectable=\"on\" dojoOnMouseover=\"_onmouseover\" dojoOnMouseout=\"_onmouseout\" dojoOnClick=\"_onclick\" dojoOnMousedown=\"_onmousedown\" dojoOnMouseup=\"_onmouseup\"></div>", _getItem:function (node) {
var start = new Date();
var widget = null;
while (node && node != this.domNode) {
if (dojo.html.hasClass(node, "toolbarItem")) {
var widgets = dojo.widget.manager.getWidgetsByFilter(function (w) {
return w.domNode == node;
});
if (widgets.length == 1) {
widget = widgets[0];
break;
} else {
if (widgets.length > 1) {
dojo.raise("Toolbar._getItem: More than one widget matches the node");
}
}
}
node = node.parentNode;
}
return widget;
}, _onmouseover:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmouseover) {
widget._onmouseover(e);
}
}, _onmouseout:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmouseout) {
widget._onmouseout(e);
}
}, _onclick:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onclick) {
widget._onclick(e);
}
}, _onmousedown:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmousedown) {
widget._onmousedown(e);
}
}, _onmouseup:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmouseup) {
widget._onmouseup(e);
}
}, addChild:function (item, pos, props) {
var widget = dojo.widget.ToolbarItem.make(item, null, props);
var ret = dojo.widget.Toolbar.superclass.addChild.call(this, widget, null, pos, null);
return ret;
}, push:function () {
for (var i = 0; i < arguments.length; i++) {
this.addChild(arguments[i]);
}
}, getItem:function (name) {
if (name instanceof dojo.widget.ToolbarItem) {
return name;
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem && child._name == name) {
return child;
}
}
return null;
}, getItems:function () {
var items = [];
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
items.push(child);
}
}
return items;
}, getItemsState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
values[child._name] = {selected:child._selected, enabled:!child.disabled};
}
}
return values;
}, getItemsActiveState:function () {
var values = this.getItemsState();
for (var item in values) {
values[item] = values[item].enabled;
}
return values;
}, getItemsSelectedState:function () {
var values = this.getItemsState();
for (var item in values) {
values[item] = values[item].selected;
}
return values;
}, enable:function () {
var items = arguments.length ? arguments : this.children;
for (var i = 0; i < items.length; i++) {
var child = this.getItem(items[i]);
if (child instanceof dojo.widget.ToolbarItem) {
child.enable(false, true);
}
}
}, disable:function () {
var items = arguments.length ? arguments : this.children;
for (var i = 0; i < items.length; i++) {
var child = this.getItem(items[i]);
if (child instanceof dojo.widget.ToolbarItem) {
child.disable();
}
}
}, select:function () {
for (var i = 0; i < arguments.length; i++) {
var name = arguments[i];
var item = this.getItem(name);
if (item) {
item.select();
}
}
}, deselect:function () {
for (var i = 0; i < arguments.length; i++) {
var name = arguments[i];
var item = this.getItem(name);
if (item) {
item.disable();
}
}
}, setValue:function () {
for (var i = 0; i < arguments.length; i += 2) {
var name = arguments[i], value = arguments[i + 1];
var item = this.getItem(name);
if (item) {
if (item instanceof dojo.widget.ToolbarItem) {
item.setValue(value);
}
}
}
}});
dojo.widget.defineWidget("dojo.widget.ToolbarItem", dojo.widget.HtmlWidget, {templateString:"<span unselectable=\"on\" class=\"toolbarItem\"></span>", _name:null, getName:function () {
return this._name;
}, setName:function (value) {
return (this._name = value);
}, getValue:function () {
return this.getName();
}, setValue:function (value) {
return this.setName(value);
}, _selected:false, isSelected:function () {
return this._selected;
}, setSelected:function (is, force, preventEvent) {
if (!this._toggleItem && !force) {
return;
}
is = Boolean(is);
if (force || !this.disabled && this._selected != is) {
this._selected = is;
this.update();
if (!preventEvent) {
this._fireEvent(is ? "onSelect" : "onDeselect");
this._fireEvent("onChangeSelect");
}
}
}, select:function (force, preventEvent) {
return this.setSelected(true, force, preventEvent);
}, deselect:function (force, preventEvent) {
return this.setSelected(false, force, preventEvent);
}, _toggleItem:false, isToggleItem:function () {
return this._toggleItem;
}, setToggleItem:function (value) {
this._toggleItem = Boolean(value);
}, toggleSelected:function (force) {
return this.setSelected(!this._selected, force);
}, isEnabled:function () {
return !this.disabled;
}, setEnabled:function (is, force, preventEvent) {
is = Boolean(is);
if (force || this.disabled == is) {
this.disabled = !is;
this.update();
if (!preventEvent) {
this._fireEvent(this.disabled ? "onDisable" : "onEnable");
this._fireEvent("onChangeEnabled");
}
}
return !this.disabled;
}, enable:function (force, preventEvent) {
return this.setEnabled(true, force, preventEvent);
}, disable:function (force, preventEvent) {
return this.setEnabled(false, force, preventEvent);
}, toggleEnabled:function (force, preventEvent) {
return this.setEnabled(this.disabled, force, preventEvent);
}, _icon:null, getIcon:function () {
return this._icon;
}, setIcon:function (value) {
var icon = dojo.widget.Icon.make(value);
if (this._icon) {
this._icon.setIcon(icon);
} else {
this._icon = icon;
}
var iconNode = this._icon.getNode();
if (iconNode.parentNode != this.domNode) {
if (this.domNode.hasChildNodes()) {
this.domNode.insertBefore(iconNode, this.domNode.firstChild);
} else {
this.domNode.appendChild(iconNode);
}
}
return this._icon;
}, _label:"", getLabel:function () {
return this._label;
}, setLabel:function (value) {
var ret = (this._label = value);
if (!this.labelNode) {
this.labelNode = document.createElement("span");
this.domNode.appendChild(this.labelNode);
}
this.labelNode.innerHTML = "";
this.labelNode.appendChild(document.createTextNode(this._label));
this.update();
return ret;
}, update:function () {
if (this.disabled) {
this._selected = false;
dojo.html.addClass(this.domNode, "disabled");
dojo.html.removeClass(this.domNode, "down");
dojo.html.removeClass(this.domNode, "hover");
} else {
dojo.html.removeClass(this.domNode, "disabled");
if (this._selected) {
dojo.html.addClass(this.domNode, "selected");
} else {
dojo.html.removeClass(this.domNode, "selected");
}
}
this._updateIcon();
}, _updateIcon:function () {
if (this._icon) {
if (this.disabled) {
this._icon.disable();
} else {
if (this._cssHover) {
this._icon.hover();
} else {
if (this._selected) {
this._icon.select();
} else {
this._icon.enable();
}
}
}
}
}, _fireEvent:function (evt) {
if (typeof this[evt] == "function") {
var args = [this];
for (var i = 1; i < arguments.length; i++) {
args.push(arguments[i]);
}
this[evt].apply(this, args);
}
}, _onmouseover:function (e) {
if (this.disabled) {
return;
}
dojo.html.addClass(this.domNode, "hover");
this._fireEvent("onMouseOver");
}, _onmouseout:function (e) {
dojo.html.removeClass(this.domNode, "hover");
dojo.html.removeClass(this.domNode, "down");
if (!this._selected) {
dojo.html.removeClass(this.domNode, "selected");
}
this._fireEvent("onMouseOut");
}, _onclick:function (e) {
if (!this.disabled && !this._toggleItem) {
this._fireEvent("onClick");
}
}, _onmousedown:function (e) {
if (e.preventDefault) {
e.preventDefault();
}
if (this.disabled) {
return;
}
dojo.html.addClass(this.domNode, "down");
if (this._toggleItem) {
if (this.parent.preventDeselect && this._selected) {
return;
}
this.toggleSelected();
}
this._fireEvent("onMouseDown");
}, _onmouseup:function (e) {
dojo.html.removeClass(this.domNode, "down");
this._fireEvent("onMouseUp");
}, onClick:function () {
}, onMouseOver:function () {
}, onMouseOut:function () {
}, onMouseDown:function () {
}, onMouseUp:function () {
}, fillInTemplate:function (args, frag) {
if (args.name) {
this._name = args.name;
}
if (args.selected) {
this.select();
}
if (args.disabled) {
this.disable();
}
if (args.label) {
this.setLabel(args.label);
}
if (args.icon) {
this.setIcon(args.icon);
}
if (args.toggleitem || args.toggleItem) {
this.setToggleItem(true);
}
}});
dojo.widget.ToolbarItem.make = function (wh, whIsType, props) {
var item = null;
if (wh instanceof Array) {
item = dojo.widget.createWidget("ToolbarButtonGroup", props);
item.setName(wh[0]);
for (var i = 1; i < wh.length; i++) {
item.addChild(wh[i]);
}
} else {
if (wh instanceof dojo.widget.ToolbarItem) {
item = wh;
} else {
if (wh instanceof dojo.uri.Uri) {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {icon:new dojo.widget.Icon(wh.toString())}));
} else {
if (whIsType) {
item = dojo.widget.createWidget(wh, props);
} else {
if (typeof wh == "string" || wh instanceof String) {
switch (wh.charAt(0)) {
case "|":
case "-":
case "/":
item = dojo.widget.createWidget("ToolbarSeparator", props);
break;
case " ":
if (wh.length == 1) {
item = dojo.widget.createWidget("ToolbarSpace", props);
} else {
item = dojo.widget.createWidget("ToolbarFlexibleSpace", props);
}
break;
default:
if (/\.(gif|jpg|jpeg|png)$/i.test(wh)) {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {icon:new dojo.widget.Icon(wh.toString())}));
} else {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {label:wh.toString()}));
}
}
} else {
if (wh && wh.tagName && /^img$/i.test(wh.tagName)) {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {icon:wh}));
} else {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {label:wh.toString()}));
}
}
}
}
}
}
return item;
};
dojo.widget.defineWidget("dojo.widget.ToolbarButtonGroup", dojo.widget.ToolbarItem, {isContainer:true, templateString:"<span unselectable=\"on\" class=\"toolbarButtonGroup\" dojoAttachPoint=\"containerNode\"></span>", defaultButton:"", postCreate:function () {
for (var i = 0; i < this.children.length; i++) {
this._injectChild(this.children[i]);
}
}, addChild:function (item, pos, props) {
var widget = dojo.widget.ToolbarItem.make(item, null, dojo.lang.mixin(props || {}, {toggleItem:true}));
var ret = dojo.widget.ToolbarButtonGroup.superclass.addChild.call(this, widget, null, pos, null);
this._injectChild(widget);
return ret;
}, _injectChild:function (widget) {
dojo.event.connect(widget, "onSelect", this, "onChildSelected");
dojo.event.connect(widget, "onDeselect", this, "onChildDeSelected");
if (widget._name == this.defaultButton || (typeof this.defaultButton == "number" && this.children.length - 1 == this.defaultButton)) {
widget.select(false, true);
}
}, getItem:function (name) {
if (name instanceof dojo.widget.ToolbarItem) {
return name;
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem && child._name == name) {
return child;
}
}
return null;
}, getItems:function () {
var items = [];
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
items.push(child);
}
}
return items;
}, onChildSelected:function (e) {
this.select(e._name);
}, onChildDeSelected:function (e) {
this._fireEvent("onChangeSelect", this._value);
}, enable:function (force, preventEvent) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
child.enable(force, preventEvent);
if (child._name == this._value) {
child.select(force, preventEvent);
}
}
}
}, disable:function (force, preventEvent) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
child.disable(force, preventEvent);
}
}
}, _value:"", getValue:function () {
return this._value;
}, select:function (name, force, preventEvent) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
if (child._name == name) {
child.select(force, preventEvent);
this._value = name;
} else {
child.deselect(true, true);
}
}
}
if (!preventEvent) {
this._fireEvent("onSelect", this._value);
this._fireEvent("onChangeSelect", this._value);
}
}, setValue:this.select, preventDeselect:false});
dojo.widget.defineWidget("dojo.widget.ToolbarButton", dojo.widget.ToolbarItem, {fillInTemplate:function (args, frag) {
dojo.widget.ToolbarButton.superclass.fillInTemplate.call(this, args, frag);
dojo.html.addClass(this.domNode, "toolbarButton");
if (this._icon) {
this.setIcon(this._icon);
}
if (this._label) {
this.setLabel(this._label);
}
if (!this._name) {
if (this._label) {
this.setName(this._label);
} else {
if (this._icon) {
var src = this._icon.getSrc("enabled").match(/[\/^]([^\.\/]+)\.(gif|jpg|jpeg|png)$/i);
if (src) {
this.setName(src[1]);
}
} else {
this._name = this._widgetId;
}
}
}
}});
dojo.widget.defineWidget("dojo.widget.ToolbarDialog", dojo.widget.ToolbarButton, {fillInTemplate:function (args, frag) {
dojo.widget.ToolbarDialog.superclass.fillInTemplate.call(this, args, frag);
dojo.event.connect(this, "onSelect", this, "showDialog");
dojo.event.connect(this, "onDeselect", this, "hideDialog");
}, showDialog:function (e) {
dojo.lang.setTimeout(dojo.event.connect, 1, document, "onmousedown", this, "deselect");
}, hideDialog:function (e) {
dojo.event.disconnect(document, "onmousedown", this, "deselect");
}});
dojo.widget.defineWidget("dojo.widget.ToolbarMenu", dojo.widget.ToolbarDialog, {});
dojo.widget.ToolbarMenuItem = function () {
};
dojo.widget.defineWidget("dojo.widget.ToolbarSeparator", dojo.widget.ToolbarItem, {templateString:"<span unselectable=\"on\" class=\"toolbarItem toolbarSeparator\"></span>", defaultIconPath:new dojo.uri.moduleUri("dojo.widget", "templates/buttons/sep.gif"), fillInTemplate:function (args, frag, skip) {
dojo.widget.ToolbarSeparator.superclass.fillInTemplate.call(this, args, frag);
this._name = this.widgetId;
if (!skip) {
if (!this._icon) {
this.setIcon(this.defaultIconPath);
}
this.domNode.appendChild(this._icon.getNode());
}
}, _onmouseover:null, _onmouseout:null, _onclick:null, _onmousedown:null, _onmouseup:null});
dojo.widget.defineWidget("dojo.widget.ToolbarSpace", dojo.widget.ToolbarSeparator, {fillInTemplate:function (args, frag, skip) {
dojo.widget.ToolbarSpace.superclass.fillInTemplate.call(this, args, frag, true);
if (!skip) {
dojo.html.addClass(this.domNode, "toolbarSpace");
}
}});
dojo.widget.defineWidget("dojo.widget.ToolbarSelect", dojo.widget.ToolbarItem, {templateString:"<span class=\"toolbarItem toolbarSelect\" unselectable=\"on\"><select dojoAttachPoint=\"selectBox\" dojoOnChange=\"changed\"></select></span>", fillInTemplate:function (args, frag) {
dojo.widget.ToolbarSelect.superclass.fillInTemplate.call(this, args, frag, true);
var keys = args.values;
var i = 0;
for (var val in keys) {
var opt = document.createElement("option");
opt.setAttribute("value", keys[val]);
opt.innerHTML = val;
this.selectBox.appendChild(opt);
}
}, changed:function (e) {
this._fireEvent("onSetValue", this.selectBox.value);
}, setEnabled:function (is, force, preventEvent) {
var ret = dojo.widget.ToolbarSelect.superclass.setEnabled.call(this, is, force, preventEvent);
this.selectBox.disabled = this.disabled;
return ret;
}, _onmouseover:null, _onmouseout:null, _onclick:null, _onmousedown:null, _onmouseup:null});
dojo.widget.Icon = function (enabled, disabled, hovered, selected) {
if (!arguments.length) {
throw new Error("Icon must have at least an enabled state");
}
var states = ["enabled", "disabled", "hovered", "selected"];
var currentState = "enabled";
var domNode = document.createElement("img");
this.getState = function () {
return currentState;
};
this.setState = function (value) {
if (dojo.lang.inArray(states, value)) {
if (this[value]) {
currentState = value;
var img = this[currentState];
if ((dojo.render.html.ie55 || dojo.render.html.ie60) && img.src && img.src.match(/[.]png$/i)) {
domNode.width = img.width || img.offsetWidth;
domNode.height = img.height || img.offsetHeight;
domNode.setAttribute("src", dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif").uri);
domNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src + "',sizingMethod='image')";
} else {
domNode.setAttribute("src", img.src);
}
}
} else {
throw new Error("Invalid state set on Icon (state: " + value + ")");
}
};
this.setSrc = function (state, value) {
if (/^img$/i.test(value.tagName)) {
this[state] = value;
} else {
if (typeof value == "string" || value instanceof String || value instanceof dojo.uri.Uri) {
this[state] = new Image();
this[state].src = value.toString();
}
}
return this[state];
};
this.setIcon = function (icon) {
for (var i = 0; i < states.length; i++) {
if (icon[states[i]]) {
this.setSrc(states[i], icon[states[i]]);
}
}
this.update();
};
this.enable = function () {
this.setState("enabled");
};
this.disable = function () {
this.setState("disabled");
};
this.hover = function () {
this.setState("hovered");
};
this.select = function () {
this.setState("selected");
};
this.getSize = function () {
return {width:domNode.width || domNode.offsetWidth, height:domNode.height || domNode.offsetHeight};
};
this.setSize = function (w, h) {
domNode.width = w;
domNode.height = h;
return {width:w, height:h};
};
this.getNode = function () {
return domNode;
};
this.getSrc = function (state) {
if (state) {
return this[state].src;
}
return domNode.src || "";
};
this.update = function () {
this.setState(currentState);
};
for (var i = 0; i < states.length; i++) {
var arg = arguments[i];
var state = states[i];
this[state] = null;
if (!arg) {
continue;
}
this.setSrc(state, arg);
}
this.enable();
};
dojo.widget.Icon.make = function (a, b, c, d) {
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] instanceof dojo.widget.Icon) {
return arguments[i];
}
}
return new dojo.widget.Icon(a, b, c, d);
};
dojo.widget.defineWidget("dojo.widget.ToolbarColorDialog", dojo.widget.ToolbarDialog, {palette:"7x10", fillInTemplate:function (args, frag) {
dojo.widget.ToolbarColorDialog.superclass.fillInTemplate.call(this, args, frag);
this.dialog = dojo.widget.createWidget("ColorPalette", {palette:this.palette});
this.dialog.domNode.style.position = "absolute";
dojo.event.connect(this.dialog, "onColorSelect", this, "_setValue");
}, _setValue:function (color) {
this._value = color;
this._fireEvent("onSetValue", color);
}, showDialog:function (e) {
dojo.widget.ToolbarColorDialog.superclass.showDialog.call(this, e);
var abs = dojo.html.getAbsolutePosition(this.domNode, true);
var y = abs.y + dojo.html.getBorderBox(this.domNode).height;
this.dialog.showAt(abs.x, y);
}, hideDialog:function (e) {
dojo.widget.ToolbarColorDialog.superclass.hideDialog.call(this, e);
this.dialog.hide();
}});
 
/trunk/api/js/dojo/src/widget/TreeEmphasizeOnSelect.js
New file
0,0 → 1,24
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeEmphasizeOnSelect");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeSelectorV3");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.TreeEmphasizeOnSelect", dojo.widget.HtmlWidget, {selector:"", initialize:function () {
this.selector = dojo.widget.byId(this.selector);
dojo.event.topic.subscribe(this.selector.eventNames.select, this, "onSelect");
dojo.event.topic.subscribe(this.selector.eventNames.deselect, this, "onDeselect");
}, onSelect:function (message) {
message.node.viewEmphasize();
}, onDeselect:function (message) {
message.node.viewUnemphasize();
}});
 
/trunk/api/js/dojo/src/widget/Toggler.js
New file
0,0 → 1,24
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Toggler");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.widget.defineWidget("dojo.widget.Toggler", dojo.widget.HtmlWidget, {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();
}});
 
/trunk/api/js/dojo/src/widget/AccordionContainer.js
New file
0,0 → 1,126
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.AccordionContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.*");
dojo.require("dojo.lfx.html");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.html.layout");
dojo.require("dojo.widget.PageContainer");
dojo.widget.defineWidget("dojo.widget.AccordionContainer", dojo.widget.HtmlWidget, {isContainer:true, labelNodeClass:"label", containerNodeClass:"accBody", duration:250, fillInTemplate:function () {
with (this.domNode.style) {
if (position != "absolute") {
position = "relative";
}
overflow = "hidden";
}
}, addChild:function (widget) {
var child = this._addChild(widget);
this._setSizes();
return child;
}, _addChild:function (widget) {
if (widget.open) {
dojo.deprecated("open parameter deprecated, use 'selected=true' instead will be removed in ", "0.5");
dojo.debug(widget.widgetId + ": open == " + widget.open);
widget.selected = true;
}
if (widget.widgetType != "AccordionPane") {
var wrapper = dojo.widget.createWidget("AccordionPane", {label:widget.label, selected:widget.selected, labelNodeClass:this.labelNodeClass, containerNodeClass:this.containerNodeClass, allowCollapse:this.allowCollapse});
wrapper.addChild(widget);
this.addWidgetAsDirectChild(wrapper);
this.registerChild(wrapper, this.children.length);
return wrapper;
} else {
dojo.html.addClass(widget.containerNode, this.containerNodeClass);
dojo.html.addClass(widget.labelNode, this.labelNodeClass);
this.addWidgetAsDirectChild(widget);
this.registerChild(widget, this.children.length);
return widget;
}
}, postCreate:function () {
var tmpChildren = this.children;
this.children = [];
dojo.html.removeChildren(this.domNode);
dojo.lang.forEach(tmpChildren, dojo.lang.hitch(this, "_addChild"));
this._setSizes();
}, removeChild:function (widget) {
dojo.widget.AccordionContainer.superclass.removeChild.call(this, widget);
this._setSizes();
}, onResized:function () {
this._setSizes();
}, _setSizes:function () {
var totalCollapsedHeight = 0;
var openIdx = 0;
dojo.lang.forEach(this.children, function (child, idx) {
totalCollapsedHeight += child.getLabelHeight();
if (child.selected) {
openIdx = idx;
}
});
var mySize = dojo.html.getContentBox(this.domNode);
var y = 0;
dojo.lang.forEach(this.children, function (child, idx) {
var childCollapsedHeight = child.getLabelHeight();
child.resizeTo(mySize.width, mySize.height - totalCollapsedHeight + childCollapsedHeight);
child.domNode.style.zIndex = idx + 1;
child.domNode.style.position = "absolute";
child.domNode.style.top = y + "px";
y += (idx == openIdx) ? dojo.html.getBorderBox(child.domNode).height : childCollapsedHeight;
});
}, selectChild:function (page) {
dojo.lang.forEach(this.children, function (child) {
child.setSelected(child == page);
});
var y = 0;
var anims = [];
dojo.lang.forEach(this.children, function (child, idx) {
if (child.domNode.style.top != (y + "px")) {
anims.push(dojo.lfx.html.slideTo(child.domNode, {top:y, left:0}, this.duration));
}
y += child.selected ? dojo.html.getBorderBox(child.domNode).height : child.getLabelHeight();
}, this);
dojo.lfx.combine(anims).play();
}});
dojo.widget.defineWidget("dojo.widget.AccordionPane", dojo.widget.HtmlWidget, {label:"", "class":"dojoAccordionPane", labelNodeClass:"label", containerNodeClass:"accBody", selected:false, templateString:"<div dojoAttachPoint=\"domNode\">\n<div dojoAttachPoint=\"labelNode\" dojoAttachEvent=\"onclick: onLabelClick\" class=\"${this.labelNodeClass}\">${this.label}</div>\n<div dojoAttachPoint=\"containerNode\" style=\"overflow: hidden;\" class=\"${this.containerNodeClass}\"></div>\n</div>\n", templateCssString:".dojoAccordionPane .label {\n\tcolor: #000;\n\tfont-weight: bold;\n\tbackground: url(\"images/soriaAccordionOff.gif\") repeat-x top left #85aeec;\n\tborder:1px solid #d9d9d9;\n\tfont-size:0.9em;\n}\n\n.dojoAccordionPane-selected .label {\n\tbackground: url(\"images/soriaAccordionSelected.gif\") repeat-x top left #85aeec;\n\tborder:1px solid #84a3d1;\n}\n\n.dojoAccordionPane .label:hover {\n\tcursor: pointer;\n}\n\n.dojoAccordionPane .accBody {\n\tbackground: #fff;\n\toverflow: auto;\n\tborder:1px solid #84a3d1;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/AccordionPane.css"), isContainer:true, fillInTemplate:function () {
dojo.html.addClass(this.domNode, this["class"]);
dojo.widget.AccordionPane.superclass.fillInTemplate.call(this);
dojo.html.disableSelection(this.labelNode);
this.setSelected(this.selected);
}, setLabel:function (label) {
this.labelNode.innerHTML = label;
}, resizeTo:function (width, height) {
dojo.html.setMarginBox(this.domNode, {width:width, height:height});
var children = [{domNode:this.labelNode, layoutAlign:"top"}, {domNode:this.containerNode, layoutAlign:"client"}];
dojo.widget.html.layout(this.domNode, children);
var childSize = dojo.html.getContentBox(this.containerNode);
this.children[0].resizeTo(childSize.width, childSize.height);
}, getLabelHeight:function () {
return dojo.html.getMarginBox(this.labelNode).height;
}, onLabelClick:function () {
this.parent.selectChild(this);
}, setSelected:function (isSelected) {
this.selected = isSelected;
(isSelected ? dojo.html.addClass : dojo.html.removeClass)(this.domNode, this["class"] + "-selected");
var child = this.children[0];
if (child) {
if (isSelected) {
if (!child.isShowing()) {
child.show();
} else {
child.onShow();
}
} else {
child.onHide();
}
}
}});
dojo.lang.extend(dojo.widget.Widget, {open:false});
 
/trunk/api/js/dojo/src/widget/InternetTextbox.js
New file
0,0 → 1,76
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.InternetTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.validate.web");
dojo.widget.defineWidget("dojo.widget.IpAddressTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties) {
dojo.widget.IpAddressTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.allowdotteddecimal) {
this.flags.allowDottedDecimal = (localProperties.allowdotteddecimal == "true");
}
if (localProperties.allowdottedhex) {
this.flags.allowDottedHex = (localProperties.allowdottedhex == "true");
}
if (localProperties.allowdottedoctal) {
this.flags.allowDottedOctal = (localProperties.allowdottedoctal == "true");
}
if (localProperties.allowdecimal) {
this.flags.allowDecimal = (localProperties.allowdecimal == "true");
}
if (localProperties.allowhex) {
this.flags.allowHex = (localProperties.allowhex == "true");
}
if (localProperties.allowipv6) {
this.flags.allowIPv6 = (localProperties.allowipv6 == "true");
}
if (localProperties.allowhybrid) {
this.flags.allowHybrid = (localProperties.allowhybrid == "true");
}
}, isValid:function () {
return dojo.validate.isIpAddress(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.UrlTextbox", dojo.widget.IpAddressTextbox, {mixInProperties:function (localProperties) {
dojo.widget.UrlTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.scheme) {
this.flags.scheme = (localProperties.scheme == "true");
}
if (localProperties.allowip) {
this.flags.allowIP = (localProperties.allowip == "true");
}
if (localProperties.allowlocal) {
this.flags.allowLocal = (localProperties.allowlocal == "true");
}
if (localProperties.allowcc) {
this.flags.allowCC = (localProperties.allowcc == "true");
}
if (localProperties.allowgeneric) {
this.flags.allowGeneric = (localProperties.allowgeneric == "true");
}
}, isValid:function () {
return dojo.validate.isUrl(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.EmailTextbox", dojo.widget.UrlTextbox, {mixInProperties:function (localProperties) {
dojo.widget.EmailTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.allowcruft) {
this.flags.allowCruft = (localProperties.allowcruft == "true");
}
}, isValid:function () {
return dojo.validate.isEmailAddress(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.EmailListTextbox", dojo.widget.EmailTextbox, {mixInProperties:function (localProperties) {
dojo.widget.EmailListTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.listseparator) {
this.flags.listSeparator = localProperties.listseparator;
}
}, isValid:function () {
return dojo.validate.isEmailAddressList(this.textbox.value, this.flags);
}});
 
/trunk/api/js/dojo/src/widget/TreeCommon.js
New file
0,0 → 1,80
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeCommon");
dojo.require("dojo.widget.*");
dojo.declare("dojo.widget.TreeCommon", null, {listenTreeEvents:[], listenedTrees:{}, listenNodeFilter:null, listenTree:function (tree) {
var _this = this;
if (this.listenedTrees[tree.widgetId]) {
return;
}
dojo.lang.forEach(this.listenTreeEvents, function (event) {
var eventHandler = "on" + event.charAt(0).toUpperCase() + event.substr(1);
dojo.event.topic.subscribe(tree.eventNames[event], _this, eventHandler);
});
var filter;
if (this.listenNodeFilter) {
this.processDescendants(tree, this.listenNodeFilter, this.listenNode, true);
}
this.listenedTrees[tree.widgetId] = true;
}, listenNode:function () {
}, unlistenNode:function () {
}, unlistenTree:function (tree, nodeFilter) {
var _this = this;
if (!this.listenedTrees[tree.widgetId]) {
return;
}
dojo.lang.forEach(this.listenTreeEvents, function (event) {
var eventHandler = "on" + event.charAt(0).toUpperCase() + event.substr(1);
dojo.event.topic.unsubscribe(tree.eventNames[event], _this, eventHandler);
});
if (this.listenNodeFilter) {
this.processDescendants(tree, this.listenNodeFilter, this.unlistenNode, true);
}
delete this.listenedTrees[tree.widgetId];
}, checkPathCondition:function (domElement, condition) {
while (domElement && !domElement.widgetId) {
if (condition.call(null, domElement)) {
return true;
}
domElement = domElement.parentNode;
}
return false;
}, domElement2TreeNode:function (domElement) {
while (domElement && !domElement.widgetId) {
domElement = domElement.parentNode;
}
if (!domElement) {
return null;
}
var widget = dojo.widget.byId(domElement.widgetId);
if (!widget.isTreeNode) {
return null;
}
return widget;
}, processDescendants:function (elem, filter, func, skipFirst) {
var _this = this;
if (!skipFirst) {
if (!filter.call(_this, elem)) {
return;
}
func.call(_this, elem);
}
var stack = [elem];
while (elem = stack.pop()) {
dojo.lang.forEach(elem.children, function (elem) {
if (filter.call(_this, elem)) {
func.call(_this, elem);
stack.push(elem);
}
});
}
}});
 
/trunk/api/js/dojo/src/widget/TreeV3.js
New file
0,0 → 1,133
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeV3");
dojo.require("dojo.widget.TreeWithNode");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeNodeV3");
dojo.widget.defineWidget("dojo.widget.TreeV3", [dojo.widget.HtmlWidget, dojo.widget.TreeWithNode], function () {
this.eventNames = {};
this.DndAcceptTypes = [];
this.actionsDisabled = [];
this.listeners = [];
this.tree = this;
}, {DndMode:"", defaultChildWidget:null, defaultChildTitle:"New Node", eagerWidgetInstantiation:false, eventNamesDefault:{afterTreeCreate:"afterTreeCreate", beforeTreeDestroy:"beforeTreeDestroy", beforeNodeDestroy:"beforeNodeDestroy", afterChangeTree:"afterChangeTree", afterSetFolder:"afterSetFolder", afterUnsetFolder:"afterUnsetFolder", beforeMoveFrom:"beforeMoveFrom", beforeMoveTo:"beforeMoveTo", afterMoveFrom:"afterMoveFrom", afterMoveTo:"afterMoveTo", afterAddChild:"afterAddChild", afterDetach:"afterDetach", afterExpand:"afterExpand", beforeExpand:"beforeExpand", afterSetTitle:"afterSetTitle", afterCollapse:"afterCollapse", beforeCollapse:"beforeCollapse"}, classPrefix:"Tree", style:"", allowAddChildToLeaf:true, unsetFolderOnEmpty:true, DndModes:{BETWEEN:1, ONTO:2}, DndAcceptTypes:"", templateCssString:"/* indent for all tree children excepts root */\n.TreeNode {\n background-image : url('../templates/images/TreeV3/i.gif');\n background-position : top left;\n background-repeat : repeat-y;\n margin-left: 19px;\n zoom: 1;\n}\n.TreeIsRoot {\n margin-left: 0;\n}\n \n/* left vertical line (grid) for all nodes */\n.TreeIsLast {\n background-image: url('../templates/images/TreeV3/i_half.gif');\n background-repeat : no-repeat;\n}\n \n.TreeExpandOpen .TreeExpand {\n background-image: url('../templates/images/TreeV3/expand_minus.gif');\n}\n \n/* closed is higher priority than open */\n.TreeExpandClosed .TreeExpand {\n background-image: url('../templates/images/TreeV3/expand_plus.gif');\n}\n \n/* highest priority */\n.TreeExpandLeaf .TreeExpand {\n background-image: url('../templates/images/TreeV3/expand_leaf.gif');\n}\n\n/* \nshould always override any expand setting, but do not touch children.\nif I add .TreeExpand .TreeExpandLoading same time and put it to top/bottom, then it will take precedence over +- for all descendants or always fail\nso I have to remove TreeExpand and process this one specifically\n*/\n\n.TreeExpandLoading {\n width: 18px;\n height: 18px;\n float: left;\n display: inline;\n background-repeat : no-repeat;\n background-image: url('../templates/images/TreeV3/expand_loading.gif');\n}\n \n.TreeContent {\n min-height: 18px;\n min-width: 18px;\n margin-left:18px;\n cursor: default;\n /* can't make inline - multiline bugs */\n}\n\n.TreeIEContent {\n\theight: 18px;\n}\n \n.TreeExpand {\n width: 18px;\n height: 18px;\n float: left;\n display: inline;\n background-repeat : no-repeat;\n}\n \n/* same style as IE selection */\n.TreeNodeEmphasized {\n background-color: Highlight;\n color: HighlightText;\n}\n \n.TreeContent .RichTextEditable, .TreeContent .RichTextEditable iframe {\n background-color: #ffc;\n color: black;\n}\n\n/* don't use :focus due to opera's lack of support on div's */\n.TreeLabelFocused {\n outline: 1px invert dotted;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeV3.css"), templateString:"<div style=\"${this.style}\">\n</div>", isExpanded:true, isTree:true, createNode:function (data) {
data.tree = this.widgetId;
if (data.widgetName) {
return dojo.widget.createWidget(data.widgetName, data);
} else {
if (this.defaultChildWidget.prototype.createSimple) {
return this.defaultChildWidget.prototype.createSimple(data);
} else {
var ns = this.defaultChildWidget.prototype.ns;
var wt = this.defaultChildWidget.prototype.widgetType;
return dojo.widget.createWidget(ns + ":" + wt, data);
}
}
}, makeNodeTemplate:function () {
var domNode = document.createElement("div");
dojo.html.setClass(domNode, this.classPrefix + "Node " + this.classPrefix + "ExpandLeaf " + this.classPrefix + "ChildrenNo");
this.nodeTemplate = domNode;
var expandNode = document.createElement("div");
var clazz = this.classPrefix + "Expand";
if (dojo.render.html.ie) {
clazz = clazz + " " + this.classPrefix + "IEExpand";
}
dojo.html.setClass(expandNode, clazz);
this.expandNodeTemplate = expandNode;
var labelNode = document.createElement("span");
dojo.html.setClass(labelNode, this.classPrefix + "Label");
this.labelNodeTemplate = labelNode;
var contentNode = document.createElement("div");
var clazz = this.classPrefix + "Content";
if (dojo.render.html.ie && !dojo.render.html.ie70) {
clazz = clazz + " " + this.classPrefix + "IEContent";
}
dojo.html.setClass(contentNode, clazz);
this.contentNodeTemplate = contentNode;
domNode.appendChild(expandNode);
domNode.appendChild(contentNode);
contentNode.appendChild(labelNode);
}, makeContainerNodeTemplate:function () {
var div = document.createElement("div");
div.style.display = "none";
dojo.html.setClass(div, this.classPrefix + "Container");
this.containerNodeTemplate = div;
}, actions:{ADDCHILD:"ADDCHILD"}, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId};
return info;
}, adjustEventNames:function () {
for (var name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
}, adjustDndMode:function () {
var _this = this;
var DndMode = 0;
dojo.lang.forEach(this.DndMode.split(";"), function (elem) {
var mode = _this.DndModes[dojo.string.trim(elem).toUpperCase()];
if (mode) {
DndMode = DndMode | mode;
}
});
this.DndMode = DndMode;
}, destroy:function () {
dojo.event.topic.publish(this.tree.eventNames.beforeTreeDestroy, {source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, initialize:function (args) {
this.domNode.widgetId = this.widgetId;
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
if (!args.defaultChildWidget) {
this.defaultChildWidget = dojo.widget.TreeNodeV3;
} else {
this.defaultChildWidget = dojo.lang.getObjPathValue(args.defaultChildWidget);
}
this.adjustEventNames();
this.adjustDndMode();
this.makeNodeTemplate();
this.makeContainerNodeTemplate();
this.containerNode = this.domNode;
dojo.html.setClass(this.domNode, this.classPrefix + "Container");
var _this = this;
dojo.lang.forEach(this.listeners, function (elem) {
var t = dojo.lang.isString(elem) ? dojo.widget.byId(elem) : elem;
t.listenTree(_this);
});
}, postCreate:function () {
dojo.event.topic.publish(this.eventNames.afterTreeCreate, {source:this});
}, move:function (child, newParent, index) {
if (!child.parent) {
dojo.raise(this.widgetType + ": child can be moved only while it's attached");
}
var oldParent = child.parent;
var oldTree = child.tree;
var oldIndex = child.getParentIndex();
var newTree = newParent.tree;
var newParent = newParent;
var newIndex = index;
var message = {oldParent:oldParent, oldTree:oldTree, oldIndex:oldIndex, newParent:newParent, newTree:newTree, newIndex:newIndex, child:child};
dojo.event.topic.publish(oldTree.eventNames.beforeMoveFrom, message);
dojo.event.topic.publish(newTree.eventNames.beforeMoveTo, message);
this.doMove.apply(this, arguments);
dojo.event.topic.publish(oldTree.eventNames.afterMoveFrom, message);
dojo.event.topic.publish(newTree.eventNames.afterMoveTo, message);
}, doMove:function (child, newParent, index) {
child.doDetach();
newParent.doAddChild(child, index);
}, toString:function () {
return "[" + this.widgetType + " ID:" + this.widgetId + "]";
}});
 
/trunk/api/js/dojo/src/widget/DebugConsole.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DebugConsole");
dojo.require("dojo.widget.Widget");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.widget.defineWidget("dojo.widget.DebugConsole", dojo.widget.FloatingPane, {fillInTemplate:function () {
dojo.widget.DebugConsole.superclass.fillInTemplate.apply(this, arguments);
this.containerNode.id = "debugConsoleClientPane";
djConfig.isDebug = true;
djConfig.debugContainerId = this.containerNode.id;
}});
 
/trunk/api/js/dojo/src/widget/TabContainer.js
New file
0,0 → 1,87
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TabContainer");
dojo.require("dojo.lang.func");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.PageContainer");
dojo.require("dojo.event.*");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.html.layout");
dojo.widget.defineWidget("dojo.widget.TabContainer", dojo.widget.PageContainer, {labelPosition:"top", closeButton:"none", templateString:null, templateString:"<div id=\"${this.widgetId}\" class=\"dojoTabContainer\">\n\t<div dojoAttachPoint=\"tablistNode\"></div>\n\t<div class=\"dojoTabPaneWrapper\" dojoAttachPoint=\"containerNode\" dojoAttachEvent=\"onKey\" waiRole=\"tabpanel\"></div>\n</div>\n", templateCssString:".dojoTabContainer {\n\tposition : relative;\n}\n\n.dojoTabPaneWrapper {\n\tborder : 1px solid #6290d2;\n\t_zoom: 1; /* force IE6 layout mode so top border doesnt disappear */\n\tdisplay: block;\n\tclear: both;\n\toverflow: hidden;\n}\n\n.dojoTabLabels-top {\n\tposition : relative;\n\ttop : 0px;\n\tleft : 0px;\n\toverflow : visible;\n\tmargin-bottom : -1px;\n\twidth : 100%;\n\tz-index: 2;\t/* so the bottom of the tab label will cover up the border of dojoTabPaneWrapper */\n}\n\n.dojoTabNoLayout.dojoTabLabels-top .dojoTab {\n\tmargin-bottom: -1px;\n\t_margin-bottom: 0px; /* IE filter so top border lines up correctly */\n}\n\n.dojoTab {\n\tposition : relative;\n\tfloat : left;\n\tpadding-left : 9px;\n\tborder-bottom : 1px solid #6290d2;\n\tbackground : url(images/tab_left.gif) no-repeat left top;\n\tcursor: pointer;\n\twhite-space: nowrap;\n\tz-index: 3;\n}\n\n.dojoTab div {\n\tdisplay : block;\n\tpadding : 4px 15px 4px 6px;\n\tbackground : url(images/tab_top_right.gif) no-repeat right top;\n\tcolor : #333;\n\tfont-size : 90%;\n}\n\n.dojoTab .close {\n\tdisplay : inline-block;\n\theight : 12px;\n\twidth : 12px;\n\tpadding : 0 12px 0 0;\n\tmargin : 0 -10px 0 10px;\n\tcursor : default;\n\tfont-size: small;\n}\n\n.dojoTab .closeImage {\n\tbackground : url(images/tab_close.gif) no-repeat right top;\n}\n\n.dojoTab .closeHover {\n\tbackground-image : url(images/tab_close_h.gif);\n}\n\n.dojoTab.current {\n\tpadding-bottom : 1px;\n\tborder-bottom : 0;\n\tbackground-position : 0 -150px;\n}\n\n.dojoTab.current div {\n\tpadding-bottom : 5px;\n\tmargin-bottom : -1px;\n\tbackground-position : 100% -150px;\n}\n\n/* bottom tabs */\n\n.dojoTabLabels-bottom {\n\tposition : relative;\n\tbottom : 0px;\n\tleft : 0px;\n\toverflow : visible;\n\tmargin-top : -1px;\n\twidth : 100%;\n\tz-index: 2;\n}\n\n.dojoTabNoLayout.dojoTabLabels-bottom {\n\tposition : relative;\n}\n\n.dojoTabLabels-bottom .dojoTab {\n\tborder-top : 1px solid #6290d2;\n\tborder-bottom : 0;\n\tbackground : url(images/tab_bot_left.gif) no-repeat left bottom;\n}\n\n.dojoTabLabels-bottom .dojoTab div {\n\tbackground : url(images/tab_bot_right.gif) no-repeat right bottom;\n}\n\n.dojoTabLabels-bottom .dojoTab.current {\n\tborder-top : 0;\n\tbackground : url(images/tab_bot_left_curr.gif) no-repeat left bottom;\n}\n\n.dojoTabLabels-bottom .dojoTab.current div {\n\tpadding-top : 4px;\n\tbackground : url(images/tab_bot_right_curr.gif) no-repeat right bottom;\n}\n\n/* right-h tabs */\n\n.dojoTabLabels-right-h {\n\toverflow : visible;\n\tmargin-left : -1px;\n\tz-index: 2;\n}\n\n.dojoTabLabels-right-h .dojoTab {\n\tpadding-left : 0;\n\tborder-left : 1px solid #6290d2;\n\tborder-bottom : 0;\n\tbackground : url(images/tab_bot_right.gif) no-repeat right bottom;\n\tfloat : none;\n}\n\n.dojoTabLabels-right-h .dojoTab div {\n\tpadding : 4px 15px 4px 15px;\n}\n\n.dojoTabLabels-right-h .dojoTab.current {\n\tborder-left : 0;\n\tborder-bottom : 1px solid #6290d2;\n}\n\n/* left-h tabs */\n\n.dojoTabLabels-left-h {\n\toverflow : visible;\n\tmargin-right : -1px;\n\tz-index: 2;\n}\n\n.dojoTabLabels-left-h .dojoTab {\n\tborder-right : 1px solid #6290d2;\n\tborder-bottom : 0;\n\tfloat : none;\n\tbackground : url(images/tab_top_left.gif) no-repeat left top;\n}\n\n.dojoTabLabels-left-h .dojoTab.current {\n\tborder-right : 0;\n\tborder-bottom : 1px solid #6290d2;\n\tpadding-bottom : 0;\n\tbackground : url(images/tab_top_left.gif) no-repeat 0 -150px;\n}\n\n.dojoTabLabels-left-h .dojoTab div {\n\tbackground : 0;\n\tborder-bottom : 1px solid #6290d2;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TabContainer.css"), selectedTab:"", postMixInProperties:function () {
if (this.selectedTab) {
dojo.deprecated("selectedTab deprecated, use selectedChild instead, will be removed in", "0.5");
this.selectedChild = this.selectedTab;
}
if (this.closeButton != "none") {
dojo.deprecated("closeButton deprecated, use closable='true' on each child instead, will be removed in", "0.5");
}
dojo.widget.TabContainer.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
this.tablist = dojo.widget.createWidget("TabController", {id:this.widgetId + "_tablist", labelPosition:this.labelPosition, doLayout:this.doLayout, containerId:this.widgetId}, this.tablistNode);
dojo.widget.TabContainer.superclass.fillInTemplate.apply(this, arguments);
}, postCreate:function (args, frag) {
dojo.widget.TabContainer.superclass.postCreate.apply(this, arguments);
this.onResized();
}, _setupChild:function (tab) {
if (this.closeButton == "tab" || this.closeButton == "pane") {
tab.closable = true;
}
dojo.html.addClass(tab.domNode, "dojoTabPane");
dojo.widget.TabContainer.superclass._setupChild.apply(this, arguments);
}, onResized:function () {
if (!this.doLayout) {
return;
}
var labelAlign = this.labelPosition.replace(/-h/, "");
var children = [{domNode:this.tablist.domNode, layoutAlign:labelAlign}, {domNode:this.containerNode, layoutAlign:"client"}];
dojo.widget.html.layout(this.domNode, children);
if (this.selectedChildWidget) {
var containerSize = dojo.html.getContentBox(this.containerNode);
this.selectedChildWidget.resizeTo(containerSize.width, containerSize.height);
}
}, selectTab:function (tab, callingWidget) {
dojo.deprecated("use selectChild() rather than selectTab(), selectTab() will be removed in", "0.5");
this.selectChild(tab, callingWidget);
}, onKey:function (e) {
if (e.keyCode == e.KEY_UP_ARROW && e.ctrlKey) {
var button = this.correspondingTabButton || this.selectedTabWidget.tabButton;
button.focus();
dojo.event.browser.stopEvent(e);
} else {
if (e.keyCode == e.KEY_DELETE && e.altKey) {
if (this.selectedChildWidget.closable) {
this.closeChild(this.selectedChildWidget);
dojo.event.browser.stopEvent(e);
}
}
}
}, destroy:function () {
this.tablist.destroy();
dojo.widget.TabContainer.superclass.destroy.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.TabController", dojo.widget.PageController, {templateString:"<div wairole='tablist' dojoAttachEvent='onKey'></div>", labelPosition:"top", doLayout:true, "class":"", buttonWidget:"TabButton", postMixInProperties:function () {
if (!this["class"]) {
this["class"] = "dojoTabLabels-" + this.labelPosition + (this.doLayout ? "" : " dojoTabNoLayout");
}
dojo.widget.TabController.superclass.postMixInProperties.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.TabButton", dojo.widget.PageButton, {templateString:"<div class='dojoTab' dojoAttachEvent='onClick'>" + "<div dojoAttachPoint='innerDiv'>" + "<span dojoAttachPoint='titleNode' tabIndex='-1' waiRole='tab'>${this.label}</span>" + "<span dojoAttachPoint='closeButtonNode' class='close closeImage' style='${this.closeButtonStyle}'" + " dojoAttachEvent='onMouseOver:onCloseButtonMouseOver; onMouseOut:onCloseButtonMouseOut; onClick:onCloseButtonClick'></span>" + "</div>" + "</div>", postMixInProperties:function () {
this.closeButtonStyle = this.closeButton ? "" : "display: none";
dojo.widget.TabButton.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
dojo.html.disableSelection(this.titleNode);
dojo.widget.TabButton.superclass.fillInTemplate.apply(this, arguments);
}, onCloseButtonClick:function (evt) {
evt.stopPropagation();
dojo.widget.TabButton.superclass.onCloseButtonClick.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.a11y.TabButton", dojo.widget.TabButton, {imgPath:dojo.uri.moduleUri("dojo.widget", "templates/images/tab_close.gif"), templateString:"<div class='dojoTab' dojoAttachEvent='onClick;onKey'>" + "<div dojoAttachPoint='innerDiv'>" + "<span dojoAttachPoint='titleNode' tabIndex='-1' waiRole='tab'>${this.label}</span>" + "<img class='close' src='${this.imgPath}' alt='[x]' style='${this.closeButtonStyle}'" + " dojoAttachEvent='onClick:onCloseButtonClick'>" + "</div>" + "</div>"});
 
/trunk/api/js/dojo/src/widget/DropdownTimePicker.js
New file
0,0 → 1,154
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DropdownTimePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.TimePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.date.format");
dojo.require("dojo.date.serialize");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.widget", "DropdownTimePicker", null, "ROOT");
dojo.widget.defineWidget("dojo.widget.DropdownTimePicker", dojo.widget.DropdownContainer, {iconURL:dojo.uri.moduleUri("dojo.widget", "templates/images/timeIcon.gif"), formatLength:"short", displayFormat:"", timeFormat:"", saveFormat:"", value:"", name:"", postMixInProperties:function () {
dojo.widget.DropdownTimePicker.superclass.postMixInProperties.apply(this, arguments);
var messages = dojo.i18n.getLocalization("dojo.widget", "DropdownTimePicker", this.lang);
this.iconAlt = messages.selectTime;
if (typeof (this.value) == "string" && this.value.toLowerCase() == "today") {
this.value = new Date();
}
if (this.value && isNaN(this.value)) {
var orig = this.value;
this.value = dojo.date.fromRfc3339(this.value);
if (!this.value) {
var d = dojo.date.format(new Date(), {selector:"dateOnly", datePattern:"yyyy-MM-dd"});
var c = orig.split(":");
for (var i = 0; i < c.length; ++i) {
if (c[i].length == 1) {
c[i] = "0" + c[i];
}
}
orig = c.join(":");
this.value = dojo.date.fromRfc3339(d + "T" + orig);
dojo.deprecated("dojo.widget.DropdownTimePicker", "time attributes must be passed in Rfc3339 format", "0.5");
}
}
if (this.value && !isNaN(this.value)) {
this.value = new Date(this.value);
}
}, fillInTemplate:function () {
dojo.widget.DropdownTimePicker.superclass.fillInTemplate.apply(this, arguments);
var value = "";
if (this.value instanceof Date) {
value = this.value;
} else {
if (this.value) {
var orig = this.value;
var d = dojo.date.format(new Date(), {selector:"dateOnly", datePattern:"yyyy-MM-dd"});
var c = orig.split(":");
for (var i = 0; i < c.length; ++i) {
if (c[i].length == 1) {
c[i] = "0" + c[i];
}
}
orig = c.join(":");
value = dojo.date.fromRfc3339(d + "T" + orig);
}
}
var tpArgs = {widgetContainerId:this.widgetId, lang:this.lang, value:value};
this.timePicker = dojo.widget.createWidget("TimePicker", tpArgs, this.containerNode, "child");
dojo.event.connect(this.timePicker, "onValueChanged", this, "_updateText");
if (this.value) {
this._updateText();
}
this.containerNode.style.zIndex = this.zIndex;
this.containerNode.explodeClassName = "timeContainer";
this.valueNode.name = this.name;
}, getValue:function () {
return this.valueNode.value;
}, getTime:function () {
return this.timePicker.storedTime;
}, setValue:function (rfcDate) {
this.setTime(rfcDate);
}, setTime:function (dateObj) {
var value = "";
if (dateObj instanceof Date) {
value = dateObj;
} else {
if (this.value) {
var orig = this.value;
var d = dojo.date.format(new Date(), {selector:"dateOnly", datePattern:"yyyy-MM-dd"});
var c = orig.split(":");
for (var i = 0; i < c.length; ++i) {
if (c[i].length == 1) {
c[i] = "0" + c[i];
}
}
orig = c.join(":");
value = dojo.date.fromRfc3339(d + "T" + orig);
}
}
this.timePicker.setTime(value);
this._syncValueNode();
}, _updateText:function () {
if (this.timePicker.selectedTime.anyTime) {
this.inputNode.value = "";
} else {
if (this.timeFormat) {
dojo.deprecated("dojo.widget.DropdownTimePicker", "Must use displayFormat attribute instead of timeFormat. See dojo.date.format for specification.", "0.5");
this.inputNode.value = dojo.date.strftime(this.timePicker.time, this.timeFormat, this.lang);
} else {
this.inputNode.value = dojo.date.format(this.timePicker.time, {formatLength:this.formatLength, timePattern:this.displayFormat, selector:"timeOnly", locale:this.lang});
}
}
this._syncValueNode();
this.onValueChanged(this.getTime());
this.hideContainer();
}, onValueChanged:function (dateObj) {
}, onInputChange:function () {
if (this.dateFormat) {
dojo.deprecated("dojo.widget.DropdownTimePicker", "Cannot parse user input. Must use displayFormat attribute instead of dateFormat. See dojo.date.format for specification.", "0.5");
} else {
var input = dojo.string.trim(this.inputNode.value);
if (input) {
var inputTime = dojo.date.parse(input, {formatLength:this.formatLength, timePattern:this.displayFormat, selector:"timeOnly", locale:this.lang});
if (inputTime) {
this.setTime(inputTime);
}
} else {
this.valueNode.value = input;
}
}
if (input) {
this._updateText();
}
}, _syncValueNode:function () {
var time = this.timePicker.time;
var value;
switch (this.saveFormat.toLowerCase()) {
case "rfc":
case "iso":
case "":
value = dojo.date.toRfc3339(time, "timeOnly");
break;
case "posix":
case "unix":
value = Number(time);
break;
default:
value = dojo.date.format(time, {datePattern:this.saveFormat, selector:"timeOnly", locale:this.lang});
}
this.valueNode.value = value;
}, destroy:function (finalize) {
this.timePicker.destroy(finalize);
dojo.widget.DropdownTimePicker.superclass.destroy.apply(this, arguments);
}});
 
/trunk/api/js/dojo/src/widget/Manager.js
New file
0,0 → 1,286
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Manager");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.func");
dojo.require("dojo.event.*");
dojo.widget.manager = new function () {
this.widgets = [];
this.widgetIds = [];
this.topWidgets = {};
var widgetTypeCtr = {};
var renderPrefixCache = [];
this.getUniqueId = function (widgetType) {
var widgetId;
do {
widgetId = widgetType + "_" + (widgetTypeCtr[widgetType] != undefined ? ++widgetTypeCtr[widgetType] : widgetTypeCtr[widgetType] = 0);
} while (this.getWidgetById(widgetId));
return widgetId;
};
this.add = function (widget) {
this.widgets.push(widget);
if (!widget.extraArgs["id"]) {
widget.extraArgs["id"] = widget.extraArgs["ID"];
}
if (widget.widgetId == "") {
if (widget["id"]) {
widget.widgetId = widget["id"];
} else {
if (widget.extraArgs["id"]) {
widget.widgetId = widget.extraArgs["id"];
} else {
widget.widgetId = this.getUniqueId(widget.ns + "_" + widget.widgetType);
}
}
}
if (this.widgetIds[widget.widgetId]) {
dojo.debug("widget ID collision on ID: " + widget.widgetId);
}
this.widgetIds[widget.widgetId] = widget;
};
this.destroyAll = function () {
for (var x = this.widgets.length - 1; x >= 0; x--) {
try {
this.widgets[x].destroy(true);
delete this.widgets[x];
}
catch (e) {
}
}
};
this.remove = function (widgetIndex) {
if (dojo.lang.isNumber(widgetIndex)) {
var tw = this.widgets[widgetIndex].widgetId;
delete this.topWidgets[tw];
delete this.widgetIds[tw];
this.widgets.splice(widgetIndex, 1);
} else {
this.removeById(widgetIndex);
}
};
this.removeById = function (id) {
if (!dojo.lang.isString(id)) {
id = id["widgetId"];
if (!id) {
dojo.debug("invalid widget or id passed to removeById");
return;
}
}
for (var i = 0; i < this.widgets.length; i++) {
if (this.widgets[i].widgetId == id) {
this.remove(i);
break;
}
}
};
this.getWidgetById = function (id) {
if (dojo.lang.isString(id)) {
return this.widgetIds[id];
}
return id;
};
this.getWidgetsByType = function (type) {
var lt = type.toLowerCase();
var getType = (type.indexOf(":") < 0 ? function (x) {
return x.widgetType.toLowerCase();
} : function (x) {
return x.getNamespacedType();
});
var ret = [];
dojo.lang.forEach(this.widgets, function (x) {
if (getType(x) == lt) {
ret.push(x);
}
});
return ret;
};
this.getWidgetsByFilter = function (unaryFunc, onlyOne) {
var ret = [];
dojo.lang.every(this.widgets, function (x) {
if (unaryFunc(x)) {
ret.push(x);
if (onlyOne) {
return false;
}
}
return true;
});
return (onlyOne ? ret[0] : ret);
};
this.getAllWidgets = function () {
return this.widgets.concat();
};
this.getWidgetByNode = function (node) {
var w = this.getAllWidgets();
node = dojo.byId(node);
for (var i = 0; i < w.length; i++) {
if (w[i].domNode == node) {
return w[i];
}
}
return null;
};
this.byId = this.getWidgetById;
this.byType = this.getWidgetsByType;
this.byFilter = this.getWidgetsByFilter;
this.byNode = this.getWidgetByNode;
var knownWidgetImplementations = {};
var widgetPackages = ["dojo.widget"];
for (var i = 0; i < widgetPackages.length; i++) {
widgetPackages[widgetPackages[i]] = true;
}
this.registerWidgetPackage = function (pname) {
if (!widgetPackages[pname]) {
widgetPackages[pname] = true;
widgetPackages.push(pname);
}
};
this.getWidgetPackageList = function () {
return dojo.lang.map(widgetPackages, function (elt) {
return (elt !== true ? elt : undefined);
});
};
this.getImplementation = function (widgetName, ctorObject, mixins, ns) {
var impl = this.getImplementationName(widgetName, ns);
if (impl) {
var ret = ctorObject ? new impl(ctorObject) : new impl();
return ret;
}
};
function buildPrefixCache() {
for (var renderer in dojo.render) {
if (dojo.render[renderer]["capable"] === true) {
var prefixes = dojo.render[renderer].prefixes;
for (var i = 0; i < prefixes.length; i++) {
renderPrefixCache.push(prefixes[i].toLowerCase());
}
}
}
}
var findImplementationInModule = function (lowerCaseWidgetName, module) {
if (!module) {
return null;
}
for (var i = 0, l = renderPrefixCache.length, widgetModule; i <= l; i++) {
widgetModule = (i < l ? module[renderPrefixCache[i]] : module);
if (!widgetModule) {
continue;
}
for (var name in widgetModule) {
if (name.toLowerCase() == lowerCaseWidgetName) {
return widgetModule[name];
}
}
}
return null;
};
var findImplementation = function (lowerCaseWidgetName, moduleName) {
var module = dojo.evalObjPath(moduleName, false);
return (module ? findImplementationInModule(lowerCaseWidgetName, module) : null);
};
this.getImplementationName = function (widgetName, ns) {
var lowerCaseWidgetName = widgetName.toLowerCase();
ns = ns || "dojo";
var imps = knownWidgetImplementations[ns] || (knownWidgetImplementations[ns] = {});
var impl = imps[lowerCaseWidgetName];
if (impl) {
return impl;
}
if (!renderPrefixCache.length) {
buildPrefixCache();
}
var nsObj = dojo.ns.get(ns);
if (!nsObj) {
dojo.ns.register(ns, ns + ".widget");
nsObj = dojo.ns.get(ns);
}
if (nsObj) {
nsObj.resolve(widgetName);
}
impl = findImplementation(lowerCaseWidgetName, nsObj.module);
if (impl) {
return (imps[lowerCaseWidgetName] = impl);
}
nsObj = dojo.ns.require(ns);
if ((nsObj) && (nsObj.resolver)) {
nsObj.resolve(widgetName);
impl = findImplementation(lowerCaseWidgetName, nsObj.module);
if (impl) {
return (imps[lowerCaseWidgetName] = impl);
}
}
dojo.deprecated("dojo.widget.Manager.getImplementationName", "Could not locate widget implementation for \"" + widgetName + "\" in \"" + nsObj.module + "\" registered to namespace \"" + nsObj.name + "\". " + "Developers must specify correct namespaces for all non-Dojo widgets", "0.5");
for (var i = 0; i < widgetPackages.length; i++) {
impl = findImplementation(lowerCaseWidgetName, widgetPackages[i]);
if (impl) {
return (imps[lowerCaseWidgetName] = impl);
}
}
throw new Error("Could not locate widget implementation for \"" + widgetName + "\" in \"" + nsObj.module + "\" registered to namespace \"" + nsObj.name + "\"");
};
this.resizing = false;
this.onWindowResized = function () {
if (this.resizing) {
return;
}
try {
this.resizing = true;
for (var id in this.topWidgets) {
var child = this.topWidgets[id];
if (child.checkSize) {
child.checkSize();
}
}
}
catch (e) {
}
finally {
this.resizing = false;
}
};
if (typeof window != "undefined") {
dojo.addOnLoad(this, "onWindowResized");
dojo.event.connect(window, "onresize", this, "onWindowResized");
}
};
(function () {
var dw = dojo.widget;
var dwm = dw.manager;
var h = dojo.lang.curry(dojo.lang, "hitch", dwm);
var g = function (oldName, newName) {
dw[(newName || oldName)] = h(oldName);
};
g("add", "addWidget");
g("destroyAll", "destroyAllWidgets");
g("remove", "removeWidget");
g("removeById", "removeWidgetById");
g("getWidgetById");
g("getWidgetById", "byId");
g("getWidgetsByType");
g("getWidgetsByFilter");
g("getWidgetsByType", "byType");
g("getWidgetsByFilter", "byFilter");
g("getWidgetByNode", "byNode");
dw.all = function (n) {
var widgets = dwm.getAllWidgets.apply(dwm, arguments);
if (arguments.length > 0) {
return widgets[n];
}
return widgets;
};
g("registerWidgetPackage");
g("getImplementation", "getWidgetImplementation");
g("getImplementationName", "getWidgetImplementationName");
dw.widgets = dwm.widgets;
dw.widgetIds = dwm.widgetIds;
dw.root = dwm.root;
})();
 
/trunk/api/js/dojo/src/widget/RealNumberTextbox.js
New file
0,0 → 1,48
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RealNumberTextbox");
dojo.require("dojo.widget.IntegerTextbox");
dojo.require("dojo.validate.common");
dojo.widget.defineWidget("dojo.widget.RealNumberTextbox", dojo.widget.IntegerTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.RealNumberTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.places) {
this.flags.places = Number(localProperties.places);
}
if ((localProperties.exponent == "true") || (localProperties.exponent == "always")) {
this.flags.exponent = true;
} else {
if ((localProperties.exponent == "false") || (localProperties.exponent == "never")) {
this.flags.exponent = false;
} else {
this.flags.exponent = [true, false];
}
}
if ((localProperties.esigned == "true") || (localProperties.esigned == "always")) {
this.flags.eSigned = true;
} else {
if ((localProperties.esigned == "false") || (localProperties.esigned == "never")) {
this.flags.eSigned = false;
} else {
this.flags.eSigned = [true, false];
}
}
if (localProperties.min) {
this.flags.min = parseFloat(localProperties.min);
}
if (localProperties.max) {
this.flags.max = parseFloat(localProperties.max);
}
}, isValid:function () {
return dojo.validate.isRealNumber(this.textbox.value, this.flags);
}, isInRange:function () {
return dojo.validate.isInRange(this.textbox.value, this.flags);
}});
 
/trunk/api/js/dojo/src/widget/TreeLinkExtension.js
New file
0,0 → 1,44
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeLinkExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeExtension");
dojo.widget.defineWidget("dojo.widget.TreeLinkExtension", dojo.widget.TreeExtension, function () {
this.params = {};
}, {listenTreeEvents:["afterChangeTree"], listenTree:function (tree) {
dojo.widget.TreeCommon.prototype.listenTree.call(this, tree);
var labelNode = tree.labelNodeTemplate;
var newLabel = this.makeALabel();
dojo.html.setClass(newLabel, dojo.html.getClass(labelNode));
labelNode.parentNode.replaceChild(newLabel, labelNode);
}, makeALabel:function () {
var newLabel = document.createElement("a");
for (var key in this.params) {
if (key in {}) {
continue;
}
newLabel.setAttribute(key, this.params[key]);
}
return newLabel;
}, onAfterChangeTree:function (message) {
var _this = this;
if (!message.oldTree) {
this.listenNode(message.node);
}
}, listenNode:function (node) {
for (var key in node.object) {
if (key in {}) {
continue;
}
node.labelNode.setAttribute(key, node.object[key]);
}
}});
 
/trunk/api/js/dojo/src/widget/ResizeHandle.js
New file
0,0 → 1,66
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ResizeHandle");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.event.*");
dojo.widget.defineWidget("dojo.widget.ResizeHandle", dojo.widget.HtmlWidget, {targetElmId:"", templateCssString:".dojoHtmlResizeHandle {\n\tfloat: right;\n\tposition: absolute;\n\tright: 2px;\n\tbottom: 2px;\n\twidth: 13px;\n\theight: 13px;\n\tz-index: 20;\n\tcursor: nw-resize;\n\tbackground-image: url(grabCorner.gif);\n\tline-height: 0px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ResizeHandle.css"), templateString:"<div class=\"dojoHtmlResizeHandle\"><div></div></div>", postCreate:function () {
dojo.event.connect(this.domNode, "onmousedown", this, "_beginSizing");
}, _beginSizing:function (e) {
if (this._isSizing) {
return false;
}
this.targetWidget = dojo.widget.byId(this.targetElmId);
this.targetDomNode = this.targetWidget ? this.targetWidget.domNode : dojo.byId(this.targetElmId);
if (!this.targetDomNode) {
return;
}
this._isSizing = true;
this.startPoint = {"x":e.clientX, "y":e.clientY};
var mb = dojo.html.getMarginBox(this.targetDomNode);
this.startSize = {"w":mb.width, "h":mb.height};
dojo.event.kwConnect({srcObj:dojo.body(), srcFunc:"onmousemove", targetObj:this, targetFunc:"_changeSizing", rate:25});
dojo.event.connect(dojo.body(), "onmouseup", this, "_endSizing");
e.preventDefault();
}, _changeSizing:function (e) {
try {
if (!e.clientX || !e.clientY) {
return;
}
}
catch (e) {
return;
}
var dx = this.startPoint.x - e.clientX;
var dy = this.startPoint.y - e.clientY;
var newW = this.startSize.w - dx;
var newH = this.startSize.h - dy;
if (this.minSize) {
var mb = dojo.html.getMarginBox(this.targetDomNode);
if (newW < this.minSize.w) {
newW = mb.width;
}
if (newH < this.minSize.h) {
newH = mb.height;
}
}
if (this.targetWidget) {
this.targetWidget.resizeTo(newW, newH);
} else {
dojo.html.setMarginBox(this.targetDomNode, {width:newW, height:newH});
}
e.preventDefault();
}, _endSizing:function (e) {
dojo.event.disconnect(dojo.body(), "onmousemove", this, "_changeSizing");
dojo.event.disconnect(dojo.body(), "onmouseup", this, "_endSizing");
this._isSizing = false;
}});
 
/trunk/api/js/dojo/src/widget/Select.js
New file
0,0 → 1,37
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Select");
dojo.require("dojo.widget.ComboBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.html.stabile");
dojo.widget.defineWidget("dojo.widget.Select", dojo.widget.ComboBox, {forceValidOption:true, setValue:function (value) {
this.comboBoxValue.value = value;
dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
this.onValueChanged(value);
}, setLabel:function (value) {
this.comboBoxSelectionValue.value = value;
if (this.textInputNode.value != value) {
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.setLabel(value1);
this.setValue(value2);
}});
 
/trunk/api/js/dojo/src/widget/TreeRpcControllerV3.js
New file
0,0 → 1,180
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeRpcControllerV3");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeLoadingControllerV3");
dojo.widget.defineWidget("dojo.widget.TreeRpcControllerV3", dojo.widget.TreeLoadingControllerV3, {extraRpcOnEdit:false, doMove:function (child, newParent, index, sync) {
var params = {child:this.getInfo(child), childTree:this.getInfo(child.tree), oldParent:this.getInfo(child.parent), oldParentTree:this.getInfo(child.parent.tree), newParent:this.getInfo(newParent), newParentTree:this.getInfo(newParent.tree), newIndex:index};
var deferred = this.runRpc({url:this.getRpcUrl("move"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doMove.apply(_this, args);
});
return deferred;
}, prepareDetach:function (node, sync) {
var deferred = this.startProcessing(node);
return deferred;
}, finalizeDetach:function (node) {
this.finishProcessing(node);
}, doDetach:function (node, sync) {
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("detach"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doDetach.apply(_this, args);
});
return deferred;
}, requestEditConfirmation:function (node, action, sync) {
if (!this.extraRpcOnEdit) {
return dojo.Deferred.prototype.makeCalled();
}
var _this = this;
var deferred = this.startProcessing(node);
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
deferred.addCallback(function () {
return _this.runRpc({url:_this.getRpcUrl(action), sync:sync, params:params});
});
deferred.addBoth(function (r) {
_this.finishProcessing(node);
return r;
});
return deferred;
}, editLabelSave:function (node, newContent, sync) {
var deferred = this.startProcessing(node);
var _this = this;
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree), newContent:newContent};
deferred.addCallback(function () {
return _this.runRpc({url:_this.getRpcUrl("editLabelSave"), sync:sync, params:params});
});
deferred.addBoth(function (r) {
_this.finishProcessing(node);
return r;
});
return deferred;
}, editLabelStart:function (node, sync) {
if (!this.canEditLabel(node)) {
return false;
}
var _this = this;
if (!this.editor.isClosed()) {
var deferred = this.editLabelFinish(this.editor.saveOnBlur, sync);
deferred.addCallback(function () {
return _this.editLabelStart(node, sync);
});
return deferred;
}
var deferred = this.requestEditConfirmation(node, "editLabelStart", sync);
deferred.addCallback(function () {
_this.doEditLabelStart(node);
});
return deferred;
}, editLabelFinish:function (save, sync) {
var _this = this;
var node = this.editor.node;
var deferred = dojo.Deferred.prototype.makeCalled();
if (!save && !node.isPhantom) {
deferred = this.requestEditConfirmation(this.editor.node, "editLabelFinishCancel", sync);
}
if (save) {
if (node.isPhantom) {
deferred = this.sendCreateChildRequest(node.parent, node.getParentIndex(), {title:this.editor.getContents()}, sync);
} else {
deferred = this.editLabelSave(node, this.editor.getContents(), sync);
}
}
deferred.addCallback(function (server_data) {
_this.doEditLabelFinish(save, server_data);
});
deferred.addErrback(function (r) {
_this.doEditLabelFinish(false);
return false;
});
return deferred;
}, createAndEdit:function (parent, index, sync) {
var data = {title:parent.tree.defaultChildTitle};
if (!this.canCreateChild(parent, index, data)) {
return false;
}
if (!this.editor.isClosed()) {
var deferred = this.editLabelFinish(this.editor.saveOnBlur, sync);
deferred.addCallback(function () {
return _this.createAndEdit(parent, index, sync);
});
return deferred;
}
var _this = this;
var deferred = this.prepareCreateChild(parent, index, data, sync);
deferred.addCallback(function () {
var child = _this.makeDefaultNode(parent, index);
child.isPhantom = true;
return child;
});
deferred.addBoth(function (r) {
_this.finalizeCreateChild(parent, index, data, sync);
return r;
});
deferred.addCallback(function (child) {
var d = _this.exposeCreateChild(parent, index, data, sync);
d.addCallback(function () {
return child;
});
return d;
});
deferred.addCallback(function (child) {
_this.doEditLabelStart(child);
return child;
});
return deferred;
}, prepareDestroyChild:function (node, sync) {
var deferred = this.startProcessing(node);
return deferred;
}, finalizeDestroyChild:function (node) {
this.finishProcessing(node);
}, doDestroyChild:function (node, sync) {
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("destroyChild"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doDestroyChild.apply(_this, args);
});
return deferred;
}, sendCreateChildRequest:function (parent, index, data, sync) {
var params = {tree:this.getInfo(parent.tree), parent:this.getInfo(parent), index:index, data:data};
var deferred = this.runRpc({url:this.getRpcUrl("createChild"), sync:sync, params:params});
return deferred;
}, doCreateChild:function (parent, index, data, sync) {
if (dojo.lang.isUndefined(data.title)) {
data.title = parent.tree.defaultChildTitle;
}
var deferred = this.sendCreateChildRequest(parent, index, data, sync);
var _this = this;
var args = arguments;
deferred.addCallback(function (server_data) {
dojo.lang.mixin(data, server_data);
return dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(_this, parent, index, data);
});
return deferred;
}, doClone:function (child, newParent, index, deep, sync) {
var params = {child:this.getInfo(child), oldParent:this.getInfo(child.parent), oldParentTree:this.getInfo(child.parent.tree), newParent:this.getInfo(newParent), newParentTree:this.getInfo(newParent.tree), index:index, deep:deep ? true : false, tree:this.getInfo(child.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("clone"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doClone.apply(_this, args);
});
return deferred;
}});
 
/trunk/api/js/dojo/src/widget/SwtWidget.js
New file
0,0 → 1,52
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SwtWidget");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.SwtWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.Widget");
dojo.require("dojo.uri.*");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.extras");
try {
importPackage(Packages.org.eclipse.swt.widgets);
dojo.declare("dojo.widget.SwtWidget", dojo.widget.Widget, function () {
if ((arguments.length > 0) && (typeof arguments[0] == "object")) {
this.create(arguments[0]);
}
}, {display:null, shell:null, show:function () {
}, hide:function () {
}, addChild:function () {
}, registerChild:function () {
}, addWidgetAsDirectChild:function () {
}, removeChild:function () {
}, destroyRendering:function () {
}, postInitialize:function () {
}});
dojo.widget.SwtWidget.prototype.display = new Display();
dojo.widget.SwtWidget.prototype.shell = new Shell(dojo.widget.SwtWidget.prototype.display);
dojo.widget.manager.startShell = function () {
var sh = dojo.widget.SwtWidget.prototype.shell;
var d = dojo.widget.SwtWidget.prototype.display;
sh.open();
while (!sh.isDisposed()) {
dojo.widget.manager.doNext();
if (!d.readAndDispatch()) {
d.sleep();
}
}
d.dispose();
};
}
catch (e) {
dojo.debug("dojo.widget.SwtWidget not loaded. SWT classes not available");
}
 
/trunk/api/js/dojo/src/widget/Slider.js
New file
0,0 → 1,473
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Slider");
dojo.require("dojo.event.*");
dojo.require("dojo.dnd.*");
dojo.require("dojo.dnd.HtmlDragMove");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.widget.defineWidget("dojo.widget.Slider", dojo.widget.HtmlWidget, {minimumX:0, minimumY:0, maximumX:10, maximumY:10, snapValuesX:0, snapValuesY:0, _snapToGrid:true, isEnableX:true, isEnableY:true, _valueSizeX:0, _valueSizeY:0, _minX:0, _minY:0, _constraintWidth:0, _constraintHeight:0, _clipLeft:0, _clipRight:0, _clipTop:0, _clipBottom:0, _clipXdelta:0, _clipYdelta:0, initialValueX:0, initialValueY:0, flipX:false, flipY:false, clickSelect:true, activeDrag:false, templateCssString:".sliderMain {\n border: 0px !important;\n border-spacing: 0px !important;\n line-height: 0px !important;\n padding: 0px !important;\n display: -moz-inline-table !important;\n display: inline !important;\n -moz-user-focus: normal !important;\n}\n\n.sliderComponent {\n border: 0px;\n padding: 0px;\n margin: 0px;\n}\n\n.sliderHandle { \n top: 0px;\n left: 0px;\n z-index: 1000;\n position: absolute !important;\n}\n\n.sliderOutsetButton { \n border-style: outset;\n border-width: 0px 1px 1px 0px;\n border-color: black;\n}\n\n.sliderInsetButton { \n border-style: inset;\n border-width: 1px 0px 0px 1px;\n border-color: black;\n}\n\n.sliderButtonY {\n margin: 0px;\n padding: 0px;\n z-index: 900;\n}\n\n.sliderButtonX {\n margin: 0px;\n padding: 0px;\n z-index: 900;\n}\n\n.sliderBackground { \n z-index: 0;\n display: block !important;\n position: relative !important;\n}\n\n.sliderProgressBackground { \n z-index: 800;\n position: absolute !important;\n clip: rect(0px,0px,0px,0px);\n}\n\n.sliderBackgroundSizeOnly { \n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Slider.css"), templateString:"<table _=\"weird end tag formatting is to prevent whitespace from becoming &nbsp;\" \n\tclass=\"sliderMain\" \n\tdojoAttachPoint=\"focusNode\" \n\tdojoAttachEvent=\"onmousedown:_setFocus; onkey:_handleKeyEvents; onkeyup:_buttonReleased; onmouseup:_buttonReleased; onmousewheel:_mouseWheeled;\"\n\ttabindex=\"0\" cols=3 cellpadding=0 cellspacing=0 style=\"\">\n\t<tr valign=middle align=center>\n\t\t<td class=\"sliderComponent\" colspan=3 dojoAttachPoint=topBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonY\"\n\t\t\t\tdojoAttachPoint=topButtonNode \n\t\t\t\tdojoAttachEvent=\"onmousedown:_topButtonPressed; onmousemove:_discardEvent; ondblclick:_topButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.topButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleY}\"\n\t\t></td>\n\t</tr>\n\t<tr valign=middle align=center>\n\t\t<td class=\"sliderComponent\" dojoAttachPoint=leftBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonX\"\n\t\t\t\tdojoAttachPoint=leftButtonNode\n\t\t\t\tdojoAttachEvent=\"onmousedown:_leftButtonPressed; onmousemove:_discardEvent; ondblclick:_leftButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.leftButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleX}\"\n\t\t></td>\n\t\t<td dojoAttachPoint=constrainingContainerNode \n\t\t\tclass=\"sliderComponent sliderBackground\"\n\t\t\tstyle=\"${this.backgroundStyle}\"\n\t\t\t><img src=\"${this.handleSrc}\" \n\t\t\t\tclass=sliderHandle\n\t\t\t\tdojoAttachPoint=sliderHandleNode\n\t\t\t\tstyle=\"${this.handleStyle}\"\n\t\t\t><img src=\"${this.progressBackgroundSrc}\"\n\t\t\t\tclass=\"sliderBackgroundSizeOnly sliderProgressBackground\"\n\t\t\t\tdojoAttachPoint=progressBackgroundNode\n\t\t\t\tstyle=\"${this.backgroundSize}\"\n\t\t\t><img src=\"${this.backgroundSrc}\" \n\t\t\t\tclass=sliderBackgroundSizeOnly\n\t\t\t\tdojoAttachPoint=sliderBackgroundNode\n\t\t\t\tstyle=\"${this.backgroundSize}\"\n\t\t></td>\n\t\t<td class=\"sliderComponent\" dojoAttachPoint=rightBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonX\"\n\t\t\t\tdojoAttachPoint=rightButtonNode\n\t\t\t\tdojoAttachEvent=\"onmousedown:_rightButtonPressed; onmousemove:_discardEvent; ondblclick:_rightButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.rightButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleX}\"\n\t\t></td>\n\t</tr>\n\t<tr valign=middle align=center>\n\t\t<td class=\"sliderComponent\" colspan=3 dojoAttachPoint=bottomBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonY\"\n\t\t\t\tdojoAttachPoint=bottomButtonNode \n\t\t\t\tdojoAttachEvent=\"onmousedown:_bottomButtonPressed; onmousemove:_discardEvent; ondblclick:_bottomButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.bottomButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleY}\"\n\t\t></td>\n\t</tr>\n</table>\n", _isDragInProgress:false, bottomButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_down_arrow.png"), topButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_up_arrow.png"), leftButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_left_arrow.png"), rightButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_right_arrow.png"), backgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), progressBackgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), backgroundSize:"width:200px;height:200px;", backgroundStyle:"", buttonStyleX:"", buttonStyleY:"", handleStyle:"", handleSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider-button.png"), showButtons:true, _eventCount:0, _typamaticTimer:null, _typamaticFunction:null, defaultTimeout:500, timeoutChangeRate:0.9, _currentTimeout:this.defaultTimeout, _handleKeyEvents:function (evt) {
if (!evt.key) {
return;
}
if (!evt.ctrlKey && !evt.altKey) {
switch (evt.key) {
case evt.KEY_LEFT_ARROW:
dojo.event.browser.stopEvent(evt);
this._leftButtonPressed(evt);
return;
case evt.KEY_RIGHT_ARROW:
dojo.event.browser.stopEvent(evt);
this._rightButtonPressed(evt);
return;
case evt.KEY_DOWN_ARROW:
dojo.event.browser.stopEvent(evt);
this._bottomButtonPressed(evt);
return;
case evt.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
this._topButtonPressed(evt);
return;
}
}
this._eventCount++;
}, _pressButton:function (buttonNode) {
buttonNode.className = buttonNode.className.replace("Outset", "Inset");
}, _releaseButton:function (buttonNode) {
buttonNode.className = buttonNode.className.replace("Inset", "Outset");
}, _buttonPressed:function (evt, buttonNode) {
this._setFocus();
if (typeof evt == "object") {
if (this._typamaticTimer != null) {
if (this._typamaticNode == buttonNode) {
return;
}
clearTimeout(this._typamaticTimer);
}
this._buttonReleased(null);
this._eventCount++;
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
dojo.event.browser.stopEvent(evt);
} else {
if (evt != this._eventCount) {
this._buttonReleased(null);
return false;
}
}
if (buttonNode == this.leftButtonNode && this.isEnableX) {
this._snapX(dojo.html.getPixelValue(this.sliderHandleNode, "left") - this._valueSizeX);
} else {
if (buttonNode == this.rightButtonNode && this.isEnableX) {
this._snapX(dojo.html.getPixelValue(this.sliderHandleNode, "left") + this._valueSizeX);
} else {
if (buttonNode == this.topButtonNode && this.isEnableY) {
this._snapY(dojo.html.getPixelValue(this.sliderHandleNode, "top") - this._valueSizeY);
} else {
if (buttonNode == this.bottomButtonNode && this.isEnableY) {
this._snapY(dojo.html.getPixelValue(this.sliderHandleNode, "top") + this._valueSizeY);
} else {
return false;
}
}
}
}
this._pressButton(buttonNode);
this.notifyListeners();
this._typamaticNode = buttonNode;
this._typamaticTimer = dojo.lang.setTimeout(this, "_buttonPressed", this._currentTimeout, this._eventCount, buttonNode);
this._currentTimeout = Math.round(this._currentTimeout * this.timeoutChangeRate);
return false;
}, _bottomButtonPressed:function (evt) {
return this._buttonPressed(evt, this.bottomButtonNode);
}, _bottomButtonDoubleClicked:function (evt) {
var rc = this._bottomButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _topButtonPressed:function (evt) {
return this._buttonPressed(evt, this.topButtonNode);
}, _topButtonDoubleClicked:function (evt) {
var rc = this._topButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _leftButtonPressed:function (evt) {
return this._buttonPressed(evt, this.leftButtonNode);
}, _leftButtonDoubleClicked:function (evt) {
var rc = this._leftButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _rightButtonPressed:function (evt) {
return this._buttonPressed(evt, this.rightButtonNode);
}, _rightButtonDoubleClicked:function (evt) {
var rc = this._rightButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _buttonReleased:function (evt) {
if (typeof evt == "object" && evt != null && typeof evt.keyCode != "undefined" && evt.keyCode != null) {
var keyCode = evt.keyCode;
switch (keyCode) {
case evt.KEY_LEFT_ARROW:
case evt.KEY_RIGHT_ARROW:
case evt.KEY_DOWN_ARROW:
case evt.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
break;
}
}
this._releaseButton(this.topButtonNode);
this._releaseButton(this.bottomButtonNode);
this._releaseButton(this.leftButtonNode);
this._releaseButton(this.rightButtonNode);
this._eventCount++;
if (this._typamaticTimer != null) {
clearTimeout(this._typamaticTimer);
}
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
}, _mouseWheeled:function (evt) {
var scrollAmount = 0;
if (typeof evt.wheelDelta == "number") {
scrollAmount = evt.wheelDelta;
} else {
if (typeof evt.detail == "number") {
scrollAmount = -evt.detail;
}
}
if (this.isEnableY) {
if (scrollAmount > 0) {
this._topButtonPressed(evt);
this._buttonReleased(evt);
} else {
if (scrollAmount < 0) {
this._bottomButtonPressed(evt);
this._buttonReleased(evt);
}
}
} else {
if (this.isEnableX) {
if (scrollAmount > 0) {
this._rightButtonPressed(evt);
this._buttonReleased(evt);
} else {
if (scrollAmount < 0) {
this._leftButtonPressed(evt);
this._buttonReleased(evt);
}
}
}
}
}, _discardEvent:function (evt) {
dojo.event.browser.stopEvent(evt);
}, _setFocus:function () {
if (this.focusNode.focus) {
this.focusNode.focus();
}
}, fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
var padding = this.domNode.style.padding;
if (dojo.lang.isString(padding) && padding != "" && padding != "0px" && padding != "0px 0px 0px 0px") {
this.topBorderNode.style.padding = this.bottomBorderNode.style.padding = padding;
this.topBorderNode.style.paddingBottom = "0px";
this.bottomBorderNode.style.paddingTop = "0px";
this.rightBorderNode.style.paddingRight = this.domNode.style.paddingRight;
this.leftBorderNode.style.paddingLeft = this.domNode.style.paddingLeft;
this.domNode.style.padding = "0px 0px 0px 0px";
}
var borderWidth = this.domNode.style.borderWidth;
if (dojo.lang.isString(borderWidth) && borderWidth != "" && borderWidth != "0px" && borderWidth != "0px 0px 0px 0px") {
this.topBorderNode.style.borderStyle = this.rightBorderNode.style.borderStyle = this.bottomBorderNode.style.borderStyle = this.leftBorderNode.style.borderStyle = this.domNode.style.borderStyle;
this.topBorderNode.style.borderColor = this.rightBorderNode.style.borderColor = this.bottomBorderNode.style.borderColor = this.leftBorderNode.style.borderColor = this.domNode.style.borderColor;
this.topBorderNode.style.borderWidth = this.bottomBorderNode.style.borderWidth = borderWidth;
this.topBorderNode.style.borderBottomWidth = "0px";
this.bottomBorderNode.style.borderTopWidth = "0px";
this.rightBorderNode.style.borderRightWidth = this.domNode.style.borderRightWidth;
this.leftBorderNode.style.borderLeftWidth = this.domNode.style.borderLeftWidth;
this.domNode.style.borderWidth = "0px 0px 0px 0px";
}
this._handleMove = new dojo.widget._SliderDragMoveSource(this.sliderHandleNode);
this._handleMove.setParent(this);
if (this.clickSelect) {
dojo.event.connect(this.constrainingContainerNode, "onmousedown", this, "_onClick");
}
if (this.isEnableX) {
this.setValueX(!isNaN(this.initialValueX) ? this.initialValueX : (!isNaN(this.minimumX) ? this.minimumX : 0));
}
if (!this.isEnableX || !this.showButtons) {
this.rightButtonNode.style.width = "1px";
this.rightButtonNode.style.visibility = "hidden";
this.leftButtonNode.style.width = "1px";
this.leftButtonNode.style.visibility = "hidden";
}
if (this.isEnableY) {
this.setValueY(!isNaN(this.initialValueY) ? this.initialValueY : (!isNaN(this.minimumY) ? this.minimumY : 0));
}
if (!this.isEnableY || !this.showButtons) {
this.bottomButtonNode.style.width = "1px";
this.bottomButtonNode.style.visibility = "hidden";
this.topButtonNode.style.width = "1px";
this.topButtonNode.style.visibility = "hidden";
}
if (this.focusNode.addEventListener) {
this.focusNode.addEventListener("DOMMouseScroll", dojo.lang.hitch(this, "_mouseWheeled"), false);
}
}, _snapX:function (x) {
if (x < 0) {
x = 0;
} else {
if (x > this._constraintWidth) {
x = this._constraintWidth;
} else {
var selectedValue = Math.round(x / this._valueSizeX);
x = Math.round(selectedValue * this._valueSizeX);
}
}
this.sliderHandleNode.style.left = x + "px";
if (this.flipX) {
this._clipLeft = x + this._clipXdelta;
} else {
this._clipRight = x + this._clipXdelta;
}
this.progressBackgroundNode.style.clip = "rect(" + this._clipTop + "px," + this._clipRight + "px," + this._clipBottom + "px," + this._clipLeft + "px)";
}, _calc_valueSizeX:function () {
var constrainingCtrBox = dojo.html.getContentBox(this.constrainingContainerNode);
var sliderHandleBox = dojo.html.getContentBox(this.sliderHandleNode);
if (isNaN(constrainingCtrBox.width) || isNaN(sliderHandleBox.width) || constrainingCtrBox.width <= 0 || sliderHandleBox.width <= 0) {
return false;
}
this._constraintWidth = constrainingCtrBox.width + dojo.html.getPadding(this.constrainingContainerNode).width - sliderHandleBox.width;
if (this.flipX) {
this._clipLeft = this._clipRight = constrainingCtrBox.width;
} else {
this._clipLeft = this._clipRight = 0;
}
this._clipXdelta = sliderHandleBox.width >> 1;
if (!this.isEnableY) {
this._clipTop = 0;
this._clipBottom = constrainingCtrBox.height;
}
if (this._constraintWidth <= 0) {
return false;
}
if (this.snapValuesX == 0) {
this.snapValuesX = this._constraintWidth + 1;
}
this._valueSizeX = this._constraintWidth / (this.snapValuesX - 1);
return true;
}, setValueX:function (value) {
if (0 == this._valueSizeX) {
if (this._calc_valueSizeX() == false) {
dojo.lang.setTimeout(this, "setValueX", 100, value);
return;
}
}
if (isNaN(value)) {
value = 0;
}
if (value > this.maximumX) {
value = this.maximumX;
} else {
if (value < this.minimumX) {
value = this.minimumX;
}
}
var pixelPercent = (value - this.minimumX) / (this.maximumX - this.minimumX);
if (this.flipX) {
pixelPercent = 1 - pixelPercent;
}
this._snapX(pixelPercent * this._constraintWidth);
this.notifyListeners();
}, getValueX:function () {
var pixelPercent = dojo.html.getPixelValue(this.sliderHandleNode, "left") / this._constraintWidth;
if (this.flipX) {
pixelPercent = 1 - pixelPercent;
}
return Math.round(pixelPercent * (this.snapValuesX - 1)) * ((this.maximumX - this.minimumX) / (this.snapValuesX - 1)) + this.minimumX;
}, _snapY:function (y) {
if (y < 0) {
y = 0;
} else {
if (y > this._constraintHeight) {
y = this._constraintHeight;
} else {
var selectedValue = Math.round(y / this._valueSizeY);
y = Math.round(selectedValue * this._valueSizeY);
}
}
this.sliderHandleNode.style.top = y + "px";
if (this.flipY) {
this._clipTop = y + this._clipYdelta;
} else {
this._clipBottom = y + this._clipYdelta;
}
this.progressBackgroundNode.style.clip = "rect(" + this._clipTop + "px," + this._clipRight + "px," + this._clipBottom + "px," + this._clipLeft + "px)";
}, _calc_valueSizeY:function () {
var constrainingCtrBox = dojo.html.getContentBox(this.constrainingContainerNode);
var sliderHandleBox = dojo.html.getContentBox(this.sliderHandleNode);
if (isNaN(constrainingCtrBox.height) || isNaN(sliderHandleBox.height) || constrainingCtrBox.height <= 0 || sliderHandleBox.height <= 0) {
return false;
}
this._constraintHeight = constrainingCtrBox.height + dojo.html.getPadding(this.constrainingContainerNode).height - sliderHandleBox.height;
if (this.flipY) {
this._clipTop = this._clipBottom = constrainingCtrBox.height;
} else {
this._clipTop = this._clipBottom = 0;
}
this._clipYdelta = sliderHandleBox.height >> 1;
if (!this.isEnableX) {
this._clipLeft = 0;
this._clipRight = constrainingCtrBox.width;
}
if (this._constraintHeight <= 0) {
return false;
}
if (this.snapValuesY == 0) {
this.snapValuesY = this._constraintHeight + 1;
}
this._valueSizeY = this._constraintHeight / (this.snapValuesY - 1);
return true;
}, setValueY:function (value) {
if (0 == this._valueSizeY) {
if (this._calc_valueSizeY() == false) {
dojo.lang.setTimeout(this, "setValueY", 100, value);
return;
}
}
if (isNaN(value)) {
value = 0;
}
if (value > this.maximumY) {
value = this.maximumY;
} else {
if (value < this.minimumY) {
value = this.minimumY;
}
}
var pixelPercent = (value - this.minimumY) / (this.maximumY - this.minimumY);
if (this.flipY) {
pixelPercent = 1 - pixelPercent;
}
this._snapY(pixelPercent * this._constraintHeight);
this.notifyListeners();
}, getValueY:function () {
var pixelPercent = dojo.html.getPixelValue(this.sliderHandleNode, "top") / this._constraintHeight;
if (this.flipY) {
pixelPercent = 1 - pixelPercent;
}
return Math.round(pixelPercent * (this.snapValuesY - 1)) * ((this.maximumY - this.minimumY) / (this.snapValuesY - 1)) + this.minimumY;
}, _onClick:function (evt) {
if (this._isDragInProgress) {
return;
}
var parent = dojo.html.getAbsolutePosition(this.constrainingContainerNode, true, dojo.html.boxSizing.MARGIN_BOX);
var content = dojo.html.getContentBox(this._handleMove.domNode);
if (this.isEnableX) {
var x = evt.pageX - parent.x - (content.width >> 1);
this._snapX(x);
}
if (this.isEnableY) {
var y = evt.pageY - parent.y - (content.height >> 1);
this._snapY(y);
}
this.notifyListeners();
}, notifyListeners:function () {
this.onValueChanged(this.getValueX(), this.getValueY());
}, onValueChanged:function (x, y) {
}});
dojo.widget.defineWidget("dojo.widget.SliderHorizontal", dojo.widget.Slider, {isEnableX:true, isEnableY:false, initialValue:"", snapValues:"", minimum:"", maximum:"", buttonStyle:"", backgroundSize:"height:10px;width:200px;", backgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider-bg.gif"), flip:false, postMixInProperties:function () {
dojo.widget.SliderHorizontal.superclass.postMixInProperties.apply(this, arguments);
if (!isNaN(parseFloat(this.initialValue))) {
this.initialValueX = parseFloat(this.initialValue);
}
if (!isNaN(parseFloat(this.minimum))) {
this.minimumX = parseFloat(this.minimum);
}
if (!isNaN(parseFloat(this.maximum))) {
this.maximumX = parseFloat(this.maximum);
}
if (!isNaN(parseInt(this.snapValues))) {
this.snapValuesX = parseInt(this.snapValues);
}
if (dojo.lang.isString(this.buttonStyle) && this.buttonStyle != "") {
this.buttonStyleX = this.buttonStyle;
}
if (dojo.lang.isBoolean(this.flip)) {
this.flipX = this.flip;
}
}, notifyListeners:function () {
this.onValueChanged(this.getValueX());
}, getValue:function () {
return this.getValueX();
}, setValue:function (value) {
this.setValueX(value);
}, onValueChanged:function (value) {
}});
dojo.widget.defineWidget("dojo.widget.SliderVertical", dojo.widget.Slider, {isEnableX:false, isEnableY:true, initialValue:"", snapValues:"", minimum:"", maximum:"", buttonStyle:"", backgroundSize:"width:10px;height:200px;", backgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider-bg-vert.gif"), flip:false, postMixInProperties:function () {
dojo.widget.SliderVertical.superclass.postMixInProperties.apply(this, arguments);
if (!isNaN(parseFloat(this.initialValue))) {
this.initialValueY = parseFloat(this.initialValue);
}
if (!isNaN(parseFloat(this.minimum))) {
this.minimumY = parseFloat(this.minimum);
}
if (!isNaN(parseFloat(this.maximum))) {
this.maximumY = parseFloat(this.maximum);
}
if (!isNaN(parseInt(this.snapValues))) {
this.snapValuesY = parseInt(this.snapValues);
}
if (dojo.lang.isString(this.buttonStyle) && this.buttonStyle != "") {
this.buttonStyleY = this.buttonStyle;
}
if (dojo.lang.isBoolean(this.flip)) {
this.flipY = this.flip;
}
}, notifyListeners:function () {
this.onValueChanged(this.getValueY());
}, getValue:function () {
return this.getValueY();
}, setValue:function (value) {
this.setValueY(value);
}, onValueChanged:function (value) {
}});
dojo.declare("dojo.widget._SliderDragMoveSource", dojo.dnd.HtmlDragMoveSource, {slider:null, onDragStart:function (evt) {
this.slider._isDragInProgress = true;
var dragObj = this.createDragMoveObject();
this.slider.notifyListeners();
return dragObj;
}, onDragEnd:function (evt) {
this.slider._isDragInProgress = false;
this.slider.notifyListeners();
}, createDragMoveObject:function () {
var dragObj = new dojo.widget._SliderDragMoveObject(this.dragObject, this.type);
dragObj.slider = this.slider;
if (this.dragClass) {
dragObj.dragClass = this.dragClass;
}
return dragObj;
}, setParent:function (slider) {
this.slider = slider;
}});
dojo.declare("dojo.widget._SliderDragMoveObject", dojo.dnd.HtmlDragMoveObject, {slider:null, onDragMove:function (evt) {
this.updateDragOffset();
if (this.slider.isEnableX) {
var x = this.dragOffset.x + evt.pageX;
this.slider._snapX(x);
}
if (this.slider.isEnableY) {
var y = this.dragOffset.y + evt.pageY;
this.slider._snapY(y);
}
if (this.slider.activeDrag) {
this.slider.notifyListeners();
}
}});
 
/trunk/api/js/dojo/src/widget/vml/Chart.js
New file
0,0 → 1,525
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
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.layout");
dojo.require("dojo.gfx.color");
dojo.widget.defineWidget("dojo.widget.vml.Chart", [dojo.widget.HtmlWidget, dojo.widget.Chart], function () {
this.templatePath = null;
this.templateCssPath = null;
this._isInitialize = false;
this.hasData = false;
this.vectorNode = null;
this.plotArea = null;
this.dataGroup = null;
this.axisGroup = null;
this.properties = {height:0, width:0, defaultWidth:600, defaultHeight:400, 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}}}};
}, {parseProperties:function (node) {
var bRangeX = false;
var bRangeY = false;
if (node.getAttribute("width")) {
this.properties.width = node.getAttribute("width");
}
if (node.getAttribute("height")) {
this.properties.height = node.getAttribute("height");
}
if (node.getAttribute("plotType")) {
this.properties.plotType = node.getAttribute("plotType");
}
if (node.getAttribute("padding")) {
if (node.getAttribute("padding").indexOf(",") > -1) {
var p = node.getAttribute("padding").split(",");
} else {
var p = node.getAttribute("padding").split(" ");
}
if (p.length == 1) {
var pad = parseFloat(p[0]);
this.properties.padding.top = pad;
this.properties.padding.right = pad;
this.properties.padding.bottom = pad;
this.properties.padding.left = pad;
} else {
if (p.length == 2) {
var padV = parseFloat(p[0]);
var padH = parseFloat(p[1]);
this.properties.padding.top = padV;
this.properties.padding.right = padH;
this.properties.padding.bottom = padV;
this.properties.padding.left = padH;
} else {
if (p.length == 4) {
this.properties.padding.top = parseFloat(p[0]);
this.properties.padding.right = parseFloat(p[1]);
this.properties.padding.bottom = parseFloat(p[2]);
this.properties.padding.left = parseFloat(p[3]);
}
}
}
}
if (node.getAttribute("rangeX")) {
var p = node.getAttribute("rangeX");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.x.range.min = parseFloat(p[0]);
this.properties.axes.x.range.max = parseFloat(p[1]);
bRangeX = true;
}
if (node.getAttribute("rangeY")) {
var p = node.getAttribute("rangeY");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.y.range.min = parseFloat(p[0]);
this.properties.axes.y.range.max = parseFloat(p[1]);
bRangeY = true;
}
return {rangeX:bRangeX, rangeY:bRangeY};
}, setAxesPlot:function (table) {
if (table.getAttribute("axisAt")) {
var p = table.getAttribute("axisAt");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
if (!isNaN(parseFloat(p[0]))) {
this.properties.axes.x.plotAt = parseFloat(p[0]);
} else {
if (p[0].toLowerCase() == "ymin") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
} else {
if (p[0].toLowerCase() == "ymax") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.max;
}
}
}
if (!isNaN(parseFloat(p[1]))) {
this.properties.axes.y.plotAt = parseFloat(p[1]);
} else {
if (p[1].toLowerCase() == "xmin") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
} else {
if (p[1].toLowerCase() == "xmax") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.max;
}
}
}
} else {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
}
}, drawVectorNode:function () {
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);
}, drawPlotArea:function () {
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;
if (this.plotArea) {
this.plotArea.parentNode.removeChild(this.plotArea);
this.plotArea = null;
}
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.plotArea.style.clip = "rect(0 " + plotWidth + " " + plotHeight + " 0)";
this.vectorNode.appendChild(this.plotArea);
}, drawDataGroup:function () {
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;
if (this.dataGroup) {
this.dataGroup.parentNode.removeChild(this.dataGroup);
this.dataGroup = null;
}
this.dataGroup = document.createElement("div");
this.dataGroup.style.position = "absolute";
this.dataGroup.setAttribute("title", "Data Group");
this.dataGroup.style.top = "0px";
this.dataGroup.style.left = "0px";
this.dataGroup.style.width = plotWidth + "px";
this.dataGroup.style.height = plotHeight + "px";
this.plotArea.appendChild(this.dataGroup);
}, drawAxes:function () {
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;
if (this.axisGroup) {
this.axisGroup.parentNode.removeChild(this.axisGroup);
this.axisGroup = null;
}
this.axisGroup = document.createElement("div");
this.axisGroup.style.position = "absolute";
this.axisGroup.setAttribute("title", "Axis Group");
this.axisGroup.style.top = "0px";
this.axisGroup.style.left = "0px";
this.axisGroup.style.width = plotWidth + "px";
this.axisGroup.style.height = plotHeight + "px";
this.plotArea.appendChild(this.axisGroup);
var stroke = 1;
var line = document.createElement("v:line");
var y = dojo.widget.vml.Chart.Plotter.getY(this.properties.axes.x.plotAt, this);
line.setAttribute("from", "0px," + y + "px");
line.setAttribute("to", plotWidth + "px," + y + "px");
line.style.position = "absolute";
line.style.top = "0px";
line.style.left = "0px";
line.style.antialias = "false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke * 2 + "px");
this.axisGroup.appendChild(line);
var line = document.createElement("v:line");
var x = dojo.widget.vml.Chart.Plotter.getX(this.properties.axes.y.plotAt, this);
line.setAttribute("from", x + "px,0px");
line.setAttribute("to", x + "px," + plotHeight + "px");
line.style.position = "absolute";
line.style.top = "0px";
line.style.left = "0px";
line.style.antialias = "false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke * 2 + "px");
this.axisGroup.appendChild(line);
var size = 10;
var t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (this.properties.height - this.properties.padding.bottom) + "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.vectorNode.appendChild(t);
t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (this.properties.height - this.properties.padding.bottom) + "px";
t.style.left = (this.properties.width - this.properties.padding.right - size) + "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.vectorNode.appendChild(t);
t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (size / 2) + "px";
t.style.left = "0px";
t.style.width = this.properties.padding.left + "px";
t.style.textAlign = "right";
t.style.paddingRight = "4px";
t.style.fontFamily = "sans-serif";
t.style.fontSize = size + "px";
t.innerHTML = dojo.math.round(parseFloat(this.properties.axes.y.range.max), 2);
this.vectorNode.appendChild(t);
t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (this.properties.height - this.properties.padding.bottom - size) + "px";
t.style.left = "0px";
t.style.width = this.properties.padding.left + "px";
t.style.textAlign = "right";
t.style.paddingRight = "4px";
t.style.fontFamily = "sans-serif";
t.style.fontSize = size + "px";
t.innerHTML = dojo.math.round(parseFloat(this.properties.axes.y.range.min), 2);
this.vectorNode.appendChild(t);
}, init:function () {
if (!this.properties.width || !this.properties.height) {
var box = dojo.html.getContentBox(this.domNode);
if (!this.properties.width) {
this.properties.width = (box.width < 32) ? this.properties.defaultWidth : box.width;
}
if (!this.properties.height) {
this.properties.height = (box.height < 32) ? this.properties.defaultHeight : box.height;
}
}
this.drawVectorNode();
this.drawPlotArea();
this.drawDataGroup();
this.drawAxes();
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.init();
}
for (var i = 0; i < this.series.length; i++) {
dojo.widget.vml.Chart.Plotter.plot(this.series[i], this);
}
}, postCreate:function () {
var table = this.domNode.getElementsByTagName("table")[0];
if (table) {
var ranges = this.parseProperties(table);
var bRangeX = false;
var bRangeY = false;
var axisValues = this.parseData(table);
if (!bRangeX) {
this.properties.axes.x.range = {min:axisValues.x.min, max:axisValues.x.max};
}
if (!bRangeY) {
this.properties.axes.y.range = {min:axisValues.y.min, max:axisValues.y.max};
}
this.setAxesPlot(table);
this.domNode.removeChild(table);
}
if (this.series.length > 0) {
this.render();
}
}});
dojo.widget.vml.Chart.Plotter = new function () {
var self = 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 = 0;
var xmax = chart.properties.width - chart.properties.padding.left - 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.top - chart.properties.padding.bottom;
var ymax = 0;
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);
}
}
};
plotters["bar"] = function (series, chart) {
var space = 1;
var lastW = 0;
var ys = [];
var yAxis = self.getY(chart.properties.axes.x.plotAt, chart);
var yA = yAxis;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var w;
if (i == series.values.length - 1) {
w = lastW;
} else {
w = self.getX(series.values[i + 1].x, chart) - x - space;
lastW = w;
}
x -= (w / 2);
var y = self.getY(series.values[i].value, chart);
var h = Math.abs(yA - y);
if (parseFloat(series.values[i].value) < chart.properties.axes.x.plotAt) {
y = yA;
}
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + "px";
bar.style.left = x + "px";
bar.style.width = w + "px";
bar.style.height = h + "px";
bar.setAttribute("fillColor", series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
bar.setAttribute("title", series.label + " (" + i + "): " + series.values[i].value);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.9");
bar.appendChild(fill);
chart.dataGroup.appendChild(bar);
}
};
plotters["line"] = function (series, chart) {
var tension = 1.5;
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 = Math.round(self.getX(series.values[i].x, chart));
var y = Math.round(self.getY(series.values[i].value, chart));
if (i == 0) {
path.push("m");
path.push(x + "," + y);
} else {
var lastx = Math.round(self.getX(series.values[i - 1].x, chart));
var lasty = Math.round(self.getY(series.values[i - 1].value, chart));
var dx = x - lastx;
var dy = y - lasty;
path.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
path.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
path.push(cx + "," + y);
path.push(x + "," + y);
}
}
line.setAttribute("path", path.join(" ") + " e");
chart.dataGroup.appendChild(line);
};
plotters["area"] = function (series, chart) {
var tension = 1.5;
var line = document.createElement("v:shape");
line.setAttribute("strokeweight", "1px");
line.setAttribute("strokecolor", series.color);
line.setAttribute("fillcolor", series.color);
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.8");
line.appendChild(stroke);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.4");
line.appendChild(fill);
var path = [];
for (var i = 0; i < series.values.length; i++) {
var x = Math.round(self.getX(series.values[i].x, chart));
var y = Math.round(self.getY(series.values[i].value, chart));
if (i == 0) {
path.push("m");
path.push(x + "," + y);
} else {
var lastx = Math.round(self.getX(series.values[i - 1].x, chart));
var lasty = Math.round(self.getY(series.values[i - 1].value, chart));
var dx = x - lastx;
var dy = y - lasty;
path.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
path.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
path.push(cx + "," + y);
path.push(x + "," + y);
}
}
path.push("l");
path.push(x + "," + self.getY(0, chart));
path.push("l");
path.push(self.getX(0, chart) + "," + self.getY(0, chart));
line.setAttribute("path", path.join(" ") + " x e");
chart.dataGroup.appendChild(line);
};
plotters["scatter"] = function (series, chart) {
var r = 6;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.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.6");
point.appendChild(fill);
chart.dataGroup.appendChild(point);
}
};
plotters["bubble"] = function (series, chart) {
var minR = 1;
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 radius = (parseFloat(size) * factor) / 2;
var diameter = radius * 2;
var cx = self.getX(series.values[i].x, chart);
var cy = self.getY(series.values[i].value, chart);
var top = cy - radius;
var left = cx - radius;
var point = document.createElement("v:oval");
point.setAttribute("fillcolor", series.color);
point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
point.setAttribute("stroked", "false");
point.style.position = "absolute";
point.style.top = top + "px";
point.style.left = left + "px";
point.style.width = diameter + "px";
point.style.height = diameter + "px";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.8");
point.appendChild(fill);
chart.dataGroup.appendChild(point);
}
};
}();
 
/trunk/api/js/dojo/src/widget/RemoteTabController.js
New file
0,0 → 1,26
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RemoteTabController");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.TabContainer");
dojo.require("dojo.event.*");
dojo.deprecated("dojo.widget.RemoteTabController is slated for removal in 0.5; use PageController or TabController instead.", "0.5");
dojo.widget.defineWidget("dojo.widget.RemoteTabController", dojo.widget.TabController, {templateCssString:".dojoRemoteTabController {\n\tposition: relative;\n}\n\n.dojoRemoteTab {\n\tposition : relative;\n\tfloat : left;\n\tpadding-left : 9px;\n\tborder-bottom : 1px solid #6290d2;\n\tbackground : url(images/tab_left.gif) no-repeat left top;\n\tcursor: pointer;\n\twhite-space: nowrap;\n\tz-index: 3;\n}\n\n.dojoRemoteTab div {\n\tdisplay : block;\n\tpadding : 4px 15px 4px 6px;\n\tbackground : url(images/tab_top_right.gif) no-repeat right top;\n\tcolor : #333;\n\tfont-size : 90%;\n}\n\n.dojoRemoteTabPaneClose {\n\tposition : absolute;\n\tbottom : 0px;\n\tright : 6px;\n\theight : 12px;\n\twidth : 12px;\n\tbackground : url(images/tab_close.gif) no-repeat right top;\n}\n\n.dojoRemoteTabPaneCloseHover {\n\tbackground-image : url(images/tab_close_h.gif);\n}\n\n.dojoRemoteTabClose {\n\tdisplay : inline-block;\n\theight : 12px;\n\twidth : 12px;\n\tpadding : 0 12px 0 0;\n\tmargin : 0 -10px 0 10px;\n\tbackground : url(images/tab_close.gif) no-repeat right top;\n\tcursor : default;\n}\n\n.dojoRemoteTabCloseHover {\n\tbackground-image : url(images/tab_close_h.gif);\n}\n\n.dojoRemoteTab.current {\n\tpadding-bottom : 1px;\n\tborder-bottom : 0;\n\tbackground-position : 0 -150px;\n}\n\n.dojoRemoteTab.current div {\n\tpadding-bottom : 5px;\n\tmargin-bottom : -1px;\n\tbackground-position : 100% -150px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/RemoteTabControl.css"), templateString:"<div dojoAttachPoint=\"domNode\" wairole=\"tablist\"></div>", "class":"dojoRemoteTabController", tabContainer:"", postMixInProperties:function () {
this.containerId = this.tabContainer;
dojo.widget.RemoteTabController.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
dojo.html.addClass(this.domNode, this["class"]);
if (this.tabContainer) {
dojo.addOnLoad(dojo.lang.hitch(this, "setupTabs"));
}
dojo.widget.RemoteTabController.superclass.fillInTemplate.apply(this, arguments);
}});
 
/trunk/api/js/dojo/src/widget/Editor.js
New file
0,0 → 1,388
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor");
dojo.deprecated("dojo.widget.Editor", "is replaced by dojo.widget.Editor2", "0.5");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Toolbar");
dojo.require("dojo.widget.RichText");
dojo.require("dojo.widget.ColorPalette");
dojo.require("dojo.string.extras");
dojo.widget.tags.addParseTreeHandler("dojo:Editor");
dojo.widget.Editor = function () {
dojo.widget.HtmlWidget.call(this);
this.contentFilters = [];
this._toolbars = [];
};
dojo.inherits(dojo.widget.Editor, dojo.widget.HtmlWidget);
dojo.widget.Editor.itemGroups = {textGroup:["bold", "italic", "underline", "strikethrough"], blockGroup:["formatBlock", "fontName", "fontSize"], justifyGroup:["justifyleft", "justifycenter", "justifyright"], commandGroup:["save", "cancel"], colorGroup:["forecolor", "hilitecolor"], listGroup:["insertorderedlist", "insertunorderedlist"], indentGroup:["outdent", "indent"], linkGroup:["createlink", "insertimage", "inserthorizontalrule"]};
dojo.widget.Editor.formatBlockValues = {"Normal":"p", "Main heading":"h2", "Sub heading":"h3", "Sub sub heading":"h4", "Preformatted":"pre"};
dojo.widget.Editor.fontNameValues = {"Arial":"Arial, Helvetica, sans-serif", "Verdana":"Verdana, sans-serif", "Times New Roman":"Times New Roman, serif", "Courier":"Courier New, monospace"};
dojo.widget.Editor.fontSizeValues = {"1 (8 pt)":"1", "2 (10 pt)":"2", "3 (12 pt)":"3", "4 (14 pt)":"4", "5 (18 pt)":"5", "6 (24 pt)":"6", "7 (36 pt)":"7"};
dojo.widget.Editor.defaultItems = ["commandGroup", "|", "blockGroup", "|", "textGroup", "|", "colorGroup", "|", "justifyGroup", "|", "listGroup", "indentGroup", "|", "linkGroup"];
dojo.widget.Editor.supportedCommands = ["save", "cancel", "|", "-", "/", " "];
dojo.lang.extend(dojo.widget.Editor, {widgetType:"Editor", saveUrl:"", saveMethod:"post", saveArgName:"editorContent", closeOnSave:false, items:dojo.widget.Editor.defaultItems, formatBlockItems:dojo.lang.shallowCopy(dojo.widget.Editor.formatBlockValues), fontNameItems:dojo.lang.shallowCopy(dojo.widget.Editor.fontNameValues), fontSizeItems:dojo.lang.shallowCopy(dojo.widget.Editor.fontSizeValues), getItemProperties:function (name) {
var props = {};
switch (name.toLowerCase()) {
case "bold":
case "italic":
case "underline":
case "strikethrough":
props.toggleItem = true;
break;
case "justifygroup":
props.defaultButton = "justifyleft";
props.preventDeselect = true;
props.buttonGroup = true;
break;
case "listgroup":
props.buttonGroup = true;
break;
case "save":
case "cancel":
props.label = dojo.string.capitalize(name);
break;
case "forecolor":
case "hilitecolor":
props.name = name;
props.toggleItem = true;
props.icon = this.getCommandImage(name);
break;
case "formatblock":
props.name = "formatBlock";
props.values = this.formatBlockItems;
break;
case "fontname":
props.name = "fontName";
props.values = this.fontNameItems;
case "fontsize":
props.name = "fontSize";
props.values = this.fontSizeItems;
}
return props;
}, validateItems:true, focusOnLoad:true, minHeight:"1em", _richText:null, _richTextType:"RichText", _toolbarContainer:null, _toolbarContainerType:"ToolbarContainer", _toolbars:[], _toolbarType:"Toolbar", _toolbarItemType:"ToolbarItem", buildRendering:function (args, frag) {
var node = frag["dojo:" + this.widgetType.toLowerCase()]["nodeRef"];
var trt = dojo.widget.createWidget(this._richTextType, {focusOnLoad:this.focusOnLoad, minHeight:this.minHeight}, node);
var _this = this;
setTimeout(function () {
_this.setRichText(trt);
_this.initToolbar();
_this.fillInTemplate(args, frag);
}, 0);
}, setRichText:function (richText) {
if (this._richText && this._richText == richText) {
dojo.debug("Already set the richText to this richText!");
return;
}
if (this._richText && !this._richText.isClosed) {
dojo.debug("You are switching richTexts yet you haven't closed the current one. Losing reference!");
}
this._richText = richText;
dojo.event.connect(this._richText, "close", this, "onClose");
dojo.event.connect(this._richText, "onLoad", this, "onLoad");
dojo.event.connect(this._richText, "onDisplayChanged", this, "updateToolbar");
if (this._toolbarContainer) {
this._toolbarContainer.enable();
this.updateToolbar(true);
}
}, initToolbar:function () {
if (this._toolbarContainer) {
return;
}
this._toolbarContainer = dojo.widget.createWidget(this._toolbarContainerType);
var tb = this.addToolbar();
var last = true;
for (var i = 0; i < this.items.length; i++) {
if (this.items[i] == "\n") {
tb = this.addToolbar();
} else {
if ((this.items[i] == "|") && (!last)) {
last = true;
} else {
last = this.addItem(this.items[i], tb);
}
}
}
this.insertToolbar(this._toolbarContainer.domNode, this._richText.domNode);
}, insertToolbar:function (tbNode, richTextNode) {
dojo.html.insertBefore(tbNode, richTextNode);
}, addToolbar:function (toolbar) {
this.initToolbar();
if (!(toolbar instanceof dojo.widget.Toolbar)) {
toolbar = dojo.widget.createWidget(this._toolbarType);
}
this._toolbarContainer.addChild(toolbar);
this._toolbars.push(toolbar);
return toolbar;
}, addItem:function (item, tb, dontValidate) {
if (!tb) {
tb = this._toolbars[0];
}
var cmd = ((item) && (!dojo.lang.isUndefined(item["getValue"]))) ? cmd = item["getValue"]() : item;
var groups = dojo.widget.Editor.itemGroups;
if (item instanceof dojo.widget.ToolbarItem) {
tb.addChild(item);
} else {
if (groups[cmd]) {
var group = groups[cmd];
var worked = true;
if (cmd == "justifyGroup" || cmd == "listGroup") {
var btnGroup = [cmd];
for (var i = 0; i < group.length; i++) {
if (dontValidate || this.isSupportedCommand(group[i])) {
btnGroup.push(this.getCommandImage(group[i]));
} else {
worked = false;
}
}
if (btnGroup.length) {
var btn = tb.addChild(btnGroup, null, this.getItemProperties(cmd));
dojo.event.connect(btn, "onClick", this, "_action");
dojo.event.connect(btn, "onChangeSelect", this, "_action");
}
return worked;
} else {
for (var i = 0; i < group.length; i++) {
if (!this.addItem(group[i], tb)) {
worked = false;
}
}
return worked;
}
} else {
if ((!dontValidate) && (!this.isSupportedCommand(cmd))) {
return false;
}
if (dontValidate || this.isSupportedCommand(cmd)) {
cmd = cmd.toLowerCase();
if (cmd == "formatblock") {
var select = dojo.widget.createWidget("ToolbarSelect", {name:"formatBlock", values:this.formatBlockItems});
tb.addChild(select);
var _this = this;
dojo.event.connect(select, "onSetValue", function (item, value) {
_this.onAction("formatBlock", value);
});
} else {
if (cmd == "fontname") {
var select = dojo.widget.createWidget("ToolbarSelect", {name:"fontName", values:this.fontNameItems});
tb.addChild(select);
dojo.event.connect(select, "onSetValue", dojo.lang.hitch(this, function (item, value) {
this.onAction("fontName", value);
}));
} else {
if (cmd == "fontsize") {
var select = dojo.widget.createWidget("ToolbarSelect", {name:"fontSize", values:this.fontSizeItems});
tb.addChild(select);
dojo.event.connect(select, "onSetValue", dojo.lang.hitch(this, function (item, value) {
this.onAction("fontSize", value);
}));
} else {
if (dojo.lang.inArray(cmd, ["forecolor", "hilitecolor"])) {
var btn = tb.addChild(dojo.widget.createWidget("ToolbarColorDialog", this.getItemProperties(cmd)));
dojo.event.connect(btn, "onSetValue", this, "_setValue");
} else {
var btn = tb.addChild(this.getCommandImage(cmd), null, this.getItemProperties(cmd));
if (cmd == "save") {
dojo.event.connect(btn, "onClick", this, "_save");
} else {
if (cmd == "cancel") {
dojo.event.connect(btn, "onClick", this, "_close");
} else {
dojo.event.connect(btn, "onClick", this, "_action");
dojo.event.connect(btn, "onChangeSelect", this, "_action");
}
}
}
}
}
}
}
}
}
return true;
}, enableToolbar:function () {
if (this._toolbarContainer) {
this._toolbarContainer.domNode.style.display = "";
this._toolbarContainer.enable();
}
}, disableToolbar:function (hide) {
if (hide) {
if (this._toolbarContainer) {
this._toolbarContainer.domNode.style.display = "none";
}
} else {
if (this._toolbarContainer) {
this._toolbarContainer.disable();
}
}
}, _updateToolbarLastRan:null, _updateToolbarTimer:null, _updateToolbarFrequency:500, updateToolbar:function (force) {
if (!this._toolbarContainer) {
return;
}
var diff = new Date() - this._updateToolbarLastRan;
if (!force && this._updateToolbarLastRan && (diff < this._updateToolbarFrequency)) {
clearTimeout(this._updateToolbarTimer);
var _this = this;
this._updateToolbarTimer = setTimeout(function () {
_this.updateToolbar();
}, this._updateToolbarFrequency / 2);
return;
} else {
this._updateToolbarLastRan = new Date();
}
var items = this._toolbarContainer.getItems();
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item instanceof dojo.widget.ToolbarSeparator) {
continue;
}
var cmd = item._name;
if (cmd == "save" || cmd == "cancel") {
continue;
} else {
if (cmd == "justifyGroup") {
try {
if (!this._richText.queryCommandEnabled("justifyleft")) {
item.disable(false, true);
} else {
item.enable(false, true);
var jitems = item.getItems();
for (var j = 0; j < jitems.length; j++) {
var name = jitems[j]._name;
var value = this._richText.queryCommandValue(name);
if (typeof value == "boolean" && value) {
value = name;
break;
} else {
if (typeof value == "string") {
value = "justify" + value;
} else {
value = null;
}
}
}
if (!value) {
value = "justifyleft";
}
item.setValue(value, false, true);
}
}
catch (err) {
}
} else {
if (cmd == "listGroup") {
var litems = item.getItems();
for (var j = 0; j < litems.length; j++) {
this.updateItem(litems[j]);
}
} else {
this.updateItem(item);
}
}
}
}
}, updateItem:function (item) {
try {
var cmd = item._name;
var enabled = this._richText.queryCommandEnabled(cmd);
item.setEnabled(enabled, false, true);
var active = this._richText.queryCommandState(cmd);
if (active && cmd == "underline") {
active = !this._richText.queryCommandEnabled("unlink");
}
item.setSelected(active, false, true);
return true;
}
catch (err) {
return false;
}
}, supportedCommands:dojo.widget.Editor.supportedCommands.concat(), isSupportedCommand:function (cmd) {
var yes = dojo.lang.inArray(cmd, this.supportedCommands);
if (!yes) {
try {
var richText = this._richText || dojo.widget.HtmlRichText.prototype;
yes = richText.queryCommandAvailable(cmd);
}
catch (E) {
}
}
return yes;
}, getCommandImage:function (cmd) {
if (cmd == "|") {
return cmd;
} else {
return dojo.uri.moduleUri("dojo.widget", "templates/buttons/" + cmd + ".gif");
}
}, _action:function (e) {
this._fire("onAction", e.getValue());
}, _setValue:function (a, b) {
this._fire("onAction", a.getValue(), b);
}, _save:function (e) {
if (!this._richText.isClosed) {
if (this.saveUrl.length) {
var content = {};
content[this.saveArgName] = this.getHtml();
dojo.io.bind({method:this.saveMethod, url:this.saveUrl, content:content});
} else {
dojo.debug("please set a saveUrl for the editor");
}
if (this.closeOnSave) {
this._richText.close(e.getName().toLowerCase() == "save");
}
}
}, _close:function (e) {
if (!this._richText.isClosed) {
this._richText.close(e.getName().toLowerCase() == "save");
}
}, onAction:function (cmd, value) {
switch (cmd) {
case "createlink":
if (!(value = prompt("Please enter the URL of the link:", "http://"))) {
return;
}
break;
case "insertimage":
if (!(value = prompt("Please enter the URL of the image:", "http://"))) {
return;
}
break;
}
this._richText.execCommand(cmd, value);
}, fillInTemplate:function (args, frag) {
}, _fire:function (eventName) {
if (dojo.lang.isFunction(this[eventName])) {
var args = [];
if (arguments.length == 1) {
args.push(this);
} else {
for (var i = 1; i < arguments.length; i++) {
args.push(arguments[i]);
}
}
this[eventName].apply(this, args);
}
}, getHtml:function () {
this._richText.contentFilters = this._richText.contentFilters.concat(this.contentFilters);
return this._richText.getEditorContent();
}, getEditorContent:function () {
return this.getHtml();
}, onClose:function (save, hide) {
this.disableToolbar(hide);
if (save) {
this._fire("onSave");
} else {
this._fire("onCancel");
}
}, onLoad:function () {
}, onSave:function () {
}, onCancel:function () {
}});
 
/trunk/api/js/dojo/src/widget/TaskBar.js
New file
0,0 → 1,47
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TaskBar");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.TaskBarItem", dojo.widget.HtmlWidget, {iconSrc:"", caption:"Untitled", templateString:"<div class=\"dojoTaskBarItem\" dojoAttachEvent=\"onClick\">\n</div>\n", templateCssString:".dojoTaskBarItem {\n\tdisplay: inline-block;\n\tbackground-color: ThreeDFace;\n\tborder: outset 2px;\n\tmargin-right: 5px;\n\tcursor: pointer;\n\theight: 35px;\n\twidth: 100px;\n\tfont-size: 10pt;\n\twhite-space: nowrap;\n\ttext-align: center;\n\tfloat: left;\n\toverflow: hidden;\n}\n\n.dojoTaskBarItem img {\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\t\n\theight: 32px;\n\twidth: 32px;\n}\n\n.dojoTaskBarItem a {\n\t color: black;\n\ttext-decoration: none;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TaskBar.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.toggleDisplay();
}});
dojo.widget.defineWidget("dojo.widget.TaskBar", dojo.widget.FloatingPane, function () {
this._addChildStack = [];
}, {resizable:false, titleBarDisplay:false, 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.TaskBar.superclass.addChild.call(this, tbi);
}});
 
/trunk/api/js/dojo/src/widget/TreeDeselectOnDblselect.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDeselectOnDblselect");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeSelectorV3");
dojo.deprecated("Does anyone still need this extension? (TreeDeselectOnDblselect)");
dojo.widget.defineWidget("dojo.widget.TreeDeselectOnDblselect", [dojo.widget.HtmlWidget], {selector:"", initialize:function () {
this.selector = dojo.widget.byId(this.selector);
dojo.event.topic.subscribe(this.selector.eventNames.dblselect, this, "onDblselect");
}, onDblselect:function (message) {
this.selector.deselect(message.node);
}});
 
/trunk/api/js/dojo/src/widget/Tooltip.js
New file
0,0 → 1,105
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Tooltip");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.widget.PopupContainer");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.html.style");
dojo.require("dojo.html.util");
dojo.widget.defineWidget("dojo.widget.Tooltip", [dojo.widget.ContentPane, dojo.widget.PopupContainerBase], {caption:"", showDelay:500, hideDelay:100, connectId:"", templateCssString:".dojoTooltip {\n\tborder: solid black 1px;\n\tbackground: beige;\n\tcolor: black;\n\tposition: absolute;\n\tfont-size: small;\n\tpadding: 2px 2px 2px 2px;\n\tz-index: 10;\n\tdisplay: block;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TooltipTemplate.css"), fillInTemplate:function (args, frag) {
if (this.caption != "") {
this.domNode.appendChild(document.createTextNode(this.caption));
}
this._connectNode = dojo.byId(this.connectId);
dojo.widget.Tooltip.superclass.fillInTemplate.call(this, args, frag);
this.addOnLoad(this, "_loadedContent");
dojo.html.addClass(this.domNode, "dojoTooltip");
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
this.applyPopupBasicStyle();
}, postCreate:function (args, frag) {
dojo.event.connect(this._connectNode, "onmouseover", this, "_onMouseOver");
dojo.widget.Tooltip.superclass.postCreate.call(this, args, frag);
}, _onMouseOver:function (e) {
this._mouse = {x:e.pageX, y:e.pageY};
if (!this._tracking) {
dojo.event.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
this._tracking = true;
}
this._onHover(e);
}, _onMouseMove:function (e) {
this._mouse = {x:e.pageX, y:e.pageY};
if (dojo.html.overElement(this._connectNode, e) || dojo.html.overElement(this.domNode, e)) {
this._onHover(e);
} else {
this._onUnHover(e);
}
}, _onHover:function (e) {
if (this._hover) {
return;
}
this._hover = true;
if (this._hideTimer) {
clearTimeout(this._hideTimer);
delete this._hideTimer;
}
if (!this.isShowingNow && !this._showTimer) {
this._showTimer = setTimeout(dojo.lang.hitch(this, "open"), this.showDelay);
}
}, _onUnHover:function (e) {
if (!this._hover) {
return;
}
this._hover = false;
if (this._showTimer) {
clearTimeout(this._showTimer);
delete this._showTimer;
}
if (this.isShowingNow && !this._hideTimer) {
this._hideTimer = setTimeout(dojo.lang.hitch(this, "close"), this.hideDelay);
}
if (!this.isShowingNow) {
dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");
this._tracking = false;
}
}, open:function () {
if (this.isShowingNow) {
return;
}
dojo.widget.PopupContainerBase.prototype.open.call(this, this._mouse.x, this._mouse.y, null, [this._mouse.x, this._mouse.y], "TL,TR,BL,BR", [10, 15]);
}, close:function () {
if (this.isShowingNow) {
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");
this._tracking = false;
dojo.widget.PopupContainerBase.prototype.close.call(this);
}
}, _position:function () {
this.move(this._mouse.x, this._mouse.y, [10, 15], "TL,TR,BL,BR");
}, _loadedContent:function () {
if (this.isShowingNow) {
this._position();
}
}, checkSize:function () {
}, uninitialize:function () {
this.close();
dojo.event.disconnect(this._connectNode, "onmouseover", this, "_onMouseOver");
}});
 
/trunk/api/js/dojo/src/widget/TreeDocIconExtension.js
New file
0,0 → 1,52
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDocIconExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeExtension");
dojo.widget.defineWidget("dojo.widget.TreeDocIconExtension", [dojo.widget.TreeExtension], {templateCssString:"\n/* CSS for TreeDocIconExtension */\n\n\n/* long vertical line under docIcon, connecting w/ children */\n.TreeStateChildrenYes-ExpandOpen .TreeIconContent {\n background-image : url('../templates/images/TreeV3/i_long.gif');\n background-repeat : no-repeat;\n background-position: 18px 9px;\n}\n\n/* close has higher priority */\n.TreeStateChildrenYes-ExpandClosed .TreeIconContent {\n background-image : url();\n}\n\n/* higher priotity: same length and appear after background-definition */\n.TreeStateChildrenNo-ExpandLeaf .TreeIconContent {\n background-image : url();\n}\n\n.TreeStateChildrenNo-ExpandClosed .TreeIconContent {\n background-image : url();\n}\n\n.TreeStateChildrenNo-ExpandOpen .TreeIconContent {\n background-image : url();\n}\n\n\n/* highest priority */\n.TreeIconDocument {\n background-image: url('../templates/images/TreeV3/document.gif');\n}\n\n.TreeExpandOpen .TreeIconFolder {\n background-image: url('../templates/images/TreeV3/open.gif');\n}\n\n.TreeExpandClosed .TreeIconFolder {\n background-image: url('../templates/images/TreeV3/closed.gif');\n}\n\n/* generic class for docIcon */\n.TreeIcon {\n width: 18px;\n height: 18px;\n float: left;\n display: inline;\n background-repeat : no-repeat;\n}\n\ndiv.TreeContent {\n margin-left: 36px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeDocIcon.css"), listenTreeEvents:["afterChangeTree", "afterSetFolder", "afterUnsetFolder"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, getnodeDocType:function (node) {
var nodeDocType = node.getnodeDocType();
if (!nodeDocType) {
nodeDocType = node.isFolder ? "Folder" : "Document";
}
return nodeDocType;
}, setnodeDocTypeClass:function (node) {
var reg = new RegExp("(^|\\s)" + node.tree.classPrefix + "Icon\\w+", "g");
var clazz = dojo.html.getClass(node.iconNode).replace(reg, "") + " " + node.tree.classPrefix + "Icon" + this.getnodeDocType(node);
dojo.html.setClass(node.iconNode, clazz);
}, onAfterSetFolder:function (message) {
if (message.source.iconNode) {
this.setnodeDocTypeClass(message.source);
}
}, onAfterUnsetFolder:function (message) {
this.setnodeDocTypeClass(message.source);
}, listenNode:function (node) {
node.contentIconNode = document.createElement("div");
var clazz = node.tree.classPrefix + "IconContent";
if (dojo.render.html.ie) {
clazz = clazz + " " + node.tree.classPrefix + "IEIconContent";
}
dojo.html.setClass(node.contentIconNode, clazz);
node.contentNode.parentNode.replaceChild(node.contentIconNode, node.expandNode);
node.iconNode = document.createElement("div");
dojo.html.setClass(node.iconNode, node.tree.classPrefix + "Icon" + " " + node.tree.classPrefix + "Icon" + this.getnodeDocType(node));
node.contentIconNode.appendChild(node.expandNode);
node.contentIconNode.appendChild(node.iconNode);
dojo.dom.removeNode(node.contentNode);
node.contentIconNode.appendChild(node.contentNode);
}, onAfterChangeTree:function (message) {
var _this = this;
if (!message.oldTree || !this.listenedTrees[message.oldTree.widgetId]) {
this.processDescendants(message.node, this.listenNodeFilter, this.listenNode);
}
}});
 
/trunk/api/js/dojo/src/widget/SvgButton.js
New file
0,0 → 1,98
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SvgButton");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.SvgButton");
dojo.widget.SvgButton = function () {
dojo.widget.DomButton.call(this);
dojo.widget.SvgWidget.call(this);
this.onFoo = function () {
alert("bar");
};
this.label = "huzzah!";
this.setLabel = function (x, y, textSize, label, shape) {
var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);
var textString = "";
switch (shape) {
case "ellipse":
textString = "<text x='" + coords[6] + "' y='" + coords[7] + "'>" + label + "</text>";
break;
case "rectangle":
textString = "";
break;
case "circle":
textString = "";
break;
}
return textString;
};
this.fillInTemplate = function (x, y, textSize, label, shape) {
this.textSize = textSize || 12;
this.label = label;
var textWidth = this.label.length * this.textSize;
};
};
dojo.inherits(dojo.widget.SvgButton, dojo.widget.DomButton);
dojo.widget.SvgButton.prototype.shapeString = function (x, y, textSize, label, shape) {
switch (shape) {
case "ellipse":
var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);
return "<ellipse cx='" + coords[4] + "' cy='" + coords[5] + "' rx='" + coords[2] + "' ry='" + coords[3] + "'/>";
break;
case "rect":
return "";
break;
case "circle":
return "";
break;
}
};
dojo.widget.SvgButton.prototype.coordinates = function (x, y, textSize, label, shape) {
switch (shape) {
case "ellipse":
var buttonWidth = label.length * textSize;
var buttonHeight = textSize * 2.5;
var rx = buttonWidth / 2;
var ry = buttonHeight / 2;
var cx = rx + x;
var cy = ry + y;
var textX = cx - rx * textSize / 25;
var textY = cy * 1.1;
return [buttonWidth, buttonHeight, rx, ry, cx, cy, textX, textY];
break;
case "rectangle":
return "";
break;
case "circle":
return "";
break;
}
};
dojo.widget.SvgButton.prototype.labelString = function (x, y, textSize, label, shape) {
var textString = "";
var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);
switch (shape) {
case "ellipse":
textString = "<text x='" + coords[6] + "' y='" + coords[7] + "'>" + label + "</text>";
break;
case "rectangle":
textString = "";
break;
case "circle":
textString = "";
break;
}
return textString;
};
dojo.widget.SvgButton.prototype.templateString = function (x, y, textSize, label, shape) {
return "<g class='dojoButton' dojoAttachEvent='onClick; onMouseMove: onFoo;' dojoAttachPoint='labelNode'>" + dojo.widgets.SVGButton.prototype.shapeString(x, y, textSize, label, shape) + dojo.widget.SVGButton.prototype.labelString(x, y, textSize, label, shape) + "</g>";
};
 
/trunk/api/js/dojo/src/widget/TimePicker.js
New file
0,0 → 1,276
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TimePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.date.serialize");
dojo.require("dojo.date.format");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.requireLocalization("dojo.i18n.calendar", "gregorian", null, "de,en,es,fi,fr,hu,ja,it,ko,nl,pt,sv,zh,pt-br,zh-cn,zh-hk,zh-tw,ROOT");
dojo.requireLocalization("dojo.widget", "TimePicker", null, "ROOT");
dojo.widget.defineWidget("dojo.widget.TimePicker", dojo.widget.HtmlWidget, function () {
this.time = "";
this.useDefaultTime = false;
this.useDefaultMinutes = false;
this.storedTime = "";
this.currentTime = {};
this.classNames = {selectedTime:"selectedItem"};
this.any = "any";
this.selectedTime = {hour:"", minute:"", amPm:"", anyTime:false};
this.hourIndexMap = ["", 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11, 0];
this.minuteIndexMap = [0, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11];
}, {isContainer:false, templateString:"<div class=\"timePickerContainer\" dojoAttachPoint=\"timePickerContainerNode\">\n\t<table class=\"timeContainer\" cellspacing=\"0\" >\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<td class=\"timeCorner cornerTopLeft\" valign=\"top\">&nbsp;</td>\n\t\t\t\t<td class=\"timeLabelContainer hourSelector\">${this.calendar.field-hour}</td>\n\t\t\t\t<td class=\"timeLabelContainer minutesHeading\">${this.calendar.field-minute}</td>\n\t\t\t\t<td class=\"timeCorner cornerTopRight\" valign=\"top\">&nbsp;</td>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td valign=\"top\" colspan=\"2\" class=\"hours\">\n\t\t\t\t\t<table align=\"center\">\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"hourContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedHour;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>12</td>\n\t\t\t\t\t\t\t\t<td>6</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>1</td>\n\t\t\t\t\t\t\t\t<td>7</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>2</td>\n\t\t\t\t\t\t\t\t<td>8</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>3</td>\n\t\t\t\t\t\t\t\t<td>9</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>4</td>\n\t\t\t\t\t\t\t\t<td>10</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>5</td>\n\t\t\t\t\t\t\t\t<td>11</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td valign=\"top\" class=\"minutes\" colspan=\"2\">\n\t\t\t\t\t<table align=\"center\">\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"minuteContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedMinute;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>00</td>\n\t\t\t\t\t\t\t\t<td>30</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>05</td>\n\t\t\t\t\t\t\t\t<td>35</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>10</td>\n\t\t\t\t\t\t\t\t<td>40</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>15</td>\n\t\t\t\t\t\t\t\t<td>45</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>20</td>\n\t\t\t\t\t\t\t\t<td>50</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>25</td>\n\t\t\t\t\t\t\t\t<td>55</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=\"cornerBottomLeft\">&nbsp;</td>\n\t\t\t\t<td valign=\"top\" class=\"timeOptions\">\n\t\t\t\t\t<table class=\"amPmContainer\">\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"amPmContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedAmPm;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td id=\"am\">${this.calendar.am}</td>\n\t\t\t\t\t\t\t\t<td id=\"pm\">${this.calendar.pm}</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"timeOptions\">\n\t\t\t\t\t<div dojoAttachPoint=\"anyTimeContainerNode\" \n\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedAnyTime;\" \n\t\t\t\t\t\tclass=\"anyTimeContainer\">${this.widgetStrings.any}</div>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"cornerBottomRight\">&nbsp;</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:"/*Time Picker */\n.timePickerContainer {\n\twidth:122px;\n\tfont-family:Tahoma, Myriad, Helvetica, Arial, Verdana, sans-serif;\n\tfont-size:16px;\n}\n\n.timeContainer {\n\tborder-collapse:collapse;\n\tborder-spacing:0;\n}\n\n.timeContainer thead {\n\tcolor:#293a4b;\n\tfont-size:0.9em;\n\tfont-weight:700;\n}\n\n.timeContainer thead td {\n\tpadding:0.25em;\n\tfont-size:0.80em;\n\tborder-bottom:1px solid #6782A8;\n}\n\n.timeCorner {\n\twidth:10px;\n}\n\n.cornerTopLeft {\n\tbackground: url(\"images/dpCurveTL.png\") top left no-repeat;\n}\n\n.cornerTopRight {\n\tbackground: url(\"images/dpCurveTR.png\") top right no-repeat;\n}\n\n.timeLabelContainer {\n\tbackground: url(\"images/dpMonthBg.png\") top left repeat-x;\n}\n\n.hours, .minutes, .timeBorder {\n\tbackground: #7591bc url(\"images/dpBg.gif\") top left repeat-x;\n\n}\n\n.hours td, .minutes td {\n\tpadding:0.2em;\n\ttext-align:center;\n\tfont-size:0.7em;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tcursor:hand;\n\tcolor:#fff;\n}\n\n.minutes {\n\tborder-left:1px solid #f5d1db;\n}\n\n.hours {\n\tborder-right:1px solid #6782A8;\n}\n\n.hourSelector {\n\tborder-right:1px solid #6782A8;\n\tpadding:5px;\n\tpadding-right:10px;\n}\n\n.minutesSelector {\n\tpadding:5px;\n\tborder-left:1px solid #f5c7d4;\n\ttext-align:center;\n}\n\n.minutesHeading {\n\tpadding-left:9px !important;\n}\n\n.timeOptions {\n\tbackground-color:#F9C9D7;\n}\n\n.timeContainer .cornerBottomLeft, .timeContainer .cornerBottomRight, .timeContainer .timeOptions {\n\tborder-top:1px solid #6782A8;\n}\n\n.timeContainer .cornerBottomLeft {\n\tbackground: url(\"images/dpCurveBL.png\") bottom left no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n.timeContainer .cornerBottomRight {\n\tbackground: url(\"images/dpCurveBR.png\") bottom right no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n.timeOptions {\n\tcolor:#fff;\n\tbackground:url(\"images/dpYearBg.png\") top left repeat-x;\n\n}\n\n.selectedItem {\n\tbackground-color:#fff;\n\tcolor:#6782a8 !important;\n}\n\n.timeOptions .selectedItem {\n\tcolor:#fff !important;\n\tbackground-color:#9ec3fb !important;\n}\n\n.anyTimeContainer {\n\ttext-align:center;\n\tfont-weight:bold;\n\tfont-size:0.7em;\n\tpadding:0.1em;\n\tcursor:pointer;\n\tcursor:hand;\n\tcolor:#fff !important;\n}\n\n.amPmContainer {\n\twidth:100%;\n}\n\n.amPmContainer td {\n\ttext-align:center;\n\tfont-size:0.7em;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tcursor:hand;\n\tcolor:#fff;\n}\n\n\n\n/*.timePickerContainer {\n\tmargin:1.75em 0 0.5em 0;\n\twidth:10em;\n\tfloat:left;\n}\n\n.timeContainer {\n\tborder-collapse:collapse;\n\tborder-spacing:0;\n}\n\n.timeContainer thead td{\n\tborder-bottom:1px solid #e6e6e6;\n\tpadding:0 0.4em 0.2em 0.4em;\n}\n\n.timeContainer td {\n\tfont-size:0.9em;\n\tpadding:0 0.25em 0 0.25em;\n\ttext-align:left;\n\tcursor:pointer;cursor:hand;\n}\n\n.timeContainer td.minutesHeading {\n\tborder-left:1px solid #e6e6e6;\n\tborder-right:1px solid #e6e6e6;\t\n}\n\n.timeContainer .minutes {\n\tborder-left:1px solid #e6e6e6;\n\tborder-right:1px solid #e6e6e6;\n}\n\n.selectedItem {\n\tbackground-color:#3a3a3a;\n\tcolor:#ffffff;\n}*/\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TimePicker.css"), postMixInProperties:function (localProperties, frag) {
dojo.widget.TimePicker.superclass.postMixInProperties.apply(this, arguments);
this.calendar = dojo.i18n.getLocalization("dojo.i18n.calendar", "gregorian", this.lang);
this.widgetStrings = dojo.i18n.getLocalization("dojo.widget", "TimePicker", this.lang);
}, fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
if (args.value) {
if (args.value instanceof Date) {
this.storedTime = dojo.date.toRfc3339(args.value);
} else {
this.storedTime = args.value;
}
}
this.initData();
this.initUI();
}, initData:function () {
if (this.storedTime.indexOf("T") != -1 && this.storedTime.split("T")[1] && this.storedTime != " " && this.storedTime.split("T")[1] != "any") {
this.time = dojo.widget.TimePicker.util.fromRfcDateTime(this.storedTime, this.useDefaultMinutes, this.selectedTime.anyTime);
} else {
if (this.useDefaultTime) {
this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes, this.selectedTime.anyTime);
} else {
this.selectedTime.anyTime = true;
this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", 0, 1);
}
}
}, initUI:function () {
if (!this.selectedTime.anyTime && this.time) {
var amPmHour = dojo.widget.TimePicker.util.toAmPmHour(this.time.getHours());
var hour = amPmHour[0];
var isAm = amPmHour[1];
var minute = this.time.getMinutes();
var minuteIndex = parseInt(minute / 5);
this.onSetSelectedHour(this.hourIndexMap[hour]);
this.onSetSelectedMinute(this.minuteIndexMap[minuteIndex]);
this.onSetSelectedAmPm(isAm);
} else {
this.onSetSelectedAnyTime();
}
}, setTime:function (date) {
if (date) {
this.selectedTime.anyTime = false;
this.setDateTime(dojo.date.toRfc3339(date));
} else {
this.selectedTime.anyTime = true;
}
this.initData();
this.initUI();
}, setDateTime:function (rfcDate) {
this.storedTime = rfcDate;
}, onClearSelectedHour:function (evt) {
this.clearSelectedHour();
}, onClearSelectedMinute:function (evt) {
this.clearSelectedMinute();
}, onClearSelectedAmPm:function (evt) {
this.clearSelectedAmPm();
}, onClearSelectedAnyTime:function (evt) {
this.clearSelectedAnyTime();
if (this.selectedTime.anyTime) {
this.selectedTime.anyTime = false;
this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes);
this.initUI();
}
}, clearSelectedHour:function () {
var hourNodes = this.hourContainerNode.getElementsByTagName("td");
for (var i = 0; i < hourNodes.length; i++) {
dojo.html.setClass(hourNodes.item(i), "");
}
}, clearSelectedMinute:function () {
var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");
for (var i = 0; i < minuteNodes.length; i++) {
dojo.html.setClass(minuteNodes.item(i), "");
}
}, clearSelectedAmPm:function () {
var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
for (var i = 0; i < amPmNodes.length; i++) {
dojo.html.setClass(amPmNodes.item(i), "");
}
}, clearSelectedAnyTime:function () {
dojo.html.setClass(this.anyTimeContainerNode, "anyTimeContainer");
}, onSetSelectedHour:function (evt) {
this.onClearSelectedAnyTime();
this.onClearSelectedHour();
this.setSelectedHour(evt);
this.onSetTime();
}, setSelectedHour:function (evt) {
if (evt && evt.target) {
if (evt.target.nodeType == dojo.dom.ELEMENT_NODE) {
var eventTarget = evt.target;
} else {
var eventTarget = evt.target.parentNode;
}
dojo.event.browser.stopEvent(evt);
dojo.html.setClass(eventTarget, this.classNames.selectedTime);
this.selectedTime["hour"] = eventTarget.innerHTML;
} else {
if (!isNaN(evt)) {
var hourNodes = this.hourContainerNode.getElementsByTagName("td");
if (hourNodes.item(evt)) {
dojo.html.setClass(hourNodes.item(evt), this.classNames.selectedTime);
this.selectedTime["hour"] = hourNodes.item(evt).innerHTML;
}
}
}
this.selectedTime.anyTime = false;
}, onSetSelectedMinute:function (evt) {
this.onClearSelectedAnyTime();
this.onClearSelectedMinute();
this.setSelectedMinute(evt);
this.selectedTime.anyTime = false;
this.onSetTime();
}, setSelectedMinute:function (evt) {
if (evt && evt.target) {
if (evt.target.nodeType == dojo.dom.ELEMENT_NODE) {
var eventTarget = evt.target;
} else {
var eventTarget = evt.target.parentNode;
}
dojo.event.browser.stopEvent(evt);
dojo.html.setClass(eventTarget, this.classNames.selectedTime);
this.selectedTime["minute"] = eventTarget.innerHTML;
} else {
if (!isNaN(evt)) {
var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");
if (minuteNodes.item(evt)) {
dojo.html.setClass(minuteNodes.item(evt), this.classNames.selectedTime);
this.selectedTime["minute"] = minuteNodes.item(evt).innerHTML;
}
}
}
}, onSetSelectedAmPm:function (evt) {
this.onClearSelectedAnyTime();
this.onClearSelectedAmPm();
this.setSelectedAmPm(evt);
this.selectedTime.anyTime = false;
this.onSetTime();
}, setSelectedAmPm:function (evt) {
var eventTarget = evt.target;
if (evt && eventTarget) {
if (eventTarget.nodeType != dojo.dom.ELEMENT_NODE) {
eventTarget = eventTarget.parentNode;
}
dojo.event.browser.stopEvent(evt);
this.selectedTime.amPm = eventTarget.id;
dojo.html.setClass(eventTarget, this.classNames.selectedTime);
} else {
evt = evt ? 0 : 1;
var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
if (amPmNodes.item(evt)) {
this.selectedTime.amPm = amPmNodes.item(evt).id;
dojo.html.setClass(amPmNodes.item(evt), this.classNames.selectedTime);
}
}
}, onSetSelectedAnyTime:function (evt) {
this.onClearSelectedHour();
this.onClearSelectedMinute();
this.onClearSelectedAmPm();
this.setSelectedAnyTime();
this.onSetTime();
}, setSelectedAnyTime:function (evt) {
this.selectedTime.anyTime = true;
dojo.html.setClass(this.anyTimeContainerNode, this.classNames.selectedTime + " " + "anyTimeContainer");
}, onClick:function (evt) {
dojo.event.browser.stopEvent(evt);
}, onSetTime:function () {
if (this.selectedTime.anyTime) {
this.time = new Date();
var tempDateTime = dojo.widget.TimePicker.util.toRfcDateTime(this.time);
this.setDateTime(tempDateTime.split("T")[0]);
} else {
var hour = 12;
var minute = 0;
var isAm = false;
if (this.selectedTime["hour"]) {
hour = parseInt(this.selectedTime["hour"], 10);
}
if (this.selectedTime["minute"]) {
minute = parseInt(this.selectedTime["minute"], 10);
}
if (this.selectedTime["amPm"]) {
isAm = (this.selectedTime["amPm"].toLowerCase() == "am");
}
this.time = new Date();
this.time.setHours(dojo.widget.TimePicker.util.fromAmPmHour(hour, isAm));
this.time.setMinutes(minute);
this.setDateTime(dojo.widget.TimePicker.util.toRfcDateTime(this.time));
}
this.onValueChanged(this.time);
}, onValueChanged:function (date) {
}});
dojo.widget.TimePicker.util = new function () {
this.toRfcDateTime = function (jsDate) {
if (!jsDate) {
jsDate = new Date();
}
jsDate.setSeconds(0);
return dojo.date.strftime(jsDate, "%Y-%m-%dT%H:%M:00%z");
};
this.fromRfcDateTime = function (rfcDate, useDefaultMinutes, isAnyTime) {
var tempDate = new Date();
if (!rfcDate || rfcDate.indexOf("T") == -1) {
if (useDefaultMinutes) {
tempDate.setMinutes(Math.floor(tempDate.getMinutes() / 5) * 5);
} else {
tempDate.setMinutes(0);
}
} else {
var tempTime = rfcDate.split("T")[1].split(":");
var tempDate = new Date();
tempDate.setHours(tempTime[0]);
tempDate.setMinutes(tempTime[1]);
}
return tempDate;
};
this.toAmPmHour = function (hour) {
var amPmHour = hour;
var isAm = true;
if (amPmHour == 0) {
amPmHour = 12;
} else {
if (amPmHour > 12) {
amPmHour = amPmHour - 12;
isAm = false;
} else {
if (amPmHour == 12) {
isAm = false;
}
}
}
return [amPmHour, isAm];
};
this.fromAmPmHour = function (amPmHour, isAm) {
var hour = parseInt(amPmHour, 10);
if (isAm && hour == 12) {
hour = 0;
} else {
if (!isAm && hour < 12) {
hour = hour + 12;
}
}
return hour;
};
};
 
/trunk/api/js/dojo/src/widget/ColorPalette.js
New file
0,0 → 1,58
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ColorPalette");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.ColorPalette", dojo.widget.HtmlWidget, {palette:"7x10", _palettes:{"7x10":[["fff", "fcc", "fc9", "ff9", "ffc", "9f9", "9ff", "cff", "ccf", "fcf"], ["ccc", "f66", "f96", "ff6", "ff3", "6f9", "3ff", "6ff", "99f", "f9f"], ["c0c0c0", "f00", "f90", "fc6", "ff0", "3f3", "6cc", "3cf", "66c", "c6c"], ["999", "c00", "f60", "fc3", "fc0", "3c0", "0cc", "36f", "63f", "c3c"], ["666", "900", "c60", "c93", "990", "090", "399", "33f", "60c", "939"], ["333", "600", "930", "963", "660", "060", "366", "009", "339", "636"], ["000", "300", "630", "633", "330", "030", "033", "006", "309", "303"]], "3x4":[["ffffff", "00ff00", "008000", "0000ff"], ["c0c0c0", "ffff00", "ff00ff", "000080"], ["808080", "ff0000", "800080", "000000"]]}, buildRendering:function () {
this.domNode = document.createElement("table");
dojo.html.disableSelection(this.domNode);
dojo.event.connect(this.domNode, "onmousedown", function (e) {
e.preventDefault();
});
with (this.domNode) {
cellPadding = "0";
cellSpacing = "1";
border = "1";
style.backgroundColor = "white";
}
var colors = this._palettes[this.palette];
for (var i = 0; i < colors.length; i++) {
var tr = this.domNode.insertRow(-1);
for (var j = 0; j < colors[i].length; j++) {
if (colors[i][j].length == 3) {
colors[i][j] = colors[i][j].replace(/(.)(.)(.)/, "$1$1$2$2$3$3");
}
var td = tr.insertCell(-1);
with (td.style) {
backgroundColor = "#" + colors[i][j];
border = "1px solid gray";
width = height = "15px";
fontSize = "1px";
}
td.color = "#" + colors[i][j];
td.onmouseover = function (e) {
this.style.borderColor = "white";
};
td.onmouseout = function (e) {
this.style.borderColor = "gray";
};
dojo.event.connect(td, "onmousedown", this, "onClick");
td.innerHTML = "&nbsp;";
}
}
}, onClick:function (e) {
this.onColorSelect(e.currentTarget.color);
e.currentTarget.style.borderColor = "gray";
}, onColorSelect:function (color) {
}});
 
/trunk/api/js/dojo/src/widget/demoEngine/DemoNavigator.js
New file
0,0 → 1,132
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoNavigator");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Button");
dojo.require("dojo.widget.demoEngine.DemoItem");
dojo.require("dojo.io.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.lang.common");
dojo.widget.defineWidget("my.widget.demoEngine.DemoNavigator", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n\t\t<tbody>\n\t\t\t<tr dojoAttachPoint=\"navigationContainer\">\n\t\t\t\t<td dojoAttachPoint=\"categoriesNode\" valign=\"top\" width=\"1%\">\n\t\t\t\t\t<h1>Categories</h1>\n\t\t\t\t\t<div dojoAttachPoint=\"categoriesButtonsNode\"></div>\n\t\t\t\t</td>\n\n\t\t\t\t<td dojoAttachPoint=\"demoListNode\" valign=\"top\">\n\t\t\t\t\t<div dojoAttachPoint=\"demoListWrapperNode\">\n\t\t\t\t\t\t<div dojoAttachPoint=\"demoListContainerNode\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t<div dojoAttachPoint=\"demoNode\"></div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:".demoNavigatorListWrapper {\n\tborder:1px solid #dcdbdb;\n\tbackground-color:#f8f8f8;\n\tpadding:2px;\n}\n\n.demoNavigatorListContainer {\n\tborder:1px solid #f0f0f0;\n\tbackground-color:#fff;\n\tpadding:1em;\n}\n\n.demoNavigator h1 {\n\tmargin-top: 0px;\n\tmargin-bottom: 10px;\n\tfont-size: 1.2em;\n\tborder-bottom:1px dotted #a9ccf5;\n}\n\n.demoNavigator .dojoButton {\n\tmargin-bottom: 5px;\n}\n\n.demoNavigator .dojoButton .dojoButtonContents {\n\tfont-size: 1.1em;\n\twidth: 100px;\n\tcolor: black;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoNavigator.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.html.addClass(this.demoListWrapperNode, this.demoListWrapperClass);
dojo.html.addClass(this.demoListContainerNode, this.demoListContainerClass);
if (dojo.render.html.ie) {
dojo.debug("render ie");
dojo.html.hide(this.demoListWrapperNode);
} else {
dojo.debug("render non-ie");
dojo.lfx.html.fadeHide(this.demoListWrapperNode, 0).play();
}
this.getRegistry(this.demoRegistryUrl);
this.demoContainer = dojo.widget.createWidget("DemoContainer", {returnImage:this.returnImage}, this.demoNode);
dojo.event.connect(this.demoContainer, "returnToDemos", this, "returnToDemos");
this.demoContainer.hide();
}, returnToDemos:function () {
this.demoContainer.hide();
if (dojo.render.html.ie) {
dojo.debug("render ie");
dojo.html.show(this.navigationContainer);
} else {
dojo.debug("render non-ie");
dojo.lfx.html.fadeShow(this.navigationContainer, 250).play();
}
dojo.lang.forEach(this.categoriesChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
dojo.lang.forEach(this.demoListChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
}, show:function () {
dojo.html.show(this.domNode);
dojo.html.setOpacity(this.domNode, 1);
dojo.html.setOpacity(this.navigationContainer, 1);
dojo.lang.forEach(this.categoriesChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
dojo.lang.forEach(this.demoListChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
}, getRegistry:function (url) {
dojo.io.bind({url:url, load:dojo.lang.hitch(this, this.processRegistry), mimetype:"text/json"});
}, processRegistry:function (type, registry, e) {
dojo.debug("Processing Registry");
this.registry = registry;
dojo.lang.forEach(this.registry.navigation, dojo.lang.hitch(this, this.addCategory));
}, addCategory:function (category) {
var newCat = dojo.widget.createWidget("Button", {caption:category.name});
if (!dojo.lang.isObject(this.registry.categories)) {
this.registry.categories = function () {
};
}
this.registry.categories[category.name] = category;
this.categoriesChildren.push(newCat);
this.categoriesButtonsNode.appendChild(newCat.domNode);
newCat.domNode.categoryName = category.name;
dojo.event.connect(newCat, "onClick", this, "onSelectCategory");
}, addDemo:function (demoName) {
var demo = this.registry.definitions[demoName];
if (dojo.render.html.ie) {
dojo.html.show(this.demoListWrapperNode);
} else {
dojo.lfx.html.fadeShow(this.demoListWrapperNode, 250).play();
}
var newDemo = dojo.widget.createWidget("DemoItem", {viewDemoImage:this.viewDemoImage, name:demoName, description:demo.description, thumbnail:demo.thumbnail});
this.demoListChildren.push(newDemo);
this.demoListContainerNode.appendChild(newDemo.domNode);
dojo.event.connect(newDemo, "onSelectDemo", this, "onSelectDemo");
}, onSelectCategory:function (e) {
catName = e.currentTarget.categoryName;
dojo.debug("Selected Category: " + catName);
dojo.lang.forEach(this.demoListChildren, function (child) {
child.destroy();
});
this.demoListChildren = [];
dojo.lang.forEach(this.registry.categories[catName].demos, dojo.lang.hitch(this, function (demoName) {
this.addDemo(demoName);
}));
}, onSelectDemo:function (e) {
dojo.debug("Demo Selected: " + e.target.name);
if (dojo.render.html.ie) {
dojo.debug("render ie");
dojo.html.hide(this.navigationContainer);
this.demoContainer.show();
this.demoContainer.showDemo();
} else {
dojo.debug("render non-ie");
dojo.lfx.html.fadeHide(this.navigationContainer, 250, null, dojo.lang.hitch(this, function () {
this.demoContainer.show();
this.demoContainer.showDemo();
})).play();
}
this.demoContainer.loadDemo(this.registry.definitions[e.target.name].url);
this.demoContainer.setName(e.target.name);
this.demoContainer.setSummary(this.registry.definitions[e.target.name].description);
}}, "", function () {
this.demoRegistryUrl = "demoRegistry.json";
this.registry = function () {
};
this.categoriesNode = "";
this.categoriesButtonsNode = "";
this.navigationContainer = "";
this.domNodeClass = "demoNavigator";
this.demoNode = "";
this.demoContainer = "";
this.demoListWrapperNode = "";
this.demoListWrapperClass = "demoNavigatorListWrapper";
this.demoListContainerClass = "demoNavigatorListContainer";
this.returnImage = "images/dojoDemos.gif";
this.viewDemoImage = "images/viewDemo.png";
this.demoListChildren = [];
this.categoriesChildren = [];
});
 
/trunk/api/js/dojo/src/widget/demoEngine/DemoItem.js
New file
0,0 → 1,50
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoItem");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("my.widget.demoEngine.DemoItem", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<div dojoAttachPoint=\"summaryBoxNode\">\n\t\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td dojoAttachPoint=\"screenshotTdNode\" valign=\"top\" width=\"1%\">\n\t\t\t\t\t\t<img dojoAttachPoint=\"thumbnailImageNode\" dojoAttachEvent=\"onclick: onSelectDemo\" />\n\t\t\t\t\t</td>\n\t\t\t\t\t<td dojoAttachPoint=\"summaryContainerNode\" valign=\"top\">\n\t\t\t\t\t\t<h1 dojoAttachPoint=\"nameNode\">\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t<div dojoAttachPoint=\"summaryNode\">\n\t\t\t\t\t\t\t<p dojoAttachPoint=\"descriptionNode\"></p>\n\t\t\t\t\t\t\t<div dojoAttachPoint=\"viewDemoLinkNode\"><img dojoAttachPoint=\"viewDemoImageNode\"/ dojoAttachEvent=\"onclick: onSelectDemo\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n", templateCssString:".demoItemSummaryBox {\n\tbackground: #efefef;\n\tborder:1px solid #dae3ee;\n}\n\n.demoItemScreenshot {\n\tpadding:0.65em;\n\twidth:175px;\n\tborder-right:1px solid #fafafa;\n\ttext-align:center;\n\tcursor: pointer;\n}\n\n.demoItemWrapper{\n\tmargin-bottom:1em;\n}\n\n.demoItemWrapper a:link, .demoItemWrapper a:visited {\n\tcolor:#a6238f;\n\ttext-decoration:none;\n}\n\n.demoItemSummaryContainer {\n\tborder-left:1px solid #ddd;\n}\n\n.demoItemSummaryContainer h1 {\n\tbackground-color:#e8e8e8;\n\tborder-bottom: 1px solid #e6e6e6;\n\tcolor:#738fb9;\n\tmargin:1px;\n\tpadding:0.5em;\n\tfont-family:\"Lucida Grande\", \"Tahoma\", serif;\n\tfont-size:1.25em;\n\tfont-weight:normal;\n}\n\n.demoItemSummaryContainer h1 .packageSummary {\n\tdisplay:block;\n\tcolor:#000;\n\tfont-size:10px;\n\tmargin-top:2px;\n}\n\n.demoItemSummaryContainer .demoItemSummary{\n\tpadding:1em;\n}\n\n.demoItemSummaryContainer .demoItemSummary p {\n\tfont-size:0.85em;\n\tpadding:0;\n\tmargin:0;\n}\n\n.demoItemView {\n\ttext-align:right;\n\tcursor: pointer;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoItem.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.html.addClass(this.summaryBoxNode, this.summaryBoxClass);
dojo.html.addClass(this.screenshotTdNode, this.screenshotTdClass);
dojo.html.addClass(this.summaryContainerNode, this.summaryContainerClass);
dojo.html.addClass(this.summaryNode, this.summaryClass);
dojo.html.addClass(this.viewDemoLinkNode, this.viewDemoLinkClass);
this.nameNode.appendChild(document.createTextNode(this.name));
this.descriptionNode.appendChild(document.createTextNode(this.description));
this.thumbnailImageNode.src = this.thumbnail;
this.thumbnailImageNode.name = this.name;
this.viewDemoImageNode.src = this.viewDemoImage;
this.viewDemoImageNode.name = this.name;
}, onSelectDemo:function () {
}}, "", function () {
this.demo = "";
this.domNodeClass = "demoItemWrapper";
this.summaryBoxNode = "";
this.summaryBoxClass = "demoItemSummaryBox";
this.nameNode = "";
this.thumbnailImageNode = "";
this.viewDemoImageNode = "";
this.screenshotTdNode = "";
this.screenshotTdClass = "demoItemScreenshot";
this.summaryContainerNode = "";
this.summaryContainerClass = "demoItemSummaryContainer";
this.summaryNode = "";
this.summaryClass = "demoItemSummary";
this.viewDemoLinkNode = "";
this.viewDemoLinkClass = "demoItemView";
this.descriptionNode = "";
this.name = "Some Demo";
this.description = "This is the description of this demo.";
this.thumbnail = "images/test_thumb.gif";
this.viewDemoImage = "images/viewDemo.png";
});
 
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoContainer.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoContainer.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoNavigator.html
New file
0,0 → 1,24
<div dojoAttachPoint="domNode">
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
<tr dojoAttachPoint="navigationContainer">
<td dojoAttachPoint="categoriesNode" valign="top" width="1%">
<h1>Categories</h1>
<div dojoAttachPoint="categoriesButtonsNode"></div>
</td>
 
<td dojoAttachPoint="demoListNode" valign="top">
<div dojoAttachPoint="demoListWrapperNode">
<div dojoAttachPoint="demoListContainerNode">
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div dojoAttachPoint="demoNode"></div>
</td>
</tr>
</tbody>
</table>
</div>
/trunk/api/js/dojo/src/widget/demoEngine/templates/general.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/general.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/templates/images/test_thumb.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/images/test_thumb.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/templates/images/viewDemo.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/images/viewDemo.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoItem.html
New file
0,0 → 1,21
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="summaryBoxNode">
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td dojoAttachPoint="screenshotTdNode" valign="top" width="1%">
<img dojoAttachPoint="thumbnailImageNode" dojoAttachEvent="onclick: onSelectDemo" />
</td>
<td dojoAttachPoint="summaryContainerNode" valign="top">
<h1 dojoAttachPoint="nameNode">
</h1>
<div dojoAttachPoint="summaryNode">
<p dojoAttachPoint="descriptionNode"></p>
<div dojoAttachPoint="viewDemoLinkNode"><img dojoAttachPoint="viewDemoImageNode"/ dojoAttachEvent="onclick: onSelectDemo"></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoNavigator.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoNavigator.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/templates/SourcePane.html
New file
0,0 → 1,3
<div dojoAttachPoint="domNode">
<textarea dojoAttachPoint="sourceNode" rows="100%"></textarea>
</div>
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoContainer.html
New file
0,0 → 1,25
<div dojoAttachPoint="domNode">
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
<tr dojoAttachPoint="headerNode">
<td dojoAttachPoint="returnNode" valign="middle" width="1%">
<img dojoAttachPoint="returnImageNode" dojoAttachEvent="onclick: returnToDemos"/>
</td>
<td>
<h1 dojoAttachPoint="demoNameNode"></h1>
<p dojoAttachPoint="summaryNode"></p>
</td>
<td dojoAttachPoint="tabControlNode" valign="middle" align="right" nowrap>
<span dojoAttachPoint="sourceButtonNode" dojoAttachEvent="onclick: showSource">source</span>
<span dojoAttachPoint="demoButtonNode" dojoAttachEvent="onclick: showDemo">demo</span>
</td>
</tr>
<tr>
<td colspan="3">
<div dojoAttachPoint="tabNode">
</div>
</td>
</tr>
</tbody>
</table>
</div>
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoItem.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoItem.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/templates/DemoPane.html
New file
0,0 → 1,3
<div dojoAttachPoint="domNode">
<iframe dojoAttachPoint="demoNode"></iframe>
</div>
/trunk/api/js/dojo/src/widget/demoEngine/templates/SourcePane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/api/js/dojo/src/widget/demoEngine/templates/SourcePane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/api/js/dojo/src/widget/demoEngine/SourcePane.js
New file
0,0 → 1,33
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.SourcePane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("my.widget.demoEngine.SourcePane", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<textarea dojoAttachPoint=\"sourceNode\" rows=\"100%\"></textarea>\n</div>\n", templateCssString:".sourcePane {\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 0px;\n\tmargin: 0px;\n\toverflow: hidden;\n}\n\n.sourcePane textarea{\n\twidth: 100%;\n\theight: 100%;\n\tborder: 0px;\n\toverflow: auto;\n\tpadding: 0px;\n\tmargin:0px;\n}\n\n* html .sourcePane {\n\toverflow: auto;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/SourcePane.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.debug("PostCreate");
}, getSource:function () {
if (this.href) {
dojo.io.bind({url:this.href, load:dojo.lang.hitch(this, "fillInSource"), mimetype:"text/plain"});
}
}, fillInSource:function (type, source, e) {
this.sourceNode.value = source;
}, setHref:function (url) {
this.href = url;
this.getSource();
}}, "", function () {
dojo.debug("SourcePane Init");
this.domNodeClass = "sourcePane";
this.sourceNode = "";
this.href = "";
});
 
/trunk/api/js/dojo/src/widget/demoEngine/DemoContainer.js
New file
0,0 → 1,73
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.demoEngine.DemoPane");
dojo.require("dojo.widget.demoEngine.SourcePane");
dojo.require("dojo.widget.TabContainer");
dojo.widget.defineWidget("my.widget.demoEngine.DemoContainer", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n\t\t<tbody>\n\t\t\t<tr dojoAttachPoint=\"headerNode\">\n\t\t\t\t<td dojoAttachPoint=\"returnNode\" valign=\"middle\" width=\"1%\">\n\t\t\t\t\t<img dojoAttachPoint=\"returnImageNode\" dojoAttachEvent=\"onclick: returnToDemos\"/>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<h1 dojoAttachPoint=\"demoNameNode\"></h1>\n\t\t\t\t\t<p dojoAttachPoint=\"summaryNode\"></p>\n\t\t\t\t</td>\n\t\t\t\t<td dojoAttachPoint=\"tabControlNode\" valign=\"middle\" align=\"right\" nowrap>\n\t\t\t\t\t<span dojoAttachPoint=\"sourceButtonNode\" dojoAttachEvent=\"onclick: showSource\">source</span>\n\t\t\t\t\t<span dojoAttachPoint=\"demoButtonNode\" dojoAttachEvent=\"onclick: showDemo\">demo</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t<div dojoAttachPoint=\"tabNode\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:".demoContainer{\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 0px;\n\tmargin: 0px;\n}\n\n.demoContainer .return {\n\tcursor: pointer;\n}\n\n.demoContainer span {\n\tmargin-right: 10px;\n\tcursor: pointer;\n}\n\n.demoContainer .selected {\n\tborder-bottom: 5px solid #95bfff;\n}\n\n.demoContainer table {\n\tbackground: #f5f5f5;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.demoContainerTabs {\n\twidth: 100%;\n\theight: 400px;\n}\n\n.demoContainerTabs .dojoTabLabels-top {\n\tdisplay: none;\n}\n\n.demoContainerTabs .dojoTabPaneWrapper {\n\tborder: 0px;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoContainer.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.html.addClass(this.tabNode, this.tabClass);
dojo.html.addClass(this.returnImageNode, this.returnClass);
this.returnImageNode.src = this.returnImage;
this.tabContainer = dojo.widget.createWidget("TabContainer", {}, this.tabNode);
this.demoTab = dojo.widget.createWidget("DemoPane", {});
this.tabContainer.addChild(this.demoTab);
this.sourceTab = dojo.widget.createWidget("SourcePane", {});
this.tabContainer.addChild(this.sourceTab);
dojo.html.setOpacity(this.domNode, 0);
dojo.html.hide(this.domNode);
}, loadDemo:function (url) {
this.demoTab.setHref(url);
this.sourceTab.setHref(url);
this.showDemo();
}, setName:function (name) {
dojo.html.removeChildren(this.demoNameNode);
this.demoNameNode.appendChild(document.createTextNode(name));
}, setSummary:function (summary) {
dojo.html.removeChildren(this.summaryNode);
this.summaryNode.appendChild(document.createTextNode(summary));
}, showSource:function () {
dojo.html.removeClass(this.demoButtonNode, this.selectedButtonClass);
dojo.html.addClass(this.sourceButtonNode, this.selectedButtonClass);
this.tabContainer.selectTab(this.sourceTab);
}, showDemo:function () {
dojo.html.removeClass(this.sourceButtonNode, this.selectedButtonClass);
dojo.html.addClass(this.demoButtonNode, this.selectedButtonClass);
this.tabContainer.selectTab(this.demoTab);
}, returnToDemos:function () {
dojo.debug("Return To Demos");
}, show:function () {
dojo.html.setOpacity(this.domNode, 1);
dojo.html.show(this.domNode);
this.tabContainer.checkSize();
}}, "", function () {
dojo.debug("DemoPane Init");
this.domNodeClass = "demoContainer";
this.tabContainer = "";
this.sourceTab = "";
this.demoTab = "";
this.headerNode = "";
this.returnNode = "";
this.returnImageNode = "";
this.returnImage = "images/dojoDemos.gif";
this.returnClass = "return";
this.summaryNode = "";
this.demoNameNode = "";
this.tabControlNode = "";
this.tabNode = "";
this.tabClass = "demoContainerTabs";
this.sourceButtonNode = "";
this.demoButtonNode = "";
this.selectedButtonClass = "selected";
});
 
/trunk/api/js/dojo/src/widget/demoEngine/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({browser:["dojo.widget.demoEngine.DemoItem", "dojo.widget.demoEngine.DemoNavigator", "dojo.widget.demoEngine.DemoPane", "dojo.widget.demoEngine.SourcePane", "dojo.widget.demoEngine.DemoContainer"]});
dojo.provide("dojo.widget.demoEngine.*");
 
/trunk/api/js/dojo/src/widget/demoEngine/DemoPane.js
New file
0,0 → 1,31
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("my.widget.demoEngine.DemoPane", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<iframe dojoAttachPoint=\"demoNode\"></iframe>\n</div>\n", templateCssString:".demoPane {\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 0px;\n\tmargin: 0px;\n\toverflow: hidden;\n}\n\n.demoPane iframe {\n\twidth: 100%;\n\theight: 100%;\n\tborder: 0px;\n\tborder: none;\n\toverflow: auto;\n\tpadding: 0px;\n\tmargin:0px;\n\tbackground: #ffffff;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoPane.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.debug("PostCreate");
this._launchDemo();
}, _launchDemo:function () {
dojo.debug("Launching Demo");
dojo.debug(this.demoNode);
this.demoNode.src = this.href;
}, setHref:function (url) {
this.href = url;
this._launchDemo();
}}, "", function () {
dojo.debug("DemoPane Init");
this.domNodeClass = "demoPane";
this.demoNode = "";
this.href = "";
});
 
/trunk/api/js/dojo/src/widget/Tree.js
New file
0,0 → 1,234
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Tree");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeNode");
dojo.require("dojo.html.common");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.Tree", dojo.widget.HtmlWidget, function () {
this.eventNames = {};
this.tree = this;
this.DNDAcceptTypes = [];
this.actionsDisabled = [];
}, {widgetType:"Tree", eventNamesDefault:{createDOMNode:"createDOMNode", treeCreate:"treeCreate", treeDestroy:"treeDestroy", treeClick:"treeClick", iconClick:"iconClick", titleClick:"titleClick", moveFrom:"moveFrom", moveTo:"moveTo", addChild:"addChild", removeNode:"removeNode", expand:"expand", collapse:"collapse"}, isContainer:true, DNDMode:"off", lockLevel:0, strictFolders:true, DNDModes:{BETWEEN:1, ONTO:2}, DNDAcceptTypes:"", templateCssString:"\n.dojoTree {\n\tfont: caption;\n\tfont-size: 11px;\n\tfont-weight: normal;\n\toverflow: auto;\n}\n\n\n.dojoTreeNodeLabelTitle {\n\tpadding-left: 2px;\n\tcolor: WindowText;\n}\n\n.dojoTreeNodeLabel {\n\tcursor:hand;\n\tcursor:pointer;\n}\n\n.dojoTreeNodeLabelTitle:hover {\n\ttext-decoration: underline;\n}\n\n.dojoTreeNodeLabelSelected {\n\tbackground-color: Highlight;\n\tcolor: HighlightText;\n}\n\n.dojoTree div {\n\twhite-space: nowrap;\n}\n\n.dojoTree img, .dojoTreeNodeLabel img {\n\tvertical-align: middle;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/Tree.css"), templateString:"<div class=\"dojoTree\"></div>", isExpanded:true, isTree:true, objectId:"", controller:"", selector:"", menu:"", expandLevel:"", blankIconSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_blank.gif"), gridIconSrcT:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_t.gif"), gridIconSrcL:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_l.gif"), gridIconSrcV:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_v.gif"), gridIconSrcP:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_p.gif"), gridIconSrcC:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_c.gif"), gridIconSrcX:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_x.gif"), gridIconSrcY:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_y.gif"), gridIconSrcZ:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_z.gif"), expandIconSrcPlus:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_expand_plus.gif"), expandIconSrcMinus:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_expand_minus.gif"), expandIconSrcLoading:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_loading.gif"), iconWidth:18, iconHeight:18, showGrid:true, showRootGrid:true, actionIsDisabled:function (action) {
var _this = this;
return dojo.lang.inArray(_this.actionsDisabled, action);
}, actions:{ADDCHILD:"ADDCHILD"}, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId};
return info;
}, initializeController:function () {
if (this.controller != "off") {
if (this.controller) {
this.controller = dojo.widget.byId(this.controller);
} else {
dojo.require("dojo.widget.TreeBasicController");
this.controller = dojo.widget.createWidget("TreeBasicController", {DNDController:(this.DNDMode ? "create" : ""), dieWithTree:true});
}
this.controller.listenTree(this);
} else {
this.controller = null;
}
}, initializeSelector:function () {
if (this.selector != "off") {
if (this.selector) {
this.selector = dojo.widget.byId(this.selector);
} else {
dojo.require("dojo.widget.TreeSelector");
this.selector = dojo.widget.createWidget("TreeSelector", {dieWithTree:true});
}
this.selector.listenTree(this);
} else {
this.selector = null;
}
}, initialize:function (args, frag) {
var _this = this;
for (name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
if (this.DNDMode == "off") {
this.DNDMode = 0;
} else {
if (this.DNDMode == "between") {
this.DNDMode = this.DNDModes.ONTO | this.DNDModes.BETWEEN;
} else {
if (this.DNDMode == "onto") {
this.DNDMode = this.DNDModes.ONTO;
}
}
}
this.expandLevel = parseInt(this.expandLevel);
this.initializeSelector();
this.initializeController();
if (this.menu) {
this.menu = dojo.widget.byId(this.menu);
this.menu.listenTree(this);
}
this.containerNode = this.domNode;
}, postCreate:function () {
this.createDOMNode();
}, createDOMNode:function () {
dojo.html.disableSelection(this.domNode);
for (var i = 0; i < this.children.length; i++) {
this.children[i].parent = this;
var node = this.children[i].createDOMNode(this, 0);
this.domNode.appendChild(node);
}
if (!this.showRootGrid) {
for (var i = 0; i < this.children.length; i++) {
this.children[i].expand();
}
}
dojo.event.topic.publish(this.eventNames.treeCreate, {source:this});
}, destroy:function () {
dojo.event.topic.publish(this.tree.eventNames.treeDestroy, {source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, addChild:function (child, index) {
var message = {child:child, index:index, parent:this, domNodeInitialized:child.domNodeInitialized};
this.doAddChild.apply(this, arguments);
dojo.event.topic.publish(this.tree.eventNames.addChild, message);
}, doAddChild:function (child, index) {
if (dojo.lang.isUndefined(index)) {
index = this.children.length;
}
if (!child.isTreeNode) {
dojo.raise("You can only add TreeNode widgets to a " + this.widgetType + " widget!");
return;
}
if (this.isTreeNode) {
if (!this.isFolder) {
this.setFolder();
}
}
var _this = this;
dojo.lang.forEach(child.getDescendants(), function (elem) {
elem.tree = _this.tree;
});
child.parent = this;
if (this.isTreeNode) {
this.state = this.loadStates.LOADED;
}
if (index < this.children.length) {
dojo.html.insertBefore(child.domNode, this.children[index].domNode);
} else {
this.containerNode.appendChild(child.domNode);
if (this.isExpanded && this.isTreeNode) {
this.showChildren();
}
}
this.children.splice(index, 0, child);
if (child.domNodeInitialized) {
var d = this.isTreeNode ? this.depth : -1;
child.adjustDepth(d - child.depth + 1);
child.updateIconTree();
} else {
child.depth = this.isTreeNode ? this.depth + 1 : 0;
child.createDOMNode(child.tree, child.depth);
}
var prevSibling = child.getPreviousSibling();
if (child.isLastChild() && prevSibling) {
prevSibling.updateExpandGridColumn();
}
}, makeBlankImg:function () {
var img = document.createElement("img");
img.style.width = this.iconWidth + "px";
img.style.height = this.iconHeight + "px";
img.src = this.blankIconSrc;
img.style.verticalAlign = "middle";
return img;
}, updateIconTree:function () {
if (!this.isTree) {
this.updateIcons();
}
for (var i = 0; i < this.children.length; i++) {
this.children[i].updateIconTree();
}
}, toString:function () {
return "[" + this.widgetType + " ID:" + this.widgetId + "]";
}, move:function (child, newParent, index) {
var oldParent = child.parent;
var oldTree = child.tree;
this.doMove.apply(this, arguments);
var newParent = child.parent;
var newTree = child.tree;
var message = {oldParent:oldParent, oldTree:oldTree, newParent:newParent, newTree:newTree, child:child};
dojo.event.topic.publish(oldTree.eventNames.moveFrom, message);
dojo.event.topic.publish(newTree.eventNames.moveTo, message);
}, doMove:function (child, newParent, index) {
child.parent.doRemoveNode(child);
newParent.doAddChild(child, index);
}, removeNode:function (child) {
if (!child.parent) {
return;
}
var oldTree = child.tree;
var oldParent = child.parent;
var removedChild = this.doRemoveNode.apply(this, arguments);
dojo.event.topic.publish(this.tree.eventNames.removeNode, {child:removedChild, tree:oldTree, parent:oldParent});
return removedChild;
}, doRemoveNode:function (child) {
if (!child.parent) {
return;
}
var parent = child.parent;
var children = parent.children;
var index = child.getParentIndex();
if (index < 0) {
dojo.raise("Couldn't find node " + child + " for removal");
}
children.splice(index, 1);
dojo.html.removeNode(child.domNode);
if (parent.children.length == 0 && !parent.isTree) {
parent.containerNode.style.display = "none";
}
if (index == children.length && index > 0) {
children[index - 1].updateExpandGridColumn();
}
if (parent instanceof dojo.widget.Tree && index == 0 && children.length > 0) {
children[0].updateExpandGrid();
}
child.parent = child.tree = null;
return child;
}, markLoading:function () {
}, unMarkLoading:function () {
}, lock:function () {
!this.lockLevel && this.markLoading();
this.lockLevel++;
}, unlock:function () {
if (!this.lockLevel) {
dojo.raise("unlock: not locked");
}
this.lockLevel--;
!this.lockLevel && this.unMarkLoading();
}, isLocked:function () {
var node = this;
while (true) {
if (node.lockLevel) {
return true;
}
if (node instanceof dojo.widget.Tree) {
break;
}
node = node.parent;
}
return false;
}, flushLock:function () {
this.lockLevel = 0;
this.unMarkLoading();
}});
 
/trunk/api/js/dojo/src/widget/Wizard.js
New file
0,0 → 1,125
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Wizard");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.event.*");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.WizardContainer", dojo.widget.LayoutContainer, {templateString:"<div class=\"WizardContainer\" dojoAttachPoint=\"wizardNode\">\n <div class=\"WizardText\" dojoAttachPoint=\"wizardPanelContainerNode\">\n </div>\n <div class=\"WizardButtonHolder\" dojoAttachPoint=\"wizardControlContainerNode\">\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"previousButton\"/>\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"nextButton\"/>\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"doneButton\" style=\"display:none\"/>\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"cancelButton\"/>\n </div>\n</div>\n", templateCssString:".WizardContainer {\n\tbackground: #EEEEEE;\n\tborder: #798EC5 1px solid;\n\tpadding: 2px;\n}\n\n.WizardTitle {\n\tcolor: #003366;\n\tpadding: 8px 5px 15px 2px;\n\tfont-weight: bold;\n\tfont-size: x-small;\n\tfont-style: normal;\n\tfont-family: Verdana, Arial, Helvetica;\n\ttext-align: left;\n}\n\n.WizardText {\n\tcolor: #000033;\n\tfont-weight: normal;\n\tfont-size: xx-small;\n\tfont-family: Verdana, Arial, Helvetica;\n\tpadding: 2 50; text-align: justify;\n}\n\n.WizardLightText {\n\tcolor: #666666;\n\tfont-weight: normal;\n\tfont-size: xx-small;\n\tfont-family: verdana, arial, helvetica;\n\tpadding: 2px 50px;\n\ttext-align: justify;\n}\n\n.WizardButtonHolder {\n\ttext-align: right;\n\tpadding: 10px 5px;\n}\n\n.WizardButton {\n\tcolor: #ffffff;\n\tbackground: #798EC5;\n\tfont-size: xx-small;\n\tfont-family: verdana, arial, helvetica, sans-serif;\n\tborder-right: #000000 1px solid;\n\tborder-bottom: #000000 1px solid;\n\tborder-left: #666666 1px solid;\n\tborder-top: #666666 1px solid;\n\tpadding-right: 4px;\n\tpadding-left: 4px;\n\ttext-decoration: none; height: 18px;\n}\n\n.WizardButton:hover {\n\tcursor: pointer;\n}\n\n.WizardButtonDisabled {\n\tcolor: #eeeeee;\n\tbackground-color: #999999;\n\tfont-size: xx-small;\n\tFONT-FAMILY: verdana, arial, helvetica, sans-serif;\n\tborder-right: #000000 1px solid;\n\tborder-bottom: #000000 1px solid;\n\tborder-left: #798EC5 1px solid;\n\tborder-top: #798EC5 1px solid;\n\tpadding-right: 4px;\n\tpadding-left: 4px;\n\ttext-decoration: none;\n\theight: 18px;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Wizard.css"), selected:null, nextButtonLabel:"next", previousButtonLabel:"previous", cancelButtonLabel:"cancel", doneButtonLabel:"done", cancelFunction:"", hideDisabledButtons:false, fillInTemplate:function (args, frag) {
dojo.event.connect(this.nextButton, "onclick", this, "_onNextButtonClick");
dojo.event.connect(this.previousButton, "onclick", this, "_onPreviousButtonClick");
if (this.cancelFunction) {
dojo.event.connect(this.cancelButton, "onclick", this.cancelFunction);
} else {
this.cancelButton.style.display = "none";
}
dojo.event.connect(this.doneButton, "onclick", this, "done");
this.nextButton.value = this.nextButtonLabel;
this.previousButton.value = this.previousButtonLabel;
this.cancelButton.value = this.cancelButtonLabel;
this.doneButton.value = this.doneButtonLabel;
}, _checkButtons:function () {
var lastStep = !this.hasNextPanel();
this.nextButton.disabled = lastStep;
this._setButtonClass(this.nextButton);
if (this.selected.doneFunction) {
this.doneButton.style.display = "";
if (lastStep) {
this.nextButton.style.display = "none";
}
} else {
this.doneButton.style.display = "none";
}
this.previousButton.disabled = ((!this.hasPreviousPanel()) || (!this.selected.canGoBack));
this._setButtonClass(this.previousButton);
}, _setButtonClass:function (button) {
if (!this.hideDisabledButtons) {
button.style.display = "";
dojo.html.setClass(button, button.disabled ? "WizardButtonDisabled" : "WizardButton");
} else {
button.style.display = button.disabled ? "none" : "";
}
}, registerChild:function (panel, insertionIndex) {
dojo.widget.WizardContainer.superclass.registerChild.call(this, panel, insertionIndex);
this.wizardPanelContainerNode.appendChild(panel.domNode);
panel.hide();
if (!this.selected) {
this.onSelected(panel);
}
this._checkButtons();
}, onSelected:function (panel) {
if (this.selected) {
if (this.selected._checkPass()) {
this.selected.hide();
} else {
return;
}
}
panel.show();
this.selected = panel;
}, getPanels:function () {
return this.getChildrenOfType("WizardPane", false);
}, selectedIndex:function () {
if (this.selected) {
return dojo.lang.indexOf(this.getPanels(), this.selected);
}
return -1;
}, _onNextButtonClick:function () {
var selectedIndex = this.selectedIndex();
if (selectedIndex > -1) {
var childPanels = this.getPanels();
if (childPanels[selectedIndex + 1]) {
this.onSelected(childPanels[selectedIndex + 1]);
}
}
this._checkButtons();
}, _onPreviousButtonClick:function () {
var selectedIndex = this.selectedIndex();
if (selectedIndex > -1) {
var childPanels = this.getPanels();
if (childPanels[selectedIndex - 1]) {
this.onSelected(childPanels[selectedIndex - 1]);
}
}
this._checkButtons();
}, hasNextPanel:function () {
var selectedIndex = this.selectedIndex();
return (selectedIndex < (this.getPanels().length - 1));
}, hasPreviousPanel:function () {
var selectedIndex = this.selectedIndex();
return (selectedIndex > 0);
}, done:function () {
this.selected.done();
}});
dojo.widget.defineWidget("dojo.widget.WizardPane", dojo.widget.ContentPane, {canGoBack:true, passFunction:"", doneFunction:"", postMixInProperties:function (args, frag) {
if (this.passFunction) {
this.passFunction = dj_global[this.passFunction];
}
if (this.doneFunction) {
this.doneFunction = dj_global[this.doneFunction];
}
dojo.widget.WizardPane.superclass.postMixInProperties.apply(this, arguments);
}, _checkPass:function () {
if (this.passFunction && dojo.lang.isFunction(this.passFunction)) {
var failMessage = this.passFunction();
if (failMessage) {
alert(failMessage);
return false;
}
}
return true;
}, done:function () {
if (this.doneFunction && dojo.lang.isFunction(this.doneFunction)) {
this.doneFunction();
}
}});
 
/trunk/api/js/dojo/src/widget/TreeSelector.js
New file
0,0 → 1,100
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeSelector");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.TreeSelector", dojo.widget.HtmlWidget, function () {
this.eventNames = {};
this.listenedTrees = [];
}, {widgetType:"TreeSelector", selectedNode:null, dieWithTree:false, eventNamesDefault:{select:"select", destroy:"destroy", deselect:"deselect", dblselect:"dblselect"}, initialize:function () {
for (name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
}, destroy:function () {
dojo.event.topic.publish(this.eventNames.destroy, {source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, listenTree:function (tree) {
dojo.event.topic.subscribe(tree.eventNames.titleClick, this, "select");
dojo.event.topic.subscribe(tree.eventNames.iconClick, this, "select");
dojo.event.topic.subscribe(tree.eventNames.collapse, this, "onCollapse");
dojo.event.topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
this.listenedTrees.push(tree);
}, unlistenTree:function (tree) {
dojo.event.topic.unsubscribe(tree.eventNames.titleClick, this, "select");
dojo.event.topic.unsubscribe(tree.eventNames.iconClick, this, "select");
dojo.event.topic.unsubscribe(tree.eventNames.collapse, this, "onCollapse");
dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
for (var i = 0; i < this.listenedTrees.length; i++) {
if (this.listenedTrees[i] === tree) {
this.listenedTrees.splice(i, 1);
break;
}
}
}, onTreeDestroy:function (message) {
this.unlistenTree(message.source);
if (this.dieWithTree) {
this.destroy();
}
}, onCollapse:function (message) {
if (!this.selectedNode) {
return;
}
var node = message.source;
var parent = this.selectedNode.parent;
while (parent !== node && parent.isTreeNode) {
parent = parent.parent;
}
if (parent.isTreeNode) {
this.deselect();
}
}, select:function (message) {
var node = message.source;
var e = message.event;
if (this.selectedNode === node) {
if (e.ctrlKey || e.shiftKey || e.metaKey) {
this.deselect();
return;
}
dojo.event.topic.publish(this.eventNames.dblselect, {node:node});
return;
}
if (this.selectedNode) {
this.deselect();
}
this.doSelect(node);
dojo.event.topic.publish(this.eventNames.select, {node:node});
}, onMoveFrom:function (message) {
if (message.child !== this.selectedNode) {
return;
}
if (!dojo.lang.inArray(this.listenedTrees, message.newTree)) {
this.deselect();
}
}, onRemoveNode:function (message) {
if (message.child !== this.selectedNode) {
return;
}
this.deselect();
}, doSelect:function (node) {
node.markSelected();
this.selectedNode = node;
}, deselect:function () {
var node = this.selectedNode;
this.selectedNode = null;
node.unMarkSelected();
dojo.event.topic.publish(this.eventNames.deselect, {node:node});
}});
 
/trunk/api/js/dojo/src/widget/TreeDndControllerV3.js
New file
0,0 → 1,69
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDndControllerV3");
dojo.require("dojo.dnd.TreeDragAndDropV3");
dojo.require("dojo.experimental");
dojo.experimental("Tree drag'n'drop' has lots of problems/bugs, it requires dojo drag'n'drop overhaul to work, probably in 0.5");
dojo.widget.defineWidget("dojo.widget.TreeDndControllerV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.dragSources = {};
this.dropTargets = {};
this.listenedTrees = {};
}, {listenTreeEvents:["afterChangeTree", "beforeTreeDestroy", "afterAddChild"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, initialize:function (args) {
this.treeController = dojo.lang.isString(args.controller) ? dojo.widget.byId(args.controller) : args.controller;
if (!this.treeController) {
dojo.raise("treeController must be declared");
}
}, onBeforeTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, onAfterAddChild:function (message) {
this.listenNode(message.child);
}, onAfterChangeTree:function (message) {
if (!message.oldTree) {
return;
}
if (!message.newTree || !this.listenedTrees[message.newTree.widgetId]) {
this.processDescendants(message.node, this.listenNodeFilter, this.unlistenNode);
}
if (!this.listenedTrees[message.oldTree.widgetId]) {
this.processDescendants(message.node, this.listenNodeFilter, this.listenNode);
}
}, listenNode:function (node) {
if (!node.tree.DndMode) {
return;
}
if (this.dragSources[node.widgetId] || this.dropTargets[node.widgetId]) {
return;
}
var source = null;
var target = null;
if (!node.actionIsDisabled(node.actions.MOVE)) {
var source = this.makeDragSource(node);
this.dragSources[node.widgetId] = source;
}
var target = this.makeDropTarget(node);
this.dropTargets[node.widgetId] = target;
}, makeDragSource:function (node) {
return new dojo.dnd.TreeDragSourceV3(node.contentNode, this, node.tree.widgetId, node);
}, makeDropTarget:function (node) {
return new dojo.dnd.TreeDropTargetV3(node.contentNode, this.treeController, node.tree.DndAcceptTypes, node);
}, unlistenNode:function (node) {
if (this.dragSources[node.widgetId]) {
dojo.dnd.dragManager.unregisterDragSource(this.dragSources[node.widgetId]);
delete this.dragSources[node.widgetId];
}
if (this.dropTargets[node.widgetId]) {
dojo.dnd.dragManager.unregisterDropTarget(this.dropTargets[node.widgetId]);
delete this.dropTargets[node.widgetId];
}
}});
 
/trunk/api/js/dojo/src/widget/TreeContextMenuV3.js
New file
0,0 → 1,72
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeContextMenuV3");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Menu2");
dojo.require("dojo.widget.TreeCommon");
dojo.widget.defineWidget("dojo.widget.TreeContextMenuV3", [dojo.widget.PopupMenu2, dojo.widget.TreeCommon], function () {
this.listenedTrees = {};
}, {listenTreeEvents:["afterTreeCreate", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, onAfterTreeCreate:function (message) {
var tree = message.source;
this.bindDomNode(tree.domNode);
}, onBeforeTreeDestroy:function (message) {
this.unBindDomNode(message.source.domNode);
}, getTreeNode:function () {
var source = this.getTopOpenEvent().target;
var treeNode = this.domElement2TreeNode(source);
return treeNode;
}, open:function () {
var result = dojo.widget.PopupMenu2.prototype.open.apply(this, arguments);
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].menuOpen) {
this.children[i].menuOpen(this.getTreeNode());
}
}
return result;
}, close:function () {
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].menuClose) {
this.children[i].menuClose(this.getTreeNode());
}
}
var result = dojo.widget.PopupMenu2.prototype.close.apply(this, arguments);
return result;
}});
dojo.widget.defineWidget("dojo.widget.TreeMenuItemV3", [dojo.widget.MenuItem2, dojo.widget.TreeCommon], function () {
this.treeActions = [];
}, {treeActions:"", initialize:function (args, frag) {
for (var i = 0; i < this.treeActions.length; i++) {
this.treeActions[i] = this.treeActions[i].toUpperCase();
}
}, getTreeNode:function () {
var menu = this;
while (!(menu instanceof dojo.widget.TreeContextMenuV3)) {
menu = menu.parent;
}
var treeNode = menu.getTreeNode();
return treeNode;
}, menuOpen:function (treeNode) {
treeNode.viewEmphasize();
this.setDisabled(false);
var _this = this;
dojo.lang.forEach(_this.treeActions, function (action) {
_this.setDisabled(treeNode.actionIsDisabledNow(action));
});
}, menuClose:function (treeNode) {
treeNode.viewUnemphasize();
}, toString:function () {
return "[" + this.widgetType + " node " + this.getTreeNode() + "]";
}});
 
/trunk/api/js/dojo/src/widget/SvgWidget.js
New file
0,0 → 1,69
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.widget.DomWidget");
dojo.provide("dojo.widget.SvgWidget");
dojo.provide("dojo.widget.SVGWidget");
dojo.require("dojo.dom");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.SvgWidget");
dojo.widget.declare("dojo.widget.SvgWidget", dojo.widget.DomWidget, {createNodesFromText:function (txt, wrap) {
return dojo.svg.createNodesFromText(txt, wrap);
}});
dojo.widget.SVGWidget = dojo.widget.SvgWidget;
try {
(function () {
var tf = function () {
var rw = new function () {
dojo.widget.SvgWidget.call(this);
this.buildRendering = function () {
return;
};
this.destroyRendering = function () {
return;
};
this.postInitialize = function () {
return;
};
this.widgetType = "SVGRootWidget";
this.domNode = document.documentElement;
};
var wm = dojo.widget.manager;
wm.root = rw;
wm.add(rw);
wm.getWidgetFromNode = function (node) {
var filter = function (x) {
if (x.domNode == node) {
return true;
}
};
var widgets = [];
while ((node) && (widgets.length < 1)) {
widgets = this.getWidgetsByFilter(filter);
node = node.parentNode;
}
if (widgets.length > 0) {
return widgets[0];
} else {
return null;
}
};
wm.getWidgetFromEvent = function (domEvt) {
return this.getWidgetFromNode(domEvt.target);
};
wm.getWidgetFromPrimitive = wm.getWidgetFromNode;
};
dojo.event.connect(dojo.hostenv, "loaded", tf);
})();
}
catch (e) {
alert(e);
}
 
/trunk/api/js/dojo/src/widget/Repeater.js
New file
0,0 → 1,126
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Repeater");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.string");
dojo.require("dojo.event.*");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.Repeater");
dojo.widget.defineWidget("dojo.widget.Repeater", dojo.widget.HtmlWidget, {name:"", rowTemplate:"", myObject:null, pattern:"", useDnd:false, isContainer:true, initialize:function (args, frag) {
var node = this.getFragNodeRef(frag);
node.removeAttribute("dojotype");
this.setRow(dojo.string.trim(node.innerHTML), {});
node.innerHTML = "";
frag = null;
}, postCreate:function (args, frag) {
if (this.useDnd) {
dojo.require("dojo.dnd.*");
var dnd = new dojo.dnd.HtmlDropTarget(this.domNode, [this.widgetId]);
}
}, _reIndexRows:function () {
for (var i = 0, len = this.domNode.childNodes.length; i < len; i++) {
var elems = ["INPUT", "SELECT", "TEXTAREA"];
for (var k = 0; k < elems.length; k++) {
var list = this.domNode.childNodes[i].getElementsByTagName(elems[k]);
for (var j = 0, len2 = list.length; j < len2; j++) {
var name = list[j].name;
var index = dojo.string.escape("regexp", this.pattern);
index = index.replace(/(%\\\{index\\\})/g, "%{index}");
var nameRegexp = dojo.string.substituteParams(index, {"index":"[0-9]*"});
var newName = dojo.string.substituteParams(this.pattern, {"index":"" + i});
var re = new RegExp(nameRegexp, "g");
list[j].name = name.replace(re, newName);
}
}
}
}, onDeleteRow:function (e) {
var index = dojo.string.escape("regexp", this.pattern);
index = index.replace(/%\\\{index\\\}/g, "%{index}");
var nameRegexp = dojo.string.substituteParams(index, {"index":"([0-9]*)"});
var re = new RegExp(nameRegexp, "g");
this.deleteRow(re.exec(e.target.name)[1]);
}, hasRows:function () {
if (this.domNode.childNodes.length > 0) {
return true;
}
return false;
}, getRowCount:function () {
return this.domNode.childNodes.length;
}, deleteRow:function (idx) {
this.domNode.removeChild(this.domNode.childNodes[idx]);
this._reIndexRows();
}, _changeRowPosition:function (e) {
if (e.dragStatus == "dropFailure") {
this.domNode.removeChild(e["dragSource"].domNode);
} else {
if (e.dragStatus == "dropSuccess") {
}
}
this._reIndexRows();
}, setRow:function (template, myObject) {
template = template.replace(/\%\{(index)\}/g, "0");
this.rowTemplate = template;
this.myObject = myObject;
}, getRow:function () {
return this.rowTemplate;
}, _initRow:function (node) {
if (typeof (node) == "number") {
node = this.domNode.childNodes[node];
}
var elems = ["INPUT", "SELECT", "IMG"];
for (var k = 0; k < elems.length; k++) {
var list = node.getElementsByTagName(elems[k]);
for (var i = 0, len = list.length; i < len; i++) {
var child = list[i];
if (child.nodeType != 1) {
continue;
}
if (child.getAttribute("rowFunction") != null) {
if (typeof (this.myObject[child.getAttribute("rowFunction")]) == "undefined") {
dojo.debug("Function " + child.getAttribute("rowFunction") + " not found");
} else {
this.myObject[child.getAttribute("rowFunction")](child);
}
} else {
if (child.getAttribute("rowAction") != null) {
if (child.getAttribute("rowAction") == "delete") {
child.name = dojo.string.substituteParams(this.pattern, {"index":"" + (this.getRowCount() - 1)});
dojo.event.connect(child, "onclick", this, "onDeleteRow");
}
}
}
}
}
}, onAddRow:function (e) {
}, addRow:function (doInit) {
if (typeof (doInit) == "undefined") {
doInit = true;
}
var node = document.createElement("span");
node.innerHTML = this.getRow();
if (node.childNodes.length == 1) {
node = node.childNodes[0];
}
this.domNode.appendChild(node);
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(node, null, true);
dojo.widget.getParser().createSubComponents(frag, this);
this._reIndexRows();
if (doInit) {
this._initRow(node);
}
if (this.useDnd) {
node = new dojo.dnd.HtmlDragSource(node, this.widgetId);
dojo.event.connect(node, "onDragEnd", this, "_changeRowPosition");
}
this.onAddRow(node);
}});
 
/trunk/api/js/dojo/src/widget/CurrencyTextbox.js
New file
0,0 → 1,38
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.CurrencyTextbox");
dojo.require("dojo.widget.IntegerTextbox");
dojo.require("dojo.validate.common");
dojo.widget.defineWidget("dojo.widget.CurrencyTextbox", dojo.widget.IntegerTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.CurrencyTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.fractional) {
this.flags.fractional = (localProperties.fractional == "true");
} else {
if (localProperties.cents) {
dojo.deprecated("dojo.widget.IntegerTextbox", "use fractional attr instead of cents", "0.5");
this.flags.fractional = (localProperties.cents == "true");
}
}
if (localProperties.symbol) {
this.flags.symbol = localProperties.symbol;
}
if (localProperties.min) {
this.flags.min = parseFloat(localProperties.min);
}
if (localProperties.max) {
this.flags.max = parseFloat(localProperties.max);
}
}, isValid:function () {
return dojo.validate.isCurrency(this.textbox.value, this.flags);
}, isInRange:function () {
return dojo.validate.isInRange(this.textbox.value, this.flags);
}});
 
/trunk/api/js/dojo/src/widget/HtmlWidget.js
New file
0,0 → 1,99
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.DomWidget");
dojo.require("dojo.html.util");
dojo.require("dojo.html.display");
dojo.require("dojo.html.layout");
dojo.require("dojo.lang.extras");
dojo.require("dojo.lang.func");
dojo.require("dojo.lfx.toggle");
dojo.declare("dojo.widget.HtmlWidget", dojo.widget.DomWidget, {templateCssPath:null, templatePath:null, lang:"", toggle:"plain", toggleDuration:150, initialize:function (args, frag) {
}, postMixInProperties:function (args, frag) {
if (this.lang === "") {
this.lang = null;
}
this.toggleObj = dojo.lfx.toggle[this.toggle.toLowerCase()] || dojo.lfx.toggle.plain;
}, createNodesFromText:function (txt, wrap) {
return dojo.html.createNodesFromText(txt, wrap);
}, destroyRendering:function (finalize) {
try {
if (this.bgIframe) {
this.bgIframe.remove();
delete this.bgIframe;
}
if (!finalize && this.domNode) {
dojo.event.browser.clean(this.domNode);
}
dojo.widget.HtmlWidget.superclass.destroyRendering.call(this);
}
catch (e) {
}
}, isShowing:function () {
return dojo.html.isShowing(this.domNode);
}, toggleShowing:function () {
if (this.isShowing()) {
this.hide();
} else {
this.show();
}
}, show:function () {
if (this.isShowing()) {
return;
}
this.animationInProgress = true;
this.toggleObj.show(this.domNode, this.toggleDuration, null, dojo.lang.hitch(this, this.onShow), this.explodeSrc);
}, onShow:function () {
this.animationInProgress = false;
this.checkSize();
}, hide:function () {
if (!this.isShowing()) {
return;
}
this.animationInProgress = true;
this.toggleObj.hide(this.domNode, this.toggleDuration, null, dojo.lang.hitch(this, this.onHide), this.explodeSrc);
}, onHide:function () {
this.animationInProgress = false;
}, _isResized:function (w, h) {
if (!this.isShowing()) {
return false;
}
var wh = dojo.html.getMarginBox(this.domNode);
var width = w || wh.width;
var height = h || wh.height;
if (this.width == width && this.height == height) {
return false;
}
this.width = width;
this.height = height;
return true;
}, checkSize:function () {
if (!this._isResized()) {
return;
}
this.onResized();
}, resizeTo:function (w, h) {
dojo.html.setMarginBox(this.domNode, {width:w, height:h});
if (this.isShowing()) {
this.onResized();
}
}, resizeSoon:function () {
if (this.isShowing()) {
dojo.lang.setTimeout(this, this.onResized, 0);
}
}, onResized:function () {
dojo.lang.forEach(this.children, function (child) {
if (child.checkSize) {
child.checkSize();
}
});
}});
 
/trunk/api/js/dojo/src/widget/TreeRPCController.js
New file
0,0 → 1,70
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeRPCController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeLoadingController");
dojo.widget.defineWidget("dojo.widget.TreeRPCController", dojo.widget.TreeLoadingController, {doMove:function (child, newParent, index) {
var params = {child:this.getInfo(child), childTree:this.getInfo(child.tree), newParent:this.getInfo(newParent), newParentTree:this.getInfo(newParent.tree), newIndex:index};
var success;
this.runRPC({url:this.getRPCUrl("move"), load:function (response) {
success = this.doMoveProcessResponse(response, child, newParent, index);
}, sync:true, lock:[child, newParent], params:params});
return success;
}, doMoveProcessResponse:function (response, child, newParent, index) {
if (!dojo.lang.isUndefined(response.error)) {
this.RPCErrorHandler("server", response.error);
return false;
}
var args = [child, newParent, index];
return dojo.widget.TreeLoadingController.prototype.doMove.apply(this, args);
}, doRemoveNode:function (node, callObj, callFunc) {
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
this.runRPC({url:this.getRPCUrl("removeNode"), load:function (response) {
this.doRemoveNodeProcessResponse(response, node, callObj, callFunc);
}, params:params, lock:[node]});
}, doRemoveNodeProcessResponse:function (response, node, callObj, callFunc) {
if (!dojo.lang.isUndefined(response.error)) {
this.RPCErrorHandler("server", response.error);
return false;
}
if (!response) {
return false;
}
if (response == true) {
var args = [node, callObj, callFunc];
dojo.widget.TreeLoadingController.prototype.doRemoveNode.apply(this, args);
return;
} else {
if (dojo.lang.isObject(response)) {
dojo.raise(response.error);
} else {
dojo.raise("Invalid response " + response);
}
}
}, doCreateChild:function (parent, index, output, callObj, callFunc) {
var params = {tree:this.getInfo(parent.tree), parent:this.getInfo(parent), index:index, data:output};
this.runRPC({url:this.getRPCUrl("createChild"), load:function (response) {
this.doCreateChildProcessResponse(response, parent, index, callObj, callFunc);
}, params:params, lock:[parent]});
}, doCreateChildProcessResponse:function (response, parent, index, callObj, callFunc) {
if (!dojo.lang.isUndefined(response.error)) {
this.RPCErrorHandler("server", response.error);
return false;
}
if (!dojo.lang.isObject(response)) {
dojo.raise("Invalid result " + response);
}
var args = [parent, index, response, callObj, callFunc];
dojo.widget.TreeLoadingController.prototype.doCreateChild.apply(this, args);
}});
 
/trunk/api/js/dojo/src/widget/TreeDisableWrapExtension.js
New file
0,0 → 1,35
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDisableWrapExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeExtension");
dojo.widget.defineWidget("dojo.widget.TreeDisableWrapExtension", dojo.widget.TreeExtension, {templateCssString:"\n/* CSS for TreeDisableWrapExtension */\n\n.TreeDisableWrap {\n\twhite-space: nowrap;\n}\n.TreeIEDisableWrap {\n\twidth: expression( 5 + firstChild.offsetWidth );\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeDisableWrap.css"), listenTree:function (tree) {
var wrappingDiv = document.createElement("div");
var clazz = tree.classPrefix + "DisableWrap";
if (dojo.render.html.ie) {
clazz = clazz + " " + tree.classPrefix + "IEDisableWrap";
}
dojo.html.setClass(wrappingDiv, clazz);
var table = document.createElement("table");
wrappingDiv.appendChild(table);
var tbody = document.createElement("tbody");
table.appendChild(tbody);
var tr = document.createElement("tr");
tbody.appendChild(tr);
var td = document.createElement("td");
tr.appendChild(td);
if (tree.domNode.parentNode) {
tree.domNode.parentNode.replaceChild(wrappingDiv, tree.domNode);
}
td.appendChild(tree.domNode);
tree.domNode = wrappingDiv;
}});
 
/trunk/api/js/dojo/src/widget/Parse.js
New file
0,0 → 1,225
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Parse");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.dom");
dojo.widget.Parse = function (fragment) {
this.propertySetsList = [];
this.fragment = fragment;
this.createComponents = function (frag, parentComp) {
var comps = [];
var built = false;
try {
if (frag && frag.tagName && (frag != frag.nodeRef)) {
var djTags = dojo.widget.tags;
var tna = String(frag.tagName).split(";");
for (var x = 0; x < tna.length; x++) {
var ltn = tna[x].replace(/^\s+|\s+$/g, "").toLowerCase();
frag.tagName = ltn;
var ret;
if (djTags[ltn]) {
built = true;
ret = djTags[ltn](frag, this, parentComp, frag.index);
comps.push(ret);
} else {
if (ltn.indexOf(":") == -1) {
ltn = "dojo:" + ltn;
}
ret = dojo.widget.buildWidgetFromParseTree(ltn, frag, this, parentComp, frag.index);
if (ret) {
built = true;
comps.push(ret);
}
}
}
}
}
catch (e) {
dojo.debug("dojo.widget.Parse: error:", e);
}
if (!built) {
comps = comps.concat(this.createSubComponents(frag, parentComp));
}
return comps;
};
this.createSubComponents = function (fragment, parentComp) {
var frag, comps = [];
for (var item in fragment) {
frag = fragment[item];
if (frag && typeof frag == "object" && (frag != fragment.nodeRef) && (frag != fragment.tagName) && (!dojo.dom.isNode(frag))) {
comps = comps.concat(this.createComponents(frag, parentComp));
}
}
return comps;
};
this.parsePropertySets = function (fragment) {
return [];
};
this.parseProperties = function (fragment) {
var properties = {};
for (var item in fragment) {
if ((fragment[item] == fragment.tagName) || (fragment[item] == fragment.nodeRef)) {
} else {
var frag = fragment[item];
if (frag.tagName && dojo.widget.tags[frag.tagName.toLowerCase()]) {
} else {
if (frag[0] && frag[0].value != "" && frag[0].value != null) {
try {
if (item.toLowerCase() == "dataprovider") {
var _this = this;
this.getDataProvider(_this, frag[0].value);
properties.dataProvider = this.dataProvider;
}
properties[item] = frag[0].value;
var nestedProperties = this.parseProperties(frag);
for (var property in nestedProperties) {
properties[property] = nestedProperties[property];
}
}
catch (e) {
dojo.debug(e);
}
}
}
switch (item.toLowerCase()) {
case "checked":
case "disabled":
if (typeof properties[item] != "boolean") {
properties[item] = true;
}
break;
}
}
}
return properties;
};
this.getDataProvider = function (objRef, dataUrl) {
dojo.io.bind({url:dataUrl, load:function (type, evaldObj) {
if (type == "load") {
objRef.dataProvider = evaldObj;
}
}, mimetype:"text/javascript", sync:true});
};
this.getPropertySetById = function (propertySetId) {
for (var x = 0; x < this.propertySetsList.length; x++) {
if (propertySetId == this.propertySetsList[x]["id"][0].value) {
return this.propertySetsList[x];
}
}
return "";
};
this.getPropertySetsByType = function (componentType) {
var propertySets = [];
for (var x = 0; x < this.propertySetsList.length; x++) {
var cpl = this.propertySetsList[x];
var cpcc = cpl.componentClass || cpl.componentType || null;
var propertySetId = this.propertySetsList[x]["id"][0].value;
if (cpcc && (propertySetId == cpcc[0].value)) {
propertySets.push(cpl);
}
}
return propertySets;
};
this.getPropertySets = function (fragment) {
var ppl = "dojo:propertyproviderlist";
var propertySets = [];
var tagname = fragment.tagName;
if (fragment[ppl]) {
var propertyProviderIds = fragment[ppl].value.split(" ");
for (var propertySetId in propertyProviderIds) {
if ((propertySetId.indexOf("..") == -1) && (propertySetId.indexOf("://") == -1)) {
var propertySet = this.getPropertySetById(propertySetId);
if (propertySet != "") {
propertySets.push(propertySet);
}
} else {
}
}
}
return this.getPropertySetsByType(tagname).concat(propertySets);
};
this.createComponentFromScript = function (nodeRef, componentName, properties, ns) {
properties.fastMixIn = true;
var ltn = (ns || "dojo") + ":" + componentName.toLowerCase();
if (dojo.widget.tags[ltn]) {
return [dojo.widget.tags[ltn](properties, this, null, null, properties)];
}
return [dojo.widget.buildWidgetFromParseTree(ltn, properties, this, null, null, properties)];
};
};
dojo.widget._parser_collection = {"dojo":new dojo.widget.Parse()};
dojo.widget.getParser = function (name) {
if (!name) {
name = "dojo";
}
if (!this._parser_collection[name]) {
this._parser_collection[name] = new dojo.widget.Parse();
}
return this._parser_collection[name];
};
dojo.widget.createWidget = function (name, props, refNode, position) {
var isNode = false;
var isNameStr = (typeof name == "string");
if (isNameStr) {
var pos = name.indexOf(":");
var ns = (pos > -1) ? name.substring(0, pos) : "dojo";
if (pos > -1) {
name = name.substring(pos + 1);
}
var lowerCaseName = name.toLowerCase();
var namespacedName = ns + ":" + lowerCaseName;
isNode = (dojo.byId(name) && !dojo.widget.tags[namespacedName]);
}
if ((arguments.length == 1) && (isNode || !isNameStr)) {
var xp = new dojo.xml.Parse();
var tn = isNode ? dojo.byId(name) : name;
return dojo.widget.getParser().createComponents(xp.parseElement(tn, null, true))[0];
}
function fromScript(placeKeeperNode, name, props, ns) {
props[namespacedName] = {dojotype:[{value:lowerCaseName}], nodeRef:placeKeeperNode, fastMixIn:true};
props.ns = ns;
return dojo.widget.getParser().createComponentFromScript(placeKeeperNode, name, props, ns);
}
props = props || {};
var notRef = false;
var tn = null;
var h = dojo.render.html.capable;
if (h) {
tn = document.createElement("span");
}
if (!refNode) {
notRef = true;
refNode = tn;
if (h) {
dojo.body().appendChild(refNode);
}
} else {
if (position) {
dojo.dom.insertAtPosition(tn, refNode, position);
} else {
tn = refNode;
}
}
var widgetArray = fromScript(tn, name.toLowerCase(), props, ns);
if ((!widgetArray) || (!widgetArray[0]) || (typeof widgetArray[0].widgetType == "undefined")) {
throw new Error("createWidget: Creation of \"" + name + "\" widget failed.");
}
try {
if (notRef && widgetArray[0].domNode.parentNode) {
widgetArray[0].domNode.parentNode.removeChild(widgetArray[0].domNode);
}
}
catch (e) {
dojo.debug(e);
}
return widgetArray[0];
};
 
/trunk/api/js/dojo/src/widget/RadioGroup.js
New file
0,0 → 1,120
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RadioGroup");
dojo.require("dojo.lang.common");
dojo.require("dojo.event.browser");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.RadioGroup", dojo.widget.HtmlWidget, function () {
this.selectedItem = null;
this.items = [];
this.selected = [];
this.groupCssClass = "radioGroup";
this.selectedCssClass = "selected";
this.itemContentCssClass = "itemContent";
}, {isContainer:false, templatePath:null, templateCssPath:null, postCreate:function () {
this._parseStructure();
dojo.html.addClass(this.domNode, this.groupCssClass);
this._setupChildren();
dojo.event.browser.addListener(this.domNode, "onclick", dojo.lang.hitch(this, "onSelect"));
if (this.selectedItem) {
this._selectItem(this.selectedItem);
}
}, _parseStructure:function () {
if (this.domNode.tagName.toLowerCase() != "ul" && this.domNode.tagName.toLowerCase() != "ol") {
dojo.raise("RadioGroup: Expected ul or ol content.");
return;
}
this.items = [];
var nl = this.domNode.getElementsByTagName("li");
for (var i = 0; i < nl.length; i++) {
if (nl[i].parentNode == this.domNode) {
this.items.push(nl[i]);
}
}
}, add:function (node) {
if (node.parentNode != this.domNode) {
this.domNode.appendChild(node);
}
this.items.push(node);
this._setup(node);
}, remove:function (node) {
var idx = -1;
for (var i = 0; i < this.items.length; i++) {
if (this.items[i] == node) {
idx = i;
break;
}
}
if (idx < 0) {
return;
}
this.items.splice(idx, 1);
node.parentNode.removeChild(node);
}, clear:function () {
for (var i = 0; i < this.items.length; i++) {
this.domNode.removeChild(this.items[i]);
}
this.items = [];
}, clearSelections:function () {
for (var i = 0; i < this.items.length; i++) {
dojo.html.removeClass(this.items[i], this.selectedCssClass);
}
this.selectedItem = null;
}, _setup:function (node) {
var span = document.createElement("span");
dojo.html.disableSelection(span);
dojo.html.addClass(span, this.itemContentCssClass);
dojo.dom.moveChildren(node, span);
node.appendChild(span);
if (this.selected.length > 0) {
var uid = dojo.html.getAttribute(node, "id");
if (uid && uid == this.selected) {
this.selectedItem = node;
}
}
dojo.event.browser.addListener(node, "onclick", dojo.lang.hitch(this, "onItemSelect"));
if (dojo.html.hasAttribute(node, "onitemselect")) {
var tn = dojo.lang.nameAnonFunc(new Function(dojo.html.getAttribute(node, "onitemselect")), this);
dojo.event.browser.addListener(node, "onclick", dojo.lang.hitch(this, tn));
}
}, _setupChildren:function () {
for (var i = 0; i < this.items.length; i++) {
this._setup(this.items[i]);
}
}, _selectItem:function (node, event, nofire) {
if (this.selectedItem) {
dojo.html.removeClass(this.selectedItem, this.selectedCssClass);
}
this.selectedItem = node;
dojo.html.addClass(this.selectedItem, this.selectedCssClass);
if (!dj_undef("currentTarget", event)) {
return;
}
if (!nofire) {
if (dojo.render.html.ie) {
this.selectedItem.fireEvent("onclick");
} else {
var e = document.createEvent("MouseEvents");
e.initEvent("click", true, false);
this.selectedItem.dispatchEvent(e);
}
}
}, getValue:function () {
return this.selectedItem;
}, onSelect:function (e) {
}, onItemSelect:function (e) {
if (!dj_undef("currentTarget", e)) {
this._selectItem(e.currentTarget, e);
}
}});
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js
New file
0,0 → 1,61
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.CreateLinkDialog");
dojo.widget.defineWidget("dojo.widget.Editor2CreateLinkDialog", dojo.widget.Editor2DialogContent, {templateString:"<table>\n<tr><td>URL</td><td> <input type=\"text\" dojoAttachPoint=\"link_href\" name=\"dojo_createLink_href\"/></td></tr>\n<tr><td>Target </td><td><select dojoAttachPoint=\"link_target\">\n\t<option value=\"\">Self</option>\n\t<option value=\"_blank\">New Window</option>\n\t<option value=\"_top\">Top Window</option>\n\t</select></td></tr>\n<tr><td>Class </td><td><input type=\"text\" dojoAttachPoint=\"link_class\" /></td></tr>\n<tr><td colspan=\"2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", editableAttributes:["href", "target", "class"], loadContent:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
curInst.saveSelection();
this.linkNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ["a"]);
var linkAttributes = {};
this.extraAttribText = "";
if (this.linkNode) {
var attrs = this.linkNode.attributes;
for (var i = 0; i < attrs.length; i++) {
if (dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase()) > -1) {
linkAttributes[attrs[i].name] = attrs[i].value;
} else {
if (attrs[i].specified == undefined || attrs[i].specified) {
this.extraAttribText += attrs[i].name + "=\"" + attrs[i].value + "\" ";
}
}
}
} else {
var html = dojo.withGlobal(curInst.window, "getSelectedText", dojo.html.selection);
if (html == null || html.length == 0) {
alert("Please select some text to create a link.");
return false;
}
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
this["link_" + name].value = (linkAttributes[name] == undefined) ? "" : linkAttributes[name];
}
return true;
}, ok:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
curInst.restoreSelection();
if (!this.linkNode) {
var html = dojo.withGlobal(curInst.window, "getSelectedHtml", dojo.html.selection);
} else {
var html = this.linkNode.innerHTML;
dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.linkNode]);
}
var attstr = "";
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
var value = this["link_" + name].value;
if (value.length > 0) {
attstr += name + "=\"" + value + "\" ";
}
}
curInst.execCommand("inserthtml", "<a " + attstr + this.extraAttribText + ">" + html + "</a>");
this.cancel();
}});
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js
New file
0,0 → 1,116
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.AlwaysShowToolbar");
dojo.event.topic.subscribe("dojo.widget.Editor2::onLoad", function (editor) {
if (editor.toolbarAlwaysVisible) {
var p = new dojo.widget.Editor2Plugin.AlwaysShowToolbar(editor);
}
});
dojo.declare("dojo.widget.Editor2Plugin.AlwaysShowToolbar", null, function (editor) {
this.editor = editor;
this.editor.registerLoadedPlugin(this);
this.setup();
}, {_scrollSetUp:false, _fixEnabled:false, _scrollThreshold:false, _handleScroll:true, setup:function () {
var tdn = this.editor.toolbarWidget;
if (!tdn.tbBgIframe) {
tdn.tbBgIframe = new dojo.html.BackgroundIframe(tdn.domNode);
tdn.tbBgIframe.onResized();
}
this.scrollInterval = setInterval(dojo.lang.hitch(this, "globalOnScrollHandler"), 100);
dojo.event.connect("before", this.editor.toolbarWidget, "destroy", this, "destroy");
}, globalOnScrollHandler:function () {
var isIE = dojo.render.html.ie;
if (!this._handleScroll) {
return;
}
var dh = dojo.html;
var tdn = this.editor.toolbarWidget.domNode;
var db = dojo.body();
if (!this._scrollSetUp) {
this._scrollSetUp = true;
var editorWidth = dh.getMarginBox(this.editor.domNode).width;
this._scrollThreshold = dh.abs(tdn, true).y;
if ((isIE) && (db) && (dh.getStyle(db, "background-image") == "none")) {
with (db.style) {
backgroundImage = "url(" + dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif") + ")";
backgroundAttachment = "fixed";
}
}
}
var scrollPos = (window["pageYOffset"]) ? window["pageYOffset"] : (document["documentElement"] || document["body"]).scrollTop;
if (scrollPos > this._scrollThreshold) {
if (!this._fixEnabled) {
var tdnbox = dojo.html.getMarginBox(tdn);
this.editor.editorObject.style.marginTop = tdnbox.height + "px";
if (isIE) {
tdn.style.left = dojo.html.abs(tdn, dojo.html.boxSizing.MARGIN_BOX).x;
if (tdn.previousSibling) {
this._IEOriginalPos = ["after", tdn.previousSibling];
} else {
if (tdn.nextSibling) {
this._IEOriginalPos = ["before", tdn.nextSibling];
} else {
this._IEOriginalPos = ["", tdn.parentNode];
}
}
dojo.body().appendChild(tdn);
dojo.html.addClass(tdn, "IEFixedToolbar");
} else {
with (tdn.style) {
position = "fixed";
top = "0px";
}
}
tdn.style.width = tdnbox.width + "px";
tdn.style.zIndex = 1000;
this._fixEnabled = true;
}
if (!dojo.render.html.safari) {
var eHeight = (this.height) ? parseInt(this.editor.height) : this.editor._lastHeight;
if (scrollPos > (this._scrollThreshold + eHeight)) {
tdn.style.display = "none";
} else {
tdn.style.display = "";
}
}
} else {
if (this._fixEnabled) {
(this.editor.object || this.editor.iframe).style.marginTop = null;
with (tdn.style) {
position = "";
top = "";
zIndex = "";
display = "";
}
if (isIE) {
tdn.style.left = "";
dojo.html.removeClass(tdn, "IEFixedToolbar");
if (this._IEOriginalPos) {
dojo.html.insertAtPosition(tdn, this._IEOriginalPos[1], this._IEOriginalPos[0]);
this._IEOriginalPos = null;
} else {
dojo.html.insertBefore(tdn, this.editor.object || this.editor.iframe);
}
}
tdn.style.width = "";
this._fixEnabled = false;
}
}
}, destroy:function () {
this._IEOriginalPos = null;
this._handleScroll = false;
clearInterval(this.scrollInterval);
this.editor.unregisterLoadedPlugin(this);
if (dojo.render.html.ie) {
dojo.html.removeClass(this.editor.toolbarWidget.domNode, "IEFixedToolbar");
}
}});
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js
New file
0,0 → 1,44
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.ToolbarDndSupport");
dojo.require("dojo.dnd.*");
dojo.event.topic.subscribe("dojo.widget.Editor2::preLoadingToolbar", function (editor) {
dojo.dnd.dragManager.nestedTargets = true;
var p = new dojo.widget.Editor2Plugin.ToolbarDndSupport(editor);
});
dojo.declare("dojo.widget.Editor2Plugin.ToolbarDndSupport", null, {lookForClass:"dojoEditorToolbarDnd TB_ToolbarSet TB_Toolbar", initializer:function (editor) {
this.editor = editor;
dojo.event.connect(this.editor, "toolbarLoaded", this, "setup");
this.editor.registerLoadedPlugin(this);
}, setup:function () {
dojo.event.disconnect(this.editor, "toolbarLoaded", this, "setup");
var tbw = this.editor.toolbarWidget;
dojo.event.connect("before", tbw, "destroy", this, "destroy");
var nodes = dojo.html.getElementsByClass(this.lookForClass, tbw.domNode, null, dojo.html.classMatchType.ContainsAny);
if (!nodes) {
dojo.debug("dojo.widget.Editor2Plugin.ToolbarDndSupport: No dom node with class in " + this.lookForClass);
return;
}
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
var droptarget = node.getAttribute("dojoETDropTarget");
if (droptarget) {
(new dojo.dnd.HtmlDropTarget(node, [droptarget + tbw.widgetId])).vertical = true;
}
var dragsource = node.getAttribute("dojoETDragSource");
if (dragsource) {
new dojo.dnd.HtmlDragSource(node, dragsource + tbw.widgetId);
}
}
}, destroy:function () {
this.editor.unregisterLoadedPlugin(this);
}});
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/InsertImageDialog.js
New file
0,0 → 1,53
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.InsertImageDialog");
dojo.widget.defineWidget("dojo.widget.Editor2InsertImageDialog", dojo.widget.Editor2DialogContent, {templateString:"<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\" width=\"100%\" height=\"100%\">\n\t<tr>\n\t\t<td>\n\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"100%\">\n\t\t\t\t\t\t<span>URL</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style=\"display: none\" nowrap=\"nowrap\" rowspan=\"2\">\n\t\t\t\t\t\t<!--input id=\"btnBrowse\" onclick=\"BrowseServer();\" type=\"button\" value=\"Browse Server\"/-->\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t<input dojoAttachPoint=\"image_src\" style=\"width: 100%\" type=\"text\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t<span>Alternative Text</span><br />\n\t\t\t<input dojoAttachPoint=\"image_alt\" style=\"width: 100%\" type=\"text\" /><br />\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td valign=\"top\">\n\t\t\t<table><tr><td>\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Width</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"3\" dojoAttachPoint=\"image_width\" /></td>\n\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<!--div id=\"btnLockSizes\" class=\"BtnLocked\" onmouseover=\"this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';\"\n\t\t\t\t\t\t\t\t\t\tonmouseout=\"this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );\" title=\"Lock Sizes\"\n\t\t\t\t\t\t\t\t\t\tonclick=\"SwitchLock(this);\">\n\t\t\t\t\t\t\t\t\t</div-->\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<!--div id=\"btnResetSize\" class=\"BtnReset\" onmouseover=\"this.className='BtnReset BtnOver';\"\n\t\t\t\t\t\t\t\t\t\tonmouseout=\"this.className='BtnReset';\" title=\"Reset Size\" onclick=\"ResetSizes();\">\n\t\t\t\t\t\t\t\t\t</div-->\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Height</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"3\" dojoAttachPoint=\"image_height\" /></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td><td>\n\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >HSpace</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" dojoAttachPoint=\"image_hspace\"/></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >VSpace</span>&nbsp;</td>\n\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" dojoAttachPoint=\"image_vspace\" /></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Border</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" value=\"\" dojoAttachPoint=\"image_border\" /></td>\n\t\t\t\t\t\t\t\t<td>&nbsp;&nbsp;&nbsp;</td>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >Align</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<select dojoAttachPoint=\"image_align\">\n\n\t\t\t\t\t\t\t\t\t\t<option value=\"\" selected=\"selected\"></option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"left\">Left</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"absBottom\">Abs Bottom</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"absMiddle\">Abs Middle</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"baseline\">Baseline</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"bottom\">Bottom</option>\n\n\t\t\t\t\t\t\t\t\t\t<option value=\"middle\">Middle</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"right\">Right</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"textTop\">Text Top</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"top\">Top</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr></table>\n\t\t</td>\n\t</tr>\n\t<tr><td>\n\t\t<table><tr>\n\t\t<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>\n\t\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n\t\t</tr></table>\n\t</td></tr>\n</table>\n", editableAttributes:["src", "alt", "width", "height", "hspace", "vspace", "border", "align"], loadContent:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
this.imageNode = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
if (!this.imageNode) {
this.imageNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ["img"]);
}
var imageAttributes = {};
this.extraAttribText = "";
if (this.imageNode) {
var attrs = this.imageNode.attributes;
for (var i = 0; i < attrs.length; i++) {
if (dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase()) > -1) {
imageAttributes[attrs[i].name] = attrs[i].value;
} else {
this.extraAttribText += attrs[i].name + "=\"" + attrs[i].value + "\" ";
}
}
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
this["image_" + name].value = (imageAttributes[name] == undefined) ? "" : imageAttributes[name];
}
return true;
}, ok:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var insertcmd = curInst.getCommand("inserthtml");
var option = 0;
var attstr = "";
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
var value = this["image_" + name].value;
if (value.length > 0) {
attstr += name + "=\"" + value + "\" ";
}
}
if (this.imageNode) {
dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.imageNode]);
}
insertcmd.execute("<img " + attstr + this.extraAttribText + "/>");
this.cancel();
}});
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.widget.Editor2", "dojo.widget.Editor2Toolbar"]});
dojo.provide("dojo.widget.Editor2Plugin.*");
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/TableOperation.js
New file
0,0 → 1,118
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.TableOperation");
dojo.require("dojo.widget.Editor2");
dojo.event.topic.subscribe("dojo.widget.RichText::init", function (editor) {
if (dojo.render.html.ie) {
editor.contentDomPreFilters.push(dojo.widget.Editor2Plugin.TableOperation.showIETableBorder);
editor.contentDomPostFilters.push(dojo.widget.Editor2Plugin.TableOperation.removeIEFakeClass);
}
editor.getCommand("toggletableborder");
});
dojo.lang.declare("dojo.widget.Editor2Plugin.deleteTableCommand", dojo.widget.Editor2Command, {execute:function () {
var table = dojo.withGlobal(this._editor.window, "getAncestorElement", dojo.html.selection, ["table"]);
if (table) {
dojo.withGlobal(this._editor.window, "selectElement", dojo.html.selection, [table]);
this._editor.execCommand("inserthtml", " ");
}
}, getState:function () {
if (this._editor._lastStateTimestamp > this._updateTime || this._state == undefined) {
this._updateTime = this._editor._lastStateTimestamp;
var table = dojo.withGlobal(this._editor.window, "hasAncestorElement", dojo.html.selection, ["table"]);
this._state = table ? dojo.widget.Editor2Manager.commandState.Enabled : dojo.widget.Editor2Manager.commandState.Disabled;
}
return this._state;
}, getText:function () {
return "Delete Table";
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.toggleTableBorderCommand", dojo.widget.Editor2Command, function () {
this._showTableBorder = false;
dojo.event.connect(this._editor, "editorOnLoad", this, "execute");
}, {execute:function () {
if (this._showTableBorder) {
this._showTableBorder = false;
if (dojo.render.html.moz) {
this._editor.removeStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_gecko.css"));
} else {
if (dojo.render.html.ie) {
this._editor.removeStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_ie.css"));
}
}
} else {
this._showTableBorder = true;
if (dojo.render.html.moz) {
this._editor.addStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_gecko.css"));
} else {
if (dojo.render.html.ie) {
this._editor.addStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_ie.css"));
}
}
}
}, getText:function () {
return "Toggle Table Border";
}, getState:function () {
return this._showTableBorder ? dojo.widget.Editor2Manager.commandState.Latched : dojo.widget.Editor2Manager.commandState.Enabled;
}});
dojo.widget.Editor2Plugin.TableOperation = {getCommand:function (editor, name) {
switch (name.toLowerCase()) {
case "toggletableborder":
return new dojo.widget.Editor2Plugin.toggleTableBorderCommand(editor, name);
case "inserttable":
return new dojo.widget.Editor2DialogCommand(editor, "inserttable", {contentFile:"dojo.widget.Editor2Plugin.InsertTableDialog", contentClass:"Editor2InsertTableDialog", title:"Insert/Edit Table", width:"450px", height:"250px"});
case "deletetable":
return new dojo.widget.Editor2Plugin.deleteTableCommand(editor, name);
}
}, getToolbarItem:function (name) {
var name = name.toLowerCase();
var item;
switch (name) {
case "inserttable":
case "toggletableborder":
item = new dojo.widget.Editor2ToolbarButton(name);
}
return item;
}, getContextMenuGroup:function (name, contextmenuplugin) {
return new dojo.widget.Editor2Plugin.TableContextMenuGroup(contextmenuplugin);
}, showIETableBorder:function (dom) {
var tables = dom.getElementsByTagName("table");
dojo.lang.forEach(tables, function (t) {
dojo.html.addClass(t, "dojoShowIETableBorders");
});
return dom;
}, removeIEFakeClass:function (dom) {
var tables = dom.getElementsByTagName("table");
dojo.lang.forEach(tables, function (t) {
dojo.html.removeClass(t, "dojoShowIETableBorders");
});
return dom;
}};
dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getCommand);
dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getToolbarItem);
if (dojo.widget.Editor2Plugin.ContextMenuManager) {
dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup("Table", dojo.widget.Editor2Plugin.TableOperation.getContextMenuGroup);
dojo.declare("dojo.widget.Editor2Plugin.TableContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption:"Delete Table", command:"deletetable"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption:"Table Property", command:"inserttable", iconClass:"TB_Button_Icon TB_Button_Table"}));
}, checkVisibility:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var table = dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ["table"]);
if (dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ["table"])) {
this.items[0].show();
this.items[1].show();
return true;
} else {
this.items[0].hide();
this.items[1].hide();
return false;
}
}});
}
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/ContextMenu.js
New file
0,0 → 1,201
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.ContextMenu");
dojo.require("dojo.widget.Menu2");
dojo.event.topic.subscribe("dojo.widget.Editor2::onLoad", function (editor) {
dojo.widget.Editor2Plugin.ContextMenuManager.getContextMenu(editor);
});
dojo.widget.Editor2Plugin.ContextMenuManager = {menuGroups:["Generic", "Link", "Anchor", "Image", "List", "Table"], _contextMenuGroupSets:{}, _registeredGroups:{}, _menus:{}, registerGroup:function (name, handler) {
if (this._registeredGroups[name]) {
alert("dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup: menu group " + name + "is already registered. Ignored.");
return;
}
this._registeredGroups[name] = handler;
}, removeGroup:function (name) {
delete this._registeredGroups[name];
}, getGroup:function (name, contextmenuplugin) {
if (this._registeredGroups[name]) {
var item = this._registeredGroups[name](name, contextmenuplugin);
if (item) {
return item;
}
}
switch (name) {
case "Generic":
case "Link":
case "Image":
return new dojo.widget.Editor2Plugin[name + "ContextMenuGroup"](contextmenuplugin);
case "Anchor":
case "List":
}
}, registerGroupSet:function (name, set) {
this._contextMenuGroupSets[name] = set;
}, removeGroupSet:function (name) {
var set = this._contextMenuGroupSets[name];
delete this._contextMenuGroupSets[name];
return set;
}, getContextMenu:function (editor) {
var set = editor.contextMenuGroupSet || "defaultDojoEditor2MenuGroupSet";
if (this._menus[set]) {
this._menus[set].bindEditor(editor);
return this._menus[set];
}
var gs = (editor.contextMenuGroupSet && this._contextMenuGroupSets[editor.contextMenuGroupSet]) || this.menuGroups;
var menu = new dojo.widget.Editor2Plugin.ContextMenu(editor, gs);
this._menus[set] = menu;
return menu;
}};
dojo.declare("dojo.widget.Editor2Plugin.ContextMenu", null, function (editor, gs) {
this.groups = [];
this.separators = [];
this.editor = editor;
this.editor.registerLoadedPlugin(this);
this.contextMenu = dojo.widget.createWidget("PopupMenu2", {});
dojo.body().appendChild(this.contextMenu.domNode);
this.bindEditor(this.editor);
dojo.event.connect(this.contextMenu, "aboutToShow", this, "aboutToShow");
dojo.event.connect(this.editor, "destroy", this, "destroy");
this.setup(gs);
}, {bindEditor:function (editor) {
this.contextMenu.bindDomNode(editor.document.body);
}, setup:function (gs) {
for (var i in gs) {
var g = dojo.widget.Editor2Plugin.ContextMenuManager.getGroup(gs[i], this);
if (g) {
this.groups.push(g);
}
}
}, aboutToShow:function () {
var first = true;
for (var i in this.groups) {
if (i > 0 && this.separators.length != this.groups.length - 1) {
this.separators.push(dojo.widget.createWidget("MenuSeparator2", {}));
this.contextMenu.addChild(this.separators[this.separators.length - 1]);
}
if (this.groups[i].refresh()) {
if (i > 0) {
if (first) {
this.separators[i - 1].hide();
} else {
this.separators[i - 1].show();
}
}
if (first) {
first = false;
}
} else {
if (i > 0) {
this.separators[i - 1].hide();
}
}
}
}, destroy:function () {
this.editor.unregisterLoadedPlugin(this);
delete this.groups;
delete this.separators;
this.contextMenu.destroy();
delete this.contextMenu;
}});
dojo.widget.defineWidget("dojo.widget.Editor2ContextMenuItem", dojo.widget.MenuItem2, {command:"", buildRendering:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
this.caption = curInst.getCommand(this.command).getText();
dojo.widget.Editor2ContextMenuItem.superclass.buildRendering.apply(this, arguments);
}, onClick:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this.command);
if (_command) {
_command.execute();
}
}
}, refresh:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this.command);
if (_command) {
if (_command.getState() == dojo.widget.Editor2Manager.commandState.Disabled) {
this.disable();
return false;
} else {
this.enable();
return true;
}
}
}
}, hide:function () {
this.domNode.style.display = "none";
}, show:function () {
this.domNode.style.display = "";
}});
dojo.declare("dojo.widget.Editor2Plugin.SimpleContextMenuGroup", null, function (contextmenuplugin) {
this.contextMenu = contextmenuplugin.contextMenu;
this.items = [];
dojo.event.connect(contextmenuplugin, "destroy", this, "destroy");
}, {refresh:function () {
if (!this.items.length) {
this.createItems();
for (var i in this.items) {
this.contextMenu.addChild(this.items[i]);
}
}
return this.checkVisibility();
}, destroy:function () {
this.contextmenu = null;
delete this.items;
delete this.contextMenu;
}, createItems:function () {
}, checkVisibility:function () {
var show = false;
for (var i in this.items) {
show = show || this.items[i].refresh();
}
var action = show ? "show" : "hide";
for (var i in this.items) {
this.items[i][action]();
}
return show;
}});
dojo.declare("dojo.widget.Editor2Plugin.GenericContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"cut", iconClass:"dojoE2TBIcon dojoE2TBIcon_Cut"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"copy", iconClass:"dojoE2TBIcon dojoE2TBIcon_Copy"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"paste", iconClass:"dojoE2TBIcon dojoE2TBIcon_Paste"}));
}});
dojo.declare("dojo.widget.Editor2Plugin.LinkContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"createlink", iconClass:"dojoE2TBIcon dojoE2TBIcon_Link"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"unlink", iconClass:"dojoE2TBIcon dojoE2TBIcon_UnLink"}));
}, checkVisibility:function () {
var show = this.items[1].refresh();
if (show) {
this.items[0].refresh();
for (var i in this.items) {
this.items[i].show();
}
} else {
for (var i in this.items) {
this.items[i].hide();
}
}
return show;
}});
dojo.declare("dojo.widget.Editor2Plugin.ImageContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"insertimage", iconClass:"dojoE2TBIcon dojoE2TBIcon_Image"}));
}, checkVisibility:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var img = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
if (img && img.tagName.toLowerCase() == "img") {
this.items[0].show();
return true;
} else {
this.items[0].hide();
return false;
}
}});
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js
New file
0,0 → 1,50
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.SimpleSignalCommands");
dojo.require("dojo.widget.Editor2");
dojo.declare("dojo.widget.Editor2Plugin.SimpleSignalCommand", dojo.widget.Editor2Command, function (editor, name) {
if (dojo.widget.Editor2.prototype[name] == undefined) {
dojo.widget.Editor2.prototype[name] = function () {
};
}
}, {execute:function () {
this._editor[this._name]();
}});
if (dojo.widget.Editor2Plugin["SimpleSignalCommands"]) {
dojo.widget.Editor2Plugin["_SimpleSignalCommands"] = dojo.widget.Editor2Plugin["SimpleSignalCommands"];
}
dojo.widget.Editor2Plugin.SimpleSignalCommands = {signals:["save", "insertImage"], Handler:function (name) {
if (name.toLowerCase() == "save") {
return new dojo.widget.Editor2ToolbarButton("Save");
} else {
if (name.toLowerCase() == "insertimage") {
return new dojo.widget.Editor2ToolbarButton("InsertImage");
}
}
}, getCommand:function (editor, name) {
var signal;
dojo.lang.every(this.signals, function (s) {
if (s.toLowerCase() == name.toLowerCase()) {
signal = s;
return false;
}
return true;
});
if (signal) {
return new dojo.widget.Editor2Plugin.SimpleSignalCommand(editor, signal);
}
}};
if (dojo.widget.Editor2Plugin["_SimpleSignalCommands"]) {
dojo.lang.mixin(dojo.widget.Editor2Plugin.SimpleSignalCommands, dojo.widget.Editor2Plugin["_SimpleSignalCommands"]);
}
dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands, "getCommand");
dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands.Handler);
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/FindReplace.js
New file
0,0 → 1,59
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.FindReplace");
dojo.require("dojo.widget.Editor2");
dojo.declare("dojo.widget.Editor2Plugin.FindCommand", dojo.widget.Editor2DialogCommand, {SearchOption:{CaseSensitive:4, SearchBackwards:64, WholeWord:2, WrapSearch:128}, find:function (text, option) {
this._editor.focus();
if (window.find) {
this._editor.window.find(text, option & this.SearchOption.CaseSensitive ? true : false, option & this.SearchOption.SearchBackwards ? true : false, option & this.SearchOption.WrapSearch ? true : false, option & this.SearchOption.WholeWord ? true : false);
} else {
if (dojo.body().createTextRange) {
var range = this._editor.document.body.createTextRange();
var found = range.findText(text, (option & this.SearchOption.SearchBackwards) ? 1 : -1, option);
if (found) {
range.scrollIntoView();
range.select();
} else {
alert("Can not find " + text + " in the document");
}
} else {
alert("No idea how to search in this browser. Please submit patch if you know.");
}
}
}, getText:function () {
return "Find";
}});
dojo.widget.Editor2Plugin.FindReplace = {getCommand:function (editor, name) {
var name = name.toLowerCase();
var command;
if (name == "find") {
command = new dojo.widget.Editor2Plugin.FindCommand(editor, "find", {contentFile:"dojo.widget.Editor2Plugin.FindReplaceDialog", contentClass:"Editor2FindDialog", title:"Find", width:"350px", height:"150px", modal:false});
} else {
if (name == "replace") {
command = new dojo.widget.Editor2DialogCommand(editor, "replace", {contentFile:"dojo.widget.Editor2Plugin.FindReplaceDialog", contentClass:"Editor2ReplaceDialog", href:dojo.uri.cache.set(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/Dialog/replace.html"), "<table style=\"white-space: nowrap;\">\n<tr><td>Find: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td>Replace with: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td colspan='2'><table><tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_casesens\" id=\"dojo_replace_option_casesens\" />\n\t\t<label for=\"dojo_replace_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_backwards\" id=\"dojo_replace_option_backwards\" />\n\t\t<label for=\"dojo_replace_option_backwards\">Search Backwards</label></td></tr></table></td></tr>\n<tr><td colspan=2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replaceAll'>Replace All</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n"), title:"Replace", width:"350px", height:"200px", modal:false});
}
}
return command;
}, getToolbarItem:function (name) {
var name = name.toLowerCase();
var item;
if (name == "replace") {
item = new dojo.widget.Editor2ToolbarButton("Replace");
} else {
if (name == "find") {
item = new dojo.widget.Editor2ToolbarButton("Find");
}
}
return item;
}};
dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.FindReplace.getCommand);
dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.FindReplace.getToolbarItem);
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/FindReplaceDialog.js
New file
0,0 → 1,32
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.FindReplaceDialog");
dojo.widget.defineWidget("dojo.widget.Editor2FindDialog", dojo.widget.Editor2DialogContent, {templateString:"<table style=\"white-space: nowrap;\">\n<tr><td colspan='2'>Find: <input type=\"text\" dojoAttachPoint=\"find_text\" /></td></tr>\n<tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_casesens\" />\n\t\t<label for=\"find_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_backwards\" />\n\t\t<label for=\"find_option_backwards\">Search Backwards</label></td></tr>\n<tr><td style=\"display: none;\"><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_wholeword\" />\n\t\t<label for=\"find_option_wholeword\">Whole Word</label></td>\n<tr><td colspan=\"1\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:find'>Find</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", find:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var findcmd = curInst.getCommand("find");
var option = 0;
if (this["find_option_casesens"].checked) {
option |= findcmd.SearchOption.CaseSensitive;
}
if (this["find_option_backwards"].checked) {
option |= findcmd.SearchOption.SearchBackwards;
}
if (this["find_option_wholeword"].checked) {
option |= findcmd.SearchOption.WholeWord;
}
findcmd.find(this["find_text"].value, option);
}});
dojo.widget.defineWidget("dojo.widget.Editor2ReplaceDialog", dojo.widget.Editor2DialogContent, {templateString:"<table style=\"white-space: nowrap;\">\n<tr><td>Find: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td>Replace with: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td colspan='2'><table><tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_casesens\" id=\"dojo_replace_option_casesens\" />\n\t\t<label for=\"dojo_replace_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_backwards\" id=\"dojo_replace_option_backwards\" />\n\t\t<label for=\"dojo_replace_option_backwards\">Search Backwards</label></td></tr></table></td></tr>\n<tr><td colspan=2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replaceAll'>Replace All</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", replace:function () {
alert("not implemented yet");
}, replaceAll:function () {
alert("not implemented yet");
}});
 
/trunk/api/js/dojo/src/widget/Editor2Plugin/InsertTableDialog.js
New file
0,0 → 1,129
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.InsertTableDialog");
dojo.widget.defineWidget("dojo.widget.Editor2InsertTableDialog", dojo.widget.Editor2DialogContent, {templateString:"<div>\n<table cellSpacing=\"1\" cellPadding=\"1\" width=\"100%\" border=\"0\">\n\t<tr>\n\t\t<td valign=\"top\">\n\t\t\t<table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\n\t\t\t\t\t<td><span>Rows</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_rows\" type=\"text\" maxLength=\"3\" size=\"2\" value=\"3\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Columns</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_cols\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"2\"></td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Border size</span>:</td>\n\t\t\t\t\t<td>&nbsp;<INPUT dojoAttachPoint=\"table_border\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Alignment</span>:</td>\n\t\t\t\t\t<td>&nbsp;<select dojoAttachPoint=\"table_align\">\n\t\t\t\t\t\t\t<option value=\"\" selected>&lt;Not set&gt;</option>\n\t\t\t\t\t\t\t<option value=\"left\">Left</option>\n\t\t\t\t\t\t\t<option value=\"center\">Center</option>\n\t\t\t\t\t\t\t<option value=\"right\">Right</option>\n\t\t\t\t\t\t</select></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t\t<td>&nbsp;&nbsp;&nbsp;</td>\n\t\t<td align=\"right\" valign=\"top\">\n\t\t\t<table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Width</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_width\" type=\"text\" maxLength=\"4\" size=\"3\"></td>\n\t\t\t\t\t<td>&nbsp;<select dojoAttachPoint=\"table_widthtype\">\n\t\t\t\t\t\t\t<option value=\"percent\" selected>percent</option>\n\t\t\t\t\t\t\t<option value=\"pixels\">pixels</option>\n\t\t\t\t\t\t</select></td>\n\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Height</span>:</td>\n\t\t\t\t\t<td>&nbsp;<INPUT dojoAttachPoint=\"table_height\" type=\"text\" maxLength=\"4\" size=\"3\"></td>\n\t\t\t\t\t<td>&nbsp;<span>pixels</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td nowrap><span>Cell spacing</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_cellspacing\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t\t<td>&nbsp;</td>\n\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td nowrap><span>Cell padding</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_cellpadding\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n</table>\n<table cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\">\n\t<tr>\n\t\t<td nowrap><span>Caption</span>:</td>\n\t\t<td>&nbsp;</td>\n\t\t<td width=\"100%\" nowrap>&nbsp;\n\t\t\t<input dojoAttachPoint=\"table_caption\" type=\"text\" style=\"WIDTH: 90%\"></td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap><span>Summary</span>:</td>\n\t\t<td>&nbsp;</td>\n\t\t<td width=\"100%\" nowrap>&nbsp;\n\t\t\t<input dojoAttachPoint=\"table_summary\" type=\"text\" style=\"WIDTH: 90%\"></td>\n\t</tr>\n</table>\n<table><tr>\n<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>Ok</button></td>\n<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n</tr></table>\n</div>\n", editableAttributes:["summary", "height", "cellspacing", "cellpadding", "border", "align"], loadContent:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
curInst.saveSelection();
this.tableNode = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
if (!this.tableNode || this.tableNode.tagName.toLowerCase() != "table") {
this.tableNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ["table"]);
}
var tableAttributes = {};
this.extraAttribText = "";
if (this.tableNode) {
this["table_rows"].value = this.tableNode.rows.length;
this["table_rows"].disabled = true;
this["table_cols"].value = this.tableNode.rows[0].cells.length;
this["table_cols"].disabled = true;
if (this.tableNode.caption) {
this["table_caption"].value = this.tableNode.caption.innerHTML;
} else {
this["table_caption"].value = "";
}
var width = this.tableNode.style.width || this.tableNode.width;
if (width) {
this["table_width"].value = parseInt(width);
if (width.indexOf("%") > -1) {
this["table_widthtype"].value = "percent";
} else {
this["table_widthtype"].value = "pixels";
}
} else {
this["table_width"].value = "100";
}
var height = this.tableNode.style.height || this.tableNode.height;
if (height) {
this["table_height"].value = parseInt(width);
} else {
this["table_height"].value = "";
}
var attrs = this.tableNode.attributes;
for (var i = 0; i < attrs.length; i++) {
if (dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase()) > -1) {
tableAttributes[attrs[i].name] = attrs[i].value;
} else {
this.extraAttribText += attrs[i].name + "=\"" + attrs[i].value + "\" ";
}
}
} else {
this["table_rows"].value = 3;
this["table_rows"].disabled = false;
this["table_cols"].value = 2;
this["table_cols"].disabled = false;
this["table_width"].value = 100;
this["table_widthtype"].value = "percent";
this["table_height"].value = "";
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
this["table_" + name].value = (tableAttributes[name] == undefined) ? "" : tableAttributes[name];
if (name == "height" && tableAttributes[name] != undefined) {
this["table_" + name].value = tableAttributes[name];
}
}
return true;
}, ok:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var args = {};
args["rows"] = this["table_rows"].value;
args["cols"] = this["table_cols"].value;
args["caption"] = this["table_caption"].value;
args["tableattrs"] = "";
if (this["table_widthtype"].value == "percent") {
args["tableattrs"] += "width=\"" + this["table_width"].value + "%\" ";
} else {
args["tableattrs"] += "width=\"" + this["table_width"].value + "px\" ";
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
var name = this.editableAttributes[i];
var value = this["table_" + name].value;
if (value.length > 0) {
args["tableattrs"] += name + "=\"" + value + "\" ";
}
}
if (!args["tableattrs"]) {
args["tableattrs"] = "";
}
if (dojo.render.html.ie && !this["table_border"].value) {
args["tableattrs"] += "class=\"dojoShowIETableBorders\" ";
}
var html = "<table " + args["tableattrs"] + ">";
if (args["caption"]) {
html += "<caption>" + args["caption"] + "</caption>";
}
var outertbody = "<tbody>";
if (this.tableNode) {
var tbody = this.tableNode.getElementsByTagName("tbody")[0];
outertbody = tbody.outerHTML;
if (!outertbody) {
var cnode = tbody.cloneNode(true);
var tmpnode = tbody.ownerDocument.createElement("div");
tmpnode.appendChild(cnode);
outertbody = tmpnode.innerHTML;
}
dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.tableNode]);
} else {
var cols = "<tr>";
for (var i = 0; i < +args.cols; i++) {
cols += "<td></td>";
}
cols += "</tr>";
for (var i = 0; i < args.rows; i++) {
outertbody += cols;
}
outertbody += "</tbody>";
}
html += outertbody + "</table>";
curInst.restoreSelection();
curInst.execCommand("inserthtml", html);
this.cancel();
}});
 
/trunk/api/js/dojo/src/widget/ContentPane.js
New file
0,0 → 1,439
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ContentPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.string");
dojo.require("dojo.string.extras");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.ContentPane", dojo.widget.HtmlWidget, function () {
this._styleNodes = [];
this._onLoadStack = [];
this._onUnloadStack = [];
this._callOnUnload = false;
this._ioBindObj;
this.scriptScope;
this.bindArgs = {};
}, {isContainer:true, adjustPaths:true, href:"", extractContent:true, parseContent:true, cacheContent:true, preload:false, refreshOnShow:false, handler:"", executeScripts:false, scriptSeparation:true, loadingMessage:"Loading...", isLoaded:false, postCreate:function (args, frag, parentComp) {
if (this.handler !== "") {
this.setHandler(this.handler);
}
if (this.isShowing() || this.preload) {
this.loadContents();
}
}, show:function () {
if (this.refreshOnShow) {
this.refresh();
} else {
this.loadContents();
}
dojo.widget.ContentPane.superclass.show.call(this);
}, refresh:function () {
this.isLoaded = false;
this.loadContents();
}, loadContents:function () {
if (this.isLoaded) {
return;
}
if (dojo.lang.isFunction(this.handler)) {
this._runHandler();
} else {
if (this.href != "") {
this._downloadExternalContent(this.href, this.cacheContent && !this.refreshOnShow);
}
}
}, setUrl:function (url) {
this.href = url;
this.isLoaded = false;
if (this.preload || this.isShowing()) {
this.loadContents();
}
}, abort:function () {
var bind = this._ioBindObj;
if (!bind || !bind.abort) {
return;
}
bind.abort();
delete this._ioBindObj;
}, _downloadExternalContent:function (url, useCache) {
this.abort();
this._handleDefaults(this.loadingMessage, "onDownloadStart");
var self = this;
this._ioBindObj = dojo.io.bind(this._cacheSetting({url:url, mimetype:"text/html", handler:function (type, data, xhr) {
delete self._ioBindObj;
if (type == "load") {
self.onDownloadEnd.call(self, url, data);
} else {
var e = {responseText:xhr.responseText, status:xhr.status, statusText:xhr.statusText, responseHeaders:xhr.getAllResponseHeaders(), text:"Error loading '" + url + "' (" + xhr.status + " " + xhr.statusText + ")"};
self._handleDefaults.call(self, e, "onDownloadError");
self.onLoad();
}
}}, useCache));
}, _cacheSetting:function (bindObj, useCache) {
for (var x in this.bindArgs) {
if (dojo.lang.isUndefined(bindObj[x])) {
bindObj[x] = this.bindArgs[x];
}
}
if (dojo.lang.isUndefined(bindObj.useCache)) {
bindObj.useCache = useCache;
}
if (dojo.lang.isUndefined(bindObj.preventCache)) {
bindObj.preventCache = !useCache;
}
if (dojo.lang.isUndefined(bindObj.mimetype)) {
bindObj.mimetype = "text/html";
}
return bindObj;
}, onLoad:function (e) {
this._runStack("_onLoadStack");
this.isLoaded = true;
}, onUnLoad:function (e) {
dojo.deprecated(this.widgetType + ".onUnLoad, use .onUnload (lowercased load)", 0.5);
}, onUnload:function (e) {
this._runStack("_onUnloadStack");
delete this.scriptScope;
if (this.onUnLoad !== dojo.widget.ContentPane.prototype.onUnLoad) {
this.onUnLoad.apply(this, arguments);
}
}, _runStack:function (stName) {
var st = this[stName];
var err = "";
var scope = this.scriptScope || window;
for (var i = 0; i < st.length; i++) {
try {
st[i].call(scope);
}
catch (e) {
err += "\n" + st[i] + " failed: " + e.description;
}
}
this[stName] = [];
if (err.length) {
var name = (stName == "_onLoadStack") ? "addOnLoad" : "addOnUnLoad";
this._handleDefaults(name + " failure\n " + err, "onExecError", "debug");
}
}, addOnLoad:function (obj, func) {
this._pushOnStack(this._onLoadStack, obj, func);
}, addOnUnload:function (obj, func) {
this._pushOnStack(this._onUnloadStack, obj, func);
}, addOnUnLoad:function () {
dojo.deprecated(this.widgetType + ".addOnUnLoad, use addOnUnload instead. (lowercased Load)", 0.5);
this.addOnUnload.apply(this, arguments);
}, _pushOnStack:function (stack, obj, func) {
if (typeof func == "undefined") {
stack.push(obj);
} else {
stack.push(function () {
obj[func]();
});
}
}, destroy:function () {
this.onUnload();
dojo.widget.ContentPane.superclass.destroy.call(this);
}, onExecError:function (e) {
}, onContentError:function (e) {
}, onDownloadError:function (e) {
}, onDownloadStart:function (e) {
}, onDownloadEnd:function (url, data) {
data = this.splitAndFixPaths(data, url);
this.setContent(data);
}, _handleDefaults:function (e, handler, messType) {
if (!handler) {
handler = "onContentError";
}
if (dojo.lang.isString(e)) {
e = {text:e};
}
if (!e.text) {
e.text = e.toString();
}
e.toString = function () {
return this.text;
};
if (typeof e.returnValue != "boolean") {
e.returnValue = true;
}
if (typeof e.preventDefault != "function") {
e.preventDefault = function () {
this.returnValue = false;
};
}
this[handler](e);
if (e.returnValue) {
switch (messType) {
case true:
case "alert":
alert(e.toString());
break;
case "debug":
dojo.debug(e.toString());
break;
default:
if (this._callOnUnload) {
this.onUnload();
}
this._callOnUnload = false;
if (arguments.callee._loopStop) {
dojo.debug(e.toString());
} else {
arguments.callee._loopStop = true;
this._setContent(e.toString());
}
}
}
arguments.callee._loopStop = false;
}, splitAndFixPaths:function (s, url) {
var titles = [], scripts = [], tmp = [];
var match = [], requires = [], attr = [], styles = [];
var str = "", path = "", fix = "", tagFix = "", tag = "", origPath = "";
if (!url) {
url = "./";
}
if (s) {
var regex = /<title[^>]*>([\s\S]*?)<\/title>/i;
while (match = regex.exec(s)) {
titles.push(match[1]);
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
if (this.adjustPaths) {
var regexFindTag = /<[a-z][a-z0-9]*[^>]*\s(?:(?:src|href|style)=[^>])+[^>]*>/i;
var regexFindAttr = /\s(src|href|style)=(['"]?)([\w()\[\]\/.,\\'"-:;#=&?\s@]+?)\2/i;
var regexProtocols = /^(?:[#]|(?:(?:https?|ftps?|file|javascript|mailto|news):))/;
while (tag = regexFindTag.exec(s)) {
str += s.substring(0, tag.index);
s = s.substring((tag.index + tag[0].length), s.length);
tag = tag[0];
tagFix = "";
while (attr = regexFindAttr.exec(tag)) {
path = "";
origPath = attr[3];
switch (attr[1].toLowerCase()) {
case "src":
case "href":
if (regexProtocols.exec(origPath)) {
path = origPath;
} else {
path = (new dojo.uri.Uri(url, origPath).toString());
}
break;
case "style":
path = dojo.html.fixPathsInCssText(origPath, url);
break;
default:
path = origPath;
}
fix = " " + attr[1] + "=" + attr[2] + path + attr[2];
tagFix += tag.substring(0, attr.index) + fix;
tag = tag.substring((attr.index + attr[0].length), tag.length);
}
str += tagFix + tag;
}
s = str + s;
}
regex = /(?:<(style)[^>]*>([\s\S]*?)<\/style>|<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>)/i;
while (match = regex.exec(s)) {
if (match[1] && match[1].toLowerCase() == "style") {
styles.push(dojo.html.fixPathsInCssText(match[2], url));
} else {
if (attr = match[3].match(/href=(['"]?)([^'">]*)\1/i)) {
styles.push({path:attr[2]});
}
}
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
var regex = /<script([^>]*)>([\s\S]*?)<\/script>/i;
var regexSrc = /src=(['"]?)([^"']*)\1/i;
var regexDojoJs = /.*(\bdojo\b\.js(?:\.uncompressed\.js)?)$/;
var regexInvalid = /(?:var )?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g;
var regexRequires = /dojo\.(?:(?:require(?:After)?(?:If)?)|(?:widget\.(?:manager\.)?registerWidgetPackage)|(?:(?:hostenv\.)?setModulePrefix|registerModulePath)|defineNamespace)\((['"]).*?\1\)\s*;?/;
while (match = regex.exec(s)) {
if (this.executeScripts && match[1]) {
if (attr = regexSrc.exec(match[1])) {
if (regexDojoJs.exec(attr[2])) {
dojo.debug("Security note! inhibit:" + attr[2] + " from being loaded again.");
} else {
scripts.push({path:attr[2]});
}
}
}
if (match[2]) {
var sc = match[2].replace(regexInvalid, "");
if (!sc) {
continue;
}
while (tmp = regexRequires.exec(sc)) {
requires.push(tmp[0]);
sc = sc.substring(0, tmp.index) + sc.substr(tmp.index + tmp[0].length);
}
if (this.executeScripts) {
scripts.push(sc);
}
}
s = s.substr(0, match.index) + s.substr(match.index + match[0].length);
}
if (this.extractContent) {
match = s.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if (match) {
s = match[1];
}
}
if (this.executeScripts && this.scriptSeparation) {
var regex = /(<[a-zA-Z][a-zA-Z0-9]*\s[^>]*?\S=)((['"])[^>]*scriptScope[^>]*>)/;
var regexAttr = /([\s'";:\(])scriptScope(.*)/;
str = "";
while (tag = regex.exec(s)) {
tmp = ((tag[3] == "'") ? "\"" : "'");
fix = "";
str += s.substring(0, tag.index) + tag[1];
while (attr = regexAttr.exec(tag[2])) {
tag[2] = tag[2].substring(0, attr.index) + attr[1] + "dojo.widget.byId(" + tmp + this.widgetId + tmp + ").scriptScope" + attr[2];
}
str += tag[2];
s = s.substr(tag.index + tag[0].length);
}
s = str + s;
}
}
return {"xml":s, "styles":styles, "titles":titles, "requires":requires, "scripts":scripts, "url":url};
}, _setContent:function (cont) {
this.destroyChildren();
for (var i = 0; i < this._styleNodes.length; i++) {
if (this._styleNodes[i] && this._styleNodes[i].parentNode) {
this._styleNodes[i].parentNode.removeChild(this._styleNodes[i]);
}
}
this._styleNodes = [];
try {
var node = this.containerNode || this.domNode;
while (node.firstChild) {
dojo.html.destroyNode(node.firstChild);
}
if (typeof cont != "string") {
node.appendChild(cont);
} else {
node.innerHTML = cont;
}
}
catch (e) {
e.text = "Couldn't load content:" + e.description;
this._handleDefaults(e, "onContentError");
}
}, setContent:function (data) {
this.abort();
if (this._callOnUnload) {
this.onUnload();
}
this._callOnUnload = true;
if (!data || dojo.html.isNode(data)) {
this._setContent(data);
this.onResized();
this.onLoad();
} else {
if (typeof data.xml != "string") {
this.href = "";
data = this.splitAndFixPaths(data);
}
this._setContent(data.xml);
for (var i = 0; i < data.styles.length; i++) {
if (data.styles[i].path) {
this._styleNodes.push(dojo.html.insertCssFile(data.styles[i].path, dojo.doc(), false, true));
} else {
this._styleNodes.push(dojo.html.insertCssText(data.styles[i]));
}
}
if (this.parseContent) {
for (var i = 0; i < data.requires.length; i++) {
try {
eval(data.requires[i]);
}
catch (e) {
e.text = "ContentPane: error in package loading calls, " + (e.description || e);
this._handleDefaults(e, "onContentError", "debug");
}
}
}
var _self = this;
function asyncParse() {
if (_self.executeScripts) {
_self._executeScripts(data.scripts);
}
if (_self.parseContent) {
var node = _self.containerNode || _self.domNode;
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(node, null, true);
dojo.widget.getParser().createSubComponents(frag, _self);
}
_self.onResized();
_self.onLoad();
}
if (dojo.hostenv.isXDomain && data.requires.length) {
dojo.addOnLoad(asyncParse);
} else {
asyncParse();
}
}
}, setHandler:function (handler) {
var fcn = dojo.lang.isFunction(handler) ? handler : window[handler];
if (!dojo.lang.isFunction(fcn)) {
this._handleDefaults("Unable to set handler, '" + handler + "' not a function.", "onExecError", true);
return;
}
this.handler = function () {
return fcn.apply(this, arguments);
};
}, _runHandler:function () {
var ret = true;
if (dojo.lang.isFunction(this.handler)) {
this.handler(this, this.domNode);
ret = false;
}
this.onLoad();
return ret;
}, _executeScripts:function (scripts) {
var self = this;
var tmp = "", code = "";
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].path) {
dojo.io.bind(this._cacheSetting({"url":scripts[i].path, "load":function (type, scriptStr) {
dojo.lang.hitch(self, tmp = ";" + scriptStr);
}, "error":function (type, error) {
error.text = type + " downloading remote script";
self._handleDefaults.call(self, error, "onExecError", "debug");
}, "mimetype":"text/plain", "sync":true}, this.cacheContent));
code += tmp;
} else {
code += scripts[i];
}
}
try {
if (this.scriptSeparation) {
delete this.scriptScope;
this.scriptScope = new (new Function("_container_", code + "; return this;"))(self);
} else {
var djg = dojo.global();
if (djg.execScript) {
djg.execScript(code);
} else {
var djd = dojo.doc();
var sc = djd.createElement("script");
sc.appendChild(djd.createTextNode(code));
(this.containerNode || this.domNode).appendChild(sc);
}
}
}
catch (e) {
e.text = "Error running scripts from content:\n" + e.description;
this._handleDefaults(e, "onExecError", "debug");
}
}});
 
/trunk/api/js/dojo/src/widget/Spinner.js
New file
0,0 → 1,524
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Spinner");
dojo.require("dojo.io.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.string");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.IntegerTextbox");
dojo.require("dojo.widget.RealNumberTextbox");
dojo.require("dojo.widget.DateTextbox");
dojo.require("dojo.experimental");
dojo.declare("dojo.widget.Spinner", null, {_typamaticTimer:null, _typamaticFunction:null, _currentTimeout:this.defaultTimeout, _eventCount:0, defaultTimeout:500, timeoutChangeRate:0.9, templateString:"<span _=\"weird end tag formatting is to prevent whitespace from becoming &nbsp;\"\n\tstyle='float:${this.htmlfloat};'\n\t><table cellpadding=0 cellspacing=0 class=\"dojoSpinner\">\n\t\t<tr>\n\t\t\t<td\n\t\t\t\t><input\n\t\t\t\t\tdojoAttachPoint='textbox' type='${this.type}'\n\t\t\t\t\tdojoAttachEvent='onblur;onfocus;onkey:_handleKeyEvents;onKeyUp:_onSpinnerKeyUp;onresize:_resize'\n\t\t\t\t\tid='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'\n\t\t\t\t\tvalue='${this.value}' class='${this.className}' autocomplete=\"off\"\n\t\t\t></td>\n\t\t\t<td\n\t\t\t\t><img dojoAttachPoint=\"upArrowNode\"\n\t\t\t\t\tdojoAttachEvent=\"onDblClick: _upArrowDoubleClicked; onMouseDown: _upArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;\"\n\t\t\t\t\tsrc=\"${this.incrementSrc}\" style=\"width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;\"\n\t\t\t\t><img dojoAttachPoint=\"downArrowNode\"\n\t\t\t\t\tdojoAttachEvent=\"onDblClick: _downArrowDoubleClicked; onMouseDown: _downArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;\"\n\t\t\t\t\tsrc=\"${this.decrementSrc}\" style=\"width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;\"\n\t\t\t></td>\n\t\t</tr>\n\t</table\n\t><span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span\n\t><span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span\n\t><span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span\n></span>\n", templateCssString:"/* inline the table holding the <input> and buttons (method varies by browser) */\n.ie .dojoSpinner, .safari .dojoSpinner {\n\tdisplay: inline;\n}\n\n.moz .dojoSpinner {\n\tdisplay: -moz-inline-box;\n}\n\n.opera .dojoSpinner {\n\tdisplay: inline-table;\n}\n\n/* generic stuff for the table */\n.dojoSpinner td {\n\tpadding:0px;\n\tmargin:0px;\n\tvertical-align: middle;\n}\ntable.dojoSpinner {\n\tborder:0px;\n\tborder-spacing:0px;\n\tline-height:0px;\n\tpadding:0px;\n\tmargin: 0px;\n\tvertical-align: middle;\n}\n\n/* the buttons */\n.dojoSpinner img {\n\tdisplay: block;\n\tborder-width:0px 1px 1px 0px;\n\tborder-style:outset;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Spinner.css"), incrementSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/spinnerIncrement.gif"), decrementSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/spinnerDecrement.gif"), _handleKeyEvents:function (evt) {
if (!evt.key) {
return;
}
if (!evt.ctrlKey && !evt.altKey) {
switch (evt.key) {
case evt.KEY_DOWN_ARROW:
dojo.event.browser.stopEvent(evt);
this._downArrowPressed(evt);
return;
case evt.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
this._upArrowPressed(evt);
return;
}
}
this._eventCount++;
}, _onSpinnerKeyUp:function (evt) {
this._arrowReleased(evt);
this.onkeyup(evt);
}, _resize:function () {
var inputSize = dojo.html.getBorderBox(this.textbox);
this.buttonSize = {width:inputSize.height / 2, height:inputSize.height / 2};
if (this.upArrowNode) {
dojo.html.setMarginBox(this.upArrowNode, this.buttonSize);
dojo.html.setMarginBox(this.downArrowNode, this.buttonSize);
}
}, _pressButton:function (node) {
node.style.borderWidth = "1px 0px 0px 1px";
node.style.borderStyle = "inset";
}, _releaseButton:function (node) {
node.style.borderWidth = "0px 1px 1px 0px";
node.style.borderStyle = "outset";
}, _arrowPressed:function (evt, direction) {
var nodePressed = (direction == -1) ? this.downArrowNode : this.upArrowNode;
var nodeReleased = (direction == +1) ? this.downArrowNode : this.upArrowNode;
if (typeof evt != "number") {
if (this._typamaticTimer != null) {
if (this._typamaticNode == nodePressed) {
return;
}
dojo.lang.clearTimeout(this._typamaticTimer);
}
this._releaseButton(nodeReleased);
this._eventCount++;
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
} else {
if (evt != this._eventCount) {
this._releaseButton(nodePressed);
return;
}
}
this._pressButton(nodePressed);
this._setCursorX(this.adjustValue(direction, this._getCursorX()));
this._typamaticNode = nodePressed;
this._typamaticTimer = dojo.lang.setTimeout(this, "_arrowPressed", this._currentTimeout, this._eventCount, direction);
this._currentTimeout = Math.round(this._currentTimeout * this.timeoutChangeRate);
}, _downArrowPressed:function (evt) {
return this._arrowPressed(evt, -1);
}, _downArrowDoubleClicked:function (evt) {
var rc = this._downArrowPressed(evt);
dojo.lang.setTimeout(this, "_arrowReleased", 50, null);
return rc;
}, _upArrowPressed:function (evt) {
return this._arrowPressed(evt, +1);
}, _upArrowDoubleClicked:function (evt) {
var rc = this._upArrowPressed(evt);
dojo.lang.setTimeout(this, "_arrowReleased", 50, null);
return rc;
}, _arrowReleased:function (evt) {
this.textbox.focus();
if (evt != null && typeof evt == "object" && evt.keyCode && evt.keyCode != null) {
var keyCode = evt.keyCode;
var k = dojo.event.browser.keys;
switch (keyCode) {
case k.KEY_DOWN_ARROW:
case k.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
break;
}
}
this._releaseButton(this.upArrowNode);
this._releaseButton(this.downArrowNode);
this._eventCount++;
if (this._typamaticTimer != null) {
dojo.lang.clearTimeout(this._typamaticTimer);
}
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
}, _mouseWheeled:function (evt) {
var scrollAmount = 0;
if (typeof evt.wheelDelta == "number") {
scrollAmount = evt.wheelDelta;
} else {
if (typeof evt.detail == "number") {
scrollAmount = -evt.detail;
}
}
if (scrollAmount > 0) {
this._upArrowPressed(evt);
this._arrowReleased(evt);
} else {
if (scrollAmount < 0) {
this._downArrowPressed(evt);
this._arrowReleased(evt);
}
}
}, _discardEvent:function (evt) {
dojo.event.browser.stopEvent(evt);
}, _getCursorX:function () {
var x = -1;
try {
this.textbox.focus();
if (typeof this.textbox.selectionEnd == "number") {
x = this.textbox.selectionEnd;
} else {
if (document.selection && document.selection.createRange) {
var range = document.selection.createRange().duplicate();
if (range.parentElement() == this.textbox) {
range.moveStart("textedit", -1);
x = range.text.length;
}
}
}
}
catch (e) {
}
return x;
}, _setCursorX:function (x) {
try {
this.textbox.focus();
if (!x) {
x = 0;
}
if (typeof this.textbox.selectionEnd == "number") {
this.textbox.selectionEnd = x;
} else {
if (this.textbox.createTextRange) {
var range = this.textbox.createTextRange();
range.collapse(true);
range.moveEnd("character", x);
range.moveStart("character", x);
range.select();
}
}
}
catch (e) {
}
}, _spinnerPostMixInProperties:function (args, frag) {
var inputNode = this.getFragNodeRef(frag);
var inputSize = dojo.html.getBorderBox(inputNode);
this.buttonSize = {width:inputSize.height / 2 - 1, height:inputSize.height / 2 - 1};
}, _spinnerPostCreate:function (args, frag) {
if (this.textbox.addEventListener) {
this.textbox.addEventListener("DOMMouseScroll", dojo.lang.hitch(this, "_mouseWheeled"), false);
} else {
dojo.event.connect(this.textbox, "onmousewheel", this, "_mouseWheeled");
}
}});
dojo.widget.defineWidget("dojo.widget.IntegerSpinner", [dojo.widget.IntegerTextbox, dojo.widget.Spinner], {delta:"1", postMixInProperties:function (args, frag) {
dojo.widget.IntegerSpinner.superclass.postMixInProperties.apply(this, arguments);
this._spinnerPostMixInProperties(args, frag);
}, postCreate:function (args, frag) {
dojo.widget.IntegerSpinner.superclass.postCreate.apply(this, arguments);
this._spinnerPostCreate(args, frag);
}, adjustValue:function (direction, x) {
var val = this.getValue().replace(/[^\-+\d]/g, "");
if (val.length == 0) {
return;
}
var num = Math.min(Math.max((parseInt(val) + (parseInt(this.delta) * direction)), (this.flags.min ? this.flags.min : -Infinity)), (this.flags.max ? this.flags.max : +Infinity));
val = num.toString();
if (num >= 0) {
val = ((this.flags.signed == true) ? "+" : " ") + val;
}
if (this.flags.separator.length > 0) {
for (var i = val.length - 3; i > 1; i -= 3) {
val = val.substr(0, i) + this.flags.separator + val.substr(i);
}
}
if (val.substr(0, 1) == " ") {
val = val.substr(1);
}
this.setValue(val);
return val.length;
}});
dojo.widget.defineWidget("dojo.widget.RealNumberSpinner", [dojo.widget.RealNumberTextbox, dojo.widget.Spinner], function () {
dojo.experimental("dojo.widget.RealNumberSpinner");
}, {delta:"1e1", postMixInProperties:function (args, frag) {
dojo.widget.RealNumberSpinner.superclass.postMixInProperties.apply(this, arguments);
this._spinnerPostMixInProperties(args, frag);
}, postCreate:function (args, frag) {
dojo.widget.RealNumberSpinner.superclass.postCreate.apply(this, arguments);
this._spinnerPostCreate(args, frag);
}, adjustValue:function (direction, x) {
var val = this.getValue().replace(/[^\-+\.eE\d]/g, "");
if (!val.length) {
return;
}
var num = parseFloat(val);
if (isNaN(num)) {
return;
}
var delta = this.delta.split(/[eE]/);
if (!delta.length) {
delta = [1, 1];
} else {
delta[0] = parseFloat(delta[0].replace(/[^\-+\.\d]/g, ""));
if (isNaN(delta[0])) {
delta[0] = 1;
}
if (delta.length > 1) {
delta[1] = parseInt(delta[1]);
}
if (isNaN(delta[1])) {
delta[1] = 1;
}
}
val = this.getValue().split(/[eE]/);
if (!val.length) {
return;
}
var numBase = parseFloat(val[0].replace(/[^\-+\.\d]/g, ""));
if (val.length == 1) {
var numExp = 0;
} else {
var numExp = parseInt(val[1].replace(/[^\-+\d]/g, ""));
}
if (x <= val[0].length) {
x = 0;
numBase += delta[0] * direction;
} else {
x = Number.MAX_VALUE;
numExp += delta[1] * direction;
if (this.flags.eSigned == false && numExp < 0) {
numExp = 0;
}
}
num = Math.min(Math.max((numBase * Math.pow(10, numExp)), (this.flags.min ? this.flags.min : -Infinity)), (this.flags.max ? this.flags.max : +Infinity));
if ((this.flags.exponent == true || (this.flags.exponent != false && x != 0)) && num.toExponential) {
if (isNaN(this.flags.places) || this.flags.places == Infinity) {
val = num.toExponential();
} else {
val = num.toExponential(this.flags.places);
}
} else {
if (num.toFixed && num.toPrecision) {
if (isNaN(this.flags.places) || this.flags.places == Infinity) {
val = num.toPrecision((1 / 3).toString().length - 1);
} else {
val = num.toFixed(this.flags.places);
}
} else {
val = num.toString();
}
}
if (num >= 0) {
if (this.flags.signed == true) {
val = "+" + val;
}
}
val = val.split(/[eE]/);
if (this.flags.separator.length > 0) {
if (num >= 0 && val[0].substr(0, 1) != "+") {
val[0] = " " + val[0];
}
var i = val[0].lastIndexOf(".");
if (i >= 0) {
i -= 3;
} else {
i = val[0].length - 3;
}
for (; i > 1; i -= 3) {
val[0] = val[0].substr(0, i) + this.flags.separator + val[0].substr(i);
}
if (val[0].substr(0, 1) == " ") {
val[0] = val[0].substr(1);
}
}
if (val.length > 1) {
if ((this.flags.eSigned == true) && (val[1].substr(0, 1) != "+")) {
val[1] = "+" + val[1];
} else {
if ((!this.flags.eSigned) && (val[1].substr(0, 1) == "+")) {
val[1] = val[1].substr(1);
} else {
if ((!this.flags.eSigned) && (val[1].substr(0, 1) == "-") && (num.toFixed && num.toPrecision)) {
if (isNaN(this.flags.places)) {
val[0] = num.toPrecision((1 / 3).toString().length - 1);
} else {
val[0] = num.toFixed(this.flags.places).toString();
}
val[1] = "0";
}
}
}
val[0] += "e" + val[1];
}
this.setValue(val[0]);
if (x > val[0].length) {
x = val[0].length;
}
return x;
}});
dojo.widget.defineWidget("dojo.widget.TimeSpinner", [dojo.widget.TimeTextbox, dojo.widget.Spinner], function () {
dojo.experimental("dojo.widget.TimeSpinner");
}, {postMixInProperties:function (args, frag) {
dojo.widget.TimeSpinner.superclass.postMixInProperties.apply(this, arguments);
this._spinnerPostMixInProperties(args, frag);
}, postCreate:function (args, frag) {
dojo.widget.TimeSpinner.superclass.postCreate.apply(this, arguments);
this._spinnerPostCreate(args, frag);
}, adjustValue:function (direction, x) {
var val = this.getValue();
var format = (this.flags.format && this.flags.format.search(/[Hhmst]/) >= 0) ? this.flags.format : "hh:mm:ss t";
if (direction == 0 || !val.length || !this.isValid()) {
return;
}
if (!this.flags.amSymbol) {
this.flags.amSymbol = "AM";
}
if (!this.flags.pmSymbol) {
this.flags.pmSymbol = "PM";
}
var re = dojo.regexp.time(this.flags);
var qualifiers = format.replace(/H/g, "h").replace(/[^hmst]/g, "").replace(/([hmst])\1/g, "$1");
var hourPos = qualifiers.indexOf("h") + 1;
var minPos = qualifiers.indexOf("m") + 1;
var secPos = qualifiers.indexOf("s") + 1;
var ampmPos = qualifiers.indexOf("t") + 1;
var cursorFormat = format;
var ampm = "";
if (ampmPos > 0) {
ampm = val.replace(new RegExp(re), "$" + ampmPos);
cursorFormat = cursorFormat.replace(/t+/, ampm.replace(/./g, "t"));
}
var hour = 0;
var deltaHour = 1;
if (hourPos > 0) {
hour = val.replace(new RegExp(re), "$" + hourPos);
if (dojo.lang.isString(this.delta)) {
deltaHour = this.delta.replace(new RegExp(re), "$" + hourPos);
}
if (isNaN(deltaHour)) {
deltaHour = 1;
} else {
deltaHour = parseInt(deltaHour);
}
if (hour.length == 2) {
cursorFormat = cursorFormat.replace(/([Hh])+/, "$1$1");
} else {
cursorFormat = cursorFormat.replace(/([Hh])+/, "$1");
}
if (isNaN(hour)) {
hour = 0;
} else {
hour = parseInt(hour.replace(/^0(\d)/, "$1"));
}
}
var min = 0;
var deltaMin = 1;
if (minPos > 0) {
min = val.replace(new RegExp(re), "$" + minPos);
if (dojo.lang.isString(this.delta)) {
deltaMin = this.delta.replace(new RegExp(re), "$" + minPos);
}
if (isNaN(deltaMin)) {
deltaMin = 1;
} else {
deltaMin = parseInt(deltaMin);
}
cursorFormat = cursorFormat.replace(/m+/, min.replace(/./g, "m"));
if (isNaN(min)) {
min = 0;
} else {
min = parseInt(min.replace(/^0(\d)/, "$1"));
}
}
var sec = 0;
var deltaSec = 1;
if (secPos > 0) {
sec = val.replace(new RegExp(re), "$" + secPos);
if (dojo.lang.isString(this.delta)) {
deltaSec = this.delta.replace(new RegExp(re), "$" + secPos);
}
if (isNaN(deltaSec)) {
deltaSec = 1;
} else {
deltaSec = parseInt(deltaSec);
}
cursorFormat = cursorFormat.replace(/s+/, sec.replace(/./g, "s"));
if (isNaN(sec)) {
sec = 0;
} else {
sec = parseInt(sec.replace(/^0(\d)/, "$1"));
}
}
if (isNaN(x) || x >= cursorFormat.length) {
x = cursorFormat.length - 1;
}
var cursorToken = cursorFormat.charAt(x);
switch (cursorToken) {
case "t":
if (ampm == this.flags.amSymbol) {
ampm = this.flags.pmSymbol;
} else {
if (ampm == this.flags.pmSymbol) {
ampm = this.flags.amSymbol;
}
}
break;
default:
if (hour >= 1 && hour < 12 && ampm == this.flags.pmSymbol) {
hour += 12;
}
if (hour == 12 && ampm == this.flags.amSymbol) {
hour = 0;
}
switch (cursorToken) {
case "s":
sec += deltaSec * direction;
while (sec < 0) {
min--;
sec += 60;
}
while (sec >= 60) {
min++;
sec -= 60;
}
case "m":
if (cursorToken == "m") {
min += deltaMin * direction;
}
while (min < 0) {
hour--;
min += 60;
}
while (min >= 60) {
hour++;
min -= 60;
}
case "h":
case "H":
if (cursorToken == "h" || cursorToken == "H") {
hour += deltaHour * direction;
}
while (hour < 0) {
hour += 24;
}
while (hour >= 24) {
hour -= 24;
}
break;
default:
return;
}
if (hour >= 12) {
ampm = this.flags.pmSymbol;
if (format.indexOf("h") >= 0 && hour >= 13) {
hour -= 12;
}
} else {
ampm = this.flags.amSymbol;
if (format.indexOf("h") >= 0 && hour == 0) {
hour = 12;
}
}
}
cursorFormat = format;
if (hour >= 0 && hour < 10 && format.search(/[hH]{2}/) >= 0) {
hour = "0" + hour.toString();
}
if (hour >= 10 && cursorFormat.search(/[hH]{2}/) < 0) {
cursorFormat = cursorFormat.replace(/(h|H)/, "$1$1");
}
if (min >= 0 && min < 10 && cursorFormat.search(/mm/) >= 0) {
min = "0" + min.toString();
}
if (min >= 10 && cursorFormat.search(/mm/) < 0) {
cursorFormat = cursorFormat.replace(/m/, "$1$1");
}
if (sec >= 0 && sec < 10 && cursorFormat.search(/ss/) >= 0) {
sec = "0" + sec.toString();
}
if (sec >= 10 && cursorFormat.search(/ss/) < 0) {
cursorFormat = cursorFormat.replace(/s/, "$1$1");
}
x = cursorFormat.indexOf(cursorToken);
if (x == -1) {
x = format.length;
}
format = format.replace(/[hH]+/, hour);
format = format.replace(/m+/, min);
format = format.replace(/s+/, sec);
format = format.replace(/t/, ampm);
this.setValue(format);
if (x > format.length) {
x = format.length;
}
return x;
}});
 
/trunk/api/js/dojo/src/widget/ResizableTextarea.js
New file
0,0 → 1,33
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ResizableTextarea");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.ResizeHandle");
dojo.widget.defineWidget("dojo.widget.ResizableTextarea", dojo.widget.HtmlWidget, {templateString:"<div>\n\t<div style=\"border: 2px solid black; width: 90%; height: 200px;\"\n\t\tdojoAttachPoint=\"rootLayoutNode\">\n\t\t<div dojoAttachPoint=\"textAreaContainerNode\" \n\t\t\tstyle=\"border: 0px; margin: 0px; overflow: hidden;\">\n\t\t</div>\n\t\t<div dojoAttachPoint=\"statusBarContainerNode\" class=\"statusBar\">\n\t\t\t<div dojoAttachPoint=\"statusLabelNode\" \n\t\t\t\tclass=\"statusPanel\"\n\t\t\t\tstyle=\"padding-right: 0px; z-index: 1;\">drag to resize</div>\n\t\t\t<div dojoAttachPoint=\"resizeHandleNode\"></div>\n\t\t</div>\n\t</div>\n</div>\n", templateCssString:"div.statusBar {\n\tbackground-color: ThreeDFace;\n\theight: 28px;\n\tpadding: 1px;\n\toverflow: hidden;\n\tfont-size: 12px;\n}\n\ndiv.statusPanel {\n\tbackground-color: ThreeDFace;\n\tborder: 1px solid;\n\tborder-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;\n\tmargin: 1px;\n\tpadding: 2px 6px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ResizableTextarea.css"), fillInTemplate:function (args, frag) {
this.textAreaNode = this.getFragNodeRef(frag).cloneNode(true);
dojo.body().appendChild(this.domNode);
this.rootLayout = dojo.widget.createWidget("LayoutContainer", {minHeight:50, minWidth:100}, this.rootLayoutNode);
this.textAreaContainer = dojo.widget.createWidget("LayoutContainer", {layoutAlign:"client"}, this.textAreaContainerNode);
this.rootLayout.addChild(this.textAreaContainer);
this.textAreaContainer.domNode.appendChild(this.textAreaNode);
with (this.textAreaNode.style) {
width = "100%";
height = "100%";
}
this.statusBar = dojo.widget.createWidget("LayoutContainer", {layoutAlign:"bottom", minHeight:28}, this.statusBarContainerNode);
this.rootLayout.addChild(this.statusBar);
this.statusLabel = dojo.widget.createWidget("LayoutContainer", {layoutAlign:"client", minWidth:50}, this.statusLabelNode);
this.statusBar.addChild(this.statusLabel);
this.resizeHandle = dojo.widget.createWidget("ResizeHandle", {targetElmId:this.rootLayout.widgetId}, this.resizeHandleNode);
this.statusBar.addChild(this.resizeHandle);
}});
 
/trunk/api/js/dojo/src/widget/TreeBasicControllerV3.js
New file
0,0 → 1,459
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeBasicControllerV3");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeCommon");
dojo.require("dojo.widget.TreeNodeV3");
dojo.require("dojo.widget.TreeV3");
dojo.widget.defineWidget("dojo.widget.TreeBasicControllerV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.listenedTrees = {};
}, {listenTreeEvents:["afterSetFolder", "afterTreeCreate", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, editor:null, initialize:function (args) {
if (args.editor) {
this.editor = dojo.widget.byId(args.editor);
this.editor.controller = this;
}
}, getInfo:function (elem) {
return elem.getInfo();
}, onBeforeTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, onAfterSetFolder:function (message) {
if (message.source.expandLevel > 0) {
this.expandToLevel(message.source, message.source.expandLevel);
}
if (message.source.loadLevel > 0) {
this.loadToLevel(message.source, message.source.loadLevel);
}
}, _focusNextVisible:function (nodeWidget) {
if (nodeWidget.isFolder && nodeWidget.isExpanded && nodeWidget.children.length > 0) {
returnWidget = nodeWidget.children[0];
} else {
while (nodeWidget.isTreeNode && nodeWidget.isLastChild()) {
nodeWidget = nodeWidget.parent;
}
if (nodeWidget.isTreeNode) {
var returnWidget = nodeWidget.parent.children[nodeWidget.getParentIndex() + 1];
}
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, _focusPreviousVisible:function (nodeWidget) {
var returnWidget = nodeWidget;
if (!nodeWidget.isFirstChild()) {
var previousSibling = nodeWidget.parent.children[nodeWidget.getParentIndex() - 1];
nodeWidget = previousSibling;
while (nodeWidget.isFolder && nodeWidget.isExpanded && nodeWidget.children.length > 0) {
returnWidget = nodeWidget;
nodeWidget = nodeWidget.children[nodeWidget.children.length - 1];
}
} else {
nodeWidget = nodeWidget.parent;
}
if (nodeWidget && nodeWidget.isTreeNode) {
returnWidget = nodeWidget;
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, _focusZoomIn:function (nodeWidget) {
var returnWidget = nodeWidget;
if (nodeWidget.isFolder && !nodeWidget.isExpanded) {
this.expand(nodeWidget);
} else {
if (nodeWidget.children.length > 0) {
nodeWidget = nodeWidget.children[0];
}
}
if (nodeWidget && nodeWidget.isTreeNode) {
returnWidget = nodeWidget;
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, _focusZoomOut:function (node) {
var returnWidget = node;
if (node.isFolder && node.isExpanded) {
this.collapse(node);
} else {
node = node.parent;
}
if (node && node.isTreeNode) {
returnWidget = node;
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, onFocusNode:function (e) {
var node = this.domElement2TreeNode(e.target);
if (node) {
node.viewFocus();
dojo.event.browser.stopEvent(e);
}
}, onBlurNode:function (e) {
var node = this.domElement2TreeNode(e.target);
if (!node) {
return;
}
var labelNode = node.labelNode;
labelNode.setAttribute("tabIndex", "-1");
node.viewUnfocus();
dojo.event.browser.stopEvent(e);
node.tree.domNode.setAttribute("tabIndex", "0");
}, _focusLabel:function (node) {
var lastFocused = node.tree.lastFocused;
var labelNode;
if (lastFocused && lastFocused.labelNode) {
labelNode = lastFocused.labelNode;
dojo.event.disconnect(labelNode, "onblur", this, "onBlurNode");
labelNode.setAttribute("tabIndex", "-1");
dojo.html.removeClass(labelNode, "TreeLabelFocused");
}
labelNode = node.labelNode;
labelNode.setAttribute("tabIndex", "0");
node.tree.lastFocused = node;
dojo.html.addClass(labelNode, "TreeLabelFocused");
dojo.event.connectOnce(labelNode, "onblur", this, "onBlurNode");
dojo.event.connectOnce(labelNode, "onfocus", this, "onFocusNode");
labelNode.focus();
}, onKey:function (e) {
if (!e.key || e.ctrkKey || e.altKey) {
return;
}
var nodeWidget = this.domElement2TreeNode(e.target);
if (!nodeWidget) {
return;
}
var treeWidget = nodeWidget.tree;
if (treeWidget.lastFocused && treeWidget.lastFocused.labelNode) {
nodeWidget = treeWidget.lastFocused;
}
switch (e.key) {
case e.KEY_TAB:
if (e.shiftKey) {
treeWidget.domNode.setAttribute("tabIndex", "-1");
}
break;
case e.KEY_RIGHT_ARROW:
this._focusZoomIn(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_LEFT_ARROW:
this._focusZoomOut(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_UP_ARROW:
this._focusPreviousVisible(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_DOWN_ARROW:
this._focusNextVisible(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
}
}, onFocusTree:function (e) {
if (!e.currentTarget) {
return;
}
try {
var treeWidget = this.getWidgetByNode(e.currentTarget);
if (!treeWidget || !treeWidget.isTree) {
return;
}
var nodeWidget = this.getWidgetByNode(treeWidget.domNode.firstChild);
if (nodeWidget && nodeWidget.isTreeNode) {
if (treeWidget.lastFocused && treeWidget.lastFocused.isTreeNode) {
nodeWidget = treeWidget.lastFocused;
}
this._focusLabel(nodeWidget);
}
}
catch (e) {
}
}, onAfterTreeCreate:function (message) {
var tree = message.source;
dojo.event.browser.addListener(tree.domNode, "onKey", dojo.lang.hitch(this, this.onKey));
dojo.event.browser.addListener(tree.domNode, "onmousedown", dojo.lang.hitch(this, this.onTreeMouseDown));
dojo.event.browser.addListener(tree.domNode, "onclick", dojo.lang.hitch(this, this.onTreeClick));
dojo.event.browser.addListener(tree.domNode, "onfocus", dojo.lang.hitch(this, this.onFocusTree));
tree.domNode.setAttribute("tabIndex", "0");
if (tree.expandLevel) {
this.expandToLevel(tree, tree.expandLevel);
}
if (tree.loadLevel) {
this.loadToLevel(tree, tree.loadLevel);
}
}, onTreeMouseDown:function (e) {
}, onTreeClick:function (e) {
var domElement = e.target;
var node = this.domElement2TreeNode(domElement);
if (!node || !node.isTreeNode) {
return;
}
var checkExpandClick = function (el) {
return el === node.expandNode;
};
if (this.checkPathCondition(domElement, checkExpandClick)) {
this.processExpandClick(node);
}
this._focusLabel(node);
}, processExpandClick:function (node) {
if (node.isExpanded) {
this.collapse(node);
} else {
this.expand(node);
}
}, batchExpandTimeout:20, expandAll:function (nodeOrTree) {
return this.expandToLevel(nodeOrTree, Number.POSITIVE_INFINITY);
}, collapseAll:function (nodeOrTree) {
var _this = this;
var filter = function (elem) {
return (elem instanceof dojo.widget.Widget) && elem.isFolder && elem.isExpanded;
};
if (nodeOrTree.isTreeNode) {
this.processDescendants(nodeOrTree, filter, this.collapse);
} else {
if (nodeOrTree.isTree) {
dojo.lang.forEach(nodeOrTree.children, function (c) {
_this.processDescendants(c, filter, _this.collapse);
});
}
}
}, expandToNode:function (node, withSelected) {
n = withSelected ? node : node.parent;
s = [];
while (!n.isExpanded) {
s.push(n);
n = n.parent;
}
dojo.lang.forEach(s, function (n) {
n.expand();
});
}, expandToLevel:function (nodeOrTree, level) {
dojo.require("dojo.widget.TreeTimeoutIterator");
var _this = this;
var filterFunc = function (elem) {
var res = elem.isFolder || elem.children && elem.children.length;
return res;
};
var callFunc = function (node, iterator) {
_this.expand(node, true);
iterator.forward();
};
var iterator = new dojo.widget.TreeTimeoutIterator(nodeOrTree, callFunc, this);
iterator.setFilter(filterFunc);
iterator.timeout = this.batchExpandTimeout;
iterator.setMaxLevel(nodeOrTree.isTreeNode ? level - 1 : level);
return iterator.start(nodeOrTree.isTreeNode);
}, getWidgetByNode:function (node) {
var widgetId;
var newNode = node;
while (!(widgetId = newNode.widgetId)) {
newNode = newNode.parentNode;
if (newNode == null) {
break;
}
}
if (widgetId) {
return dojo.widget.byId(widgetId);
} else {
if (node == null) {
return null;
} else {
return dojo.widget.manager.byNode(node);
}
}
}, expand:function (node) {
if (node.isFolder) {
node.expand();
}
}, collapse:function (node) {
if (node.isFolder) {
node.collapse();
}
}, canEditLabel:function (node) {
if (node.actionIsDisabledNow(node.actions.EDIT)) {
return false;
}
return true;
}, editLabelStart:function (node) {
if (!this.canEditLabel(node)) {
return false;
}
if (!this.editor.isClosed()) {
this.editLabelFinish(this.editor.saveOnBlur);
}
this.doEditLabelStart(node);
}, editLabelFinish:function (save) {
this.doEditLabelFinish(save);
}, doEditLabelStart:function (node) {
if (!this.editor) {
dojo.raise(this.widgetType + ": no editor specified");
}
this.editor.open(node);
}, doEditLabelFinish:function (save, server_data) {
if (!this.editor) {
dojo.raise(this.widgetType + ": no editor specified");
}
var node = this.editor.node;
var editorTitle = this.editor.getContents();
this.editor.close(save);
if (save) {
var data = {title:editorTitle};
if (server_data) {
dojo.lang.mixin(data, server_data);
}
if (node.isPhantom) {
var parent = node.parent;
var index = node.getParentIndex();
node.destroy();
dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this, parent, index, data);
} else {
var title = server_data && server_data.title ? server_data.title : editorTitle;
node.setTitle(title);
}
} else {
if (node.isPhantom) {
node.destroy();
}
}
}, makeDefaultNode:function (parent, index) {
var data = {title:parent.tree.defaultChildTitle};
return dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this, parent, index, data);
}, runStages:function (check, prepare, make, finalize, expose, args) {
if (check && !check.apply(this, args)) {
return false;
}
if (prepare && !prepare.apply(this, args)) {
return false;
}
var result = make.apply(this, args);
if (finalize) {
finalize.apply(this, args);
}
if (!result) {
return result;
}
if (expose) {
expose.apply(this, args);
}
return result;
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {createAndEdit:function (parent, index) {
var data = {title:parent.tree.defaultChildTitle};
if (!this.canCreateChild(parent, index, data)) {
return false;
}
var child = this.doCreateChild(parent, index, data);
if (!child) {
return false;
}
this.exposeCreateChild(parent, index, data);
child.isPhantom = true;
if (!this.editor.isClosed()) {
this.editLabelFinish(this.editor.saveOnBlur);
}
this.doEditLabelStart(child);
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canClone:function (child, newParent, index, deep) {
return true;
}, clone:function (child, newParent, index, deep) {
return this.runStages(this.canClone, this.prepareClone, this.doClone, this.finalizeClone, this.exposeClone, arguments);
}, exposeClone:function (child, newParent) {
if (newParent.isTreeNode) {
this.expand(newParent);
}
}, doClone:function (child, newParent, index, deep) {
var cloned = child.clone(deep);
newParent.addChild(cloned, index);
return cloned;
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canDetach:function (child) {
if (child.actionIsDisabledNow(child.actions.DETACH)) {
return false;
}
return true;
}, detach:function (node) {
return this.runStages(this.canDetach, this.prepareDetach, this.doDetach, this.finalizeDetach, this.exposeDetach, arguments);
}, doDetach:function (node, callObj, callFunc) {
node.detach();
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canDestroyChild:function (child) {
if (child.parent && !this.canDetach(child)) {
return false;
}
return true;
}, destroyChild:function (node) {
return this.runStages(this.canDestroyChild, this.prepareDestroyChild, this.doDestroyChild, this.finalizeDestroyChild, this.exposeDestroyChild, arguments);
}, doDestroyChild:function (node) {
node.destroy();
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canMoveNotANode:function (child, parent) {
if (child.treeCanMove) {
return child.treeCanMove(parent);
}
return true;
}, canMove:function (child, newParent) {
if (!child.isTreeNode) {
return this.canMoveNotANode(child, newParent);
}
if (child.actionIsDisabledNow(child.actions.MOVE)) {
return false;
}
if (child.parent !== newParent && newParent.actionIsDisabledNow(newParent.actions.ADDCHILD)) {
return false;
}
var node = newParent;
while (node.isTreeNode) {
if (node === child) {
return false;
}
node = node.parent;
}
return true;
}, move:function (child, newParent, index) {
return this.runStages(this.canMove, this.prepareMove, this.doMove, this.finalizeMove, this.exposeMove, arguments);
}, doMove:function (child, newParent, index) {
child.tree.move(child, newParent, index);
return true;
}, exposeMove:function (child, newParent) {
if (newParent.isTreeNode) {
this.expand(newParent);
}
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canCreateChild:function (parent, index, data) {
if (parent.actionIsDisabledNow(parent.actions.ADDCHILD)) {
return false;
}
return true;
}, createChild:function (parent, index, data) {
if (!data) {
data = {title:parent.tree.defaultChildTitle};
}
return this.runStages(this.canCreateChild, this.prepareCreateChild, this.doCreateChild, this.finalizeCreateChild, this.exposeCreateChild, [parent, index, data]);
}, prepareCreateChild:function () {
return true;
}, finalizeCreateChild:function () {
}, doCreateChild:function (parent, index, data) {
var newChild = parent.tree.createNode(data);
parent.addChild(newChild, index);
return newChild;
}, exposeCreateChild:function (parent) {
return this.expand(parent);
}});
 
/trunk/api/js/dojo/src/widget/LayoutContainer.js
New file
0,0 → 1,32
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.html.layout");
dojo.widget.defineWidget("dojo.widget.LayoutContainer", dojo.widget.HtmlWidget, {isContainer:true, layoutChildPriority:"top-bottom", postCreate:function () {
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, addChild:function (child, overrideContainerNode, pos, ref, insertIndex) {
dojo.widget.LayoutContainer.superclass.addChild.call(this, child, overrideContainerNode, pos, ref, insertIndex);
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, removeChild:function (pane) {
dojo.widget.LayoutContainer.superclass.removeChild.call(this, pane);
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, onResized:function () {
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, show:function () {
this.domNode.style.display = "";
this.checkSize();
this.domNode.style.display = "none";
this.domNode.style.visibility = "";
dojo.widget.LayoutContainer.superclass.show.call(this);
}});
dojo.lang.extend(dojo.widget.Widget, {layoutAlign:"none"});