Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 9452 invoked from network); 11 Nov 2006 16:45:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Nov 2006 16:45:51 -0000 Received: (qmail 27865 invoked by uid 500); 11 Nov 2006 16:46:01 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 27769 invoked by uid 500); 11 Nov 2006 16:46:01 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 27722 invoked by uid 99); 11 Nov 2006 16:46:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Nov 2006 08:46:00 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Nov 2006 08:45:39 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id A8AC41A9856; Sat, 11 Nov 2006 08:45:10 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r473755 [5/43] - in /jackrabbit/trunk/contrib/jcr-browser: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/jackrabbit/ src/main/java/org/apache/jackrabbit/browser/ src/main/resources/ s... Date: Sat, 11 Nov 2006 16:44:48 -0000 To: commits@jackrabbit.apache.org From: edgarpoce@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061111164510.A8AC41A9856@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/a11y.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/a11y.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/a11y.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/a11y.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,93 @@ +dojo.provide("dojo.a11y"); + +dojo.require("dojo.uri.*"); +dojo.require("dojo.html.common"); + +dojo.a11y = { + // imgPath: String path to the test image for determining if images are displayed or not + // doAccessibleCheck: Boolean if true will perform check for need to create accessible widgets + // accessible: Boolean uninitialized when null (accessible check has not been performed) + // if true generate accessible widgets + imgPath:dojo.uri.dojoUri("src/widget/templates/images"), + doAccessibleCheck: true, + accessible: null, + + checkAccessible: function(){ + // summary: + // perform check for accessibility if accessibility checking is turned + // on and the accessibility test has not been performed yet + if(this.accessible === null){ + this.accessible = false; //default + if(this.doAccessibleCheck == true){ + this.accessible = this.testAccessible(); + } + } + return this.accessible; /* Boolean */ + }, + + testAccessible: function(){ + // summary: + // Always perform the accessibility check to determine if high + // contrast mode is on or display of images are turned off. Currently only checks + // in IE and Mozilla. + this.accessible = false; //default + if (dojo.render.html.ie || dojo.render.html.mozilla){ + var div = document.createElement("div"); + //div.style.color="rgb(153,204,204)"; + div.style.backgroundImage = "url(\"" + this.imgPath + "/tab_close.gif\")"; + // must add to hierarchy before can view currentStyle below + dojo.body().appendChild(div); + // in FF and IE the value for the current background style of the added div + // will be "none" in high contrast mode + // in FF the return value will be url(invalid-url:) when running over http + var bkImg = null; + if (window.getComputedStyle ) { + var cStyle = getComputedStyle(div, ""); + bkImg = cStyle.getPropertyValue("background-image"); + }else{ + bkImg = div.currentStyle.backgroundImage; + } + var bUseImgElem = false; + if (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" )) { + this.accessible = true; + } + /* + if(this.accessible == false && document.images){ + // test if images are off in IE + var testImg = new Image(); + if(testImg.fileSize) { + testImg.src = this.imgPath + "/tab_close.gif"; + if(testImg.fileSize < 0){ + this.accessible = true; + } + } + }*/ + dojo.body().removeChild(div); + } + return this.accessible; /* Boolean */ + }, + + setCheckAccessible: function(/* Boolean */ bTest){ + // summary: + // Set whether or not to check for accessibility mode. Default value + // of module is true - perform check for accessibility modes. + // bTest: Boolean - true to check; false to turn off checking + this.doAccessibleCheck = bTest; + }, + + setAccessibleMode: function(){ + // summary: + // perform the accessibility check and sets the correct mode to load + // a11y widgets. Only runs if test for accessiiblity has not been performed yet. + // Call testAccessible() to force the test. + if (this.accessible === null){ + if (this.checkAccessible()){ + dojo.render.html.prefixes.unshift("a11y"); + } + } + return this.accessible; /* Boolean */ + } +}; + +//dojo.hostenv.modulesLoadedListeners.unshift(function() { dojo.a11y.setAccessibleMode(); }); +//dojo.event.connect("before", dojo.hostenv, "makeWidgets", dojo.a11y, "setAccessibleMode"); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/a11y.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,4 @@ +dojo.provide("dojo.animation"); +dojo.require("dojo.animation.Animation"); + +dojo.deprecated("dojo.animation is slated for removal in 0.5; use dojo.lfx instead.", "0.5"); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Animation.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Animation.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Animation.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Animation.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,235 @@ +dojo.provide("dojo.animation.Animation"); +dojo.require("dojo.animation.AnimationEvent"); + +dojo.require("dojo.lang.func"); +dojo.require("dojo.math"); +dojo.require("dojo.math.curves"); + +dojo.deprecated("dojo.animation.Animation is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5"); + +/* +Animation package based off of Dan Pupius' work on Animations: +http://pupius.co.uk/js/Toolkit.Drawing.js +*/ + +dojo.animation.Animation = function(/*dojo.math.curves.* */ curve, /*int*/ duration, /*Decimal?*/ accel, /*int?*/ repeatCount, /*int?*/ rate) { + // summary: Animation object iterates a set of numbers over a curve for a given amount of time, calling 'onAnimate' at each step. + // curve: Curve to animate over. + // duration: Duration of the animation, in milliseconds. + // accel: Either an integer or curve representing amount of acceleration. (?) Default is linear acceleration. + // repeatCount: Number of times to repeat the animation. Default is 0. + // rate: Time between animation steps, in milliseconds. Default is 25. + // description: Calls the following events: "onBegin", "onAnimate", "onEnd", "onPlay", "onPause", "onStop" + // If the animation implements a "handler" function, that will be called before each event is called. + + if(dojo.lang.isArray(curve)) { + // curve: Array + // id: i + curve = new dojo.math.curves.Line(curve[0], curve[1]); + } + this.curve = curve; + this.duration = duration; + this.repeatCount = repeatCount || 0; + this.rate = rate || 25; + if(accel) { + // accel: Decimal + // id: j + if(dojo.lang.isFunction(accel.getValue)) { + // accel: dojo.math.curves.CatmullRom + // id: k + this.accel = accel; + } else { + var i = 0.35*accel+0.5; // 0.15 <= i <= 0.85 + this.accel = new dojo.math.curves.CatmullRom([[0], [i], [1]], 0.45); + } + } +} + +dojo.lang.extend(dojo.animation.Animation, { + // public properties + curve: null, + duration: 0, + repeatCount: 0, + accel: null, + + // events + onBegin: null, + onAnimate: null, + onEnd: null, + onPlay: null, + onPause: null, + onStop: null, + handler: null, + + // "private" properties + _animSequence: null, + _startTime: null, + _endTime: null, + _lastFrame: null, + _timer: null, + _percent: 0, + _active: false, + _paused: false, + _startRepeatCount: 0, + + // public methods + play: function(/*Boolean?*/ gotoStart) { + // summary: Play the animation. + // goToStart: If true, will restart the animation from the beginning. + // Otherwise, starts from current play counter. + // description: Sends an "onPlay" event to any observers. + // Also sends an "onBegin" event if starting from the beginning. + if( gotoStart ) { + clearTimeout(this._timer); + this._active = false; + this._paused = false; + this._percent = 0; + } else if( this._active && !this._paused ) { + return; + } + + this._startTime = new Date().valueOf(); + if( this._paused ) { + this._startTime -= (this.duration * this._percent / 100); + } + this._endTime = this._startTime + this.duration; + this._lastFrame = this._startTime; + + var e = new dojo.animation.AnimationEvent(this, null, this.curve.getValue(this._percent), + this._startTime, this._startTime, this._endTime, this.duration, this._percent, 0); + + this._active = true; + this._paused = false; + + if( this._percent == 0 ) { + if(!this._startRepeatCount) { + this._startRepeatCount = this.repeatCount; + } + e.type = "begin"; + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onBegin == "function") { this.onBegin(e); } + } + + e.type = "play"; + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onPlay == "function") { this.onPlay(e); } + + if(this._animSequence) { this._animSequence._setCurrent(this); } + + this._cycle(); + }, + + pause: function() { + // summary: Temporarily stop the animation, leaving the play counter at the current location. + // Resume later with sequence.play() + // description: Sends an "onPause" AnimationEvent to any observers. + clearTimeout(this._timer); + if( !this._active ) { return; } + this._paused = true; + var e = new dojo.animation.AnimationEvent(this, "pause", this.curve.getValue(this._percent), + this._startTime, new Date().valueOf(), this._endTime, this.duration, this._percent, 0); + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onPause == "function") { this.onPause(e); } + }, + + playPause: function() { + // summary: Toggle between play and paused states. + if( !this._active || this._paused ) { + this.play(); + } else { + this.pause(); + } + }, + + gotoPercent: function(/*int*/ pct, /*Boolean*/ andPlay) { + // summary: Set the play counter at a certain point in the animation. + // pct: Point to set the play counter to, expressed as a percentage (0 to 100). + // andPlay: If true, will start the animation at the counter automatically. + clearTimeout(this._timer); + this._active = true; + this._paused = true; + this._percent = pct; + if( andPlay ) { this.play(); } + }, + + stop: function(/*Boolean?*/ gotoEnd) { + // summary: Stop the animation. + // gotoEnd: If true, will advance play counter to the end before sending the event. + // description: Sends an "onStop" AnimationEvent to any observers. + clearTimeout(this._timer); + var step = this._percent / 100; + if( gotoEnd ) { + step = 1; + } + var e = new dojo.animation.AnimationEvent(this, "stop", this.curve.getValue(step), + this._startTime, new Date().valueOf(), this._endTime, this.duration, this._percent); + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onStop == "function") { this.onStop(e); } + this._active = false; + this._paused = false; + }, + + status: function() { + // summary: Return the status of the animation. + // description: Returns one of "playing", "paused" or "stopped". + if( this._active ) { + return this._paused ? "paused" : "playing"; /* String */ + } else { + return "stopped"; /* String */ + } + }, + + // "private" methods + _cycle: function() { + // summary: Perform once 'cycle' or step of the animation. + clearTimeout(this._timer); + if( this._active ) { + var curr = new Date().valueOf(); + var step = (curr - this._startTime) / (this._endTime - this._startTime); + var fps = 1000 / (curr - this._lastFrame); + this._lastFrame = curr; + + if( step >= 1 ) { + step = 1; + this._percent = 100; + } else { + this._percent = step * 100; + } + + // Perform accelleration + if(this.accel && this.accel.getValue) { + step = this.accel.getValue(step); + } + + var e = new dojo.animation.AnimationEvent(this, "animate", this.curve.getValue(step), + this._startTime, curr, this._endTime, this.duration, this._percent, Math.round(fps)); + + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onAnimate == "function") { this.onAnimate(e); } + + if( step < 1 ) { + this._timer = setTimeout(dojo.lang.hitch(this, "_cycle"), this.rate); + } else { + e.type = "end"; + this._active = false; + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onEnd == "function") { this.onEnd(e); } + + if( this.repeatCount > 0 ) { + this.repeatCount--; + this.play(true); + } else if( this.repeatCount == -1 ) { + this.play(true); + } else { + if(this._startRepeatCount) { + this.repeatCount = this._startRepeatCount; + this._startRepeatCount = 0; + } + if( this._animSequence ) { + this._animSequence._playNext(); + } + } + } + } + } +}); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Animation.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationEvent.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationEvent.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationEvent.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationEvent.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,54 @@ +dojo.provide("dojo.animation.AnimationEvent"); +dojo.require("dojo.lang.common"); + +dojo.deprecated("dojo.animation.AnimationEvent is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5"); + +dojo.animation.AnimationEvent = function( + /*dojo.animation.Animation*/ animation, + /*String*/type, + /*int[] */ coords, + /*int*/ startTime, + /*int*/ currentTime, + /*int*/ endTime, + /*int*/ duration, + /*int*/ percent, + /*int?*/ fps) { + // summary: Event sent at various points during an Animation. + // animation: Animation throwing the event. + // type: One of: "animate", "begin", "end", "play", "pause" or "stop". + // coords: Current coordinates of the animation. + // startTime: Time the animation was started, as milliseconds. + // currentTime: Time the event was thrown, as milliseconds. + // endTime: Time the animation is expected to complete, as milliseconds. + // duration: Duration of the animation, in milliseconds. + // percent: Percent of the animation that has completed, between 0 and 100. + // fps: Frames currently shown per second. (Only sent for "animate" event). + // description: The AnimationEvent has public properties of the same name as + // all constructor arguments, plus "x", "y" and "z". + + this.type = type; // "animate", "begin", "end", "play", "pause", "stop" + this.animation = animation; + + this.coords = coords; + this.x = coords[0]; + this.y = coords[1]; + this.z = coords[2]; + + this.startTime = startTime; + this.currentTime = currentTime; + this.endTime = endTime; + + this.duration = duration; + this.percent = percent; + this.fps = fps; +}; +dojo.extend(dojo.animation.AnimationEvent, { + coordsAsInts: function() { + // summary: Coerce the coordinates into integers. + var cints = new Array(this.coords.length); + for(var i = 0; i < this.coords.length; i++) { + cints[i] = Math.round(this.coords[i]); + } + return cints; + } +}); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationEvent.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationSequence.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationSequence.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationSequence.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationSequence.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,152 @@ +dojo.provide("dojo.animation.AnimationSequence"); +dojo.require("dojo.animation.AnimationEvent"); +dojo.require("dojo.animation.Animation"); + +dojo.deprecated("dojo.animation.AnimationSequence is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5"); + +dojo.animation.AnimationSequence = function(/*int?*/ repeatCount){ + // summary: Sequence of Animations, played one after the other. + // repeatCount: Number of times to repeat the entire sequence. Default is 0 (play once only). + // description: Calls the following events: "onBegin", "onEnd", "onNext" + // If the animation implements a "handler" function, that will be called before each event is called. + this._anims = []; + this.repeatCount = repeatCount || 0; +} + +dojo.lang.extend(dojo.animation.AnimationSequence, { + repeatCount: 0, + + _anims: [], + _currAnim: -1, + + onBegin: null, + onEnd: null, + onNext: null, + handler: null, + + add: function() { + // summary: Add one or more Animations to the sequence. + // description: args: Animations (dojo.animation.Animation) to add to the sequence. + for(var i = 0; i < arguments.length; i++) { + this._anims.push(arguments[i]); + arguments[i]._animSequence = this; + } + }, + + remove: function(/*dojo.animation.Animation*/ anim) { + // summary: Remove one particular animation from the sequence. + // amim: Animation to remove. + for(var i = 0; i < this._anims.length; i++) { + if( this._anims[i] == anim ) { + this._anims[i]._animSequence = null; + this._anims.splice(i, 1); + break; + } + } + }, + + removeAll: function() { + // summary: Remove all animations from the sequence. + for(var i = 0; i < this._anims.length; i++) { + this._anims[i]._animSequence = null; + } + this._anims = []; + this._currAnim = -1; + }, + + clear: function() { + // summary: Remove all animations from the sequence. + this.removeAll(); + }, + + play: function(/*Boolean?*/ gotoStart) { + // summary: Play the animation sequence. + // gotoStart: If true, will start at the beginning of the first sequence. + // Otherwise, starts at the current play counter of the current animation. + // description: Sends an "onBegin" event to any observers. + if( this._anims.length == 0 ) { return; } + if( gotoStart || !this._anims[this._currAnim] ) { + this._currAnim = 0; + } + if( this._anims[this._currAnim] ) { + if( this._currAnim == 0 ) { + var e = {type: "begin", animation: this._anims[this._currAnim]}; + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onBegin == "function") { this.onBegin(e); } + } + this._anims[this._currAnim].play(gotoStart); + } + }, + + pause: function() { + // summary: temporarily stop the current animation. Resume later with sequence.play() + if( this._anims[this._currAnim] ) { + this._anims[this._currAnim].pause(); + } + }, + + playPause: function() { + // summary: Toggle between play and paused states. + if( this._anims.length == 0 ) { return; } + if( this._currAnim == -1 ) { this._currAnim = 0; } + if( this._anims[this._currAnim] ) { + this._anims[this._currAnim].playPause(); + } + }, + + stop: function() { + // summary: Stop the current animation. + if( this._anims[this._currAnim] ) { + this._anims[this._currAnim].stop(); + } + }, + + status: function() { + // summary: Return the status of the current animation. + // description: Returns one of "playing", "paused" or "stopped". + if( this._anims[this._currAnim] ) { + return this._anims[this._currAnim].status(); + } else { + return "stopped"; + } + }, + + _setCurrent: function(/*dojo.animation.Animation*/ anim) { + // summary: Set the current animation. + // anim: Animation to make current, must have already been added to the sequence. + for(var i = 0; i < this._anims.length; i++) { + if( this._anims[i] == anim ) { + this._currAnim = i; + break; + } + } + }, + + _playNext: function() { + // summary: Play the next animation in the sequence. + // description: Sends an "onNext" event to any observers. + // Also sends "onEnd" if the last animation is finished. + if( this._currAnim == -1 || this._anims.length == 0 ) { return; } + this._currAnim++; + if( this._anims[this._currAnim] ) { + var e = {type: "next", animation: this._anims[this._currAnim]}; + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onNext == "function") { this.onNext(e); } + this._anims[this._currAnim].play(true); + } else { + var e = {type: "end", animation: this._anims[this._anims.length-1]}; + if(typeof this.handler == "function") { this.handler(e); } + if(typeof this.onEnd == "function") { this.onEnd(e); } + if(this.repeatCount > 0) { + this._currAnim = 0; + this.repeatCount--; + this._anims[this._currAnim].play(true); + } else if(this.repeatCount == -1) { + this._currAnim = 0; + this._anims[this._currAnim].play(true); + } else { + this._currAnim = -1; + } + } + } +}); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/AnimationSequence.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Timer.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Timer.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Timer.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Timer.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,6 @@ +dojo.provide("dojo.animation.Timer"); +dojo.require("dojo.lang.timing.Timer"); + +dojo.deprecated("dojo.animation.Timer is now dojo.lang.timing.Timer", "0.5"); + +dojo.animation.Timer = dojo.lang.timing.Timer; Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/Timer.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/__package__.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/__package__.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/__package__.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/__package__.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,10 @@ +dojo.kwCompoundRequire({ + common: [ + "dojo.animation.AnimationEvent", + "dojo.animation.Animation", + "dojo.animation.AnimationSequence" + ] +}); +dojo.provide("dojo.animation.*"); + +dojo.deprecated("dojo.Animation.* is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5"); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/animation/__package__.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/behavior.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/behavior.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/behavior.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/behavior.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,238 @@ +dojo.provide("dojo.behavior"); +dojo.require("dojo.event.*"); + +dojo.require("dojo.experimental"); +dojo.experimental("dojo.behavior"); + +dojo.behavior = new function(){ + function arrIn(obj, name){ + if(!obj[name]){ obj[name] = []; } + return obj[name]; + } + + function forIn(obj, scope, func){ + var tmpObj = {}; + for(var x in obj){ + if(typeof tmpObj[x] == "undefined"){ + if(!func){ + scope(obj[x], x); + }else{ + func.call(scope, obj[x], x); + } + } + } + } + + // FIXME: need a better test so we don't exclude nightly Safari's! + this.behaviors = {}; + this.add = function(behaviorObj){ + /* behavior objects are specified in the following format: + * + * { + * "#id": { + * "found": function(element){ + * // ... + * }, + * + * "onblah": {targetObj: foo, targetFunc: "bar"}, + * + * "onblarg": "/foo/bar/baz/blarg", + * + * "onevent": function(evt){ + * }, + * + * "onotherevent: function(evt){ + * // ... + * } + * }, + * + * "#id2": { + * // ... + * }, + * + * "#id3": function(element){ + * // ... + * }, + * + * // publish the match on a topic + * "#id4": "/found/topic/name", + * + * // match all direct descendants + * "#id4 > *": function(element){ + * // ... + * }, + * + * // match the first child node that's an element + * "#id4 > @firstElement": { ... }, + * + * // match the last child node that's an element + * "#id4 > @lastElement": { ... }, + * + * // all elements of type tagname + * "tagname": { + * // ... + * }, + * + * // maps to roughly: + * // dojo.lang.forEach(body.getElementsByTagName("tagname1"), function(node){ + * // dojo.lang.forEach(node.getElementsByTagName("tagname2"), function(node2){ + * // dojo.lang.forEach(node2.getElementsByTagName("tagname3", function(node3){ + * // // apply rules + * // }); + * // }); + * // }); + * "tagname1 tagname2 tagname3": { + * // ... + * }, + * + * ".classname": { + * // ... + * }, + * + * "tagname.classname": { + * // ... + * }, + * } + * + * The "found" method is a generalized handler that's called as soon + * as the node matches the selector. Rules for values that follow also + * apply to the "found" key. + * + * The "on*" handlers are attached with dojo.event.connect(). If the + * value is not a function but is rather an object, it's assumed to be + * the "other half" of a dojo.event.kwConnect() argument object. It + * may contain any/all properties of such a connection modifier save + * for the sourceObj and sourceFunc properties which are filled in by + * the system automatically. If a string is instead encountered, the + * node publishes the specified event on the topic contained in the + * string value. + * + * If the value corresponding to the ID key is a function and not a + * list, it's treated as though it was the value of "found". + * + */ + + var tmpObj = {}; + forIn(behaviorObj, this, function(behavior, name){ + var tBehavior = arrIn(this.behaviors, name); + if((dojo.lang.isString(behavior))||(dojo.lang.isFunction(behavior))){ + behavior = { found: behavior }; + } + forIn(behavior, function(rule, ruleName){ + arrIn(tBehavior, ruleName).push(rule); + }); + }); + } + + this.apply = function(){ + dojo.profile.start("dojo.behavior.apply"); + var r = dojo.render.html; + // note, we apply one way for fast queries and one way for slow + // iteration. So be it. + var safariGoodEnough = (!r.safari); + if(r.safari){ + // Anything over release #420 should work the fast way + var uas = r.UA.split("AppleWebKit/")[1]; + if(parseInt(uas.match(/[0-9.]{3,}/)) >= 420){ + safariGoodEnough = true; + } + } + if((dj_undef("behaviorFastParse", djConfig) ? (safariGoodEnough) : djConfig["behaviorFastParse"])){ + this.applyFast(); + }else{ + this.applySlow(); + } + dojo.profile.end("dojo.behavior.apply"); + } + + this.matchCache = {}; + + this.elementsById = function(id, handleRemoved){ + var removed = []; + var added = []; + arrIn(this.matchCache, id); + if(handleRemoved){ + var nodes = this.matchCache[id]; + for(var x=0; x"); + } catch (e) { + var script = document.createElement("script"); + script.src = spath; + document.getElementsByTagName("head")[0].appendChild(script); + } + } + } +})(); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/bootstrap2.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/browser_debug.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/browser_debug.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/browser_debug.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/browser_debug.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,166 @@ +dojo.hostenv.loadedUris.push("../src/bootstrap1.js"); +dojo.hostenv.loadedUris.push("../src/loader.js"); +dojo.hostenv.loadedUris.push("../src/hostenv_browser.js"); +dojo.hostenv.loadedUris.push("../src/bootstrap2.js"); +dojo.hostenv._loadedUrisListStart = dojo.hostenv.loadedUris.length; + +function removeComments(contents){ + contents = new String((!contents) ? "" : contents); + // clobber all comments + // FIXME broken if // or /* inside quotes or regexp + contents = contents.replace( /^(.*?)\/\/(.*)$/mg , "$1"); + contents = contents.replace( /(\n)/mg , "__DOJONEWLINE"); + contents = contents.replace( /\/\*(.*?)\*\//g , ""); + return contents.replace( /__DOJONEWLINE/mg , "\n"); +} + +dojo.hostenv.getRequiresAndProvides = function(contents){ + // FIXME: should probably memoize this! + if(!contents){ return []; } + + + // check to see if we need to load anything else first. Ugg. + var deps = []; + var tmp; + RegExp.lastIndex = 0; + var testExp = /dojo.(hostenv.loadModule|hostenv.require|require|requireIf|kwCompoundRequire|hostenv.conditionalLoadModule|hostenv.startPackage|provide)\([\w\W]*?\)/mg; + while((tmp = testExp.exec(contents)) != null){ + deps.push(tmp[0]); + } + return deps; +} + +dojo.hostenv.getDelayRequiresAndProvides = function(contents){ + // FIXME: should probably memoize this! + if(!contents){ return []; } + + // check to see if we need to load anything else first. Ugg. + var deps = []; + var tmp; + RegExp.lastIndex = 0; + var testExp = /dojo.(requireAfterIf)\([\w\W]*?\)/mg; + while((tmp = testExp.exec(contents)) != null){ + deps.push(tmp[0]); + } + return deps; +} + +/* +dojo.getNonExistantDescendants = function(objpath){ + var ret = []; + // fast path for no periods + if(typeof objpath != "string"){ return dj_global; } + if(objpath.indexOf('.') == -1){ + if(dj_undef(objpath, dj_global)){ + ret.push[objpath]; + } + return ret; + } + + var syms = objpath.split(/\./); + var obj = dj_global; + for(var i=0;i=0; x--){ + dojo.clobberLastObject(removals[x]); + } + var depList = []; + var seen = dojo.hostenv._writtenIncludes; + for(var x=0; x"); + } + document.write(""); + dojo.hostenv._loadedUrisListStart = 0; + if (!willCallAgain) { + // turn off debugAtAllCosts, so that dojo.require() calls inside of ContentPane hrefs + // work correctly + dj_eval = old_dj_eval; + dojo.hostenv.loadUri = dojo.hostenv.oldLoadUri; + } +} Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/browser_debug.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/cal/iCalendar.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/cal/iCalendar.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/cal/iCalendar.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/cal/iCalendar.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,805 @@ +dojo.provide("dojo.cal.iCalendar"); +dojo.require("dojo.lang.common"); +dojo.require("dojo.text.textDirectory"); +dojo.require("dojo.date.common"); +dojo.require("dojo.date.serialize"); + + +dojo.cal.iCalendar.fromText = function (/* string */text) { + // summary + // Parse text of an iCalendar and return an array of iCalendar objects + + var properties = dojo.cal.textDirectory.tokenise(text); + var calendars = []; + + //dojo.debug("Parsing iCal String"); + for (var i = 0, begun = false; i < properties.length; i++) { + var prop = properties[i]; + if (!begun) { + if (prop.name == 'BEGIN' && prop.value == 'VCALENDAR') { + begun = true; + var calbody = []; + } + } else if (prop.name == 'END' && prop.value == 'VCALENDAR') { + calendars.push(new dojo.cal.iCalendar.VCalendar(calbody)); + begun = false; + } else { + calbody.push(prop); + } + } + return /* array */calendars; +} + + +dojo.cal.iCalendar.Component = function (/* string */ body ) { + // summary + // A component is the basic container of all this stuff. + + if (!this.name) { + this.name = "COMPONENT" + } + + this.properties = []; + this.components = []; + + if (body) { + for (var i = 0, context = ''; i < body.length; i++) { + if (context == '') { + if (body[i].name == 'BEGIN') { + context = body[i].value; + var childprops = []; + } else { + this.addProperty(new dojo.cal.iCalendar.Property(body[i])); + } + } else if (body[i].name == 'END' && body[i].value == context) { + if (context=="VEVENT") { + this.addComponent(new dojo.cal.iCalendar.VEvent(childprops)); + } else if (context=="VTIMEZONE") { + this.addComponent(new dojo.cal.iCalendar.VTimeZone(childprops)); + } else if (context=="VTODO") { + this.addComponent(new dojo.cal.iCalendar.VTodo(childprops)); + } else if (context=="VJOURNAL") { + this.addComponent(new dojo.cal.iCalendar.VJournal(childprops)); + } else if (context=="VFREEBUSY") { + this.addComponent(new dojo.cal.iCalendar.VFreeBusy(childprops)); + } else if (context=="STANDARD") { + this.addComponent(new dojo.cal.iCalendar.Standard(childprops)); + } else if (context=="DAYLIGHT") { + this.addComponent(new dojo.cal.iCalendar.Daylight(childprops)); + } else if (context=="VALARM") { + this.addComponent(new dojo.cal.iCalendar.VAlarm(childprops)); + }else { + dojo.unimplemented("dojo.cal.iCalendar." + context); + } + context = ''; + } else { + childprops.push(body[i]); + } + } + + if (this._ValidProperties) { + this.postCreate(); + } + } +} + +dojo.extend(dojo.cal.iCalendar.Component, { + + addProperty: function (prop) { + // summary + // push a new property onto a component. + this.properties.push(prop); + this[prop.name.toLowerCase()] = prop; + }, + + addComponent: function (prop) { + // summary + // add a component to this components list of children. + this.components.push(prop); + }, + + postCreate: function() { + for (var x=0; x 0) { + return events; + } + + return null; + } +}); + +/* + * STANDARD + */ + +var StandardProperties = [ + _P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true), + _P("comment"), _P("rdate"), _P("rrule"), _P("tzname") +]; + + +dojo.cal.iCalendar.Standard = function (/* string */ body) { + // summary + // STANDARD Component + + this.name = "STANDARD"; + this._ValidProperties = StandardProperties; + dojo.cal.iCalendar.Component.call(this, body); +} + +dojo.inherits(dojo.cal.iCalendar.Standard, dojo.cal.iCalendar.Component); + +/* + * DAYLIGHT + */ + +var DaylightProperties = [ + _P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true), + _P("comment"), _P("rdate"), _P("rrule"), _P("tzname") +]; + +dojo.cal.iCalendar.Daylight = function (/* string */ body) { + // summary + // Daylight Component + this.name = "DAYLIGHT"; + this._ValidProperties = DaylightProperties; + dojo.cal.iCalendar.Component.call(this, body); +} + +dojo.inherits(dojo.cal.iCalendar.Daylight, dojo.cal.iCalendar.Component); + +/* + * VEVENT + */ + +var VEventProperties = [ + // these can occur once only + _P("class", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1), + _P("geo", 1), _P("last-mod", 1), _P("location", 1), _P("organizer", 1), + _P("priority", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1), + _P("summary", 1), _P("transp", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1), + // these two are exclusive + [_P("dtend", 1), _P("duration", 1)], + // these can occur many times over + _P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"), + _P("exdate"), _P("exrule"), _P("rstatus"), _P("related"), _P("resources"), + _P("rdate"), _P("rrule") +]; + +dojo.cal.iCalendar.VEvent = function (/* string */ body) { + // summary + // VEVENT Component + this._ValidProperties = VEventProperties; + this.name = "VEVENT"; + dojo.cal.iCalendar.Component.call(this, body); + this.recurring = false; + this.startDate = dojo.date.fromIso8601(this.dtstart.value); +} + +dojo.inherits(dojo.cal.iCalendar.VEvent, dojo.cal.iCalendar.Component); + +dojo.extend(dojo.cal.iCalendar.VEvent, { + getDates: function(until) { + var dtstart = this.getDate(); + + var recurranceSet = []; + var weekdays=["su","mo","tu","we","th","fr","sa"]; + var order = { + "daily": 1, "weekly": 2, "monthly": 3, "yearly": 4, + "byday": 1, "bymonthday": 1, "byweekno": 2, "bymonth": 3, "byyearday": 4}; + + // expand rrules into the recurrance + for (var x=0; x interval) { + interval = rrule.interval; + } + + var set = []; + var freqInt = order[freq]; + + if (rrule.until) { + var tmpUntil = dojo.date.fromIso8601(rrule.until); + } else { + var tmpUntil = until + } + + if (tmpUntil > until) { + tmpUntil = until + } + + + if (dtstart 1) { + var regex = "([+-]?)([0-9]{1,3})"; + for (var z=1; x 0) { + var regex = "([+-]?)([0-9]{1,3})"; + for (var z=0; z 0) { + var regex = "([+-]?)([0-9]{0,1}?)([A-Za-z]{1,2})"; + for (var z=0; z 0) { + var arr = this.name.split('.'); + this.group = arr[0]; + this.name = arr[1]; + } + + // don't do any parsing, leave to implementation + this.value = right; +} + + +// tokeniser, parses into an array of properties. +dojo.cal.textDirectory.tokenise = function (text) { + // normlize to one propterty per line and parse + var nText = dojo.string.normalizeNewlines(text,"\n"); + nText = nText.replace(/\n[ \t]/g, ''); + nText = nText.replace(/\x00/g, ''); + + var lines = nText.split("\n"); + var properties = [] + + for (var i = 0; i < lines.length; i++) { + if (dojo.string.trim(lines[i]) == '') { continue; } + var prop = new dojo.cal.textDirectory.Property(lines[i]); + properties.push(prop); + } + return properties; +} Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/cal/textDirectory.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Axis.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Axis.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Axis.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Axis.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,136 @@ +dojo.provide("dojo.charting.Axis"); +dojo.require("dojo.lang.common"); + +dojo.charting.Axis = function(/* string? */label, /* string? */scale, /* array? */labels){ + var id = "dojo-charting-axis-"+dojo.charting.Axis.count++; + this.getId=function(){ return id; }; + this.setId=function(key){ id = key; }; + this.scale = scale || "linear"; // linear || log + this.label = label || ""; + this.showLabel = true; // show axis label. + this.showLabels = true; // show interval ticks. + this.showLines = false; // if you want lines over the range of the plot area + this.showTicks = false; // if you want tick marks on the axis. + this.range = { upper : 0, lower : 0 }; // range of individual axis. + this.origin = "min"; // this can be any number, "min" or "max". min/max is translated on init. + + this.labels = labels || []; + this._labels = []; // what we really use to draw things. + this.nodes={ main: null, axis: null, label: null, labels: null, lines: null, ticks: null }; +}; +dojo.charting.Axis.count = 0; + +dojo.extend(dojo.charting.Axis, { + // TODO: implement log scaling. + getCoord: function( + /* float */val, + /* dojo.charting.PlotArea */plotArea, + /* dojo.charting.Plot */plot + ){ + // summary + // returns the coordinate of val based on this axis range, plot area and plot. + val = parseFloat(val, 10); + var area = plotArea.getArea(); + if(plot.axisX == this){ + var offset = 0 - this.range.lower; + var min = this.range.lower + offset; // FIXME: check this. + var max = this.range.upper + offset; + val += offset; + return (val*((area.right-area.left)/max))+area.left; // float + } else { + var max = this.range.upper; + var min = this.range.lower; + var offset = 0; + if(min<0){ + offset += Math.abs(min); + } + max += offset; min += offset; val += offset; + var pmin = area.bottom; + var pmax = area.top; + return (((pmin-pmax)/(max-min))*(max-val))+pmax; + } + }, + initializeOrigin: function(drawAgainst, plane){ + // figure out the origin value. + if(isNaN(this.origin)){ + if(this.origin.toLowerCase() == "max"){ + this.origin = drawAgainst.range[(plane=="y")?"upper":"lower"]; + } + else if (this.origin.toLowerCase() == "min"){ + this.origin = drawAgainst.range[(plane=="y")?"lower":"upper"]; + } + else { this.origin=0; } + } + }, + initializeLabels: function(){ + // Translate the labels if needed. + if(this.labels.length == 0){ + this.showLabels = false; + this.showLines = false; + this.showTicks = false; + } else { + if(this.labels[0].label && this.labels[0].value != null){ + for(var i=0; i0){ + var s=a.pop(); + this._labels.push({ label: s, value: this.range.upper }); + } + // do the rest. + if(a.length>0){ + var range = this.range.upper - this.range.lower; + var step = range / (this.labels.length-1); + for(var i=1; i<=a.length; i++){ + this._labels.push({ + label: a[i-1], + value: this.range.lower+(step*i) + }); + } + } + } + } + }, + initialize: function(plotArea, plot, drawAgainst, plane){ + // summary + // Initialize the passed axis descriptor. Note that this should always + // be the result of plotArea.getAxes, and not the axis directly! + this.destroy(); + this.initializeOrigin(drawAgainst, plane); + this.initializeLabels(); + var node = this.render(plotArea, plot, drawAgainst, plane); + return node; + }, + destroy: function(){ + for(var p in this.nodes){ + while(this.nodes[p] && this.nodes[p].childNodes.length > 0){ + this.nodes[p].removeChild(this.nodes[p].childNodes[0]); + } + if(this.nodes[p] && this.nodes[p].parentNode){ + this.nodes[p].parentNode.removeChild(this.nodes[p]); + } + this.nodes[p] = null; + } + } +}); + +dojo["requireIf"](dojo.render.svg.capable, "dojo.charting.svg.Axis"); +dojo["requireIf"](!dojo.render.svg.capable && dojo.render.vml.capable, "dojo.charting.vml.Axis"); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Axis.js ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Chart.js URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Chart.js?view=auto&rev=473755 ============================================================================== --- jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Chart.js (added) +++ jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Chart.js Sat Nov 11 08:44:22 2006 @@ -0,0 +1,75 @@ +dojo.provide("dojo.charting.Chart"); +dojo.require("dojo.lang.common"); +dojo.require("dojo.charting.PlotArea"); + +dojo.charting.Chart = function( + /* HTMLElement? */node, + /* string? */title, + /* string? */description +){ + // summary + // Create the basic Chart object. + this.node = node || null; + this.title = title || "Chart"; // pure string. + this.description = description || ""; // HTML is allowed. + this.plotAreas = []; +}; + +dojo.extend(dojo.charting.Chart, { + // methods + addPlotArea: function(/* object */obj, /* bool? */doRender){ + // summary + // Add a PlotArea to this chart; object should be in the + // form of: { plotArea, (x, y) or (top, left) } + if(obj.x && !obj.left){ obj.left = obj.x; } + if(obj.y && !obj.top){ obj.top = obj.y; } + this.plotAreas.push(obj); + if(doRender){ this.render(); } + }, + + // events + onInitialize:function(chart){ }, + onRender:function(chart){ }, + onDestroy:function(chart){ }, + + // standard build methods + initialize: function(){ + // summary + // Initialize the Chart by rendering it. + if(!this.node){ + dojo.raise("dojo.charting.Chart.initialize: there must be a root node defined for the Chart."); + } + this.destroy(); + this.render(); + this.onInitialize(this); + }, + render:function(){ + // summary + // Render the chart in its entirety. + if(this.node.style.position != "absolute"){ + this.node.style.position = "relative"; + } + for(var i=0; i 0){ + this.node.removeChild(this.node.childNodes[0]); + } + } +}); Propchange: jackrabbit/trunk/contrib/jcr-browser/src/main/webapp/dojo/src/charting/Chart.js ------------------------------------------------------------------------------ svn:eol-style = native