0010655.patch

Administrator Admin, 2009-03-11 00:07

Download (92.5 KB)

View differences:

typo3/contrib/scriptaculous/builder.js (Arbeitskopie)
1
// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
1
// script.aculo.us builder.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
2 2

  
3
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
3
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4 4
//
5 5
// script.aculo.us is freely distributable under the terms of an MIT-style license.
6 6
// For details, see the script.aculo.us web site: http://script.aculo.us/
......
26 26
  //       due to a Firefox bug
27 27
  node: function(elementName) {
28 28
    elementName = elementName.toUpperCase();
29
    
29

  
30 30
    // try innerHTML approach
31 31
    var parentTag = this.NODEMAP[elementName] || 'div';
32 32
    var parentElement = document.createElement(parentTag);
......
34 34
      parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
35 35
    } catch(e) {}
36 36
    var element = parentElement.firstChild || null;
37
      
37

  
38 38
    // see if browser added wrapping tags
39 39
    if(element && (element.tagName.toUpperCase() != elementName))
40 40
      element = element.getElementsByTagName(elementName)[0];
41
    
41

  
42 42
    // fallback to createElement approach
43 43
    if(!element) element = document.createElement(elementName);
44
    
44

  
45 45
    // abort if nothing could be created
46 46
    if(!element) return;
47 47

  
......
62 62
            // workaround firefox 1.0.X bug
63 63
            if(!element) {
64 64
              element = document.createElement(elementName);
65
              for(attr in arguments[1]) 
65
              for(attr in arguments[1])
66 66
                element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
67 67
            }
68 68
            if(element.tagName.toUpperCase() != elementName)
69 69
              element = parentElement.getElementsByTagName(elementName)[0];
70 70
          }
71
        } 
71
        }
72 72

  
73 73
    // text, or array of children
74 74
    if(arguments[2])
75 75
      this._children(element, arguments[2]);
76 76

  
77
     return element;
77
     return $(element);
78 78
  },
