mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Mise jour de scriptaculous et de prototype
This commit is contained in:
@@ -1,8 +1,114 @@
|
|||||||
*V1.6.4*
|
*V1.7.0* (January 19, 2007)
|
||||||
|
|
||||||
|
* Cleanups for Effect.Morph
|
||||||
|
|
||||||
|
* Monkeypatch Prototype 1.5.0 to incorporate [6002], fixes setStyle({opacity:0}) for IE
|
||||||
|
|
||||||
|
* Fix Effect.inspect() for Prototype 1.5.0 final hash changes
|
||||||
|
|
||||||
|
* Update to Prototype 1.5.0 final
|
||||||
|
|
||||||
|
* New option keepBackgroundImage: true for Effect.Highlight, fixes #5037 [docwhat, tomg]
|
||||||
|
|
||||||
|
* Minor tweaks for issues with application/xhtml+xml documents on Firefox, fixes #6836 [sjinks]
|
||||||
|
|
||||||
|
* Fix a possible exception with Sortables, fixes #6828 [craiggwilson]
|
||||||
|
|
||||||
|
* Update to Prototype 1.5.0_rc2 revision [5844] (as of Rails 1.2 RC 2)
|
||||||
|
|
||||||
|
*V1.7.0 beta 2* (December 18, 2006)
|
||||||
|
|
||||||
|
* Change the default setting for effects to support up to 60fps, if renderable by the browser. Add performance info to effects unit test.
|
||||||
|
|
||||||
|
* Change get/setOpacity to use Prototype's new support for cross-browser opacity.
|
||||||
|
|
||||||
|
* Update to Prototype 1.5.0_rc2 revision [5741], which fixes some of the reported issues with beta 1 (see Prototype's CHANGELOG for more):
|
||||||
|
* Opera 9, while not officially supported, should work now with Prototype and script.aculo.us
|
||||||
|
* Fixes issue with Safari when using Prototype's Ajax helpers with HTTP authorization
|
||||||
|
|
||||||
|
* Add hash and CSS className support to Effect.Morph, fixes #6674 [Tobie]
|
||||||
|
Examples:
|
||||||
|
$(element).morph('myClass')
|
||||||
|
// will morph to all the properties specified
|
||||||
|
// in .className (in your external stylesheet).
|
||||||
|
// All properties which cannot be morphed (such as font-style)
|
||||||
|
// will be applied AfterFinish
|
||||||
|
$(element).morph('font-size: 10px') // or
|
||||||
|
$(element).morph({fontSize: '10px'}) // will morph the font-size to 10px
|
||||||
|
|
||||||
|
*V1.7.0 beta 1* (November 21, 2006)
|
||||||
|
|
||||||
|
* Add Element.morph() and Element.Methods.morph() as a shortcut to Effect.Morph
|
||||||
|
Example:
|
||||||
|
// basic Effect.Morph
|
||||||
|
$('error_message').morph('color:#f00;font-size:17px');
|
||||||
|
// fade out after a while
|
||||||
|
$('error_message').show().morph('font-size:17px').morph('opacity:0',{delay:4});
|
||||||
|
|
||||||
|
* Update to Prototype 1.5.0_rc2 revision [5580]
|
||||||
|
|
||||||
|
* Add a paramName option to the inplace editor for overriding the default parameter name of "value"
|
||||||
|
|
||||||
|
* Add Effect.Transform that generates parallel executing Effect.Morph sets
|
||||||
|
Example:
|
||||||
|
// set up transformation
|
||||||
|
var transformation = new Effect.Transform([
|
||||||
|
{ 'div.morphing': 'font-size:20px;padding-left:40em' },
|
||||||
|
{ 'blah' : 'width:480px;border-width:10px;border-right-width:20px;margin:200px;margin-bottom:-20px;font-size:30px' }
|
||||||
|
],{ duration: 0.5 });
|
||||||
|
// play transformation (can be called more than once)
|
||||||
|
transformation.play();
|
||||||
|
|
||||||
|
* Add Effect.Morph core effect that morphs to a given CSS style rule. Effect.Morph does take orginal styles given by CSS style rules or the style attribute into consideration when calculating the transforms. It works with all length and color based CSS properties, including margins, paddings, borders, opacity and text/background colors.
|
||||||
|
Example:
|
||||||
|
new Effect.Morph('mydiv',{
|
||||||
|
style: 'font-size:3em;color:#f00;border-width:2em',
|
||||||
|
duration: 2.0
|
||||||
|
});
|
||||||
|
|
||||||
|
*V1.6.5* (November 8, 2006)
|
||||||
|
|
||||||
|
* Update to Prototype 1.5.0_rc1 revision [5462]
|
||||||
|
|
||||||
|
* Support the HTML 'for' attribute in Builder by using 'htmlFor', fixes #6472 [gjones, tdd]
|
||||||
|
|
||||||
|
var node = Builder.node('label', { htmlFor: 'myinput' });
|
||||||
|
|
||||||
|
* Add support to run a specific failing unit test by clicking on the corresponding test result, fixes #6290 [leeo]
|
||||||
|
|
||||||
|
* Add modifier key support to Event.simulateMouse, fixes #6391 [savetheclocktower]
|
||||||
|
|
||||||
|
* Add rails-trunk update task, clean up references to MIT license
|
||||||
|
|
||||||
|
* Add new 'with-last' queue position option to queue effects to occur in parallel with the last effect to start in the queue
|
||||||
|
|
||||||
|
* Add new special core effect Effect.Event for one-shot events that follow timelines defined by effect queues
|
||||||
|
|
||||||
|
new Effect.Event({ afterFinish:function(){
|
||||||
|
// do some code here
|
||||||
|
}, position: 'end' });
|
||||||
|
|
||||||
|
* Do some refactoring to make use of Prototype 1.5 functionalities and save LOC
|
||||||
|
|
||||||
|
* Fix an possible crash of IE on Effect.SlideUp, fixes #3192 [thx nel]
|
||||||
|
|
||||||
|
* Add Builder.build() to create nodes from strings containing HTML, [DHH]
|
||||||
|
|
||||||
|
var node = Builder.build("<p>this is <b>neat!</b></p>");
|
||||||
|
|
||||||
|
* Add a pulses parameter to Effect.Pulsate to control the amount of pulses, fixes #6245 [leeo]
|
||||||
|
|
||||||
|
For example, Effect.Pulsate('d8', {pulses: 2}) would pulsate twice. If the option is not given, it defaults to five pulses.
|
||||||
|
|
||||||
|
* Fix an issue with clicking on a slider span resulting in an exception, fixes #4707 [thx sergeykojin]
|
||||||
|
|
||||||
|
* Fix an issue with Draggables when no options are supplied, fixes #6045 [thx tdd]
|
||||||
|
|
||||||
|
*V1.6.4* (September 6, 2006)
|
||||||
|
|
||||||
* Hotfix IE issues with patched Prototype V1.5.0_rc1
|
* Hotfix IE issues with patched Prototype V1.5.0_rc1
|
||||||
|
|
||||||
*V1.6.3*
|
*V1.6.3* (September 5, 2006)
|
||||||
|
|
||||||
* Update Prototype to V1.5.0_rc1
|
* Update Prototype to V1.5.0_rc1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
892
htdocs/includes/scriptaculous/lib/prototype.js
vendored
892
htdocs/includes/scriptaculous/lib/prototype.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,9 @@
|
|||||||
// script.aculo.us builder.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006
|
// script.aculo.us builder.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
||||||
|
|
||||||
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
//
|
//
|
||||||
// See scriptaculous.js for full license.
|
// 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/
|
||||||
|
|
||||||
var Builder = {
|
var Builder = {
|
||||||
NODEMAP: {
|
NODEMAP: {
|
||||||
@@ -35,7 +36,7 @@ var Builder = {
|
|||||||
var element = parentElement.firstChild || null;
|
var element = parentElement.firstChild || null;
|
||||||
|
|
||||||
// see if browser added wrapping tags
|
// see if browser added wrapping tags
|
||||||
if(element && (element.tagName != elementName))
|
if(element && (element.tagName.toUpperCase() != elementName))
|
||||||
element = element.getElementsByTagName(elementName)[0];
|
element = element.getElementsByTagName(elementName)[0];
|
||||||
|
|
||||||
// fallback to createElement approach
|
// fallback to createElement approach
|
||||||
@@ -63,7 +64,7 @@ var Builder = {
|
|||||||
for(attr in arguments[1])
|
for(attr in arguments[1])
|
||||||
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
|
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
|
||||||
}
|
}
|
||||||
if(element.tagName != elementName)
|
if(element.tagName.toUpperCase() != elementName)
|
||||||
element = parentElement.getElementsByTagName(elementName)[0];
|
element = parentElement.getElementsByTagName(elementName)[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,10 +78,16 @@ var Builder = {
|
|||||||
_text: function(text) {
|
_text: function(text) {
|
||||||
return document.createTextNode(text);
|
return document.createTextNode(text);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ATTR_MAP: {
|
||||||
|
'className': 'class',
|
||||||
|
'htmlFor': 'for'
|
||||||
|
},
|
||||||
|
|
||||||
_attributes: function(attributes) {
|
_attributes: function(attributes) {
|
||||||
var attrs = [];
|
var attrs = [];
|
||||||
for(attribute in attributes)
|
for(attribute in attributes)
|
||||||
attrs.push((attribute=='className' ? 'class' : attribute) +
|
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
|
||||||
'="' + attributes[attribute].toString().escapeHTML() + '"');
|
'="' + attributes[attribute].toString().escapeHTML() + '"');
|
||||||
return attrs.join(" ");
|
return attrs.join(" ");
|
||||||
},
|
},
|
||||||
@@ -100,6 +107,11 @@ var Builder = {
|
|||||||
_isStringOrNumber: function(param) {
|
_isStringOrNumber: function(param) {
|
||||||
return(typeof param=='string' || typeof param=='number');
|
return(typeof param=='string' || typeof param=='number');
|
||||||
},
|
},
|
||||||
|
build: function(html) {
|
||||||
|
var element = this.node('div');
|
||||||
|
$(element).update(html.strip());
|
||||||
|
return element.down();
|
||||||
|
},
|
||||||
dump: function(scope) {
|
dump: function(scope) {
|
||||||
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
|
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
|
||||||
|
|
||||||
@@ -116,4 +128,4 @@ var Builder = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
htdocs/includes/scriptaculous/src/controls.js
vendored
22
htdocs/includes/scriptaculous/src/controls.js
vendored
@@ -1,14 +1,15 @@
|
|||||||
// script.aculo.us controls.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006
|
// script.aculo.us controls.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
||||||
|
|
||||||
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
// (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
|
// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
|
||||||
// (c) 2005 Jon Tirsen (http://www.tirsen.com)
|
// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com)
|
||||||
// Contributors:
|
// Contributors:
|
||||||
// Richard Livsey
|
// Richard Livsey
|
||||||
// Rahul Bhargava
|
// Rahul Bhargava
|
||||||
// Rob Wills
|
// Rob Wills
|
||||||
//
|
//
|
||||||
// See scriptaculous.js for full license.
|
// 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/
|
||||||
|
|
||||||
// Autocompleter.Base handles all the autocompletion functionality
|
// Autocompleter.Base handles all the autocompletion functionality
|
||||||
// that's independent of the data source for autocompletion. This
|
// that's independent of the data source for autocompletion. This
|
||||||
@@ -264,11 +265,11 @@ Autocompleter.Base.prototype = {
|
|||||||
if(!this.changed && this.hasFocus) {
|
if(!this.changed && this.hasFocus) {
|
||||||
this.update.innerHTML = choices;
|
this.update.innerHTML = choices;
|
||||||
Element.cleanWhitespace(this.update);
|
Element.cleanWhitespace(this.update);
|
||||||
Element.cleanWhitespace(this.update.firstChild);
|
Element.cleanWhitespace(this.update.down());
|
||||||
|
|
||||||
if(this.update.firstChild && this.update.firstChild.childNodes) {
|
if(this.update.firstChild && this.update.down().childNodes) {
|
||||||
this.entryCount =
|
this.entryCount =
|
||||||
this.update.firstChild.childNodes.length;
|
this.update.down().childNodes.length;
|
||||||
for (var i = 0; i < this.entryCount; i++) {
|
for (var i = 0; i < this.entryCount; i++) {
|
||||||
var entry = this.getEntry(i);
|
var entry = this.getEntry(i);
|
||||||
entry.autocompleteIndex = i;
|
entry.autocompleteIndex = i;
|
||||||
@@ -474,6 +475,7 @@ Ajax.InPlaceEditor.prototype = {
|
|||||||
this.element = $(element);
|
this.element = $(element);
|
||||||
|
|
||||||
this.options = Object.extend({
|
this.options = Object.extend({
|
||||||
|
paramName: "value",
|
||||||
okButton: true,
|
okButton: true,
|
||||||
okText: "ok",
|
okText: "ok",
|
||||||
cancelLink: true,
|
cancelLink: true,
|
||||||
@@ -605,7 +607,7 @@ Ajax.InPlaceEditor.prototype = {
|
|||||||
var textField = document.createElement("input");
|
var textField = document.createElement("input");
|
||||||
textField.obj = this;
|
textField.obj = this;
|
||||||
textField.type = "text";
|
textField.type = "text";
|
||||||
textField.name = "value";
|
textField.name = this.options.paramName;
|
||||||
textField.value = text;
|
textField.value = text;
|
||||||
textField.style.backgroundColor = this.options.highlightcolor;
|
textField.style.backgroundColor = this.options.highlightcolor;
|
||||||
textField.className = 'editor_field';
|
textField.className = 'editor_field';
|
||||||
@@ -618,7 +620,7 @@ Ajax.InPlaceEditor.prototype = {
|
|||||||
this.options.textarea = true;
|
this.options.textarea = true;
|
||||||
var textArea = document.createElement("textarea");
|
var textArea = document.createElement("textarea");
|
||||||
textArea.obj = this;
|
textArea.obj = this;
|
||||||
textArea.name = "value";
|
textArea.name = this.options.paramName;
|
||||||
textArea.value = this.convertHTMLLineBreaks(text);
|
textArea.value = this.convertHTMLLineBreaks(text);
|
||||||
textArea.rows = this.options.rows;
|
textArea.rows = this.options.rows;
|
||||||
textArea.cols = this.options.cols || 40;
|
textArea.cols = this.options.cols || 40;
|
||||||
|
|||||||
94
htdocs/includes/scriptaculous/src/dragdrop.js
vendored
94
htdocs/includes/scriptaculous/src/dragdrop.js
vendored
@@ -1,11 +1,10 @@
|
|||||||
// script.aculo.us dragdrop.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006
|
// script.aculo.us dragdrop.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
||||||
|
|
||||||
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
// (c) 2005 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
|
// (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
|
||||||
//
|
//
|
||||||
// See scriptaculous.js for full license.
|
// 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/
|
||||||
/*--------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
if(typeof Effect == 'undefined')
|
if(typeof Effect == 'undefined')
|
||||||
throw("dragdrop.js requires including script.aculo.us' effects.js library");
|
throw("dragdrop.js requires including script.aculo.us' effects.js library");
|
||||||
@@ -253,7 +252,7 @@ Draggable.prototype = {
|
|||||||
delay: 0
|
delay: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if(arguments[1] && typeof arguments[1].endeffect == 'undefined')
|
if(!arguments[1] || typeof arguments[1].endeffect == 'undefined')
|
||||||
Object.extend(defaults, {
|
Object.extend(defaults, {
|
||||||
starteffect: function(element) {
|
starteffect: function(element) {
|
||||||
element._opacity = Element.getOpacity(element);
|
element._opacity = Element.getOpacity(element);
|
||||||
@@ -266,10 +265,9 @@ Draggable.prototype = {
|
|||||||
|
|
||||||
this.element = $(element);
|
this.element = $(element);
|
||||||
|
|
||||||
if(options.handle && (typeof options.handle == 'string')) {
|
if(options.handle && (typeof options.handle == 'string'))
|
||||||
var h = Element.childrenWithClassName(this.element, options.handle, true);
|
this.handle = this.element.down('.'+options.handle, 0);
|
||||||
if(h.length>0) this.handle = h[0];
|
|
||||||
}
|
|
||||||
if(!this.handle) this.handle = $(options.handle);
|
if(!this.handle) this.handle = $(options.handle);
|
||||||
if(!this.handle) this.handle = this.element;
|
if(!this.handle) this.handle = this.element;
|
||||||
|
|
||||||
@@ -307,12 +305,12 @@ Draggable.prototype = {
|
|||||||
if(Event.isLeftClick(event)) {
|
if(Event.isLeftClick(event)) {
|
||||||
// abort on form elements, fixes a Firefox issue
|
// abort on form elements, fixes a Firefox issue
|
||||||
var src = Event.element(event);
|
var src = Event.element(event);
|
||||||
if(src.tagName && (
|
if((tag_name = src.tagName.toUpperCase()) && (
|
||||||
src.tagName=='INPUT' ||
|
tag_name=='INPUT' ||
|
||||||
src.tagName=='SELECT' ||
|
tag_name=='SELECT' ||
|
||||||
src.tagName=='OPTION' ||
|
tag_name=='OPTION' ||
|
||||||
src.tagName=='BUTTON' ||
|
tag_name=='BUTTON' ||
|
||||||
src.tagName=='TEXTAREA')) return;
|
tag_name=='TEXTAREA')) return;
|
||||||
|
|
||||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||||
var pos = Position.cumulativeOffset(this.element);
|
var pos = Position.cumulativeOffset(this.element);
|
||||||
@@ -370,12 +368,8 @@ Draggable.prototype = {
|
|||||||
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
|
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
|
||||||
} else {
|
} else {
|
||||||
p = Position.page(this.options.scroll);
|
p = Position.page(this.options.scroll);
|
||||||
p[0] += this.options.scroll.scrollLeft;
|
p[0] += this.options.scroll.scrollLeft + Position.deltaX;
|
||||||
p[1] += this.options.scroll.scrollTop;
|
p[1] += this.options.scroll.scrollTop + Position.deltaY;
|
||||||
|
|
||||||
p[0] += (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0);
|
|
||||||
p[1] += (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
|
|
||||||
|
|
||||||
p.push(p[0]+this.options.scroll.offsetWidth);
|
p.push(p[0]+this.options.scroll.offsetWidth);
|
||||||
p.push(p[1]+this.options.scroll.offsetHeight);
|
p.push(p[1]+this.options.scroll.offsetHeight);
|
||||||
}
|
}
|
||||||
@@ -443,7 +437,6 @@ Draggable.prototype = {
|
|||||||
var pos = Position.cumulativeOffset(this.element);
|
var pos = Position.cumulativeOffset(this.element);
|
||||||
if(this.options.ghosting) {
|
if(this.options.ghosting) {
|
||||||
var r = Position.realOffset(this.element);
|
var r = Position.realOffset(this.element);
|
||||||
window.status = r.inspect();
|
|
||||||
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
|
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,7 +574,7 @@ var Sortable = {
|
|||||||
sortables: {},
|
sortables: {},
|
||||||
|
|
||||||
_findRootElement: function(element) {
|
_findRootElement: function(element) {
|
||||||
while (element.tagName != "BODY") {
|
while (element.tagName.toUpperCase() != "BODY") {
|
||||||
if(element.id && Sortable.sortables[element.id]) return element;
|
if(element.id && Sortable.sortables[element.id]) return element;
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
}
|
}
|
||||||
@@ -667,7 +660,6 @@ var Sortable = {
|
|||||||
tree: options.tree,
|
tree: options.tree,
|
||||||
hoverclass: options.hoverclass,
|
hoverclass: options.hoverclass,
|
||||||
onHover: Sortable.onHover
|
onHover: Sortable.onHover
|
||||||
//greedy: !options.dropOnEmpty
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var options_for_tree = {
|
var options_for_tree = {
|
||||||
@@ -692,7 +684,7 @@ var Sortable = {
|
|||||||
(this.findElements(element, options) || []).each( function(e) {
|
(this.findElements(element, options) || []).each( function(e) {
|
||||||
// handles are per-draggable
|
// handles are per-draggable
|
||||||
var handle = options.handle ?
|
var handle = options.handle ?
|
||||||
Element.childrenWithClassName(e, options.handle)[0] : e;
|
$(e).down('.'+options.handle,0) : e;
|
||||||
options.draggables.push(
|
options.draggables.push(
|
||||||
new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
|
new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
|
||||||
Droppables.add(e, options_for_droppable);
|
Droppables.add(e, options_for_droppable);
|
||||||
@@ -790,7 +782,7 @@ var Sortable = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
unmark: function() {
|
unmark: function() {
|
||||||
if(Sortable._marker) Element.hide(Sortable._marker);
|
if(Sortable._marker) Sortable._marker.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
mark: function(dropon, position) {
|
mark: function(dropon, position) {
|
||||||
@@ -799,23 +791,21 @@ var Sortable = {
|
|||||||
if(sortable && !sortable.ghosting) return;
|
if(sortable && !sortable.ghosting) return;
|
||||||
|
|
||||||
if(!Sortable._marker) {
|
if(!Sortable._marker) {
|
||||||
Sortable._marker = $('dropmarker') || document.createElement('DIV');
|
Sortable._marker =
|
||||||
Element.hide(Sortable._marker);
|
($('dropmarker') || Element.extend(document.createElement('DIV'))).
|
||||||
Element.addClassName(Sortable._marker, 'dropmarker');
|
hide().addClassName('dropmarker').setStyle({position:'absolute'});
|
||||||
Sortable._marker.style.position = 'absolute';
|
|
||||||
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
|
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
|
||||||
}
|
}
|
||||||
var offsets = Position.cumulativeOffset(dropon);
|
var offsets = Position.cumulativeOffset(dropon);
|
||||||
Sortable._marker.style.left = offsets[0] + 'px';
|
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
|
||||||
Sortable._marker.style.top = offsets[1] + 'px';
|
|
||||||
|
|
||||||
if(position=='after')
|
if(position=='after')
|
||||||
if(sortable.overlap == 'horizontal')
|
if(sortable.overlap == 'horizontal')
|
||||||
Sortable._marker.style.left = (offsets[0]+dropon.clientWidth) + 'px';
|
Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
|
||||||
else
|
else
|
||||||
Sortable._marker.style.top = (offsets[1]+dropon.clientHeight) + 'px';
|
Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
|
||||||
|
|
||||||
Element.show(Sortable._marker);
|
Sortable._marker.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
_tree: function(element, options, parent) {
|
_tree: function(element, options, parent) {
|
||||||
@@ -830,9 +820,9 @@ var Sortable = {
|
|||||||
id: encodeURIComponent(match ? match[1] : null),
|
id: encodeURIComponent(match ? match[1] : null),
|
||||||
element: element,
|
element: element,
|
||||||
parent: parent,
|
parent: parent,
|
||||||
children: new Array,
|
children: [],
|
||||||
position: parent.children.length,
|
position: parent.children.length,
|
||||||
container: Sortable._findChildrenElement(children[i], options.treeTag.toUpperCase())
|
container: $(children[i]).down(options.treeTag)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the element containing the children and recurse over it */
|
/* Get the element containing the children and recurse over it */
|
||||||
@@ -845,17 +835,6 @@ var Sortable = {
|
|||||||
return parent;
|
return parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Finds the first element of the given tag type within a parent element.
|
|
||||||
Used for finding the first LI[ST] within a L[IST]I[TEM].*/
|
|
||||||
_findChildrenElement: function (element, containerTag) {
|
|
||||||
if (element && element.hasChildNodes)
|
|
||||||
for (var i = 0; i < element.childNodes.length; ++i)
|
|
||||||
if (element.childNodes[i].tagName == containerTag)
|
|
||||||
return element.childNodes[i];
|
|
||||||
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
tree: function(element) {
|
tree: function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var sortableOptions = this.options(element);
|
var sortableOptions = this.options(element);
|
||||||
@@ -870,12 +849,12 @@ var Sortable = {
|
|||||||
var root = {
|
var root = {
|
||||||
id: null,
|
id: null,
|
||||||
parent: null,
|
parent: null,
|
||||||
children: new Array,
|
children: [],
|
||||||
container: element,
|
container: element,
|
||||||
position: 0
|
position: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
return Sortable._tree (element, options, root);
|
return Sortable._tree(element, options, root);
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Construct a [i] index for a particular node */
|
/* Construct a [i] index for a particular node */
|
||||||
@@ -935,12 +914,10 @@ var Sortable = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns true if child is contained within element */
|
// Returns true if child is contained within element
|
||||||
Element.isParent = function(child, element) {
|
Element.isParent = function(child, element) {
|
||||||
if (!child.parentNode || child == element) return false;
|
if (!child.parentNode || child == element) return false;
|
||||||
|
|
||||||
if (child.parentNode == element) return true;
|
if (child.parentNode == element) return true;
|
||||||
|
|
||||||
return Element.isParent(child.parentNode, element);
|
return Element.isParent(child.parentNode, element);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -963,8 +940,5 @@ Element.findChildren = function(element, only, recursive, tagName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Element.offsetSize = function (element, type) {
|
Element.offsetSize = function (element, type) {
|
||||||
if (type == 'vertical' || type == 'height')
|
return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
|
||||||
return element.offsetHeight;
|
}
|
||||||
else
|
|
||||||
return element.offsetWidth;
|
|
||||||
}
|
|
||||||
|
|||||||
423
htdocs/includes/scriptaculous/src/effects.js
vendored
423
htdocs/includes/scriptaculous/src/effects.js
vendored
@@ -1,17 +1,18 @@
|
|||||||
// script.aculo.us effects.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006
|
// script.aculo.us effects.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
||||||
|
|
||||||
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
// Contributors:
|
// Contributors:
|
||||||
// Justin Palmer (http://encytemedia.com/)
|
// Justin Palmer (http://encytemedia.com/)
|
||||||
// Mark Pilgrim (http://diveintomark.org/)
|
// Mark Pilgrim (http://diveintomark.org/)
|
||||||
// Martin Bialasinki
|
// Martin Bialasinki
|
||||||
//
|
//
|
||||||
// See scriptaculous.js for full license.
|
// 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/
|
||||||
|
|
||||||
// converts rgb() and #xxx to #xxxxxx format,
|
// converts rgb() and #xxx to #xxxxxx format,
|
||||||
// returns self (or first argument) if not convertable
|
// returns self (or first argument) if not convertable
|
||||||
String.prototype.parseColor = function() {
|
String.prototype.parseColor = function() {
|
||||||
var color = '#';
|
var color = '#';
|
||||||
if(this.slice(0,4) == 'rgb(') {
|
if(this.slice(0,4) == 'rgb(') {
|
||||||
var cols = this.slice(4,this.length-1).split(',');
|
var cols = this.slice(4,this.length-1).split(',');
|
||||||
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
|
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
|
||||||
@@ -43,48 +44,21 @@ Element.collectTextNodesIgnoreClass = function(element, className) {
|
|||||||
|
|
||||||
Element.setContentZoom = function(element, percent) {
|
Element.setContentZoom = function(element, percent) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
Element.setStyle(element, {fontSize: (percent/100) + 'em'});
|
element.setStyle({fontSize: (percent/100) + 'em'});
|
||||||
if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
|
if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
|
||||||
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element.getOpacity = function(element){
|
Element.getOpacity = function(element){
|
||||||
var opacity;
|
return $(element).getStyle('opacity');
|
||||||
if (opacity = Element.getStyle(element, 'opacity'))
|
|
||||||
return parseFloat(opacity);
|
|
||||||
if (opacity = (Element.getStyle(element, 'filter') || '').match(/alpha\(opacity=(.*)\)/))
|
|
||||||
if(opacity[1]) return parseFloat(opacity[1]) / 100;
|
|
||||||
return 1.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element.setOpacity = function(element, value){
|
Element.setOpacity = function(element, value){
|
||||||
element= $(element);
|
return $(element).setStyle({opacity:value});
|
||||||
if (value == 1){
|
}
|
||||||
Element.setStyle(element, { opacity:
|
|
||||||
(/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ?
|
Element.getInlineOpacity = function(element){
|
||||||
0.999999 : 1.0 });
|
|
||||||
if(/MSIE/.test(navigator.userAgent) && !window.opera)
|
|
||||||
Element.setStyle(element, {filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')});
|
|
||||||
} else {
|
|
||||||
if(value < 0.00001) value = 0;
|
|
||||||
Element.setStyle(element, {opacity: value});
|
|
||||||
if(/MSIE/.test(navigator.userAgent) && !window.opera)
|
|
||||||
Element.setStyle(element,
|
|
||||||
{ filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'') +
|
|
||||||
'alpha(opacity='+value*100+')' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Element.getInlineOpacity = function(element){
|
|
||||||
return $(element).style.opacity || '';
|
return $(element).style.opacity || '';
|
||||||
}
|
|
||||||
|
|
||||||
Element.childrenWithClassName = function(element, className, findFirst) {
|
|
||||||
var classNameRegExp = new RegExp("(^|\\s)" + className + "(\\s|$)");
|
|
||||||
var results = $A($(element).getElementsByTagName('*'))[findFirst ? 'detect' : 'select']( function(c) {
|
|
||||||
return (c.className && c.className.match(classNameRegExp));
|
|
||||||
});
|
|
||||||
if(!results) results = [];
|
|
||||||
return results;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element.forceRerendering = function(element) {
|
Element.forceRerendering = function(element) {
|
||||||
@@ -116,6 +90,7 @@ var Effect = {
|
|||||||
|
|
||||||
var tagifyStyle = 'position:relative';
|
var tagifyStyle = 'position:relative';
|
||||||
if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1';
|
if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1';
|
||||||
|
|
||||||
element = $(element);
|
element = $(element);
|
||||||
$A(element.childNodes).each( function(child) {
|
$A(element.childNodes).each( function(child) {
|
||||||
if(child.nodeType==3) {
|
if(child.nodeType==3) {
|
||||||
@@ -168,32 +143,35 @@ var Effect2 = Effect; // deprecated
|
|||||||
|
|
||||||
/* ------------- transitions ------------- */
|
/* ------------- transitions ------------- */
|
||||||
|
|
||||||
Effect.Transitions = {}
|
Effect.Transitions = {
|
||||||
|
linear: Prototype.K,
|
||||||
Effect.Transitions.linear = Prototype.K;
|
sinoidal: function(pos) {
|
||||||
|
return (-Math.cos(pos*Math.PI)/2) + 0.5;
|
||||||
Effect.Transitions.sinoidal = function(pos) {
|
},
|
||||||
return (-Math.cos(pos*Math.PI)/2) + 0.5;
|
reverse: function(pos) {
|
||||||
}
|
return 1-pos;
|
||||||
Effect.Transitions.reverse = function(pos) {
|
},
|
||||||
return 1-pos;
|
flicker: function(pos) {
|
||||||
}
|
return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
|
||||||
Effect.Transitions.flicker = function(pos) {
|
},
|
||||||
return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
|
wobble: function(pos) {
|
||||||
}
|
return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
|
||||||
Effect.Transitions.wobble = function(pos) {
|
},
|
||||||
return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
|
pulse: function(pos, pulses) {
|
||||||
}
|
pulses = pulses || 5;
|
||||||
Effect.Transitions.pulse = function(pos) {
|
return (
|
||||||
return (Math.floor(pos*10) % 2 == 0 ?
|
Math.round((pos % (1/pulses)) * pulses) == 0 ?
|
||||||
(pos*10-Math.floor(pos*10)) : 1-(pos*10-Math.floor(pos*10)));
|
((pos * pulses * 2) - Math.floor(pos * pulses * 2)) :
|
||||||
}
|
1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2))
|
||||||
Effect.Transitions.none = function(pos) {
|
);
|
||||||
return 0;
|
},
|
||||||
}
|
none: function(pos) {
|
||||||
Effect.Transitions.full = function(pos) {
|
return 0;
|
||||||
return 1;
|
},
|
||||||
}
|
full: function(pos) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* ------------- core effects ------------- */
|
/* ------------- core effects ------------- */
|
||||||
|
|
||||||
@@ -220,6 +198,9 @@ Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
|
|||||||
e.finishOn += effect.finishOn;
|
e.finishOn += effect.finishOn;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'with-last':
|
||||||
|
timestamp = this.effects.pluck('startOn').max() || timestamp;
|
||||||
|
break;
|
||||||
case 'end':
|
case 'end':
|
||||||
// start effect after last queued effect has finished
|
// start effect after last queued effect has finished
|
||||||
timestamp = this.effects.pluck('finishOn').max() || timestamp;
|
timestamp = this.effects.pluck('finishOn').max() || timestamp;
|
||||||
@@ -233,7 +214,7 @@ Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
|
|||||||
this.effects.push(effect);
|
this.effects.push(effect);
|
||||||
|
|
||||||
if(!this.interval)
|
if(!this.interval)
|
||||||
this.interval = setInterval(this.loop.bind(this), 40);
|
this.interval = setInterval(this.loop.bind(this), 15);
|
||||||
},
|
},
|
||||||
remove: function(effect) {
|
remove: function(effect) {
|
||||||
this.effects = this.effects.reject(function(e) { return e==effect });
|
this.effects = this.effects.reject(function(e) { return e==effect });
|
||||||
@@ -244,7 +225,8 @@ Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
|
|||||||
},
|
},
|
||||||
loop: function() {
|
loop: function() {
|
||||||
var timePos = new Date().getTime();
|
var timePos = new Date().getTime();
|
||||||
this.effects.invoke('loop', timePos);
|
for(var i=0, len=this.effects.length;i<len;i++)
|
||||||
|
if(this.effects[i]) this.effects[i].loop(timePos);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -264,7 +246,7 @@ Effect.Queue = Effect.Queues.get('global');
|
|||||||
Effect.DefaultOptions = {
|
Effect.DefaultOptions = {
|
||||||
transition: Effect.Transitions.sinoidal,
|
transition: Effect.Transitions.sinoidal,
|
||||||
duration: 1.0, // seconds
|
duration: 1.0, // seconds
|
||||||
fps: 25.0, // max. 25fps due to Effect.Queue implementation
|
fps: 60.0, // max. 60fps due to Effect.Queue implementation
|
||||||
sync: false, // true for combining
|
sync: false, // true for combining
|
||||||
from: 0.0,
|
from: 0.0,
|
||||||
to: 1.0,
|
to: 1.0,
|
||||||
@@ -332,7 +314,10 @@ Effect.Base.prototype = {
|
|||||||
if(this.options[eventName]) this.options[eventName](this);
|
if(this.options[eventName]) this.options[eventName](this);
|
||||||
},
|
},
|
||||||
inspect: function() {
|
inspect: function() {
|
||||||
return '#<Effect:' + $H(this).inspect() + ',options:' + $H(this.options).inspect() + '>';
|
var data = $H();
|
||||||
|
for(property in this)
|
||||||
|
if(typeof this[property] != 'function') data[property] = this[property];
|
||||||
|
return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,6 +341,17 @@ Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Effect.Event = Class.create();
|
||||||
|
Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), {
|
||||||
|
initialize: function() {
|
||||||
|
var options = Object.extend({
|
||||||
|
duration: 0
|
||||||
|
}, arguments[0] || {});
|
||||||
|
this.start(options);
|
||||||
|
},
|
||||||
|
update: Prototype.emptyFunction
|
||||||
|
});
|
||||||
|
|
||||||
Effect.Opacity = Class.create();
|
Effect.Opacity = Class.create();
|
||||||
Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
|
Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
|
||||||
initialize: function(element) {
|
initialize: function(element) {
|
||||||
@@ -469,7 +465,7 @@ Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
|
|||||||
this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
|
this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
|
||||||
},
|
},
|
||||||
finish: function(position) {
|
finish: function(position) {
|
||||||
if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
|
if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
|
||||||
},
|
},
|
||||||
setDimensions: function(height, width) {
|
setDimensions: function(height, width) {
|
||||||
var d = {};
|
var d = {};
|
||||||
@@ -502,9 +498,11 @@ Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype),
|
|||||||
// Prevent executing on elements not in the layout flow
|
// Prevent executing on elements not in the layout flow
|
||||||
if(this.element.getStyle('display')=='none') { this.cancel(); return; }
|
if(this.element.getStyle('display')=='none') { this.cancel(); return; }
|
||||||
// Disable background image during the effect
|
// Disable background image during the effect
|
||||||
this.oldStyle = {
|
this.oldStyle = {};
|
||||||
backgroundImage: this.element.getStyle('background-image') };
|
if (!this.options.keepBackgroundImage) {
|
||||||
this.element.setStyle({backgroundImage: 'none'});
|
this.oldStyle.backgroundImage = this.element.getStyle('background-image');
|
||||||
|
this.element.setStyle({backgroundImage: 'none'});
|
||||||
|
}
|
||||||
if(!this.options.endcolor)
|
if(!this.options.endcolor)
|
||||||
this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
|
this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
|
||||||
if(!this.options.restorecolor)
|
if(!this.options.restorecolor)
|
||||||
@@ -559,8 +557,7 @@ Effect.Fade = function(element) {
|
|||||||
to: 0.0,
|
to: 0.0,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
if(effect.options.to!=0) return;
|
if(effect.options.to!=0) return;
|
||||||
effect.element.hide();
|
effect.element.hide().setStyle({opacity: oldOpacity});
|
||||||
effect.element.setStyle({opacity: oldOpacity});
|
|
||||||
}}, arguments[1] || {});
|
}}, arguments[1] || {});
|
||||||
return new Effect.Opacity(element,options);
|
return new Effect.Opacity(element,options);
|
||||||
}
|
}
|
||||||
@@ -575,8 +572,7 @@ Effect.Appear = function(element) {
|
|||||||
effect.element.forceRerendering();
|
effect.element.forceRerendering();
|
||||||
},
|
},
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.setOpacity(effect.options.from);
|
effect.element.setOpacity(effect.options.from).show();
|
||||||
effect.element.show();
|
|
||||||
}}, arguments[1] || {});
|
}}, arguments[1] || {});
|
||||||
return new Effect.Opacity(element,options);
|
return new Effect.Opacity(element,options);
|
||||||
}
|
}
|
||||||
@@ -600,8 +596,7 @@ Effect.Puff = function(element) {
|
|||||||
Position.absolutize(effect.effects[0].element)
|
Position.absolutize(effect.effects[0].element)
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.hide();
|
effect.effects[0].element.hide().setStyle(oldStyle); }
|
||||||
effect.effects[0].element.setStyle(oldStyle); }
|
|
||||||
}, arguments[1] || {})
|
}, arguments[1] || {})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -614,8 +609,7 @@ Effect.BlindUp = function(element) {
|
|||||||
scaleX: false,
|
scaleX: false,
|
||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide();
|
effect.element.hide().undoClipping();
|
||||||
effect.element.undoClipping();
|
|
||||||
}
|
}
|
||||||
}, arguments[1] || {})
|
}, arguments[1] || {})
|
||||||
);
|
);
|
||||||
@@ -631,9 +625,7 @@ Effect.BlindDown = function(element) {
|
|||||||
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
afterSetup: function(effect) {
|
afterSetup: function(effect) {
|
||||||
effect.element.makeClipping();
|
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
||||||
effect.element.setStyle({height: '0px'});
|
|
||||||
effect.element.show();
|
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.undoClipping();
|
effect.element.undoClipping();
|
||||||
@@ -653,14 +645,10 @@ Effect.SwitchOff = function(element) {
|
|||||||
duration: 0.3, scaleFromCenter: true,
|
duration: 0.3, scaleFromCenter: true,
|
||||||
scaleX: false, scaleContent: false, restoreAfterFinish: true,
|
scaleX: false, scaleContent: false, restoreAfterFinish: true,
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.makePositioned();
|
effect.element.makePositioned().makeClipping();
|
||||||
effect.element.makeClipping();
|
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide();
|
effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
|
||||||
effect.element.undoClipping();
|
|
||||||
effect.element.undoPositioned();
|
|
||||||
effect.element.setStyle({opacity: oldOpacity});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -682,9 +670,7 @@ Effect.DropOut = function(element) {
|
|||||||
effect.effects[0].element.makePositioned();
|
effect.effects[0].element.makePositioned();
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.hide();
|
effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
|
||||||
effect.effects[0].element.undoPositioned();
|
|
||||||
effect.effects[0].element.setStyle(oldStyle);
|
|
||||||
}
|
}
|
||||||
}, arguments[1] || {}));
|
}, arguments[1] || {}));
|
||||||
}
|
}
|
||||||
@@ -706,16 +692,14 @@ Effect.Shake = function(element) {
|
|||||||
{ x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
|
{ x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
|
||||||
new Effect.Move(effect.element,
|
new Effect.Move(effect.element,
|
||||||
{ x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
|
{ x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
|
||||||
effect.element.undoPositioned();
|
effect.element.undoPositioned().setStyle(oldStyle);
|
||||||
effect.element.setStyle(oldStyle);
|
|
||||||
}}) }}) }}) }}) }}) }});
|
}}) }}) }}) }}) }}) }});
|
||||||
}
|
}
|
||||||
|
|
||||||
Effect.SlideDown = function(element) {
|
Effect.SlideDown = function(element) {
|
||||||
element = $(element);
|
element = $(element).cleanWhitespace();
|
||||||
element.cleanWhitespace();
|
|
||||||
// SlideDown need to have the content of the element wrapped in a container element with fixed height!
|
// SlideDown need to have the content of the element wrapped in a container element with fixed height!
|
||||||
var oldInnerBottom = $(element.firstChild).getStyle('bottom');
|
var oldInnerBottom = element.down().getStyle('bottom');
|
||||||
var elementDimensions = element.getDimensions();
|
var elementDimensions = element.getDimensions();
|
||||||
return new Effect.Scale(element, 100, Object.extend({
|
return new Effect.Scale(element, 100, Object.extend({
|
||||||
scaleContent: false,
|
scaleContent: false,
|
||||||
@@ -725,34 +709,24 @@ Effect.SlideDown = function(element) {
|
|||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
afterSetup: function(effect) {
|
afterSetup: function(effect) {
|
||||||
effect.element.makePositioned();
|
effect.element.makePositioned();
|
||||||
effect.element.firstChild.makePositioned();
|
effect.element.down().makePositioned();
|
||||||
if(window.opera) effect.element.setStyle({top: ''});
|
if(window.opera) effect.element.setStyle({top: ''});
|
||||||
effect.element.makeClipping();
|
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
||||||
effect.element.setStyle({height: '0px'});
|
},
|
||||||
effect.element.show(); },
|
|
||||||
afterUpdateInternal: function(effect) {
|
afterUpdateInternal: function(effect) {
|
||||||
effect.element.firstChild.setStyle({bottom:
|
effect.element.down().setStyle({bottom:
|
||||||
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.undoClipping();
|
effect.element.undoClipping().undoPositioned();
|
||||||
// IE will crash if child is undoPositioned first
|
effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
|
||||||
if(/MSIE/.test(navigator.userAgent) && !window.opera){
|
|
||||||
effect.element.undoPositioned();
|
|
||||||
effect.element.firstChild.undoPositioned();
|
|
||||||
}else{
|
|
||||||
effect.element.firstChild.undoPositioned();
|
|
||||||
effect.element.undoPositioned();
|
|
||||||
}
|
|
||||||
effect.element.firstChild.setStyle({bottom: oldInnerBottom}); }
|
|
||||||
}, arguments[1] || {})
|
}, arguments[1] || {})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Effect.SlideUp = function(element) {
|
Effect.SlideUp = function(element) {
|
||||||
element = $(element);
|
element = $(element).cleanWhitespace();
|
||||||
element.cleanWhitespace();
|
var oldInnerBottom = element.down().getStyle('bottom');
|
||||||
var oldInnerBottom = $(element.firstChild).getStyle('bottom');
|
|
||||||
return new Effect.Scale(element, window.opera ? 0 : 1,
|
return new Effect.Scale(element, window.opera ? 0 : 1,
|
||||||
Object.extend({ scaleContent: false,
|
Object.extend({ scaleContent: false,
|
||||||
scaleX: false,
|
scaleX: false,
|
||||||
@@ -761,32 +735,32 @@ Effect.SlideUp = function(element) {
|
|||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
beforeStartInternal: function(effect) {
|
beforeStartInternal: function(effect) {
|
||||||
effect.element.makePositioned();
|
effect.element.makePositioned();
|
||||||
effect.element.firstChild.makePositioned();
|
effect.element.down().makePositioned();
|
||||||
if(window.opera) effect.element.setStyle({top: ''});
|
if(window.opera) effect.element.setStyle({top: ''});
|
||||||
effect.element.makeClipping();
|
effect.element.makeClipping().show();
|
||||||
effect.element.show(); },
|
},
|
||||||
afterUpdateInternal: function(effect) {
|
afterUpdateInternal: function(effect) {
|
||||||
effect.element.firstChild.setStyle({bottom:
|
effect.element.down().setStyle({bottom:
|
||||||
(effect.dims[0] - effect.element.clientHeight) + 'px' }); },
|
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
||||||
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide();
|
effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom});
|
||||||
effect.element.undoClipping();
|
effect.element.down().undoPositioned();
|
||||||
effect.element.firstChild.undoPositioned();
|
}
|
||||||
effect.element.undoPositioned();
|
|
||||||
effect.element.setStyle({bottom: oldInnerBottom}); }
|
|
||||||
}, arguments[1] || {})
|
}, arguments[1] || {})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bug in opera makes the TD containing this element expand for a instance after finish
|
// Bug in opera makes the TD containing this element expand for a instance after finish
|
||||||
Effect.Squish = function(element) {
|
Effect.Squish = function(element) {
|
||||||
return new Effect.Scale(element, window.opera ? 1 : 0,
|
return new Effect.Scale(element, window.opera ? 1 : 0, {
|
||||||
{ restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.makeClipping(effect.element); },
|
effect.element.makeClipping();
|
||||||
afterFinishInternal: function(effect) {
|
},
|
||||||
effect.element.hide(effect.element);
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.undoClipping(effect.element); }
|
effect.element.hide().undoClipping();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -842,9 +816,7 @@ Effect.Grow = function(element) {
|
|||||||
y: initialMoveY,
|
y: initialMoveY,
|
||||||
duration: 0.01,
|
duration: 0.01,
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.hide();
|
effect.element.hide().makeClipping().makePositioned();
|
||||||
effect.element.makeClipping();
|
|
||||||
effect.element.makePositioned();
|
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
new Effect.Parallel(
|
new Effect.Parallel(
|
||||||
@@ -855,13 +827,10 @@ Effect.Grow = function(element) {
|
|||||||
sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
|
sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
|
||||||
], Object.extend({
|
], Object.extend({
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.effects[0].element.setStyle({height: '0px'});
|
effect.effects[0].element.setStyle({height: '0px'}).show();
|
||||||
effect.effects[0].element.show();
|
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.undoClipping();
|
effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
|
||||||
effect.effects[0].element.undoPositioned();
|
|
||||||
effect.effects[0].element.setStyle(oldStyle);
|
|
||||||
}
|
}
|
||||||
}, options)
|
}, options)
|
||||||
)
|
)
|
||||||
@@ -915,13 +884,10 @@ Effect.Shrink = function(element) {
|
|||||||
new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
|
new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
|
||||||
], Object.extend({
|
], Object.extend({
|
||||||
beforeStartInternal: function(effect) {
|
beforeStartInternal: function(effect) {
|
||||||
effect.effects[0].element.makePositioned();
|
effect.effects[0].element.makePositioned().makeClipping();
|
||||||
effect.effects[0].element.makeClipping(); },
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.hide();
|
effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
|
||||||
effect.effects[0].element.undoClipping();
|
|
||||||
effect.effects[0].element.undoPositioned();
|
|
||||||
effect.effects[0].element.setStyle(oldStyle); }
|
|
||||||
}, options)
|
}, options)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -931,10 +897,10 @@ Effect.Pulsate = function(element) {
|
|||||||
var options = arguments[1] || {};
|
var options = arguments[1] || {};
|
||||||
var oldOpacity = element.getInlineOpacity();
|
var oldOpacity = element.getInlineOpacity();
|
||||||
var transition = options.transition || Effect.Transitions.sinoidal;
|
var transition = options.transition || Effect.Transitions.sinoidal;
|
||||||
var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos)) };
|
var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
|
||||||
reverser.bind(transition);
|
reverser.bind(transition);
|
||||||
return new Effect.Opacity(element,
|
return new Effect.Opacity(element,
|
||||||
Object.extend(Object.extend({ duration: 3.0, from: 0,
|
Object.extend(Object.extend({ duration: 2.0, from: 0,
|
||||||
afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
|
afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
|
||||||
}, options), {transition: reverser}));
|
}, options), {transition: reverser}));
|
||||||
}
|
}
|
||||||
@@ -946,7 +912,7 @@ Effect.Fold = function(element) {
|
|||||||
left: element.style.left,
|
left: element.style.left,
|
||||||
width: element.style.width,
|
width: element.style.width,
|
||||||
height: element.style.height };
|
height: element.style.height };
|
||||||
Element.makeClipping(element);
|
element.makeClipping();
|
||||||
return new Effect.Scale(element, 5, Object.extend({
|
return new Effect.Scale(element, 5, Object.extend({
|
||||||
scaleContent: false,
|
scaleContent: false,
|
||||||
scaleX: false,
|
scaleX: false,
|
||||||
@@ -955,15 +921,162 @@ Effect.Fold = function(element) {
|
|||||||
scaleContent: false,
|
scaleContent: false,
|
||||||
scaleY: false,
|
scaleY: false,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide();
|
effect.element.hide().undoClipping().setStyle(oldStyle);
|
||||||
effect.element.undoClipping();
|
|
||||||
effect.element.setStyle(oldStyle);
|
|
||||||
} });
|
} });
|
||||||
}}, arguments[1] || {}));
|
}}, arguments[1] || {}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Effect.Morph = Class.create();
|
||||||
|
Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), {
|
||||||
|
initialize: function(element) {
|
||||||
|
this.element = $(element);
|
||||||
|
if(!this.element) throw(Effect._elementDoesNotExistError);
|
||||||
|
var options = Object.extend({
|
||||||
|
style: {}
|
||||||
|
}, arguments[1] || {});
|
||||||
|
if (typeof options.style == 'string') {
|
||||||
|
if(options.style.indexOf(':') == -1) {
|
||||||
|
var cssText = '', selector = '.' + options.style;
|
||||||
|
$A(document.styleSheets).reverse().each(function(styleSheet) {
|
||||||
|
if (styleSheet.cssRules) cssRules = styleSheet.cssRules;
|
||||||
|
else if (styleSheet.rules) cssRules = styleSheet.rules;
|
||||||
|
$A(cssRules).reverse().each(function(rule) {
|
||||||
|
if (selector == rule.selectorText) {
|
||||||
|
cssText = rule.style.cssText;
|
||||||
|
throw $break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (cssText) throw $break;
|
||||||
|
});
|
||||||
|
this.style = cssText.parseStyle();
|
||||||
|
options.afterFinishInternal = function(effect){
|
||||||
|
effect.element.addClassName(effect.options.style);
|
||||||
|
effect.transforms.each(function(transform) {
|
||||||
|
if(transform.style != 'opacity')
|
||||||
|
effect.element.style[transform.style.camelize()] = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else this.style = options.style.parseStyle();
|
||||||
|
} else this.style = $H(options.style)
|
||||||
|
this.start(options);
|
||||||
|
},
|
||||||
|
setup: function(){
|
||||||
|
function parseColor(color){
|
||||||
|
if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
|
||||||
|
color = color.parseColor();
|
||||||
|
return $R(0,2).map(function(i){
|
||||||
|
return parseInt( color.slice(i*2+1,i*2+3), 16 )
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.transforms = this.style.map(function(pair){
|
||||||
|
var property = pair[0].underscore().dasherize(), value = pair[1], unit = null;
|
||||||
|
|
||||||
|
if(value.parseColor('#zzzzzz') != '#zzzzzz') {
|
||||||
|
value = value.parseColor();
|
||||||
|
unit = 'color';
|
||||||
|
} else if(property == 'opacity') {
|
||||||
|
value = parseFloat(value);
|
||||||
|
if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout))
|
||||||
|
this.element.setStyle({zoom: 1});
|
||||||
|
} else if(Element.CSS_LENGTH.test(value))
|
||||||
|
var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/),
|
||||||
|
value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null;
|
||||||
|
|
||||||
|
var originalValue = this.element.getStyle(property);
|
||||||
|
return $H({
|
||||||
|
style: property,
|
||||||
|
originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),
|
||||||
|
targetValue: unit=='color' ? parseColor(value) : value,
|
||||||
|
unit: unit
|
||||||
|
});
|
||||||
|
}.bind(this)).reject(function(transform){
|
||||||
|
return (
|
||||||
|
(transform.originalValue == transform.targetValue) ||
|
||||||
|
(
|
||||||
|
transform.unit != 'color' &&
|
||||||
|
(isNaN(transform.originalValue) || isNaN(transform.targetValue))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
update: function(position) {
|
||||||
|
var style = $H(), value = null;
|
||||||
|
this.transforms.each(function(transform){
|
||||||
|
value = transform.unit=='color' ?
|
||||||
|
$R(0,2).inject('#',function(m,v,i){
|
||||||
|
return m+(Math.round(transform.originalValue[i]+
|
||||||
|
(transform.targetValue[i] - transform.originalValue[i])*position)).toColorPart() }) :
|
||||||
|
transform.originalValue + Math.round(
|
||||||
|
((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit;
|
||||||
|
style[transform.style] = value;
|
||||||
|
});
|
||||||
|
this.element.setStyle(style);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Effect.Transform = Class.create();
|
||||||
|
Object.extend(Effect.Transform.prototype, {
|
||||||
|
initialize: function(tracks){
|
||||||
|
this.tracks = [];
|
||||||
|
this.options = arguments[1] || {};
|
||||||
|
this.addTracks(tracks);
|
||||||
|
},
|
||||||
|
addTracks: function(tracks){
|
||||||
|
tracks.each(function(track){
|
||||||
|
var data = $H(track).values().first();
|
||||||
|
this.tracks.push($H({
|
||||||
|
ids: $H(track).keys().first(),
|
||||||
|
effect: Effect.Morph,
|
||||||
|
options: { style: data }
|
||||||
|
}));
|
||||||
|
}.bind(this));
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
play: function(){
|
||||||
|
return new Effect.Parallel(
|
||||||
|
this.tracks.map(function(track){
|
||||||
|
var elements = [$(track.ids) || $$(track.ids)].flatten();
|
||||||
|
return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) });
|
||||||
|
}).flatten(),
|
||||||
|
this.options
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Element.CSS_PROPERTIES = $w(
|
||||||
|
'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +
|
||||||
|
'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
|
||||||
|
'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
|
||||||
|
'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
|
||||||
|
'fontSize fontWeight height left letterSpacing lineHeight ' +
|
||||||
|
'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
|
||||||
|
'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
|
||||||
|
'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
|
||||||
|
'right textIndent top width wordSpacing zIndex');
|
||||||
|
|
||||||
|
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
|
||||||
|
|
||||||
|
String.prototype.parseStyle = function(){
|
||||||
|
var element = Element.extend(document.createElement('div'));
|
||||||
|
element.innerHTML = '<div style="' + this + '"></div>';
|
||||||
|
var style = element.down().style, styleRules = $H();
|
||||||
|
|
||||||
|
Element.CSS_PROPERTIES.each(function(property){
|
||||||
|
if(style[property]) styleRules[property] = style[property];
|
||||||
|
});
|
||||||
|
if(/MSIE/.test(navigator.userAgent) && !window.opera && this.indexOf('opacity') > -1) {
|
||||||
|
styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
|
||||||
|
}
|
||||||
|
return styleRules;
|
||||||
|
};
|
||||||
|
|
||||||
|
Element.morph = function(element, style) {
|
||||||
|
new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {}));
|
||||||
|
return element;
|
||||||
|
};
|
||||||
|
|
||||||
['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom',
|
['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom',
|
||||||
'collectTextNodes','collectTextNodesIgnoreClass','childrenWithClassName'].each(
|
'collectTextNodes','collectTextNodesIgnoreClass','morph'].each(
|
||||||
function(f) { Element.Methods[f] = Element[f]; }
|
function(f) { Element.Methods[f] = Element[f]; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// script.aculo.us scriptaculous.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006
|
// script.aculo.us scriptaculous.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
||||||
|
|
||||||
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining
|
// Permission is hereby granted, free of charge, to any person obtaining
|
||||||
// a copy of this software and associated documentation files (the
|
// a copy of this software and associated documentation files (the
|
||||||
@@ -20,9 +20,11 @@
|
|||||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||||
|
|
||||||
var Scriptaculous = {
|
var Scriptaculous = {
|
||||||
Version: '1.6.4',
|
Version: '1.7.0',
|
||||||
require: function(libraryName) {
|
require: function(libraryName) {
|
||||||
// inserting via DOM fails in Safari 2.0, so brute force approach
|
// inserting via DOM fails in Safari 2.0, so brute force approach
|
||||||
document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
|
document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
|
||||||
|
|||||||
@@ -1,27 +1,9 @@
|
|||||||
// script.aculo.us slider.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006
|
// script.aculo.us slider.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
||||||
|
|
||||||
// Copyright (c) 2005 Marty Haught, Thomas Fuchs
|
// Copyright (c) 2005, 2006 Marty Haught, Thomas Fuchs
|
||||||
//
|
//
|
||||||
// See http://script.aculo.us for more info
|
// 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/
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
// a copy of this software and associated documentation files (the
|
|
||||||
// "Software"), to deal in the Software without restriction, including
|
|
||||||
// without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
// permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
// the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be
|
|
||||||
// included in all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
if(!Control) var Control = {};
|
if(!Control) var Control = {};
|
||||||
Control.Slider = Class.create();
|
Control.Slider = Class.create();
|
||||||
@@ -241,14 +223,16 @@ Control.Slider.prototype = {
|
|||||||
// find the handle (prevents issues with Safari)
|
// find the handle (prevents issues with Safari)
|
||||||
while((this.handles.indexOf(handle) == -1) && handle.parentNode)
|
while((this.handles.indexOf(handle) == -1) && handle.parentNode)
|
||||||
handle = handle.parentNode;
|
handle = handle.parentNode;
|
||||||
|
|
||||||
this.activeHandle = handle;
|
if(this.handles.indexOf(handle)!=-1) {
|
||||||
this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
|
this.activeHandle = handle;
|
||||||
this.updateStyles();
|
this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
|
||||||
|
this.updateStyles();
|
||||||
var offsets = Position.cumulativeOffset(this.activeHandle);
|
|
||||||
this.offsetX = (pointer[0] - offsets[0]);
|
var offsets = Position.cumulativeOffset(this.activeHandle);
|
||||||
this.offsetY = (pointer[1] - offsets[1]);
|
this.offsetX = (pointer[0] - offsets[0]);
|
||||||
|
this.offsetY = (pointer[1] - offsets[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
|
|||||||
@@ -1,40 +1,27 @@
|
|||||||
// script.aculo.us unittest.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006
|
// script.aculo.us unittest.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
||||||
|
|
||||||
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
// (c) 2005 Jon Tirsen (http://www.tirsen.com)
|
// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com)
|
||||||
// (c) 2005 Michael Schuerig (http://www.schuerig.de/michael/)
|
// (c) 2005, 2006 Michael Schuerig (http://www.schuerig.de/michael/)
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining
|
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||||
// a copy of this software and associated documentation files (the
|
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||||
// "Software"), to deal in the Software without restriction, including
|
|
||||||
// without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
// permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
// the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be
|
|
||||||
// included in all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
// experimental, Firefox-only
|
// experimental, Firefox-only
|
||||||
Event.simulateMouse = function(element, eventName) {
|
Event.simulateMouse = function(element, eventName) {
|
||||||
var options = Object.extend({
|
var options = Object.extend({
|
||||||
pointerX: 0,
|
pointerX: 0,
|
||||||
pointerY: 0,
|
pointerY: 0,
|
||||||
buttons: 0
|
buttons: 0,
|
||||||
|
ctrlKey: false,
|
||||||
|
altKey: false,
|
||||||
|
shiftKey: false,
|
||||||
|
metaKey: false
|
||||||
}, arguments[2] || {});
|
}, arguments[2] || {});
|
||||||
var oEvent = document.createEvent("MouseEvents");
|
var oEvent = document.createEvent("MouseEvents");
|
||||||
oEvent.initMouseEvent(eventName, true, true, document.defaultView,
|
oEvent.initMouseEvent(eventName, true, true, document.defaultView,
|
||||||
options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
|
options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
|
||||||
false, false, false, false, 0, $(element));
|
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element));
|
||||||
|
|
||||||
if(this.mark) Element.remove(this.mark);
|
if(this.mark) Element.remove(this.mark);
|
||||||
this.mark = document.createElement('div');
|
this.mark = document.createElement('div');
|
||||||
@@ -100,6 +87,7 @@ Test.Unit.Logger.prototype = {
|
|||||||
this.lastLogLine = document.createElement('tr');
|
this.lastLogLine = document.createElement('tr');
|
||||||
this.statusCell = document.createElement('td');
|
this.statusCell = document.createElement('td');
|
||||||
this.nameCell = document.createElement('td');
|
this.nameCell = document.createElement('td');
|
||||||
|
this.nameCell.className = "nameCell";
|
||||||
this.nameCell.appendChild(document.createTextNode(testName));
|
this.nameCell.appendChild(document.createTextNode(testName));
|
||||||
this.messageCell = document.createElement('td');
|
this.messageCell = document.createElement('td');
|
||||||
this.lastLogLine.appendChild(this.statusCell);
|
this.lastLogLine.appendChild(this.statusCell);
|
||||||
@@ -112,6 +100,7 @@ Test.Unit.Logger.prototype = {
|
|||||||
this.lastLogLine.className = status;
|
this.lastLogLine.className = status;
|
||||||
this.statusCell.innerHTML = status;
|
this.statusCell.innerHTML = status;
|
||||||
this.messageCell.innerHTML = this._toHTML(summary);
|
this.messageCell.innerHTML = this._toHTML(summary);
|
||||||
|
this.addLinksToResults();
|
||||||
},
|
},
|
||||||
message: function(message) {
|
message: function(message) {
|
||||||
if (!this.log) return;
|
if (!this.log) return;
|
||||||
@@ -133,6 +122,16 @@ Test.Unit.Logger.prototype = {
|
|||||||
},
|
},
|
||||||
_toHTML: function(txt) {
|
_toHTML: function(txt) {
|
||||||
return txt.escapeHTML().replace(/\n/g,"<br/>");
|
return txt.escapeHTML().replace(/\n/g,"<br/>");
|
||||||
|
},
|
||||||
|
addLinksToResults: function(){
|
||||||
|
$$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log
|
||||||
|
td.title = "Run only this test"
|
||||||
|
Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;});
|
||||||
|
});
|
||||||
|
$$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log
|
||||||
|
td.title = "Run all tests"
|
||||||
|
Event.observe(td, 'click', function(){ window.location.search = "";});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,6 +142,7 @@ Test.Unit.Runner.prototype = {
|
|||||||
testLog: 'testlog'
|
testLog: 'testlog'
|
||||||
}, arguments[1] || {});
|
}, arguments[1] || {});
|
||||||
this.options.resultsURL = this.parseResultsURLQueryParameter();
|
this.options.resultsURL = this.parseResultsURLQueryParameter();
|
||||||
|
this.options.tests = this.parseTestsQueryParameter();
|
||||||
if (this.options.testLog) {
|
if (this.options.testLog) {
|
||||||
this.options.testLog = $(this.options.testLog) || null;
|
this.options.testLog = $(this.options.testLog) || null;
|
||||||
}
|
}
|
||||||
@@ -176,6 +176,11 @@ Test.Unit.Runner.prototype = {
|
|||||||
parseResultsURLQueryParameter: function() {
|
parseResultsURLQueryParameter: function() {
|
||||||
return window.location.search.parseQuery()["resultsURL"];
|
return window.location.search.parseQuery()["resultsURL"];
|
||||||
},
|
},
|
||||||
|
parseTestsQueryParameter: function(){
|
||||||
|
if (window.location.search.parseQuery()["tests"]){
|
||||||
|
return window.location.search.parseQuery()["tests"].split(',');
|
||||||
|
};
|
||||||
|
},
|
||||||
// Returns:
|
// Returns:
|
||||||
// "ERROR" if there was an error,
|
// "ERROR" if there was an error,
|
||||||
// "FAILURE" if there was a failure, or
|
// "FAILURE" if there was a failure, or
|
||||||
@@ -290,6 +295,13 @@ Test.Unit.Assertions.prototype = {
|
|||||||
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
||||||
catch(e) { this.error(e); }
|
catch(e) { this.error(e); }
|
||||||
},
|
},
|
||||||
|
assertInspect: function(expected, actual) {
|
||||||
|
var message = arguments[2] || "assertInspect";
|
||||||
|
try { (expected == actual.inspect()) ? this.pass() :
|
||||||
|
this.fail(message + ': expected "' + Test.Unit.inspect(expected) +
|
||||||
|
'", actual "' + Test.Unit.inspect(actual) + '"'); }
|
||||||
|
catch(e) { this.error(e); }
|
||||||
|
},
|
||||||
assertEnumEqual: function(expected, actual) {
|
assertEnumEqual: function(expected, actual) {
|
||||||
var message = arguments[2] || "assertEnumEqual";
|
var message = arguments[2] || "assertEnumEqual";
|
||||||
try { $A(expected).length == $A(actual).length &&
|
try { $A(expected).length == $A(actual).length &&
|
||||||
@@ -400,7 +412,7 @@ Test.Unit.Assertions.prototype = {
|
|||||||
method();
|
method();
|
||||||
this.fail(message + ": exception expected but none was raised"); }
|
this.fail(message + ": exception expected but none was raised"); }
|
||||||
catch(e) {
|
catch(e) {
|
||||||
(e.name==exceptionName) ? this.pass() : this.error(e);
|
((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
assertElementsMatch: function() {
|
assertElementsMatch: function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user