public
Description: script.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.
Homepage: http://script.aculo.us/
Clone URL: git://github.com/madrobby/scriptaculous.git
Search Repo:
Click here to lend your support to: scriptaculous and make a donation at www.pledgie.com !
Merge branch 'master' of git://github.com/staaky/scriptaculous
madrobby (author)
Sat May 03 09:34:21 -0700 2008
commit  00226c07b81ce6822c8cb1dc82f5d99f04ec39cc
tree    85a1ae030aa55c9bf4f71b19536572e2e0382307
parent  922ae2c0efa517696b69e92bec84105251b68d2a parent  65d299d93d39da9e941625e414d9c036f5c4ea46
...
 
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
9
0
@@ -1,3 +1,9 @@
0
+* Fixed Effect.ScrollTo. Changeset 8686 had a typo, document.viewport.getScrollOffsets[0] is always undefined. Removed the max check as it is not a cross-browser way to get scroll height and breaks the effect. Depending on scrollTo to do the right thing. Closes #11306. [Nick Stakenburg]
0
+
0
+* Update version check so all Prototype versions can be required, not just x.x.x. Closes #10966. [Nick Stakenburg]
0
+
0
+* Using $$ in the loader instead of getElementsByTagName to prevent limitations. Closes #9032. [Nick Stakenburg]
0
+
0
 * Fix some missing semicolons. [jdalton]
0
 
0
 * Update to Prototype 1.6.0.2 final
...
507
508
509
510
511
512
 
 
513
514
515
516
517
518
 
519
520
521
...
507
508
509
 
 
 
510
511
512
513
514
515
516
 
517
518
519
520
0
@@ -507,15 +507,14 @@
0
 
0
 Effect.ScrollTo = function(element) {
0
   var options = arguments[1] || { },
0
- scrollOffsets = document.viewport.getScrollOffsets(),
0
- elementOffsets = $(element).cumulativeOffset(),
0
- max = document.viewport.getScrollOffsets[0] - document.viewport.getHeight();
0
+ scrollOffsets = document.viewport.getScrollOffsets(),
0
+ elementOffsets = $(element).cumulativeOffset();
0
 
0
   if (options.offset) elementOffsets[1] += options.offset;
0
 
0
   return new Effect.Tween(null,
0
     scrollOffsets.top,
0
- elementOffsets[1] > max ? max : elementOffsets[1],
0
+ elementOffsets[1] elementOffsets[1],
0
     options,
0
     function(p){ scrollTo(scrollOffsets.left, p.round()) }
0
   );
...
27
28
29
30
 
31
32
33
34
 
 
 
 
35
36
37
38
 
 
 
39
40
 
41
42
43
44
45
46
47
48
49
 
 
 
 
 
 
 
50
51
52
...
27
28
29
 
30
31
 
 
 
32
33
34
35
36
 
 
 
37
38
39
40
 
41
42
43
44
 
 
 
 
 
 
45
46
47
48
49
50
51
52
53
54
0
@@ -27,26 +27,28 @@
0
     // inserting via DOM fails in Safari 2.0, so brute force approach
0
     document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
0
   },
0
- REQUIRED_PROTOTYPE: '1.6.0',
0
+ REQUIRED_PROTOTYPE: '1.6.0.2',
0
   load: function() {
0
- function convertVersionString(versionString){
0
- var r = versionString.split('.');
0
- return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
0
+ function convertVersionString(versionString) {
0
+ var v = versionString.replace(/_.*|\./g, '');
0
+ v = parseInt(v + '0'.times(4-v.length));
0
+ return versionString.indexOf('_') > -1 ? v-1 : v;
0
     }
0
-
0
- if((typeof Prototype=='undefined') ||
0
- (typeof Element == 'undefined') ||
0
+
0
+ if((typeof Prototype=='undefined') ||
0
+ (typeof Element == 'undefined') ||
0
        (typeof Element.Methods=='undefined') ||
0
- (convertVersionString(Prototype.Version) <
0
+ (convertVersionString(Prototype.Version) <
0
         convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
0
        throw("script.aculo.us requires the Prototype JavaScript framework >= " +
0
         Scriptaculous.REQUIRED_PROTOTYPE);
0
-
0
- $A(document.getElementsByTagName("script")).findAll( function(s) {
0
- return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
0
- }).each( function(s) {
0
- var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
0
- var includes = s.src.match(/\?.*load=([a-z,]*)/);
0
+
0
+ var js = /scriptaculous\.js(\?.*)?$/;
0
+ $$('head script[src]').findAll(function(s) {
0
+ return s.src.match(js);
0
+ }).each(function(s) {
0
+ var path = s.src.replace(js, ''),
0
+ includes = s.src.match(/\?.*load=([a-z,]*)/);
0
       (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
0
        function(include) { Scriptaculous.require(path+include+'.js') });
0
     });

Comments

    No one has commented yet.