79 79
  _text: function(text) {
80 80
     return document.createTextNode(text);
......
100 100
    if(typeof children=='object') { // array can hold nodes and text
101 101
      children.flatten().each( function(e) {
102 102
        if(typeof e=='object')
103
          element.appendChild(e)
103
          element.appendChild(e);
104 104
        else
105 105
          if(Builder._isStringOrNumber(e))
106 106
            element.appendChild(Builder._text(e));
......
117 117
    $(element).update(html.strip());
118 118
    return element.down();
119 119
  },
120
  dump: function(scope) { 
121
    if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope 
122
  
120
  dump: function(scope) {
121
    if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
122

  
123 123
    var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
124 124
      "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
125 125
      "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
126 126
      "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
127 127
      "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
128 128
      "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
129
  
130
    tags.each( function(tag){ 
131
      scope[tag] = function() { 
132
        return Builder.node.apply(Builder, [tag].concat($A(arguments)));  
133
      } 
129

  
130
    tags.each( function(tag){
131
      scope[tag] = function() {
132
        return Builder.node.apply(Builder, [tag].concat($A(arguments)));
133
      };
134 134
    });
135 135
  }
136
}
136
};
typo3/contrib/scriptaculous/sound.js (Arbeitskopie)
1
// script.aculo.us sound.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
1
// script.aculo.us sound.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
2 2

  
3
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
3
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4 4
//
5 5
// Based on code created by Jules Gravinese (http://www.webveteran.com/)
6 6
//
......
23 23
    var options = Object.extend({
24 24
      track: 'global', url: url, replace: false
25 25
    }, arguments[1] || {});
26
    
26

  
27 27
    if(options.replace && this.tracks[options.track]) {
28 28
      $R(0, this.tracks[options.track].id).each(function(id){
29 29
        var sound = $('sound_'+options.track+'_'+id);
30 30
        sound.Stop && sound.Stop();
31 31
        sound.remove();
32
      })
32
      });
33 33
      this.tracks[options.track] = null;
34 34
    }
35
      
35

  
36 36
    if(!this.tracks[options.track])
37
      this.tracks[options.track] = { id: 0 }
37
      this.tracks[options.track] = { id: 0 };
38 38
    else
39 39
      this.tracks[options.track].id++;
40
      
40

  
41 41
    options.id = this.tracks[options.track].id;
42
    $$('body')[0].insert( 
42
    $$('body')[0].insert(
43 43
      Prototype.Browser.IE ? new Element('bgsound',{
44 44
        id: 'sound_'+options.track+'_'+options.id,
45 45
        src: options.url, loop: 1, autostart: true
......
49 49

  
50 50
if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
51 51
  if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
52
    Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>')
52
    Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>');
53 53
  else
54
    Sound.play = function(){}
55
}
54
    Sound.play = function(){};
55
}
typo3/contrib/scriptaculous/effects.js (Arbeitskopie)
1
// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
1
// script.aculo.us effects.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
2 2

  
3
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
3
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4 4
// Contributors:
5 5
//  Justin Palmer (http://encytemedia.com/)
6 6
//  Mark Pilgrim (http://diveintomark.org/)
7 7
//  Martin Bialasinki
8
// 
8
//
9 9
// script.aculo.us is freely distributable under the terms of an MIT-style license.
10
// For details, see the script.aculo.us web site: http://script.aculo.us/ 
10
// For details, see the script.aculo.us web site: http://script.aculo.us/
11 11

  
12
// converts rgb() and #xxx to #xxxxxx format,  
13
// returns self (or first argument) if not convertable  
14
String.prototype.parseColor = function() {  
12
// converts rgb() and #xxx to #xxxxxx format,
13
// returns self (or first argument) if not convertable
14
String.prototype.parseColor = function() {
15 15
  var color = '#';
16
  if (this.slice(0,4) == 'rgb(') {  
17
    var cols = this.slice(4,this.length-1).split(',');  
18
    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
19
  } else {  
20
    if (this.slice(0,1) == '#') {  
21
      if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();  
22
      if (this.length==7) color = this.toLowerCase();  
23
    }  
24
  }  
25
  return (color.length==7 ? color : (arguments[0] || this));  
16
  if (this.slice(0,4) == 'rgb(') {
17
    var cols = this.slice(4,this.length-1).split(',');
18
    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
19
  } else {
20
    if (this.slice(0,1) == '#') {
21
      if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
22
      if (this.length==7) color = this.toLowerCase();
23
    }
24
  }
25
  return (color.length==7 ? color : (arguments[0] || this));
26 26
};
27 27

  
28 28
/*--------------------------------------------------------------------------*/
29 29

  
30
Element.collectTextNodes = function(element) {  
30
Element.collectTextNodes = function(element) {
31 31
  return $A($(element).childNodes).collect( function(node) {
32
    return (node.nodeType==3 ? node.nodeValue : 
32
    return (node.nodeType==3 ? node.nodeValue :
33 33
      (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
34 34
  }).flatten().join('');
35 35
};
36 36

  
37
Element.collectTextNodesIgnoreClass = function(element, className) {  
37
Element.collectTextNodesIgnoreClass = function(element, className) {
38 38
  return $A($(element).childNodes).collect( function(node) {
39
    return (node.nodeType==3 ? node.nodeValue : 
40
      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
39
    return (node.nodeType==3 ? node.nodeValue :
40
      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
41 41
        Element.collectTextNodesIgnoreClass(node, className) : ''));
42 42
  }).flatten().join('');
43 43
};
44 44

  
45 45
Element.setContentZoom = function(element, percent) {
46
  element = $(element);  
47
  element.setStyle({fontSize: (percent/100) + 'em'});   
46
  element = $(element);
47
  element.setStyle({fontSize: (percent/100) + 'em'});
48 48
  if (Prototype.Browser.WebKit) window.scrollBy(0,0);
49 49
  return element;
50 50
};
......
72 72
  Transitions: {
73 73
    linear: Prototype.K,
74 74
    sinoidal: function(pos) {
75
      return (-Math.cos(pos*Math.PI)/2) + 0.5;
75
      return (-Math.cos(pos*Math.PI)/2) + .5;
76 76
    },
77 77
    reverse: function(pos) {
78 78
      return 1-pos;
79 79
    },
80 80
    flicker: function(pos) {
81
      var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
81
      var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4;
82 82
      return pos > 1 ? 1 : pos;
83 83
    },
84 84
    wobble: function(pos) {
85
      return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
85
      return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5;
86 86
    },
87
    pulse: function(pos, pulses) { 
88
      pulses = pulses || 5; 
89
      return (
90
        ((pos % (1/pulses)) * pulses).round() == 0 ? 
91
              ((pos * pulses * 2) - (pos * pulses * 2).floor()) : 
92
          1 - ((pos * pulses * 2) - (pos * pulses * 2).floor())
93
        );
87
    pulse: function(pos, pulses) {
88
      return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5;
94 89
    },
95
    spring: function(pos) { 
96
      return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); 
90
    spring: function(pos) {
91
      return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6));
97 92
    },
98 93
    none: function(pos) {
99 94
      return 0;
......
114 109
  tagifyText: function(element) {
115 110
    var tagifyStyle = 'position:relative';
116 111
    if (Prototype.Browser.IE) tagifyStyle += ';zoom:1';
117
    
112

  
118 113
    element = $(element);
119 114
    $A(element.childNodes).each( function(child) {
120 115
      if (child.nodeType==3) {
121 116
        child.nodeValue.toArray().each( function(character) {
122 117
          element.insertBefore(
123 118
            new Element('span', {style: tagifyStyle}).update(
124
              character == ' ' ? String.fromCharCode(160) : character), 
119
              character == ' ' ? String.fromCharCode(160) : character),
125 120
              child);
126 121
        });
127 122
        Element.remove(child);
......
130 125
  },
131 126
  multiple: function(element, effect) {
132 127
    var elements;
133
    if (((typeof element == 'object') || 
134
        Object.isFunction(element)) && 
128
    if (((typeof element == 'object') ||
129
        Object.isFunction(element)) &&
135 130
       (element.length))
136 131
      elements = element;
137 132
    else
138 133
      elements = $(element).childNodes;
139
      
134

  
140 135
    var options = Object.extend({
141 136
      speed: 0.1,
142 137
      delay: 0.0
......
158 153
    var options = Object.extend({
159 154
      queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
160 155
    }, arguments[2] || { });
161
    Effect[element.visible() ? 
156
    Effect[element.visible() ?
162 157
      Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
163 158
  }
164 159
};
......
170 165
Effect.ScopedQueue = Class.create(Enumerable, {
171 166
  initialize: function() {
172 167
    this.effects  = [];
173
    this.interval = null;    
168
    this.interval = null;
174 169
  },
175 170
  _each: function(iterator) {
176 171
    this.effects._each(iterator);
177 172
  },
178 173
  add: function(effect) {
179 174
    var timestamp = new Date().getTime();
180
    
181
    var position = Object.isString(effect.options.queue) ? 
175

  
176
    var position = Object.isString(effect.options.queue) ?
182 177
      effect.options.queue : effect.options.queue.position;
183
    
178

  
184 179
    switch(position) {
185 180
      case 'front':
186
        // move unstarted effects after this effect  
181
        // move unstarted effects after this effect
187 182
        this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
188 183
            e.startOn  += effect.finishOn;
189 184
            e.finishOn += effect.finishOn;
......
197 192
        timestamp = this.effects.pluck('finishOn').max() || timestamp;
198 193
        break;
199 194
    }
200
    
195

  
201 196
    effect.startOn  += timestamp;
202 197
    effect.finishOn += timestamp;
203 198

  
204 199
    if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
205 200
      this.effects.push(effect);
206
    
201

  
207 202
    if (!this.interval)
208 203
      this.interval = setInterval(this.loop.bind(this), 15);
209 204
  },
......
216 211
  },
217 212
  loop: function() {
218 213
    var timePos = new Date().getTime();
219
    for(var i=0, len=this.effects.length;i<len;i++) 
214
    for(var i=0, len=this.effects.length;i<len;i++)
220 215
      this.effects[i] && this.effects[i].loop(timePos);
221 216
  }
222 217
});
......
225 220
  instances: $H(),
226 221
  get: function(queueName) {
227 222
    if (!Object.isString(queueName)) return queueName;
228
    
223

  
229 224
    return this.instances.get(queueName) ||
230 225
      this.instances.set(queueName, new Effect.ScopedQueue());
231 226
  }
......
250 245
    this.fromToDelta  = this.options.to-this.options.from;
251 246
    this.totalTime    = this.finishOn-this.startOn;
252 247
    this.totalFrames  = this.options.fps*this.options.duration;
253
    
254
    eval('this.render = function(pos){ '+
255
      'if (this.state=="idle"){this.state="running";'+
256
      codeForEvent(this.options,'beforeSetup')+
257
      (this.setup ? 'this.setup();':'')+ 
258
      codeForEvent(this.options,'afterSetup')+
259
      '};if (this.state=="running"){'+
260
      'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
261
      'this.position=pos;'+
262
      codeForEvent(this.options,'beforeUpdate')+
263
      (this.update ? 'this.update(pos);':'')+
264
      codeForEvent(this.options,'afterUpdate')+
265
      '}}');
266
    
248

  
249
    this.render = (function() {
250
      function dispatch(effect, eventName) {
251
        if (effect.options[eventName + 'Internal'])
252
          effect.options[eventName + 'Internal'](effect);
253
        if (effect.options[eventName])
254
          effect.options[eventName](effect);
255
      }
256

  
257
      return function(pos) {
258
        if (this.state === "idle") {
259
          this.state = "running";
260
          dispatch(this, 'beforeSetup');
261
          if (this.setup) this.setup();
262
          dispatch(this, 'afterSetup');
263
        }
264
        if (this.state === "running") {
265
          pos = (this.options.transition(pos) * this.fromToDelta) + this.options.from;
266
          this.position = pos;
267
          dispatch(this, 'beforeUpdate');
268
          if (this.update) this.update(pos);
269
          dispatch(this, 'afterUpdate');
270
        }
271
      };
272
    })();
273

  
267 274
    this.event('beforeStart');
268 275
    if (!this.options.sync)
269
      Effect.Queues.get(Object.isString(this.options.queue) ? 
276
      Effect.Queues.get(Object.isString(this.options.queue) ?
270 277
        'global' : this.options.queue.scope).add(this);
271 278
  },
272 279
  loop: function(timePos) {
......
275 282
        this.render(1.0);
276 283
        this.cancel();
277 284
        this.event('beforeFinish');
278
        if (this.finish) this.finish(); 
285
        if (this.finish) this.finish();
279 286
        this.event('afterFinish');
280
        return;  
287
        return;
281 288
      }
282 289
      var pos   = (timePos - this.startOn) / this.totalTime,
283 290
          frame = (pos * this.totalFrames).round();
......
289 296
  },
290 297
  cancel: function() {
291 298
    if (!this.options.sync)
292
      Effect.Queues.get(Object.isString(this.options.queue) ? 
299
      Effect.Queues.get(Object.isString(this.options.queue) ?
293 300
        'global' : this.options.queue.scope).remove(this);
294 301
    this.state = 'finished';
295 302
  },
......
327 334
Effect.Tween = Class.create(Effect.Base, {
328 335
  initialize: function(object, from, to) {
329 336
    object = Object.isString(object) ? $(object) : object;
330
    var args = $A(arguments), method = args.last(), 
337
    var args = $A(arguments), method = args.last(),
331 338
      options = args.length == 5 ? args[3] : null;
332 339
    this.method = Object.isFunction(method) ? method.bind(object) :
333
      Object.isFunction(object[method]) ? object[method].bind(object) : 
340
      Object.isFunction(object[method]) ? object[method].bind(object) :
334 341
      function(value) { object[method] = value };
335 342
    this.start(Object.extend({ from: from, to: to }, options || { }));
336 343
  },
......
394 401

  
395 402
// for backwards compatibility
396 403
Effect.MoveBy = function(element, toTop, toLeft) {
397
  return new Effect.Move(element, 
404
  return new Effect.Move(element,
398 405
    Object.extend({ x: toLeft, y: toTop }, arguments[3] || { }));
399 406
};
400 407

  
......
416 423
  setup: function() {
417 424
    this.restoreAfterFinish = this.options.restoreAfterFinish || false;
418 425
    this.elementPositioning = this.element.getStyle('position');
419
    
426

  
420 427
    this.originalStyle = { };
421 428
    ['top','left','width','height','fontSize'].each( function(k) {
422 429
      this.originalStyle[k] = this.element.style[k];
423 430
    }.bind(this));
424
      
431

  
425 432
    this.originalTop  = this.element.offsetTop;
426 433
    this.originalLeft = this.element.offsetLeft;
427
    
434

  
428 435
    var fontSize = this.element.getStyle('font-size') || '100%';
429 436
    ['em','px','%','pt'].each( function(fontSizeType) {
430 437
      if (fontSize.indexOf(fontSizeType)>0) {
......
432 439
        this.fontSizeType = fontSizeType;
433 440
      }
434 441
    }.bind(this));
435
    
442

  
436 443
    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
437
    
444

  
438 445
    this.dims = null;
439 446
    if (this.options.scaleMode=='box')
440 447
      this.dims = [this.element.offsetHeight, this.element.offsetWidth];
......
509 516

  
510 517
Effect.ScrollTo = function(element) {
511 518
  var options = arguments[1] || { },
512
    scrollOffsets = document.viewport.getScrollOffsets(),
513
    elementOffsets = $(element).cumulativeOffset(),
514
    max = (window.height || document.body.scrollHeight) - document.viewport.getHeight();  
519
  scrollOffsets = document.viewport.getScrollOffsets(),
520
  elementOffsets = $(element).cumulativeOffset();
515 521

  
516 522
  if (options.offset) elementOffsets[1] += options.offset;
517 523

  
518 524
  return new Effect.Tween(null,
519 525
    scrollOffsets.top,
520
    elementOffsets[1] > max ? max : elementOffsets[1],
526
    elementOffsets[1],
521 527
    options,
522
    function(p){ scrollTo(scrollOffsets.left, p.round()) }
528
    function(p){ scrollTo(scrollOffsets.left, p.round()); }
523 529
  );
524 530
};
525 531

  
......
531 537
  var options = Object.extend({
532 538
    from: element.getOpacity() || 1.0,
533 539
    to:   0.0,
534
    afterFinishInternal: function(effect) { 
540
    afterFinishInternal: function(effect) {
535 541
      if (effect.options.to!=0) return;
536
      effect.element.hide().setStyle({opacity: oldOpacity}); 
542
      effect.element.hide().setStyle({opacity: oldOpacity});
537 543
    }
538 544
  }, arguments[1] || { });
539 545
  return new Effect.Opacity(element,options);
......
549 555
    effect.element.forceRerendering();
550 556
  },
551 557
  beforeSetup: function(effect) {
552
    effect.element.setOpacity(effect.options.from).show(); 
558
    effect.element.setOpacity(effect.options.from).show();
553 559
  }}, arguments[1] || { });
554 560
  return new Effect.Opacity(element,options);
555 561
};
556 562

  
557 563
Effect.Puff = function(element) {
558 564
  element = $(element);
559
  var oldStyle = { 
560
    opacity: element.getInlineOpacity(), 
565
  var oldStyle = {
566
    opacity: element.getInlineOpacity(),
561 567
    position: element.getStyle('position'),
562 568
    top:  element.style.top,
563 569
    left: element.style.left,
......
565 571
    height: element.style.height
566 572
  };
567 573
  return new Effect.Parallel(
568
   [ new Effect.Scale(element, 200, 
569
      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), 
570
     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], 
571
     Object.extend({ duration: 1.0, 
574
   [ new Effect.Scale(element, 200,
575
      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }),
576
     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],
577
     Object.extend({ duration: 1.0,
572 578
      beforeSetupInternal: function(effect) {
573
        Position.absolutize(effect.effects[0].element)
579
        Position.absolutize(effect.effects[0].element);
574 580
      },
575 581
      afterFinishInternal: function(effect) {
576 582
         effect.effects[0].element.hide().setStyle(oldStyle); }
......
582 588
  element = $(element);
583 589
  element.makeClipping();
584 590
  return new Effect.Scale(element, 0,
585
    Object.extend({ scaleContent: false, 
586
      scaleX: false, 
591
    Object.extend({ scaleContent: false,
592
      scaleX: false,
587 593
      restoreAfterFinish: true,
588 594
      afterFinishInternal: function(effect) {
589 595
        effect.element.hide().undoClipping();
590
      } 
596
      }
591 597
    }, arguments[1] || { })
592 598
  );
593 599
};
......
595 601
Effect.BlindDown = function(element) {
596 602
  element = $(element);
597 603
  var elementDimensions = element.getDimensions();
598
  return new Effect.Scale(element, 100, Object.extend({ 
599
    scaleContent: false, 
604
  return new Effect.Scale(element, 100, Object.extend({
605
    scaleContent: false,
600 606
    scaleX: false,
601 607
    scaleFrom: 0,
602 608
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
603 609
    restoreAfterFinish: true,
604 610
    afterSetup: function(effect) {
605
      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
606
    },  
611
      effect.element.makeClipping().setStyle({height: '0px'}).show();
612
    },
607 613
    afterFinishInternal: function(effect) {
608 614
      effect.element.undoClipping();
609 615
    }
......
618 624
    from: 0,
619 625
    transition: Effect.Transitions.flicker,
620 626
    afterFinishInternal: function(effect) {
621
      new Effect.Scale(effect.element, 1, { 
627
      new Effect.Scale(effect.element, 1, {
622 628
        duration: 0.3, scaleFromCenter: true,
623 629
        scaleX: false, scaleContent: false, restoreAfterFinish: true,
624
        beforeSetup: function(effect) { 
630
        beforeSetup: function(effect) {
625 631
          effect.element.makePositioned().makeClipping();
626 632
        },
627 633
        afterFinishInternal: function(effect) {
628 634
          effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
629 635
        }
630
      })
636
      });
631 637
    }
632 638
  }, arguments[1] || { }));
633 639
};
......
639 645
    left: element.getStyle('left'),
640 646
    opacity: element.getInlineOpacity() };
641 647
  return new Effect.Parallel(
642
    [ new Effect.Move(element, {x: 0, y: 100, sync: true }), 
648
    [ new Effect.Move(element, {x: 0, y: 100, sync: true }),
643 649
      new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
644 650
    Object.extend(
645 651
      { duration: 0.5,
646 652
        beforeSetup: function(effect) {
647
          effect.effects[0].element.makePositioned(); 
653
          effect.effects[0].element.makePositioned();
648 654
        },
649 655
        afterFinishInternal: function(effect) {
650 656
          effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
651
        } 
657
        }
652 658
      }, arguments[1] || { }));
653 659
};
654 660

  
......
676 682
    new Effect.Move(effect.element,
677 683
      { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) {
678 684
        effect.element.undoPositioned().setStyle(oldStyle);
679
  }}) }}) }}) }}) }}) }});
685
  }}); }}); }}); }}); }}); }});
680 686
};
681 687

  
682 688
Effect.SlideDown = function(element) {
......
684 690
  // SlideDown need to have the content of the element wrapped in a container element with fixed height!
685 691
  var oldInnerBottom = element.down().getStyle('bottom');
686 692
  var elementDimensions = element.getDimensions();
687
  return new Effect.Scale(element, 100, Object.extend({ 
688
    scaleContent: false, 
689
    scaleX: false, 
693
  return new Effect.Scale(element, 100, Object.extend({
694
    scaleContent: false,
695
    scaleX: false,
690 696
    scaleFrom: window.opera ? 0 : 1,
691 697
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
692 698
    restoreAfterFinish: true,
......
694 700
      effect.element.makePositioned();
695 701
      effect.element.down().makePositioned();
696 702
      if (window.opera) effect.element.setStyle({top: ''});
697
      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
703
      effect.element.makeClipping().setStyle({height: '0px'}).show();
698 704
    },
699 705
    afterUpdateInternal: function(effect) {
700 706
      effect.element.down().setStyle({bottom:
701
        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
707
        (effect.dims[0] - effect.element.clientHeight) + 'px' });
702 708
    },
703 709
    afterFinishInternal: function(effect) {
704 710
      effect.element.undoClipping().undoPositioned();
......
712 718
  var oldInnerBottom = element.down().getStyle('bottom');
713 719
  var elementDimensions = element.getDimensions();
714 720
  return new Effect.Scale(element, window.opera ? 0 : 1,
715
   Object.extend({ scaleContent: false, 
716
    scaleX: false, 
721
   Object.extend({ scaleContent: false,
722
    scaleX: false,
717 723
    scaleMode: 'box',
718 724
    scaleFrom: 100,
719 725
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
......
723 729
      effect.element.down().makePositioned();
724 730
      if (window.opera) effect.element.setStyle({top: ''});
725 731
      effect.element.makeClipping().show();
726
    },  
732
    },
727 733
    afterUpdateInternal: function(effect) {
728 734
      effect.element.down().setStyle({bottom:
729 735
        (effect.dims[0] - effect.element.clientHeight) + 'px' });
......
736 742
  );
737 743
};
738 744

  
739
// Bug in opera makes the TD containing this element expand for a instance after finish 
745
// Bug in opera makes the TD containing this element expand for a instance after finish
740 746
Effect.Squish = function(element) {
741
  return new Effect.Scale(element, window.opera ? 1 : 0, { 
747
  return new Effect.Scale(element, window.opera ? 1 : 0, {
742 748
    restoreAfterFinish: true,
743 749
    beforeSetup: function(effect) {
744
      effect.element.makeClipping(); 
745
    },  
750
      effect.element.makeClipping();
751
    },
746 752
    afterFinishInternal: function(effect) {
747
      effect.element.hide().undoClipping(); 
753
      effect.element.hide().undoClipping();
748 754
    }
749 755
  });
750 756
};
......
764 770
    width: element.style.width,
765 771
    opacity: element.getInlineOpacity() };
766 772

  
767
  var dims = element.getDimensions();    
773
  var dims = element.getDimensions();
768 774
  var initialMoveX, initialMoveY;
769 775
  var moveX, moveY;
770
  
776

  
771 777
  switch (options.direction) {
772 778
    case 'top-left':
773
      initialMoveX = initialMoveY = moveX = moveY = 0; 
779
      initialMoveX = initialMoveY = moveX = moveY = 0;
774 780
      break;
775 781
    case 'top-right':
776 782
      initialMoveX = dims.width;
......
795 801
      moveY = -dims.height / 2;
796 802
      break;
797 803
  }
798
  
804

  
799 805
  return new Effect.Move(element, {
800 806
    x: initialMoveX,
801 807
    y: initialMoveY,
802
    duration: 0.01, 
808
    duration: 0.01,
803 809
    beforeSetup: function(effect) {
804 810
      effect.element.hide().makeClipping().makePositioned();
805 811
    },
......
808 814
        [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
809 815
          new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
810 816
          new Effect.Scale(effect.element, 100, {
811
            scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, 
817
            scaleMode: { originalHeight: dims.height, originalWidth: dims.width },
812 818
            sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
813 819
        ], Object.extend({
814 820
             beforeSetup: function(effect) {
815
               effect.effects[0].element.setStyle({height: '0px'}).show(); 
821
               effect.effects[0].element.setStyle({height: '0px'}).show();
816 822
             },
817 823
             afterFinishInternal: function(effect) {
818
               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); 
824
               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
819 825
             }
820 826
           }, options)
821
      )
827
      );
822 828
    }
823 829
  });
824 830
};
......
840 846

  
841 847
  var dims = element.getDimensions();
842 848
  var moveX, moveY;
843
  
849

  
844 850
  switch (options.direction) {
845 851
    case 'top-left':
846 852
      moveX = moveY = 0;
......
857 863
      moveX = dims.width;
858 864
      moveY = dims.height;
859 865
      break;
860
    case 'center':  
866
    case 'center':
861 867
      moveX = dims.width / 2;
862 868
      moveY = dims.height / 2;
863 869
      break;
864 870
  }
865
  
871

  
866 872
  return new Effect.Parallel(
867 873
    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
868 874
      new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
869 875
      new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
870
    ], Object.extend({            
876
    ], Object.extend({
871 877
         beforeStartInternal: function(effect) {
872
           effect.effects[0].element.makePositioned().makeClipping(); 
878
           effect.effects[0].element.makePositioned().makeClipping();
873 879
         },
874 880
         afterFinishInternal: function(effect) {
875 881
           effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
......
879 885

  
880 886
Effect.Pulsate = function(element) {
881 887
  element = $(element);
882
  var options    = arguments[1] || { };
883
  var oldOpacity = element.getInlineOpacity();
884
  var transition = options.transition || Effect.Transitions.sinoidal;
885
  var reverser   = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
886
  reverser.bind(transition);
887
  return new Effect.Opacity(element, 
888
  var options    = arguments[1] || { },
889
    oldOpacity = element.getInlineOpacity(),
890
    transition = options.transition || Effect.Transitions.linear,
891
    reverser   = function(pos){
892
      return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5);
893
    };
894

  
895
  return new Effect.Opacity(element,
888 896
    Object.extend(Object.extend({  duration: 2.0, from: 0,
889 897
      afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
890 898
    }, options), {transition: reverser}));
......
898 906
    width: element.style.width,
899 907
    height: element.style.height };
900 908
  element.makeClipping();
901
  return new Effect.Scale(element, 5, Object.extend({   
909
  return new Effect.Scale(element, 5, Object.extend({
902 910
    scaleContent: false,
903 911
    scaleX: false,
904 912
    afterFinishInternal: function(effect) {
905
    new Effect.Scale(element, 1, { 
906
      scaleContent: false, 
913
    new Effect.Scale(element, 1, {
914
      scaleContent: false,
907 915
      scaleY: false,
908 916
      afterFinishInternal: function(effect) {
909 917
        effect.element.hide().undoClipping().setStyle(oldStyle);
......
918 926
    var options = Object.extend({
919 927
      style: { }
920 928
    }, arguments[1] || { });
921
    
929

  
922 930
    if (!Object.isString(options.style)) this.style = $H(options.style);
923 931
    else {
924 932
      if (options.style.include(':'))
......
936 944
          effect.transforms.each(function(transform) {
937 945
            effect.element.style[transform.style] = '';
938 946
          });
939
        }
947
        };
940 948
      }
941 949
    }
942 950
    this.start(options);
943 951
  },
944
  
952

  
945 953
  setup: function(){
946 954
    function parseColor(color){
947 955
      if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
948 956
      color = color.parseColor();
949 957
      return $R(0,2).map(function(i){
950
        return parseInt( color.slice(i*2+1,i*2+3), 16 ) 
958
        return parseInt( color.slice(i*2+1,i*2+3), 16 );
951 959
      });
952 960
    }
953 961
    this.transforms = this.style.map(function(pair){
......
967 975
      }
968 976

  
969 977
      var originalValue = this.element.getStyle(property);
970
      return { 
971
        style: property.camelize(), 
972
        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), 
978
      return {
979
        style: property.camelize(),
980
        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),
973 981
        targetValue: unit=='color' ? parseColor(value) : value,
974 982
        unit: unit
975 983
      };
......
980 988
          transform.unit != 'color' &&
981 989
          (isNaN(transform.originalValue) || isNaN(transform.targetValue))
982 990
        )
983
      )
991
      );
984 992
    });
985 993
  },
986 994
  update: function(position) {
987 995
    var style = { }, transform, i = this.transforms.length;
988 996
    while(i--)
989
      style[(transform = this.transforms[i]).style] = 
997
      style[(transform = this.transforms[i]).style] =
990 998
        transform.unit=='color' ? '#'+
991 999
          (Math.round(transform.originalValue[0]+
992 1000
            (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
......
995 1003
          (Math.round(transform.originalValue[2]+
996 1004
            (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
997 1005
        (transform.originalValue +
998
          (transform.targetValue - transform.originalValue) * position).toFixed(3) + 
1006
          (transform.targetValue - transform.originalValue) * position).toFixed(3) +
999 1007
            (transform.unit === null ? '' : transform.unit);
1000 1008
    this.element.setStyle(style, true);
1001 1009
  }
......
1032 1040
});
1033 1041

  
1034 1042
Element.CSS_PROPERTIES = $w(
1035
  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 
1043
  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +
1036 1044
  'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
1037 1045
  'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
1038 1046
  'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
......
1041 1049
  'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
1042 1050
  'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
1043 1051
  'right textIndent top width wordSpacing zIndex');
1044
  
1052

  
1045 1053
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
1046 1054

  
1047 1055
String.__parseStyleElement = document.createElement('div');
......
1053 1061
    String.__parseStyleElement.innerHTML = '<div style="' + this + '"></div>';
1054 1062
    style = String.__parseStyleElement.childNodes[0].style;
1055 1063
  }
1056
  
1064

  
1057 1065
  Element.CSS_PROPERTIES.each(function(property){
1058
    if (style[property]) styleRules.set(property, style[property]); 
1066
    if (style[property]) styleRules.set(property, style[property]);
1059 1067
  });
1060
  
1068

  
1061 1069
  if (Prototype.Browser.IE && this.include('opacity'))
1062 1070
    styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);
1063 1071

  
......
1083 1091
    if (!styles.opacity) styles.opacity = element.getOpacity();
1084 1092
    return styles;
1085 1093
  };
1086
};
1094
}
1087 1095

  
1088 1096
Effect.Methods = {
1089 1097
  morph: function(element, style) {
......
1092 1100
    return element;
1093 1101
  },
1094 1102
  visualEffect: function(element, effect, options) {
1095
    element = $(element)
1103
    element = $(element);
1096 1104
    var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1);
1097 1105
    new Effect[klass](element, options);
1098 1106
    return element;
......
1106 1114

  
1107 1115
$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+
1108 1116
  'pulsate shake puff squish switchOff dropOut').each(
1109
  function(effect) { 
1117
  function(effect) {
1110 1118
    Effect.Methods[effect] = function(element, options){
1111 1119
      element = $(element);
1112 1120
      Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options);
1113 1121
      return element;
1114
    }
1122
    };
1115 1123
  }
1116 1124
);
1117 1125

  
1118
$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( 
1126
$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(
1119 1127
  function(f) { Effect.Methods[f] = Element[f]; }
1120 1128
);
1121 1129

  
1122
Element.addMethods(Effect.Methods);
1130
Element.addMethods(Effect.Methods);
typo3/contrib/scriptaculous/unittest.js (Arbeitskopie)
1
// script.aculo.us unittest.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
1
// script.aculo.us unittest.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
2 2

  
3
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
//           (c) 2005-2007 Jon Tirsen (http://www.tirsen.com)
5
//           (c) 2005-2007 Michael Schuerig (http://www.schuerig.de/michael/)
3
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
//           (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
5
//           (c) 2005-2008 Michael Schuerig (http://www.schuerig.de/michael/)
6 6
//
7 7
// script.aculo.us is freely distributable under the terms of an MIT-style license.
8 8
// For details, see the script.aculo.us web site: http://script.aculo.us/
......
32 32
  this.mark.style.left = options.pointerX + "px";
33 33
  this.mark.style.width = "5px";
34 34
  this.mark.style.height = "5px;";
35
  this.mark.style.borderTop = "1px solid red;"
36
  this.mark.style.borderLeft = "1px solid red;"
35
  this.mark.style.borderTop = "1px solid red;";
36
  this.mark.style.borderLeft = "1px solid red;";
37 37
  
38 38
  if(this.step)
39 39
    alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options));
......
67 67
  }
68 68
};
69 69

  
70
var Test = {}
70
var Test = {};
71 71
Test.Unit = {};
72 72

  
73 73
// security exception workaround
......
117 117
    '<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' +
118 118
    '<tbody id="loglines"></tbody>' +
119 119
    '</table>';
120
    this.logsummary = $('logsummary')
120
    this.logsummary = $('logsummary');
121 121
    this.loglines = $('loglines');
122 122
  },
123 123
  _toHTML: function(txt) {
......
125 125
  },
126 126
  addLinksToResults: function(){ 
127 127
    $$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log
128
      td.title = "Run only this test"
128
      td.title = "Run only this test";
129 129
      Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;});
130 130
    });
131 131
    $$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log
132
      td.title = "Run all tests"
132
      td.title = "Run all tests";
133 133
      Event.observe(td, 'click', function(){ window.location.search = "";});
134 134
    });
135 135
  }
