You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/01/27 00:58:20 UTC
svn commit: r372668 [16/16] - in
/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource:
./ src/ src/alg/ src/animation/ src/collections/ src/crypto/ src/data/
src/dnd/ src/event/ src/flash/ src/flash/flash6/ sr...
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TaskBar.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TaskBar.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TaskBar.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TaskBar.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,74 @@
+/*
+ Copyright (c) 2004-2005, 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.TaskBar");
+dojo.provide("dojo.widget.html.TaskBarItem");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.FloatingPane");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.event");
+
+// Icon associated w/a floating pane
+dojo.widget.html.TaskBarItem = function(){
+ dojo.widget.TaskBarItem.call(this);
+ dojo.widget.HtmlWidget.call(this);
+}
+dojo.inherits(dojo.widget.html.TaskBarItem, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.TaskBarItem, {
+ // constructor arguments
+ iconSrc: '',
+ caption: 'Untitled',
+ window: null,
+ templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBarItemTemplate.html"),
+ templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBar.css"),
+
+ fillInTemplate: function() {
+ if ( this.iconSrc != '' ) {
+ var img = document.createElement("img");
+ img.src = this.iconSrc;
+ this.domNode.appendChild(img);
+ }
+ this.domNode.appendChild(document.createTextNode(this.caption));
+ dojo.html.disableSelection(this.domNode);
+ },
+
+ postCreate: function() {
+ this.window=dojo.widget.getWidgetById(this.windowId);
+ this.window.explodeSrc = this.domNode;
+ dojo.event.connect(this.window, "destroy", this, "destroy")
+ },
+
+ onClick: function() {
+ if (this.window.windowState != "minimized") {
+ this.window.bringToTop();
+ } else {
+ this.window.restoreWindow();
+ }
+ }
+});
+
+// Collection of widgets in a bar, like Windows task bar
+dojo.widget.html.TaskBar = function(){
+
+ dojo.widget.html.FloatingPane.call(this);
+ dojo.widget.TaskBar.call(this);
+ this.titleBarDisplay = "none";
+}
+
+dojo.inherits(dojo.widget.html.TaskBar, dojo.widget.html.FloatingPane);
+
+dojo.lang.extend(dojo.widget.html.TaskBar, {
+ addChild: function(child) {
+ var tbi = dojo.widget.createWidget("TaskBarItem",{windowId:child.widgetId, caption: child.title, iconSrc: child.iconSrc} );
+ dojo.widget.html.TaskBar.superclass.addChild.call(this,tbi);
+ }
+});
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TimePicker.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TimePicker.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TimePicker.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/TimePicker.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,248 @@
+/*
+ Copyright (c) 2004-2005, 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.TimePicker");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TimePicker");
+dojo.require("dojo.widget.TimePicker.util");
+dojo.require("dojo.event.*");
+dojo.require("dojo.html");
+
+dojo.widget.html.TimePicker = function(){
+ dojo.widget.TimePicker.call(this);
+ dojo.widget.HtmlWidget.call(this);
+
+
+ var _this = this;
+ // selected time, JS Date object
+ this.time = "";
+ // set following flag to true if a default time should be set
+ this.useDefaultTime = false;
+ // set the following to true to set default minutes to current time, false to // use zero
+ this.useDefaultMinutes = false;
+ // rfc 3339 date
+ this.storedTime = "";
+ // time currently selected in the UI, stored in hours, minutes, seconds in the format that will be actually displayed
+ this.currentTime = {};
+ this.classNames = {
+ selectedTime: "selectedItem"
+ }
+ this.any = "any"
+ // dom node indecies for selected hour, minute, amPm, and "any time option"
+ this.selectedTime = {
+ hour: "",
+ minute: "",
+ amPm: "",
+ anyTime: false
+ }
+
+ // minutes are ordered as follows: ["12", "6", "1", "7", "2", "8", "3", "9", "4", "10", "5", "11"]
+ this.hourIndexMap = ["", 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11, 0];
+ // minutes are ordered as follows: ["00", "30", "05", "35", "10", "40", "15", "45", "20", "50", "25", "55"]
+ this.minuteIndexMap = [0, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11];
+
+ this.templatePath = dojo.uri.dojoUri("src/widget/templates/HtmlTimePicker.html");
+ this.templateCssPath = dojo.uri.dojoUri("src/widget/templates/HtmlTimePicker.css");
+
+ this.fillInTemplate = function(){
+ this.initData();
+ this.initUI();
+ }
+
+ this.initData = function() {
+ // FIXME: doesn't currently validate the time before trying to set it
+ // Determine the date/time from stored info, or by default don't
+ // have a set time
+ // FIXME: should normalize against whitespace on storedTime... for now
+ // just a lame hack
+ if(this.storedTime.split("T")[1] && this.storedTime!=" " && this.storedTime.split("T")[1]!="any") {
+ this.time = dojo.widget.TimePicker.util.fromRfcDateTime(this.storedTime, this.useDefaultMinutes);
+ } else if (this.useDefaultTime) {
+ this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes);
+ } else {
+ this.selectedTime.anyTime = true;
+ }
+ }
+
+ this.initUI = function() {
+ // set UI to match the currently selected time
+ if(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();
+ }
+ }
+
+ this.setDateTime = function(rfcDate) {
+ this.storedTime = rfcDate;
+ }
+
+ this.onClearSelectedHour = function(evt) {
+ this.clearSelectedHour();
+ }
+
+ this.onClearSelectedMinute = function(evt) {
+ this.clearSelectedMinute();
+ }
+
+ this.onClearSelectedAmPm = function(evt) {
+ this.clearSelectedAmPm();
+ }
+
+ this.onClearSelectedAnyTime = function(evt) {
+ this.clearSelectedAnyTime();
+ if(this.selectedTime.anyTime) {
+ this.selectedTime.anyTime = false;
+ this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes);
+ this.initUI();
+ }
+ }
+
+ this.clearSelectedHour = function() {
+ var hourNodes = this.hourContainerNode.getElementsByTagName("td");
+ for (var i=0; i<hourNodes.length; i++) {
+ dojo.html.setClass(hourNodes.item(i), "");
+ }
+ }
+
+ this.clearSelectedMinute = function() {
+ var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");
+ for (var i=0; i<minuteNodes.length; i++) {
+ dojo.html.setClass(minuteNodes.item(i), "");
+ }
+ }
+
+ this.clearSelectedAmPm = function() {
+ var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
+ for (var i=0; i<amPmNodes.length; i++) {
+ dojo.html.setClass(amPmNodes.item(i), "");
+ }
+ }
+
+ this.clearSelectedAnyTime = function() {
+ dojo.html.setClass(this.anyTimeContainerNode, "anyTimeContainer");
+ }
+
+ this.onSetSelectedHour = function(evt) {
+ this.onClearSelectedAnyTime();
+ this.onClearSelectedHour();
+ this.setSelectedHour(evt);
+ this.onSetTime();
+ }
+
+ this.setSelectedHour = function(evt) {
+ if(evt && evt.target) {
+ dojo.html.setClass(evt.target, this.classNames.selectedTime);
+ this.selectedTime["hour"] = evt.target.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;
+ }
+
+ this.onSetSelectedMinute = function(evt) {
+ this.onClearSelectedAnyTime();
+ this.onClearSelectedMinute();
+ this.setSelectedMinute(evt);
+ this.selectedTime.anyTime = false;
+ this.onSetTime();
+ }
+
+ this.setSelectedMinute = function(evt) {
+ if(evt && evt.target) {
+ dojo.html.setClass(evt.target, this.classNames.selectedTime);
+ this.selectedTime["minute"] = evt.target.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;
+ }
+ }
+ }
+
+ this.onSetSelectedAmPm = function(evt) {
+ this.onClearSelectedAnyTime();
+ this.onClearSelectedAmPm();
+ this.setSelectedAmPm(evt);
+ this.selectedTime.anyTime = false;
+ this.onSetTime();
+ }
+
+ this.setSelectedAmPm = function(evt) {
+ if(evt && evt.target) {
+ dojo.html.setClass(evt.target, this.classNames.selectedTime);
+ this.selectedTime["amPm"] = evt.target.innerHTML;
+ } else {
+ evt = evt ? 0 : 1;
+ var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
+ if(amPmNodes.item(evt)) {
+ dojo.html.setClass(amPmNodes.item(evt), this.classNames.selectedTime);
+ this.selectedTime["amPm"] = amPmNodes.item(evt).innerHTML;
+ }
+ }
+ }
+
+ this.onSetSelectedAnyTime = function(evt) {
+ this.onClearSelectedHour();
+ this.onClearSelectedMinute();
+ this.onClearSelectedAmPm();
+ this.setSelectedAnyTime();
+ this.onSetTime();
+ }
+
+ this.setSelectedAnyTime = function(evt) {
+ this.selectedTime.anyTime = true;
+ dojo.html.setClass(this.anyTimeContainerNode, this.classNames.selectedTime + " " + "anyTimeContainer");
+ }
+
+ this.onClick = function(evt) {
+ dojo.event.browser.stopEvent(evt)
+ }
+
+ this.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] + "T" + this.any);
+ } 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));
+ }
+ }
+
+}
+dojo.inherits(dojo.widget.html.TimePicker, dojo.widget.HtmlWidget);
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/Tooltip.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/Tooltip.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/Tooltip.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/Tooltip.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,108 @@
+/*
+ Copyright (c) 2004-2005, 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.Tooltip");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.Tooltip");
+dojo.require("dojo.uri");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.event");
+dojo.require("dojo.style");
+dojo.require("dojo.html");
+
+dojo.widget.html.Tooltip = function(){
+ // mix in the tooltip properties
+ dojo.widget.Tooltip.call(this);
+ dojo.widget.HtmlWidget.call(this);
+}
+dojo.inherits(dojo.widget.html.Tooltip, dojo.widget.HtmlWidget);
+dojo.lang.extend(dojo.widget.html.Tooltip, {
+
+ // Constructor arguments (should these be in tooltip.js rather than html/tooltip.js???)
+ caption: "undefined",
+ delay: 500,
+ connectId: "",
+
+ templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.html"),
+ templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.css"),
+
+ containerNode: null,
+ connectNode: null,
+
+ hovering: false,
+ displayed: false,
+
+ fillInTemplate: function(args, frag){
+ if(this.caption != "undefined"){
+ this.domNode.appendChild(document.createTextNode(this.caption));
+ }
+ dojo.html.body().appendChild(this.domNode);
+ this.connectNode = dojo.byId(this.connectId);
+
+ // IE bug workaround
+ this.bgIframe = new dojo.html.BackgroundIframe();
+ },
+
+ postCreate: function(args, frag){
+ var self = this;
+ this.timerEvent = function () { self.display.apply(self); };
+ dojo.event.connect(this.connectNode, "onmouseover", this, "onMouseOver");
+ },
+
+ onMouseOver: function(e) {
+ if( this.displayed ){ return; }
+ this.timerEventId = setTimeout(this.timerEvent, this.delay);
+ dojo.event.connect(document.documentElement, "onmousemove", this, "onMouseMove");
+ },
+
+ onMouseMove: function(e) {
+ this.mouseX = e.pageX || e.clientX + dojo.html.body().scrollLeft;
+ this.mouseY = e.pageY || e.clientY + dojo.html.body().scrollTop;
+ if( !dojo.html.overElement(this.connectNode, e) ){
+ // Note: can't use onMouseOut because the "explode" effect causes
+ // spurious onMouseOut/onMouseOver events (due to interference from outline)
+ this.erase();
+ }
+ },
+
+ display: function() {
+ if ( this.displayed ) { return; }
+
+ this.domNode.style.top = this.mouseY + 15 + "px";
+ this.domNode.style.left = this.mouseX + 10 + "px";
+
+ // if rendering using explosion effect, need to set explosion source
+ this.explodeSrc = [this.mouseX, this.mouseY];
+
+ this.show();
+ this.bgIframe.show(this.domNode);
+
+ this.displayed=true;
+ },
+
+ onShow: function() {
+ // for explode effect, have to display the iframe after the effect completes
+ this.bgIframe.show(this.domNode);
+ dojo.widget.html.Tooltip.superclass.onShow.call(this);
+ },
+
+ erase: function() {
+ if ( this.timerEventId ) {
+ clearTimeout(this.timerEventId);
+ delete this.timerEventId;
+ }
+ if ( this.displayed ) {
+ this.hide();
+ this.bgIframe.hide();
+ this.displayed=false;
+ }
+ dojo.event.disconnect(document.documentElement, "onmousemove", this, "onMouseMove");
+ }
+});
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/stabile.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/stabile.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/stabile.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/html/stabile.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,208 @@
+/*
+ Copyright (c) 2004-2005, 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
+*/
+
+// Maintain state of widgets when user hits back/forward button
+
+dojo.provide("dojo.widget.html.stabile");
+
+dojo.widget.html.stabile = {
+ // Characters to quote in single-quoted regexprs
+ _sqQuotables: new RegExp("([\\\\'])", "g"),
+
+ // Current depth.
+ _depth: 0,
+
+ // Set to true when calling v.toString, to sniff for infinite
+ // recursion.
+ _recur: false,
+
+ // Levels of nesting of Array and object displays.
+ // If when >= depth, no display or array or object internals.
+ depthLimit: 2
+};
+
+
+
+
+
+//// PUBLIC METHODS
+
+// Get the state stored for the widget with the given ID, or undefined
+// if none.
+//
+dojo.widget.html.stabile.getState = function(id){
+ dojo.widget.html.stabile.setup();
+ return dojo.widget.html.stabile.widgetState[id];
+}
+
+
+// Set the state stored for the widget with the given ID. If isCommit
+// is true, commits all widget state to more stable storage.
+//
+dojo.widget.html.stabile.setState = function(id, state, isCommit){
+ dojo.widget.html.stabile.setup();
+ dojo.widget.html.stabile.widgetState[id] = state;
+ if(isCommit){
+ dojo.widget.html.stabile.commit(dojo.widget.html.stabile.widgetState);
+ }
+}
+
+
+// Sets up widgetState: a hash keyed by widgetId, maps to an object
+// or array writable with "describe". If there is data in the widget
+// storage area, use it, otherwise initialize an empty object.
+//
+dojo.widget.html.stabile.setup = function(){
+ if(!dojo.widget.html.stabile.widgetState){
+ var text = dojo.widget.html.stabile.getStorage().value;
+ dojo.widget.html.stabile.widgetState = text ? dj_eval("("+text+")") : {};
+ }
+}
+
+
+// Commits all widget state to more stable storage, so if the user
+// navigates away and returns, it can be restored.
+//
+dojo.widget.html.stabile.commit = function(state){
+ dojo.widget.html.stabile.getStorage().value = dojo.widget.html.stabile.description(state);
+}
+
+
+// Return a JSON "description string" for the given value.
+// Supports only core JavaScript types with literals, plus Date,
+// and cyclic structures are unsupported.
+// showAll defaults to false -- if true, this becomes a simple symbolic
+// object dumper, but you cannot "eval" the output.
+//
+dojo.widget.html.stabile.description = function(v, showAll){
+ // Save and later restore dojo.widget.html.stabile._depth;
+ var depth = dojo.widget.html.stabile._depth;
+
+ try {
+
+ if(v===void(0)){
+ return "undefined";
+ }
+ if(v===null){
+ return "null";
+ }
+ if(typeof(v)=="boolean" || typeof(v)=="number"
+ || v instanceof Boolean || v instanceof Number){
+ return v.toString();
+ }
+
+ if(typeof(v)=="string" || v instanceof String){
+ // Quote strings and their contents as required.
+ // Replacing by $& fails in IE 5.0
+ var v1 = v.replace(dojo.widget.html.stabile._sqQuotables, "\\$1");
+ v1 = v1.replace(/\n/g, "\\n");
+ v1 = v1.replace(/\r/g, "\\r");
+ // Any other important special cases?
+ return "'"+v1+"'";
+ }
+
+ if(v instanceof Date){
+ // Create a data constructor.
+ return "new Date("+d.getFullYear+","+d.getMonth()+","+d.getDate()+")";
+ }
+
+ var d;
+ if(v instanceof Array || v.push){
+ // "push" test needed for KHTML/Safari, don't know why -cp
+
+ if(depth>=dojo.widget.html.stabile.depthLimit)
+ return "[ ... ]";
+
+ d = "[";
+ var first = true;
+ dojo.widget.html.stabile._depth++;
+ for(var i=0; i<v.length; i++){
+ // Skip functions and undefined values
+ // if(v[i]==undef || typeof(v[i])=="function")
+ // continue;
+ if(first){
+ first = false;
+ }else{
+ d += ",";
+ }
+ d+=arguments.callee(v[i], showAll);
+ }
+ return d+"]";
+ }
+
+ if(v.constructor==Object
+ || v.toString==describeThis){
+ if(depth>=dojo.widget.html.stabile.depthLimit)
+ return "{ ... }";
+
+ // Instanceof Hash is good, or if we just use Objects,
+ // we can say v.constructor==Object.
+ // IE (5?) lacks hasOwnProperty, but perhaps objects do not always
+ // have prototypes??
+ if(typeof(v.hasOwnProperty)!="function" && v.prototype){
+ throw new Error("description: "+v+" not supported by script engine");
+ }
+ var first = true;
+ d = "{";
+ dojo.widget.html.stabile._depth++;
+ for(var key in v){
+ // Skip values that are functions or undefined.
+ if(v[key]==void(0) || typeof(v[key])=="function")
+ continue;
+ if(first){
+ first = false;
+ }else{
+ d += ", ";
+ }
+ kd = key;
+ // If the key is not a legal identifier, use its description.
+ // For strings this will quote the stirng.
+ if(!kd.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)){
+ kd = arguments.callee(key, showAll);
+ }
+ d += kd+": "+arguments.callee(v[key], showAll);
+ }
+ return d+"}";
+ }
+
+ if(showAll){
+ if(dojo.widget.html.stabile._recur){
+ return objectToString.apply(v, []);
+ }else{
+ dojo.widget.html.stabile._recur = true;
+ return v.toString();
+ }
+ }else{
+ // log("Description? "+v.toString()+", "+typeof(v));
+ throw new Error("Unknown type: "+v);
+ return "'unknown'";
+ }
+
+ } finally {
+ // Always restore the global current depth.
+ dojo.widget.html.stabile._depth = depth;
+ }
+
+}
+
+
+
+//// PRIVATE TO MODULE
+
+// Gets an object (form field) with a read/write "value" property.
+//
+dojo.widget.html.stabile.getStorage = function(){
+ if (dojo.widget.html.stabile.dataField) {
+ return dojo.widget.html.stabile.dataField;
+ }
+ var form = document.forms._dojo_form;
+ return dojo.widget.html.stabile.dataField = form ? form.stabile : {value: ""};
+}
+
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/Chart.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/Chart.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/Chart.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/Chart.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,534 @@
+/*
+ Copyright (c) 2004-2005, 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.math");
+dojo.require("dojo.html");
+dojo.require("dojo.svg");
+dojo.require("dojo.graphics.color");
+
+dojo.widget.svg.Chart=function(){
+ dojo.widget.Chart.call(this);
+ dojo.widget.HtmlWidget.call(this);
+};
+dojo.inherits(dojo.widget.svg.Chart, dojo.widget.HtmlWidget);
+dojo.lang.extend(dojo.widget.svg.Chart, {
+ // widget props
+ templatePath:null,
+ templateCssPath:null,
+
+ // state
+ _isInitialized:false,
+ hasData:false,
+
+ // chart props
+ vectorNode:null,
+ plotArea:null,
+ dataGroup:null,
+ axisGroup:null,
+
+ properties:{
+ height:400, // defaults, will resize to the domNode.
+ width:600,
+ plotType:null,
+ padding:{
+ top:10,
+ bottom:2,
+ left:60,
+ right:30
+ },
+ axes:{
+ x:{
+ plotAt:0,
+ label:"",
+ unitLabel:"",
+ unitType:Number,
+ nUnitsToShow:10,
+ range:{
+ min:0,
+ max:200
+ }
+ },
+ y:{
+ plotAt:0,
+ label:"",
+ unitLabel:"",
+ unitType:Number,
+ nUnitsToShow:10,
+ range:{
+ min:0,
+ max:200
+ }
+ }
+ }
+ },
+
+ fillInTemplate:function(args,frag){
+ this.parseData();
+ this.initialize();
+ this.render();
+ },
+ parseData:function(){
+ },
+ initialize:function(){
+ // begin by grabbing the table, and reading it in.
+ var table=this.domNode.getElementsByTagName("table")[0];
+ if (!table) return;
+
+ var bRangeX=false;
+ var bRangeY=false;
+
+ // properties off the table
+ if (table.getAttribute("width")) this.properties.width=table.getAttribute("width");
+ if (table.getAttribute("height")) this.properties.height=table.getAttribute("height");
+ if (table.getAttribute("plotType")) this.properties.plotType=table.getAttribute("plotType");
+ if (table.getAttribute("padding")){
+ if (table.getAttribute("padding").indexOf(",") > -1)
+ var p=table.getAttribute("padding").split(",");
+ else var p=table.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 (table.getAttribute("rangeX")){
+ var p=table.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 (table.getAttribute("rangeY")){
+ var p=table.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;
+ }
+
+ 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.");
+
+ // set up the series.
+ var columns=thead.getElementsByTagName("tr")[0].getElementsByTagName("th"); // should be <tr><..>
+
+ // assume column 0 == X
+ 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);
+ }
+
+ // ok, get the values.
+ var rows=tbody.getElementsByTagName("tr");
+ 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.getElementsByTagName("td");
+ 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);
+ }
+ }
+ }
+
+ // fix the axes
+ if(!bRangeX){
+ this.properties.axes.x.range={min:xMin, max:xMax};
+ }
+ if(!bRangeY){
+ this.properties.axes.y.range={min:yMin, max:yMax};
+ }
+
+ // where to plot the axes
+ if (table.getAttribute("axisAt")){
+ var p=table.getAttribute("axisAt");
+ if (p.indexOf(",")>-1) p=p.split(",");
+ else p=p.split(" ");
+
+ // x axis
+ 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;
+ }
+
+ // y axis
+ 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;
+ }
+
+ // table values should be populated, now pop it off.
+ this.domNode.removeChild(table);
+
+ // get the width and the height.
+// this.properties.width=dojo.html.getInnerWidth(this.domNode);
+// this.properties.height=dojo.html.getInnerHeight(this.domNode);
+
+ // ok, lets create the chart itself.
+ 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);
+
+ // set up the clip path for the plot area.
+ 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.bottom-this.properties.padding.bottom);
+ clip.appendChild(rect);
+ defs.appendChild(clip);
+ this.vectorNode.appendChild(defs);
+
+ // the plot background.
+ 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.bottom-this.properties.padding.bottom);
+ rect.setAttribute("fill", "#fff");
+ this.plotArea.appendChild(rect);
+
+ // data group
+ this.dataGroup = document.createElementNS(dojo.svg.xmlns.svg, "g");
+ this.dataGroup.setAttribute("style","clip-path:url(#plotClip"+this.widgetId+");");
+ this.plotArea.appendChild(this.dataGroup);
+
+ // axis group
+ this.axisGroup = document.createElementNS(dojo.svg.xmlns.svg, "g");
+ this.plotArea.appendChild(this.axisGroup);
+
+ // x axis
+ 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);
+
+ // x axis units.
+ // (min and max)
+ 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);
+
+ // y axis
+ 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);
+
+ // y axis units
+ 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);
+
+ this.domNode.appendChild(this.vectorNode);
+ dojo.svg.g.resume();
+
+ // this is last.
+ 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.initialize();
+ }
+
+ // the remove/append is an attempt to streamline the rendering, it's totally optional
+// var p=this.dataGroup.parentNode;
+// p.removeChild(this.dataGroup);
+ for(var i=0; i<this.series.length; i++){
+ dojo.widget.svg.Chart.Plotter.plot(this.series[i], this);
+ }
+// p.appendChild(this.dataGroup);
+
+ dojo.svg.g.resume();
+ }
+});
+
+dojo.widget.svg.Chart.PlotTypes = {
+ Bar:"bar",
+ Line:"line",
+ Scatter:"scatter",
+ Bubble:"bubble"
+};
+
+dojo.widget.svg.Chart.Plotter=new function(){
+ var _this=this;
+ var plotters = {};
+ var types=dojo.widget.svg.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);
+ }
+// else {
+// return plotters[types.Bar](series, chart);
+// }
+ };
+
+ // plotting
+ plotters[types.Bar]=function(series, chart){
+ var space=1;
+ var lastW = 0;
+ for (var i=0; i<series.values.length; i++){
+ var x=_this.getX(series.values[i].x, chart);
+ var w;
+ if (i==series.values.length-1){
+ w=lastW;
+ } else{
+ w=_this.getX(series.values[i+1].x, chart)-x-space;
+ lastW=w;
+ }
+ x-=(w/2);
+
+ var yA=_this.getY(chart.properties.axes.x.plotAt, chart);
+ var y=_this.getY(series.values[i].value, chart);
+ var h=Math.abs(yA-y);
+ if (parseFloat(series.values[i].value)<chart.properties.axes.x.plotAt){
+ var oy=yA;
+ yA=y;
+ y=oy;
+ }
+
+ var bar=document.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[types.Line]=function(series, chart){
+ var tension=3;
+ var line = document.createElementNS(dojo.svg.xmlns.svg, "path");
+ line.setAttribute("fill", "none");
+ line.setAttribute("stroke", series.color);
+ line.setAttribute("stroke-width", "1.5");
+ 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 = _this.getX(series.values[i].x, chart)
+ var y = _this.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-_this.getX(series.values[i-1].x, chart);
+ dy=_this.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[types.Scatter]=function(series, chart){
+ var r=7;
+ for (var i=0; i<series.values.length; i++){
+ var x=_this.getX(series.values[i].x, chart);
+ var y=_this.getY(series.values[i].value, chart);
+ var 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[types.Bubble]=function(series, chart){
+ // added param for series[n].value: size
+ var minR=1;
+
+ // do this off the x axis?
+ var min=chart.properties.axes.x.range.min;
+ var max=chart.properties.axes.x.range.max;
+ var ofst=0-min;
+ min+=ofst; max+=ofst; v+=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", _this.getX(series.values[i].x, chart));
+ point.setAttribute("cy", _this.getY(series.values[i].value, chart));
+ point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
+ chart.dataGroup.appendChild(point);
+ }
+ };
+}();
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/HslColorPicker.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/HslColorPicker.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/HslColorPicker.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/widget/svg/HslColorPicker.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,139 @@
+/*
+ Copyright (c) 2004-2005, 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.HslColorPicker");
+
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.HslColorPicker");
+dojo.require("dojo.math");
+dojo.require("dojo.svg");
+dojo.require("dojo.graphics.color");
+
+dojo.widget.svg.HslColorPicker=function(){
+ dojo.widget.HslColorPicker.call(this);
+ dojo.widget.HtmlWidget.call(this);
+ dojo.debug("warning: the HslColorPicker is not a finished widget, and is not yet ready for general use");
+ this.hue = "0";
+ this.saturation = "0";
+ this.light = "0";
+ this.storedColor = "#0054aa";
+ var _this = this;
+ this.filterObject = {
+ }
+};
+dojo.inherits(dojo.widget.svg.HslColorPicker, dojo.widget.HtmlWidget);
+dojo.lang.extend(dojo.widget.svg.HslColorPicker, {
+ // widget props
+ templatePath: dojo.uri.dojoUri("src/widget/templates/HslColorPicker.svg"),
+ templateCssPath: dojo.uri.dojoUri("src/widget/templates/HslColorPicker.css"),
+ fillInTemplate: function() {
+ this.height = "131px";
+ this.svgDoc = this.hueNode.ownerDocument;
+ this.leftGradientColorNode = this.hueNode.ownerDocument.getElementById("leftGradientColor");
+ this.rightGradientColorNode = this.hueNode.ownerDocument.getElementById("rightGradientColor");
+ this.hueNode.setAttributeNS(dojo.dom.xmlns.xlink, "href", dojo.uri.dojoUri("src/widget/templates/images/hue.png"));
+ var hsl = dojo.graphics.color.hex2hsl(this.storedColor);
+ this.hue = hsl[0];
+ this.saturation = hsl[1];
+ this.light = hsl[2];
+ this.setSaturationStopColors();
+ //this.setHueSlider();
+ //this.setSaturationLightSlider();
+ },
+ setSaturationStopColors: function() {
+ //this.leftGradientStopColor = "rgb(" + dojo.graphics.color.hsl2rgb(this.hue, 20, 50).join(", ") + ")";
+ //this.rightGradientStopColor = "rgb(" + dojo.graphics.color.hsl2rgb(this.hue, 100, 50).join(", ") + ")";
+ //this.leftGradientStopColor = dojo.graphics.color.hsl2hex(this.hue, 20, 50);
+ //this.rightGradientStopColor = dojo.graphics.color.hsl2hex(this.hue, 100, 50);
+ this.leftGradientStopColor = dojo.graphics.color.rgb2hex(this.hsl2rgb(this.hue, 0, 50));
+ this.rightGradientStopColor = dojo.graphics.color.rgb2hex(this.hsl2rgb(this.hue, 100, 50));
+ this.leftGradientColorNode.setAttributeNS(null,'stop-color',this.leftGradientStopColor);
+ this.rightGradientColorNode.setAttributeNS(null,'stop-color',this.rightGradientStopColor);
+ },
+ setHue: function(hue) {
+ this.hue = hue;
+ },
+ setHueSlider: function() {
+ // FIXME: need to add some padding around the picker so you can see the slider at the top and bottom of the picker)
+ this.hueSliderNode.setAttribute("y", parseInt((this.hue/360) * parseInt(this.height) - 2) + "px" );
+ },
+ setSaturationLight: function(saturation, light) {
+ this.saturation = saturation;
+ this.light = light;
+ },
+ setSaturationLightSlider: function() {
+ // TODO
+ },
+ onHueClick: function(evt) {
+ // get the position that was clicked on the element
+ // FIXME: handle document scrolling, offset
+ var yPosition = parseInt(evt.clientY) - parseInt(evt.target.getAttribute("y"));
+ this.setHue( 360 - parseInt(yPosition*(360/parseInt(this.height))) );
+ this.setSaturationStopColors();
+ this.setStoredColor(dojo.graphics.color.hsl2hex(this.hue, this.saturation, this.light));
+ },
+ onHueDrag: function(evt) {
+ // TODO
+ },
+ onSaturationLightClick: function(evt) {
+ // get the position that was clicked on the element
+ // FIXME: handle document scrolling, offset
+ var xPosition = parseInt(evt.clientX) - parseInt(evt.target.getAttribute("y"));
+ var yPosition = parseInt(evt.clientY) - parseInt(evt.target.getAttribute("y"));
+ saturation = parseInt(parseInt(xPosition)*(101/106));
+ light = parseInt(parseInt(yPosition)*(101/106));
+ this.setSaturationLight(saturation, light);
+ this.setStoredColor(dojo.graphics.color.hsl2hex(this.hue, this.saturation, this.light));
+ },
+ onSaturationLightDrag: function(evt) {
+ // TODO
+ },
+ getStoredColor: function() {
+ return this.storedColor;
+ },
+ setStoredColor: function(rgbHexColor) {
+ this.storedColor = rgbHexColor;
+ dojo.event.topic.publish("/" + this.widgetId + "/setStoredColor", this.filterObject);
+ },
+ hsl2rgb: function(hue, saturation, light)
+ {
+ // hsl2rgb in dojo.graphics.color did not behave hte way I expected, so
+ // I'm using some old code I wrote until I figure out what the issue is
+ // first, check to see if saturation = 0
+ function rgb(q1,q2,hue) {
+ if (hue>360) hue=hue-360;
+ if (hue<0) hue=hue+360;
+ if (hue<60) return (q1+(q2-q1)*hue/60);
+ else if (hue<180) return(q2);
+ else if (hue<240) return(q1+(q2-q1)*(240-hue)/60);
+ else return(q1);
+ }
+ this.rgb = rgb
+
+ if (saturation==0) {
+ return [Math.round(light*255/100), Math.round(light*255/100), Math.round(light*255/100)];
+ } else {
+ light = light/100;
+ saturation = saturation/100;
+ // check to see if light > 0.5
+ if ((light)<0.5) {
+ var temp2 = (light)*(1.0+saturation)
+ } else {
+ var temp2 = (light+saturation-(light*saturation))
+ }
+ temp1 = 2.0*light - temp2;
+ var rgbcolor = [];
+ rgbcolor[0] = Math.round(rgb(temp1,temp2,parseInt(hue)+120)*255);
+ rgbcolor[1] = Math.round(rgb(temp1,temp2,hue)*255);
+ rgbcolor[2] = Math.round(rgb(temp1,temp2,parseInt(hue)-120)*255);
+ return rgbcolor;
+ }
+ }
+});
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/Parse.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/Parse.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/Parse.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/Parse.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,171 @@
+/*
+ Copyright (c) 2004-2005, 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.xml.Parse");
+
+dojo.require("dojo.dom");
+
+//TODO: determine dependencies
+// currently has dependency on dojo.xml.DomUtil nodeTypes constants...
+
+/* generic method for taking a node and parsing it into an object
+
+TODO: WARNING: This comment is wrong!
+
+For example, the following xml fragment
+
+<foo bar="bar">
+ <baz xyzzy="xyzzy"/>
+</foo>
+
+can be described as:
+
+dojo.???.foo = {}
+dojo.???.foo.bar = {}
+dojo.???.foo.bar.value = "bar";
+dojo.???.foo.baz = {}
+dojo.???.foo.baz.xyzzy = {}
+dojo.???.foo.baz.xyzzy.value = "xyzzy"
+
+*/
+// using documentFragment nomenclature to generalize in case we don't want to require passing a collection of nodes with a single parent
+dojo.xml.Parse = function(){
+ this.parseFragment = function(documentFragment) {
+ // handle parent element
+ var parsedFragment = {};
+ // var tagName = dojo.xml.domUtil.getTagName(node);
+ var tagName = dojo.dom.getTagName(documentFragment);
+ // TODO: What if document fragment is just text... need to check for nodeType perhaps?
+ parsedFragment[tagName] = new Array(documentFragment.tagName);
+ var attributeSet = this.parseAttributes(documentFragment);
+ for(var attr in attributeSet){
+ if(!parsedFragment[attr]){
+ parsedFragment[attr] = [];
+ }
+ parsedFragment[attr][parsedFragment[attr].length] = attributeSet[attr];
+ }
+ var nodes = documentFragment.childNodes;
+ for(var childNode in nodes){
+ switch(nodes[childNode].nodeType){
+ case dojo.dom.ELEMENT_NODE: // element nodes, call this function recursively
+ parsedFragment[tagName].push(this.parseElement(nodes[childNode]));
+ break;
+ case dojo.dom.TEXT_NODE: // if a single text node is the child, treat it as an attribute
+ if(nodes.length == 1){
+ if(!parsedFragment[documentFragment.tagName]){
+ parsedFragment[tagName] = [];
+ }
+ parsedFragment[tagName].push({ value: nodes[0].nodeValue });
+ }
+ break;
+ }
+ }
+
+ return parsedFragment;
+ }
+
+ this.parseElement = function(node, hasParentNodeSet, optimizeForDojoML, thisIdx){
+ // TODO: make this namespace aware
+ var parsedNodeSet = {};
+ var tagName = dojo.dom.getTagName(node);
+ parsedNodeSet[tagName] = [];
+ if((!optimizeForDojoML)||(tagName.substr(0,4).toLowerCase()=="dojo")){
+ var attributeSet = this.parseAttributes(node);
+ for(var attr in attributeSet){
+ if((!parsedNodeSet[tagName][attr])||(typeof parsedNodeSet[tagName][attr] != "array")){
+ parsedNodeSet[tagName][attr] = [];
+ }
+ parsedNodeSet[tagName][attr].push(attributeSet[attr]);
+ }
+
+ // FIXME: we might want to make this optional or provide cloning instead of
+ // referencing, but for now, we include a node reference to allow
+ // instantiated components to figure out their "roots"
+ parsedNodeSet[tagName].nodeRef = node;
+ parsedNodeSet.tagName = tagName;
+ parsedNodeSet.index = thisIdx||0;
+ }
+
+ var count = 0;
+ for(var i=0; i<node.childNodes.length; i++){
+ var tcn = node.childNodes.item(i);
+ switch(tcn.nodeType){
+ case dojo.dom.ELEMENT_NODE: // element nodes, call this function recursively
+ count++;
+ var ctn = dojo.dom.getTagName(tcn);
+ if(!parsedNodeSet[ctn]){
+ parsedNodeSet[ctn] = [];
+ }
+ parsedNodeSet[ctn].push(this.parseElement(tcn, true, optimizeForDojoML, count));
+ if( (tcn.childNodes.length == 1)&&
+ (tcn.childNodes.item(0).nodeType == dojo.dom.TEXT_NODE)){
+ parsedNodeSet[ctn][parsedNodeSet[ctn].length-1].value = tcn.childNodes.item(0).nodeValue;
+ }
+ break;
+ case dojo.dom.TEXT_NODE: // if a single text node is the child, treat it as an attribute
+ if(node.childNodes.length == 1) {
+ parsedNodeSet[tagName].push({ value: node.childNodes.item(0).nodeValue });
+ }
+ break;
+ default: break;
+ /*
+ case dojo.dom.ATTRIBUTE_NODE: // attribute node... not meaningful here
+ break;
+ case dojo.dom.CDATA_SECTION_NODE: // cdata section... not sure if this would ever be meaningful... might be...
+ break;
+ case dojo.dom.ENTITY_REFERENCE_NODE: // entity reference node... not meaningful here
+ break;
+ case dojo.dom.ENTITY_NODE: // entity node... not sure if this would ever be meaningful
+ break;
+ case dojo.dom.PROCESSING_INSTRUCTION_NODE: // processing instruction node... not meaningful here
+ break;
+ case dojo.dom.COMMENT_NODE: // comment node... not not sure if this would ever be meaningful
+ break;
+ case dojo.dom.DOCUMENT_NODE: // document node... not sure if this would ever be meaningful
+ break;
+ case dojo.dom.DOCUMENT_TYPE_NODE: // document type node... not meaningful here
+ break;
+ case dojo.dom.DOCUMENT_FRAGMENT_NODE: // document fragment node... not meaningful here
+ break;
+ case dojo.dom.NOTATION_NODE:// notation node... not meaningful here
+ break;
+ */
+ }
+ }
+ //return (hasParentNodeSet) ? parsedNodeSet[node.tagName] : parsedNodeSet;
+ return parsedNodeSet;
+ }
+
+ /* parses a set of attributes on a node into an object tree */
+ this.parseAttributes = function(node) {
+ // TODO: make this namespace aware
+ var parsedAttributeSet = {};
+ var atts = node.attributes;
+ // TODO: should we allow for duplicate attributes at this point...
+ // would any of the relevant dom implementations even allow this?
+ for(var i=0; i<atts.length; i++) {
+ var attnode = atts.item(i);
+ if((dojo.render.html.capable)&&(dojo.render.html.ie)){
+ if(!attnode){ continue; }
+ if( (typeof attnode == "object")&&
+ (typeof attnode.nodeValue == 'undefined')||
+ (attnode.nodeValue == null)||
+ (attnode.nodeValue == '')){
+ continue;
+ }
+ }
+ var nn = (attnode.nodeName.indexOf("dojo:") == -1) ? attnode.nodeName : attnode.nodeName.split("dojo:")[1];
+ parsedAttributeSet[nn] = {
+ value: attnode.nodeValue
+ };
+ }
+ return parsedAttributeSet;
+ }
+}
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/__package__.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/__package__.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/__package__.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/__package__.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,17 @@
+/*
+ Copyright (c) 2004-2005, 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.xml.Parse");
+dojo.hostenv.conditionalLoadModule({
+ common: ["dojo.xml.domUtil"],
+ browser: ["dojo.xml.htmlUtil"],
+ svg: ["dojo.xml.svgUtil"]
+});
+dojo.hostenv.moduleLoaded("dojo.xml.*");
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/domUtil.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/domUtil.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/domUtil.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/domUtil.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,84 @@
+/*
+ Copyright (c) 2004-2005, 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.xml.domUtil");
+dojo.require("dojo.graphics.color");
+dojo.require("dojo.dom");
+dojo.require("dojo.style");
+
+dj_deprecated("dojo.xml.domUtil is deprecated, use dojo.dom instead");
+
+// for loading script:
+dojo.xml.domUtil = new function(){
+ this.nodeTypes = {
+ ELEMENT_NODE : 1,
+ ATTRIBUTE_NODE : 2,
+ TEXT_NODE : 3,
+ CDATA_SECTION_NODE : 4,
+ ENTITY_REFERENCE_NODE : 5,
+ ENTITY_NODE : 6,
+ PROCESSING_INSTRUCTION_NODE : 7,
+ COMMENT_NODE : 8,
+ DOCUMENT_NODE : 9,
+ DOCUMENT_TYPE_NODE : 10,
+ DOCUMENT_FRAGMENT_NODE : 11,
+ NOTATION_NODE : 12
+ }
+
+ this.dojoml = "http://www.dojotoolkit.org/2004/dojoml";
+ this.idIncrement = 0;
+
+ this.getTagName = function(){return dojo.dom.getTagName.apply(dojo.dom, arguments);}
+ this.getUniqueId = function(){return dojo.dom.getUniqueId.apply(dojo.dom, arguments);}
+ this.getFirstChildTag = function() {return dojo.dom.getFirstChildElement.apply(dojo.dom, arguments);}
+ this.getLastChildTag = function() {return dojo.dom.getLastChildElement.apply(dojo.dom, arguments);}
+ this.getNextSiblingTag = function() {return dojo.dom.getNextSiblingElement.apply(dojo.dom, arguments);}
+ this.getPreviousSiblingTag = function() {return dojo.dom.getPreviousSiblingElement.apply(dojo.dom, arguments);}
+
+ this.forEachChildTag = function(node, unaryFunc) {
+ var child = this.getFirstChildTag(node);
+ while(child) {
+ if(unaryFunc(child) == "break") { break; }
+ child = this.getNextSiblingTag(child);
+ }
+ }
+
+ this.moveChildren = function() {return dojo.dom.moveChildren.apply(dojo.dom, arguments);}
+ this.copyChildren = function() {return dojo.dom.copyChildren.apply(dojo.dom, arguments);}
+ this.clearChildren = function() {return dojo.dom.removeChildren.apply(dojo.dom, arguments);}
+ this.replaceChildren = function() {return dojo.dom.replaceChildren.apply(dojo.dom, arguments);}
+
+ this.getStyle = function() {return dojo.style.getStyle.apply(dojo.style, arguments);}
+ this.toCamelCase = function() {return dojo.style.toCamelCase.apply(dojo.style, arguments);}
+ this.toSelectorCase = function() {return dojo.style.toSelectorCase.apply(dojo.style, arguments);}
+
+ this.getAncestors = function(){return dojo.dom.getAncestors.apply(dojo.dom, arguments);}
+ this.isChildOf = function() {return dojo.dom.isDescendantOf.apply(dojo.dom, arguments);}
+ this.createDocumentFromText = function() {return dojo.dom.createDocumentFromText.apply(dojo.dom, arguments);}
+
+ if(dojo.render.html.capable || dojo.render.svg.capable) {
+ this.createNodesFromText = function(txt, wrap){return dojo.dom.createNodesFromText.apply(dojo.dom, arguments);}
+ }
+
+ this.extractRGB = function(color) { return dojo.graphics.color.extractRGB(color); }
+ this.hex2rgb = function(hex) { return dojo.graphics.color.hex2rgb(hex); }
+ this.rgb2hex = function(r, g, b) { return dojo.graphics.color.rgb2hex(r, g, b); }
+
+ this.insertBefore = function() {return dojo.dom.insertBefore.apply(dojo.dom, arguments);}
+ this.before = this.insertBefore;
+ this.insertAfter = function() {return dojo.dom.insertAfter.apply(dojo.dom, arguments);}
+ this.after = this.insertAfter
+ this.insert = function(){return dojo.dom.insertAtPosition.apply(dojo.dom, arguments);}
+ this.insertAtIndex = function(){return dojo.dom.insertAtIndex.apply(dojo.dom, arguments);}
+ this.textContent = function () {return dojo.dom.textContent.apply(dojo.dom, arguments);}
+ this.renderedTextContent = function () {return dojo.dom.renderedTextContent.apply(dojo.dom, arguments);}
+ this.remove = function (node) {return dojo.dom.removeNode.apply(dojo.dom, arguments);}
+}
+
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/htmlUtil.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/htmlUtil.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/htmlUtil.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/htmlUtil.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,121 @@
+/*
+ Copyright (c) 2004-2005, 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.xml.htmlUtil");
+dojo.require("dojo.html");
+dojo.require("dojo.style");
+dojo.require("dojo.dom");
+
+dj_deprecated("dojo.xml.htmlUtil is deprecated, use dojo.html instead");
+
+dojo.xml.htmlUtil = new function(){
+ this.styleSheet = dojo.style.styleSheet;
+
+ this._clobberSelection = function(){return dojo.html.clearSelection.apply(dojo.html, arguments);}
+ this.disableSelect = function(){return dojo.html.disableSelection.apply(dojo.html, arguments);}
+ this.enableSelect = function(){return dojo.html.enableSelection.apply(dojo.html, arguments);}
+
+ this.getInnerWidth = function(){return dojo.style.getInnerWidth.apply(dojo.style, arguments);}
+
+ this.getOuterWidth = function(node){
+ dj_unimplemented("dojo.xml.htmlUtil.getOuterWidth");
+ }
+
+ this.getInnerHeight = function(){return dojo.style.getInnerHeight.apply(dojo.style, arguments);}
+
+ this.getOuterHeight = function(node){
+ dj_unimplemented("dojo.xml.htmlUtil.getOuterHeight");
+ }
+
+ this.getTotalOffset = function(){return dojo.style.getTotalOffset.apply(dojo.style, arguments);}
+ this.totalOffsetLeft = function(){return dojo.style.totalOffsetLeft.apply(dojo.style, arguments);}
+
+ this.getAbsoluteX = this.totalOffsetLeft;
+
+ this.totalOffsetTop = function(){return dojo.style.totalOffsetTop.apply(dojo.style, arguments);}
+
+ this.getAbsoluteY = this.totalOffsetTop;
+
+ this.getEventTarget = function(){return dojo.html.getEventTarget.apply(dojo.html, arguments);}
+ this.getScrollTop = function() {return dojo.html.getScrollTop.apply(dojo.html, arguments);}
+ this.getScrollLeft = function() {return dojo.html.getScrollLeft.apply(dojo.html, arguments);}
+
+ this.evtTgt = this.getEventTarget;
+
+ this.getParentOfType = function(){return dojo.html.getParentOfType.apply(dojo.html, arguments);}
+ this.getAttribute = function(){return dojo.html.getAttribute.apply(dojo.html, arguments);}
+ this.getAttr = function (node, attr) { // for backwards compat (may disappear!!!)
+ dj_deprecated("dojo.xml.htmlUtil.getAttr is deprecated, use dojo.xml.htmlUtil.getAttribute instead");
+ return dojo.xml.htmlUtil.getAttribute(node, attr);
+ }
+ this.hasAttribute = function(){return dojo.html.hasAttribute.apply(dojo.html, arguments);}
+
+ this.hasAttr = function (node, attr) { // for backwards compat (may disappear!!!)
+ dj_deprecated("dojo.xml.htmlUtil.hasAttr is deprecated, use dojo.xml.htmlUtil.hasAttribute instead");
+ return dojo.xml.htmlUtil.hasAttribute(node, attr);
+ }
+
+ this.getClass = function(){return dojo.html.getClass.apply(dojo.html, arguments)}
+ this.hasClass = function(){return dojo.html.hasClass.apply(dojo.html, arguments)}
+ this.prependClass = function(){return dojo.html.prependClass.apply(dojo.html, arguments)}
+ this.addClass = function(){return dojo.html.addClass.apply(dojo.html, arguments)}
+ this.setClass = function(){return dojo.html.setClass.apply(dojo.html, arguments)}
+ this.removeClass = function(){return dojo.html.removeClass.apply(dojo.html, arguments)}
+
+ // Enum type for getElementsByClass classMatchType arg:
+ this.classMatchType = {
+ ContainsAll : 0, // all of the classes are part of the node's class (default)
+ ContainsAny : 1, // any of the classes are part of the node's class
+ IsOnly : 2 // only all of the classes are part of the node's class
+ }
+
+ this.getElementsByClass = function() {return dojo.html.getElementsByClass.apply(dojo.html, arguments)}
+ this.getElementsByClassName = this.getElementsByClass;
+
+ this.setOpacity = function() {return dojo.style.setOpacity.apply(dojo.style, arguments)}
+ this.getOpacity = function() {return dojo.style.getOpacity.apply(dojo.style, arguments)}
+ this.clearOpacity = function() {return dojo.style.clearOpacity.apply(dojo.style, arguments)}
+
+ this.gravity = function(){return dojo.html.gravity.apply(dojo.html, arguments)}
+
+ this.gravity.NORTH = 1;
+ this.gravity.SOUTH = 1 << 1;
+ this.gravity.EAST = 1 << 2;
+ this.gravity.WEST = 1 << 3;
+
+ this.overElement = function(){return dojo.html.overElement.apply(dojo.html, arguments)}
+
+ this.insertCssRule = function(){return dojo.style.insertCssRule.apply(dojo.style, arguments)}
+
+ this.insertCSSRule = function(selector, declaration, index){
+ dj_deprecated("dojo.xml.htmlUtil.insertCSSRule is deprecated, use dojo.xml.htmlUtil.insertCssRule instead");
+ return dojo.xml.htmlUtil.insertCssRule(selector, declaration, index);
+ }
+
+ this.removeCssRule = function(){return dojo.style.removeCssRule.apply(dojo.style, arguments)}
+
+ this.removeCSSRule = function(index){
+ dj_deprecated("dojo.xml.htmlUtil.removeCSSRule is deprecated, use dojo.xml.htmlUtil.removeCssRule instead");
+ return dojo.xml.htmlUtil.removeCssRule(index);
+ }
+
+ this.insertCssFile = function(){return dojo.style.insertCssFile.apply(dojo.style, arguments)}
+
+ this.insertCSSFile = function(URI, doc, checkDuplicates){
+ dj_deprecated("dojo.xml.htmlUtil.insertCSSFile is deprecated, use dojo.xml.htmlUtil.insertCssFile instead");
+ return dojo.xml.htmlUtil.insertCssFile(URI, doc, checkDuplicates);
+ }
+
+ this.getBackgroundColor = function() {return dojo.style.getBackgroundColor.apply(dojo.style, arguments)}
+
+ this.getUniqueId = function() { return dojo.dom.getUniqueId(); }
+
+ this.getStyle = function() {return dojo.style.getStyle.apply(dojo.style, arguments)}
+}
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/svgUtil.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/svgUtil.js?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/svgUtil.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/xml/svgUtil.js Thu Jan 26 15:56:50 2006
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2004-2005, 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.xml.svgUtil");
+// FIXME: add imports for deps!
+
+dojo.xml.svgUtil = new function(){
+
+ this.getInnerWidth = function(node){
+ // FIXME: need to find out from dylan how to
+ }
+
+ this.getOuterWidth = function(node){
+
+ }
+
+ this.getInnerHeight = function(node){
+
+ }
+
+ this.getOuterHeight = function(node){
+
+ }
+
+}
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/version.txt
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/version.txt?rev=372668&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/version.txt (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/version.txt Thu Jan 26 15:56:50 2006
@@ -0,0 +1 @@
+DOJO library version 0.2.2
\ No newline at end of file
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/version.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/version.txt
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL