Skip to content
Browse files

Upgrade to Prototype 1.7 and Scripty 1.9.0

Update tests to check for both Prototype version and Scripty version
Integrate in TapX Gradle build
  • Loading branch information...
1 parent e130462 commit 46e1ca9d4a6463feb708e0d3074ca759690331dd @hlship committed
View
4 README.md
@@ -64,6 +64,10 @@ Bundles [Processing.js 0.9.7](http://processingjs.org/) as a component.
* Components:
* Processing
+tapx-prototype
+--------------
+
+Patches Tapestry to Script.aculo.us 1.9.0 and Prototype 1.7.
tapx-templating
---------------
View
3 settings.gradle
@@ -1 +1,2 @@
-include "tapx-core", "tapx-kaptcha", "tapx-datefield", "tapx-plainmessage", "tapx-templating", "tapx-yui", "tapx-processing"
+include "tapx-core", "tapx-kaptcha", "tapx-datefield", "tapx-plainmessage"
+include "tapx-prototype", "tapx-templating", "tapx-yui", "tapx-processing"
View
7 tapx-prototype/build.gradle
@@ -0,0 +1,7 @@
+description = "Patch Tapestry's Prototype to version 1.7 and Script.aculo.us 1.9.0"
+
+jar {
+ manifest {
+ attributes 'Tapestry-Module-Classes': 'com.howardlewisship.tapx.prototype.PrototypeModule'
+ }
+}
View
4 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/builder.js
@@ -1,6 +1,6 @@
-// script.aculo.us builder.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us builder.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
View
8 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/controls.js
@@ -1,8 +1,8 @@
-// script.aculo.us controls.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us controls.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
-// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
+// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// (c) 2005-2010 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
+// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
// Contributors:
// Richard Livsey
// Rahul Bhargava
View
15 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/dragdrop.js
@@ -1,7 +1,6 @@
-// script.aculo.us dragdrop.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us dragdrop.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
+// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
@@ -313,7 +312,7 @@ var Draggable = Class.create({
tag_name=='TEXTAREA')) return;
var pointer = [Event.pointerX(event), Event.pointerY(event)];
- var pos = Position.cumulativeOffset(this.element);
+ var pos = this.element.cumulativeOffset();
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
Draggables.activate(this);
@@ -375,7 +374,7 @@ var Draggable = Class.create({
if (this.options.scroll == window) {
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
} else {
- p = Position.page(this.options.scroll);
+ p = Position.page(this.options.scroll).toArray();
p[0] += this.options.scroll.scrollLeft + Position.deltaX;
p[1] += this.options.scroll.scrollTop + Position.deltaY;
p.push(p[0]+this.options.scroll.offsetWidth);
@@ -456,7 +455,7 @@ var Draggable = Class.create({
},
draw: function(point) {
- var pos = Position.cumulativeOffset(this.element);
+ var pos = this.element.cumulativeOffset();
if(this.options.ghosting) {
var r = Position.realOffset(this.element);
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
@@ -732,7 +731,7 @@ var Sortable = {
}
// keep reference
- this.sortables[element.id] = options;
+ this.sortables[element.identify()] = options;
// for onupdate
Draggables.addObserver(new SortableObserver(element, options.onUpdate));
@@ -827,7 +826,7 @@ var Sortable = {
hide().addClassName('dropmarker').setStyle({position:'absolute'});
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
}
- var offsets = Position.cumulativeOffset(dropon);
+ var offsets = dropon.cumulativeOffset();
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
if(position=='after')
View
21 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/effects.js
@@ -1,6 +1,6 @@
-// script.aculo.us effects.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us effects.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
// Justin Palmer (http://encytemedia.com/)
// Mark Pilgrim (http://diveintomark.org/)
@@ -147,14 +147,13 @@ var Effect = {
'blind': ['BlindDown','BlindUp'],
'appear': ['Appear','Fade']
},
- toggle: function(element, effect) {
+ toggle: function(element, effect, options) {
element = $(element);
- effect = (effect || 'appear').toLowerCase();
- var options = Object.extend({
+ effect = (effect || 'appear').toLowerCase();
+
+ return Effect[ Effect.PAIRS[ effect ][ element.visible() ? 1 : 0 ] ](element, Object.extend({
queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
- }, arguments[2] || { });
- Effect[element.visible() ?
- Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
+ }, options || {}));
}
};
@@ -230,12 +229,6 @@ Effect.Queue = Effect.Queues.get('global');
Effect.Base = Class.create({
position: null,
start: function(options) {
- function codeForEvent(options,eventName){
- return (
- (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
- (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
- );
- }
if (options && options.transition === false) options.transition = Effect.Transitions.linear;
this.options = Object.extend(Object.extend({ },Effect.DefaultOptions), options || { });
this.currentFrame = 0;
View
3,498 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/prototype.js
2,353 additions, 1,145 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
18 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/scriptaculous.js
@@ -1,6 +1,6 @@
-// script.aculo.us scriptaculous.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us scriptaculous.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -24,10 +24,18 @@
// For details, see the script.aculo.us web site: http://script.aculo.us/
var Scriptaculous = {
- Version: '1.8.2',
+ Version: '1.9.0',
require: function(libraryName) {
- // inserting via DOM fails in Safari 2.0, so brute force approach
- document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
+ try{
+ // inserting via DOM fails in Safari 2.0, so brute force approach
+ document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
+ } catch(e) {
+ // for xhtml+xml served content, fall back to DOM methods
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.src = libraryName;
+ document.getElementsByTagName('head')[0].appendChild(script);
+ }
},
REQUIRED_PROTOTYPE: '1.6.0.3',
load: function() {
View
12 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/slider.js
@@ -1,6 +1,6 @@
-// script.aculo.us slider.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us slider.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Marty Haught, Thomas Fuchs
+// Copyright (c) 2005-2010 Marty Haught, Thomas Fuchs
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
@@ -209,12 +209,12 @@ Control.Slider = Class.create({
var pointer = [Event.pointerX(event), Event.pointerY(event)];
var track = handle;
if (track==this.track) {
- var offsets = Position.cumulativeOffset(this.track);
+ var offsets = this.track.cumulativeOffset();
this.event = event;
this.setValue(this.translateToValue(
(this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
));
- var offsets = Position.cumulativeOffset(this.activeHandle);
+ var offsets = this.activeHandle.cumulativeOffset();
this.offsetX = (pointer[0] - offsets[0]);
this.offsetY = (pointer[1] - offsets[1]);
} else {
@@ -227,7 +227,7 @@ Control.Slider = Class.create({
this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
this.updateStyles();
- var offsets = Position.cumulativeOffset(this.activeHandle);
+ var offsets = this.activeHandle.cumulativeOffset();
this.offsetX = (pointer[0] - offsets[0]);
this.offsetY = (pointer[1] - offsets[1]);
}
@@ -246,7 +246,7 @@ Control.Slider = Class.create({
},
draw: function(event) {
var pointer = [Event.pointerX(event), Event.pointerY(event)];
- var offsets = Position.cumulativeOffset(this.track);
+ var offsets = this.track.cumulativeOffset();
pointer[0] -= this.offsetX + offsets[0];
pointer[1] -= this.offsetY + offsets[1];
this.event = event;
View
10 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/sound.js
@@ -1,6 +1,6 @@
-// script.aculo.us sound.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us sound.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// Based on code created by Jules Gravinese (http://www.webveteran.com/)
//
@@ -50,6 +50,10 @@ Sound = {
if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>');
+ else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('Windows Media') != -1 }))
+ Sound.template = new Template('<object id="sound_#{track}_#{id}" type="application/x-mplayer2" data="#{url}"></object>');
+ else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('RealPlayer') != -1 }))
+ Sound.template = new Template('<embed type="audio/x-pn-realaudio-plugin" style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>');
else
Sound.play = function(){};
-}
+}
View
8 tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/unittest.js
@@ -1,8 +1,8 @@
-// script.aculo.us unittest.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+// script.aculo.us unittest.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
-// (c) 2005-2008 Michael Schuerig (http://www.schuerig.de/michael/)
+// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
+// (c) 2005-2010 Michael Schuerig (http://www.schuerig.de/michael/)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
View
11 tapx-prototype/src/test/conf/testng.xml
@@ -1,8 +1,9 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="tapx-prototype" annotations="1.5" verbose="2">
- <test name="Integration Tests">
- <packages>
- <package name="com.howardlewisship.tapx.prototype"/>
- </packages>
- </test>
+ <parameter name="tapestry.web-app-folder" value="src/test/webapp"/>
+ <test name="Integration Tests">
+ <packages>
+ <package name="com.howardlewisship.tapx.prototype"/>
+ </packages>
+ </test>
</suite>
View
17 tapx-prototype/src/test/java/com/howardlewisship/tapx/prototype/IntegrationTests.java
@@ -1,10 +1,10 @@
-// Copyright 2009 Howard M. Lewis Ship
+// Copyright 2009, 2011 Howard M. Lewis Ship
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,21 +14,18 @@
package com.howardlewisship.tapx.prototype;
-import org.apache.tapestry5.test.AbstractIntegrationTestSuite;
+import org.apache.tapestry5.test.SeleniumTestCase;
import org.testng.annotations.Test;
-public class IntegrationTests extends AbstractIntegrationTestSuite
+public class IntegrationTests extends SeleniumTestCase
{
- public IntegrationTests()
- {
- super("src/test/webapp");
- }
@Test
public void check_version()
{
open("/");
-
- assertText("id=protoversion", "1.6.1");
+
+ assertText("id=protoversion", "1.7");
+ assertText("id=scriptyversion", "1.9.0");
}
}
View
9 tapx-prototype/src/test/java/com/howardlewisship/tapx/prototype/pages/Index.java
@@ -1,10 +1,10 @@
-// Copyright 2009 Howard M. Lewis Ship
+// Copyright 2009, 2011 Howard M. Lewis Ship
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,16 +14,17 @@
package com.howardlewisship.tapx.prototype.pages;
-import org.apache.tapestry5.RenderSupport;
import org.apache.tapestry5.annotations.Environmental;
+import org.apache.tapestry5.services.javascript.JavaScriptSupport;
public class Index
{
@Environmental
- private RenderSupport support;
+ private JavaScriptSupport support;
void afterRender()
{
support.addScript("$('protoversion').update(Prototype.Version);");
+ support.addScript("$('scriptyversion').update(Scriptaculous.Version);");
}
}
View
5 tapx-prototype/src/test/resources/com/howardlewisship/tapx/prototype/pages/Index.tml
@@ -5,6 +5,9 @@
Prototype Version:
<span id="protoversion">Not Set</span>
</p>
-
+ <p style="font-size: x-large;">
+ Scriptaculous Version:
+ <span id="scriptyversion">Not Set</span>
+ </p>
</body>
</html>

0 comments on commit 46e1ca9

Please sign in to comment.
Something went wrong with that request. Please try again.