136
}
136
};
137 137

  
138 138
Test.Unit.Runner = Class.create();
139 139
Test.Unit.Runner.prototype = {
......
246 246
      failures   + " failures, " +
247 247
      errors     + " errors");
248 248
  }
249
}
249
};
250 250

  
251 251
Test.Unit.Assertions = Class.create();
252 252
Test.Unit.Assertions.prototype = {
......
331 331
    catch(e) { this.error(e); } 
332 332
  },
333 333
  assertNull: function(obj) {
334
    var message = arguments[1] || 'assertNull'
334
    var message = arguments[1] || 'assertNull';
335 335
    try { (obj==null) ? this.pass() : 
336 336
      this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); }
337 337
    catch(e) { this.error(e); }
......
461 461
       iterations + ' iterations in ' + (timeTaken/1000)+'s' );
462 462
    return timeTaken;
463 463
  }
464
}
464
};
465 465

  
466 466
Test.Unit.Testcase = Class.create();
467 467
Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), {
......
526 526
  };
527 527
  var makeAssertion = function(assertion, args, object) { 
528 528
   	this[assertion].apply(this,(args || []).concat([object]));
529
  }
529
  };
530 530
  
531 531
  Test.BDDMethods = {};   
532 532
  $H(METHODMAP).each(function(pair) { 
......
539 539
  [Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each(
540 540
    function(p){ Object.extend(p, Test.BDDMethods) }
541 541
  );
542
}
542
};
543 543

  
544 544
Test.context = function(name, spec, log){
545 545
  Test.setupBDDExtensionMethods();
typo3/contrib/scriptaculous/scriptaculous.js (Arbeitskopie)
1
// script.aculo.us scriptaculous.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
1
// script.aculo.us scriptaculous.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
2 2

  
3
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
// 
3
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
//
5 5
// Permission is hereby granted, free of charge, to any person obtaining
6 6
// a copy of this software and associated documentation files (the
7 7
// "Software"), to deal in the Software without restriction, including
......
9 9
// distribute, sublicense, and/or sell copies of the Software, and to
10 10
// permit persons to whom the Software is furnished to do so, subject to
11 11
// the following conditions:
12
// 
12
//
13 13
// The above copyright notice and this permission notice shall be
14 14
// included in all copies or substantial portions of the Software.
15 15
//
......
24 24
// For details, see the script.aculo.us web site: http://script.aculo.us/
25 25

  
26 26
var Scriptaculous = {
27
  Version: '1.8.1',
27
  Version: '1.8.2',
28 28
  require: function(libraryName) {
29 29
    // inserting via DOM fails in Safari 2.0, so brute force approach
30 30
    document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
31 31
  },
32
  REQUIRED_PROTOTYPE: '1.6.0',
32
  REQUIRED_PROTOTYPE: '1.6.0.3',
33 33
  load: function() {
34
    function convertVersionString(versionString){
35
      var r = versionString.split('.');
36
      return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
34
    function convertVersionString(versionString) {
35
      var v = versionString.replace(/_.*|\./g, '');
36
      v = parseInt(v + '0'.times(4-v.length));
37
      return versionString.indexOf('_') > -1 ? v-1 : v;
37 38
    }
38
 
39
    if((typeof Prototype=='undefined') || 
40
       (typeof Element == 'undefined') || 
39

  
40
    if((typeof Prototype=='undefined') ||
41
       (typeof Element == 'undefined') ||
41 42
       (typeof Element.Methods=='undefined') ||
42
       (convertVersionString(Prototype.Version) < 
43
       (convertVersionString(Prototype.Version) <
43 44
        convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
44 45
       throw("script.aculo.us requires the Prototype JavaScript framework >= " +
45 46
        Scriptaculous.REQUIRED_PROTOTYPE);
46
    
47
    $A(document.getElementsByTagName("script")).findAll( function(s) {
48
      return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
49
    }).each( function(s) {
50
      var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
51
      var includes = s.src.match(/\?.*load=([a-z,]*)/);
47

  
48
    var js = /scriptaculous\.js(\?.*)?$/;
49
    $$('head script[src]').findAll(function(s) {
50
      return s.src.match(js);
51
    }).each(function(s) {
52
      var path = s.src.replace(js, ''),
53
      includes = s.src.match(/\?.*load=([a-z,]*)/);
52 54
      (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
53 55
       function(include) { Scriptaculous.require(path+include+'.js') });
54 56
    });
55 57
  }
56
}
58
};
57 59

  
58 60
Scriptaculous.load();
typo3/contrib/scriptaculous/dragdrop.js (Arbeitskopie)
1
// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
1
// script.aculo.us dragdrop.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
2 2

  
3
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
//           (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
5
// 
3
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
//           (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
5
//
6 6
// script.aculo.us is freely distributable under the terms of an MIT-style license.
7 7
// For details, see the script.aculo.us web site: http://script.aculo.us/
8 8

  
......
34 34
        options._containers.push($(containment));
35 35
      }
36 36
    }
37
    
37

  
38 38
    if(options.accept) options.accept = [options.accept].flatten();
39 39

  
40 40
    Element.makePositioned(element); // fix IE
......
42 42

  
43 43
    this.drops.push(options);
44 44
  },
45
  
45

  
46 46
  findDeepestChild: function(drops) {
47 47
    deepest = drops[0];
48
      
48

  
49 49
    for (i = 1; i < drops.length; ++i)
50 50
      if (Element.isParent(drops[i].element, deepest.element))
51 51
        deepest = drops[i];
52
    
52

  
53 53
    return deepest;
54 54
  },
55 55

  
56 56
  isContained: function(element, drop) {
57 57
    var containmentNode;
58 58
    if(drop.tree) {
59
      containmentNode = element.treeNode; 
59
      containmentNode = element.treeNode;
60 60
    } else {
61 61
      containmentNode = element.parentNode;
62 62
    }
63 63
    return drop._containers.detect(function(c) { return containmentNode == c });
64 64
  },
65
  
65

  
66 66
  isAffected: function(point, element, drop) {
67 67
    return (
68 68
      (drop.element!=element) &&
69 69
      ((!drop._containers) ||
70 70
        this.isContained(element, drop)) &&
71 71
      ((!drop.accept) ||
72
        (Element.classNames(element).detect( 
72
        (Element.classNames(element).detect(
73 73
          function(v) { return drop.accept.include(v) } ) )) &&
74 74
      Position.within(drop.element, point[0], point[1]) );
75 75
  },
......
89 89
  show: function(point, element) {
90 90
    if(!this.drops.length) return;
91 91
    var drop, affected = [];
92
    
92

  
93 93
    this.drops.each( function(drop) {
94 94
      if(Droppables.isAffected(point, element, drop))
95 95
        affected.push(drop);
96 96
    });
97
        
97

  
98 98
    if(affected.length>0)
99 99
      drop = Droppables.findDeepestChild(affected);
100 100

  
......
103 103
      Position.within(drop.element, point[0], point[1]);
104 104
      if(drop.onHover)
105 105
        drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
106
      
106

  
107 107
      if (drop != this.last_active) Droppables.activate(drop);
108 108
    }
109 109
  },
......
114 114

  
115 115
    if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
116 116
      if (this.last_active.onDrop) {
117
        this.last_active.onDrop(element, this.last_active.element, event); 
118
        return true; 
117
        this.last_active.onDrop(element, this.last_active.element, event);
118
        return true;
119 119
      }
120 120
  },
121 121

  
......
123 123
    if(this.last_active)
124 124
      this.deactivate(this.last_active);
125 125
  }
126
}
126
};
127 127

  
128 128
var Draggables = {
129 129
  drags: [],
130 130
  observers: [],
131
  
131

  
132 132
  register: function(draggable) {
133 133
    if(this.drags.length == 0) {
134 134
      this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
135 135
      this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
136 136
      this.eventKeypress  = this.keyPress.bindAsEventListener(this);
137
      
137

  
138 138
      Event.observe(document, "mouseup", this.eventMouseUp);
139 139
      Event.observe(document, "mousemove", this.eventMouseMove);
140 140
      Event.observe(document, "keypress", this.eventKeypress);
141 141
    }
142 142
    this.drags.push(draggable);
143 143
  },
144
  
144

  
145 145
  unregister: function(draggable) {
146 146
    this.drags = this.drags.reject(function(d) { return d==draggable });
147 147
    if(this.drags.length == 0) {
......
150 150
      Event.stopObserving(document, "keypress", this.eventKeypress);
151 151
    }
152 152
  },
153
  
153

  
154 154
  activate: function(draggable) {
155
    if(draggable.options.delay) { 
156
      this._timeout = setTimeout(function() { 
157
        Draggables._timeout = null; 
158
        window.focus(); 
159
        Draggables.activeDraggable = draggable; 
160
      }.bind(this), draggable.options.delay); 
155
    if(draggable.options.delay) {
156
      this._timeout = setTimeout(function() {
157
        Draggables._timeout = null;
158
        window.focus();
159
        Draggables.activeDraggable = draggable;
160
      }.bind(this), draggable.options.delay);
161 161
    } else {
162 162
      window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
163 163
      this.activeDraggable = draggable;
164 164
    }
165 165
  },
166
  
166

  
167 167
  deactivate: function() {
168 168
    this.activeDraggable = null;
169 169
  },
170
  
170

  
171 171
  updateDrag: function(event) {
172 172
    if(!this.activeDraggable) return;
173 173
    var pointer = [Event.pointerX(event), Event.pointerY(event)];
......
175 175
    // the same coordinates, prevent needless redrawing (moz bug?)
176 176
    if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
177 177
    this._lastPointer = pointer;
178
    
178

  
179 179
    this.activeDraggable.updateDrag(event, pointer);
180 180
  },
181
  
181

  
182 182
  endDrag: function(event) {
183
    if(this._timeout) { 
184
      clearTimeout(this._timeout); 
185
      this._timeout = null; 
183
    if(this._timeout) {
184
      clearTimeout(this._timeout);
185
      this._timeout = null;
186 186
    }
187 187
    if(!this.activeDraggable) return;
188 188
    this._lastPointer = null;
189 189
    this.activeDraggable.endDrag(event);
190 190
    this.activeDraggable = null;
191 191
  },
192
  
192

  
193 193
  keyPress: function(event) {
194 194
    if(this.activeDraggable)
195 195
      this.activeDraggable.keyPress(event);
196 196
  },
197
  
197

  
198 198
  addObserver: function(observer) {
199 199
    this.observers.push(observer);
200 200
    this._cacheObserverCallbacks();
201 201
  },
202
  
202

  
203 203
  removeObserver: function(element) {  // element instead of observer fixes mem leaks
204 204
    this.observers = this.observers.reject( function(o) { return o.element==element });
205 205
    this._cacheObserverCallbacks();
206 206
  },
207
  
207

  
208 208
  notify: function(eventName, draggable, event) {  // 'onStart', 'onEnd', 'onDrag'
209 209
    if(this[eventName+'Count'] > 0)
210 210
      this.observers.each( function(o) {
......
212 212
      });
213 213
    if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
214 214
  },
215
  
215

  
216 216
  _cacheObserverCallbacks: function() {
217 217
    ['onStart','onEnd','onDrag'].each( function(eventName) {
218 218
      Draggables[eventName+'Count'] = Draggables.observers.select(
......
220 220
      ).length;
221 221
    });
222 222
  }
223
}
223
};
224 224

  
225 225
/*--------------------------------------------------------------------------*/
226 226

  
......
236 236
      },
237 237
      endeffect: function(element) {
238 238
        var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
239
        new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, 
239
        new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
240 240
          queue: {scope:'_draggable', position:'end'},
241
          afterFinish: function(){ 
242
            Draggable._dragging[element] = false 
241
          afterFinish: function(){
242
            Draggable._dragging[element] = false
243 243
          }
244
        }); 
244
        });
245 245
      },
246 246
      zindex: 1000,
247 247
      revert: false,
......
252 252
      snap: false,  // false, or xy or [x,y] or function(x,y){ return [x,y] }
253 253
      delay: 0
254 254
    };
255
    
255

  
256 256
    if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
257 257
      Object.extend(defaults, {
258 258
        starteffect: function(element) {
259 259
          element._opacity = Element.getOpacity(element);
260 260
          Draggable._dragging[element] = true;
261
          new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); 
261
          new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
262 262
        }
263 263
      });
264
    
264

  
265 265
    var options = Object.extend(defaults, arguments[1] || { });
266 266

  
267 267
    this.element = $(element);
268
    
268

  
269 269
    if(options.handle && Object.isString(options.handle))
270 270
      this.handle = this.element.down('.'+options.handle, 0);
271
    
271

  
272 272
    if(!this.handle) this.handle = $(options.handle);
273 273
    if(!this.handle) this.handle = this.element;
274
    
274

  
275 275
    if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
276 276
      options.scroll = $(options.scroll);
277 277
      this._isScrollChild = Element.childOf(this.element, options.scroll);
278 278
    }
279 279

  
280
    Element.makePositioned(this.element); // fix IE    
280
    Element.makePositioned(this.element); // fix IE
281 281

  
282 282
    this.options  = options;
283
    this.dragging = false;   
283
    this.dragging = false;
284 284

  
285 285
    this.eventMouseDown = this.initDrag.bindAsEventListener(this);
286 286
    Event.observe(this.handle, "mousedown", this.eventMouseDown);
287
    
287

  
288 288
    Draggables.register(this);
289 289
  },
290
  
290

  
291 291
  destroy: function() {
292 292
    Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
293 293
    Draggables.unregister(this);
294 294
  },
295
  
295

  
296 296
  currentDelta: function() {
297 297
    return([
298 298
      parseInt(Element.getStyle(this.element,'left') || '0'),
299 299
      parseInt(Element.getStyle(this.element,'top') || '0')]);
300 300
  },
301
  
301

  
302 302
  initDrag: function(event) {
303 303
    if(!Object.isUndefined(Draggable._dragging[this.element]) &&
304 304
      Draggable._dragging[this.element]) return;
305
    if(Event.isLeftClick(event)) {    
305
    if(Event.isLeftClick(event)) {
306 306
      // abort on form elements, fixes a Firefox issue
307 307
      var src = Event.element(event);
308 308
      if((tag_name = src.tagName.toUpperCase()) && (
......
311 311
        tag_name=='OPTION' ||
312 312
        tag_name=='BUTTON' ||
... This diff was truncated because it exceeds the maximum size that can be displayed.