Author: yohei
Date: Tue May 22 21:12:10 2012
New Revision: 1341627

URL: http://svn.apache.org/viewvc?rev=1341627&view=rev
Log:
updated smooth scrolling lib

Modified:
    incubator/cordova/site/bin/config.json
    incubator/cordova/site/public/js/smooth.pack.js
    incubator/cordova/site/www/js/smooth.pack.js

Modified: incubator/cordova/site/bin/config.json
URL: 
http://svn.apache.org/viewvc/incubator/cordova/site/bin/config.json?rev=1341627&r1=1341626&r2=1341627&view=diff
==============================================================================
--- incubator/cordova/site/bin/config.json (original)
+++ incubator/cordova/site/bin/config.json Tue May 22 21:12:10 2012
@@ -1,95 +1,137 @@
 {
-       "releases":[
-               /*{
-                       "version":      "1.4",
-                       "file":         "#",
-                       "note":         "#"
-               }*/
-       ],
-       
-       "repos":{
-               "platforms":[
-                       {
-                               "name":         "Android",
-                               "github":       
"https://github.com/apache/incubator-cordova-android";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=summary";
-                       },
-                       {
-                               "name":         "Bada",
-                               "github":       
"https://github.com/apache/incubator-cordova-bada";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-bada.git;a=summary";
-                       },
-                       {
-                               "name":         "Blackberry",
-                               "github":       
"https://github.com/apache/incubator-cordova-blackberry-webworks";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-blackberry-webworks.git;a=summary";
-                       },
-                       {
-                               "name":         "iOS",
-                               "github":       
"https://github.com/apache/incubator-cordova-ios";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=summary";
-                       },
-                       {
-                               "name":         "Mac OS X",
-                               "github":       
"https://github.com/apache/incubator-cordova-mac";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mac.git;a=summary";
-                       },
-                       {
-                               "name":         "WebOS",
-                               "github":       
"https://github.com/apache/incubator-cordova-webos";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-webos.git;a=summary";
-                       },
-                       {
-                               "name":         "Windows Phone",
-                               "github":       
"https://github.com/apache/incubator-cordova-wp7";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-wp7.git;a=summary";
-                       }
-               ],
-               
-               "other":[
-                       {
-                               "name":         "Docs",
-                               "github":       
"https://github.com/apache/incubator-cordova-docs";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-docs.git;a=summary";
-                       },
-                       {
-                               "name":         "Cordova-JS (JavaScript API)",
-                               "github":       
"https://github.com/apache/incubator-cordova-js";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=summary";
-                       },
-                       {
-                               "name":         "Mobile Spec (Test Suite)",
-                               "github":       
"https://github.com/apache/incubator-cordova-mobile-spec";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mobile-spec.git;a=summary";
-                       },
-                       {
-                               "name":         "Weinre",
-                               "github":       
"https://github.com/apache/incubator-cordova-weinre";,
-                               "apache":       
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-weinre.git;a=summary";
-                       }
-               ]
-       },
-       
-       "sitemap":{
-               "general":[
-                       { "title":"About Cordova",  "url":"index.html#about" },
-                       { "title":"Incubator Page", 
"url":"http://incubator.apache.org/projects/callback.html"; },
-                       { "title":"License",        
"url":"http://www.apache.org/licenses/LICENSE-2.0"; },
-                       { "title":"Artwork",        "url":"artwork.html" }
-               ],
-               "dev":[
-                       { "title":"Download",      "url":"index.html#download" 
},
-                       { "title":"Source Code",   
"url":"https://git-wip-us.apache.org/repos/asf"; },
-                       { "title":"License",       
"url":"http://www.apache.org/licenses/LICENSE-2.0"; },
-                       { "title":"Mailing List",  
"url":"index.html#mailing-list" },
-                       { "title":"Issue Tracker", 
"url":"https://issues.apache.org/jira/browse/CB"; },
-                       { "title":"Wiki",          
"url":"http://wiki.apache.org/cordova/"; }
-               ],
-               "asf":[
-                       { "title":"About ASF",        
"url":"http://www.apache.org/"; },
-                       { "title":"Thanks",           
"url":"http://www.apache.org/foundation/thanks.html"; },
-                       { "title":"Become a Sponsor", 
"url":"http://www.apache.org/foundation/sponsorship.html"; },
-                       { "title":"Security",         
"url":"http://www.apache.org/security/"; }
-               ]
-       }
+    "releases": [
+        /*{
+        "version":  "1.4",
+        "file":     "#",
+        "note":     "#"
+        }*/
+    ],
+
+    "repos": {
+        "platforms": [
+        {
+            "name": "Android",
+            "github": "https://github.com/apache/incubator-cordova-android";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=summary";
+        },
+        {
+            "name": "Bada",
+            "github": "https://github.com/apache/incubator-cordova-bada";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-bada.git;a=summary";
+        },
+        {
+            "name": "Blackberry",
+            "github": 
"https://github.com/apache/incubator-cordova-blackberry-webworks";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-blackberry-webworks.git;a=summary";
+        },
+        {
+            "name": "iOS",
+            "github": "https://github.com/apache/incubator-cordova-ios";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=summary";
+        },
+        {
+            "name": "Mac OS X",
+            "github": "https://github.com/apache/incubator-cordova-mac";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mac.git;a=summary";
+        },
+        {
+            "name": "WebOS",
+            "github": "https://github.com/apache/incubator-cordova-webos";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-webos.git;a=summary";
+        },
+        {
+            "name": "Windows Phone",
+            "github": "https://github.com/apache/incubator-cordova-wp7";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-wp7.git;a=summary";
+        }
+        ],
+
+        "other": [
+        {
+            "name": "Docs",
+            "github": "https://github.com/apache/incubator-cordova-docs";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-docs.git;a=summary";
+        },
+        {
+            "name": "Cordova-JS (JavaScript API)",
+            "github": "https://github.com/apache/incubator-cordova-js";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=summary";
+        },
+        {
+            "name": "Mobile Spec (Test Suite)",
+            "github": 
"https://github.com/apache/incubator-cordova-mobile-spec";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mobile-spec.git;a=summary";
+        },
+        {
+            "name": "Weinre",
+            "github": "https://github.com/apache/incubator-cordova-weinre";,
+            "apache": 
"https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-weinre.git;a=summary";
+        }
+        ]
+    },
+
+    "sitemap": {
+        "general": [
+        {
+            "title": "About Cordova",
+            "url": "index.html#about"
+        },
+        {
+            "title": "Incubator Page",
+            "url": "http://incubator.apache.org/projects/callback.html";
+        },
+        {
+            "title": "License",
+            "url": "http://www.apache.org/licenses/LICENSE-2.0";
+        },
+        {
+            "title": "Artwork",
+            "url": "artwork.html"
+        }
+        ],
+        "dev": [
+        {
+            "title": "Download",
+            "url": "index.html#download"
+        },
+        {
+            "title": "Source Code",
+            "url": "https://git-wip-us.apache.org/repos/asf";
+        },
+        {
+            "title": "License",
+            "url": "http://www.apache.org/licenses/LICENSE-2.0";
+        },
+        {
+            "title": "Mailing List",
+            "url": "index.html#mailing-list"
+        },
+        {
+            "title": "Issue Tracker",
+            "url": "https://issues.apache.org/jira/browse/CB";
+        },
+        {
+            "title": "Wiki",
+            "url": "http://wiki.apache.org/cordova/";
+        }
+        ],
+        "asf": [
+        {
+            "title": "About ASF",
+            "url": "http://www.apache.org/";
+        },
+        {
+            "title": "Thanks",
+            "url": "http://www.apache.org/foundation/thanks.html";
+        },
+        {
+            "title": "Become a Sponsor",
+            "url": "http://www.apache.org/foundation/sponsorship.html";
+        },
+        {
+            "title": "Security",
+            "url": "http://www.apache.org/security/";
+        }
+        ]
+    }
 }

Modified: incubator/cordova/site/public/js/smooth.pack.js
URL: 
http://svn.apache.org/viewvc/incubator/cordova/site/public/js/smooth.pack.js?rev=1341627&r1=1341626&r2=1341627&view=diff
==============================================================================
--- incubator/cordova/site/public/js/smooth.pack.js (original)
+++ incubator/cordova/site/public/js/smooth.pack.js Tue May 22 21:12:10 2012
@@ -1,2 +1,198 @@
-//dezinerfolio
-eval((function(){a="Scroller={speed:10,8dC.;d.while(dC.+C.}} 
J8N;d=5;&&M4M}d&&dM4dM}%4%} 
0J8a,F4(F,fa@7a.4a.LP+F7Jend8e66.cancelBubble=true;6.Value=fa@;}&&(E(7J8di=Hner3||5.G3;hN.3;a=(Ed>ah-d>i7e@{-(h-d)7}e@{a=a+(d-a}To(0,aEa==a}=aJHit8KwHdow,A,A7,A82P;l=9;d=locatiP;D&&D.HdexOfL#)!=-1&&(l/+l=C)Kl,Gck,endEl.PGck=2l=this.hash.substr(1E9.name==l;i=setILL+(9)+),107}}}}}};Hit()",b=48;while(b>=0)a=a.replace(new
 
RegExp("%23456789@ACDEFGHJKLMNP".charAt(b),"g"),("\042Scroller.entfunction(offsetParscrollwindow.returndocumattachEvntervala=.getElemsByTagName(a);if(offsetTop){for(i=0;i<a.length;i++.pathnamea+=Math.ceil((d-ae.stopPropagationTopa.addEvListenerbody)/speede.prevDefaultclearI(i)pageYOffsetend(this);Height
 
.Elemev)}:a[i]lseload=dl.href);b,dcliin},((.=.=C||on".split(""))
 [b--]);return a})())
\ No newline at end of file
+/*--------------------------------------------------------------------------
+
+ *  Smooth Scroller Script, version 1.0.1
+
+ *  (c) 2007 Dezinerfolio Inc. <mid...@gmail.com>
+
+ *
+
+ *  For details, please check the website : http://dezinerfolio.com/
+
+ *
+
+/*--------------------------------------------------------------------------*/
+
+
+
+Scroller = {
+
+       // control the speed of the scroller.
+
+       // dont change it here directly, please use Scroller.speed=50;
+
+       speed:10,
+
+
+       // returns the Y position of the div
+
+       gy: function (d) {
+
+               gy = d.offsetTop
+
+               if (d.offsetParent) while (d = d.offsetParent) gy += d.offsetTop
+
+               return gy
+
+       },
+
+
+
+       // returns the current scroll position
+
+       scrollTop: function (){
+
+               body=document.body
+
+           d=document.documentElement
+
+           if (body && body.scrollTop) return body.scrollTop
+
+           if (d && d.scrollTop) return d.scrollTop
+
+           if (window.pageYOffset) return window.pageYOffset
+
+           return 0
+
+       },
+
+
+
+       // attach an event for an element
+
+       // (element, type, function)
+
+       add: function(event, body, d) {
+
+           if (event.addEventListener) return event.addEventListener(body, 
d,false)
+
+           if (event.attachEvent) return event.attachEvent('on'+body, d)
+
+       },
+
+
+
+       // kill an event of an element
+
+       end: function(e){
+        
+               if (window.event) {
+
+                       window.event.cancelBubble = true
+
+                       window.event.returnValue = false
+
+               return;
+
+       }
+        
+           if (e.preventDefault && e.stopPropagation) {
+
+             e.preventDefault()
+
+             e.stopPropagation()
+
+           }
+       },
+
+       
+
+       // move the scroll bar to the particular div.
+
+       scroll: function(d){
+
+               h=document.body.scrollHeight;
+
+               a = Scroller.scrollTop()
+
+               if(d>a)
+
+                       a+=Math.ceil((d-a)/Scroller.speed)
+
+               else
+
+                       a = a+(d-a)/Scroller.speed;
+
+               window.scrollTo(0,a)
+
+               if(a==d || Scroller.offsetTop==a) {
+                   clearInterval(Scroller.interval)
+           setTimeout(function(){
+                   window.location.hash = Scroller.hash;
+            }, 10);
+        }
+               Scroller.offsetTop=a
+
+       },
+
+       // initializer that adds the renderer to the onload function of the 
window
+
+       init: function(){
+
+               Scroller.add(window,'load', Scroller.render)
+
+       },
+
+
+
+       // this method extracts all the anchors and validates then as # and 
attaches the events.
+
+       render: function(){
+
+               a = document.getElementsByTagName('a');
+
+               Scroller.end(this);
+
+               window.onscroll
+
+           for (i=0;i<a.length;i++) {
+
+             l = a[i];
+
+             if(l.href && l.href.indexOf('#') != -1 && 
((l.pathname==location.pathname) || ('/'+l.pathname==location.pathname)) ){
+
+               Scroller.add(l,'click',Scroller.end)
+
+                       l.onclick = function(){
+
+                               Scroller.end(this);
+
+                               l=this.hash.substr(1);
+                               Scroller.hash = this.hash;
+
+                                a = document.getElementsByTagName('a');
+
+                                    for (i=0;i<a.length;i++) {
+
+                                       if(a[i].name == l){
+
+                                               
clearInterval(Scroller.interval);
+
+                                               
Scroller.interval=setInterval('Scroller.scroll('+Scroller.gy(a[i])+')',10);
+
+                                               }
+
+                                       }
+
+                               }
+
+               }
+
+               }
+
+       }
+
+}
+
+// invoke the initializer of the scroller
+
+Scroller.init();
+
+
+
+
+
+/*------------------------------------------------------------
+
+ *                                             END OF CODE
+
+/*-----------------------------------------------------------*/
\ No newline at end of file

Modified: incubator/cordova/site/www/js/smooth.pack.js
URL: 
http://svn.apache.org/viewvc/incubator/cordova/site/www/js/smooth.pack.js?rev=1341627&r1=1341626&r2=1341627&view=diff
==============================================================================
--- incubator/cordova/site/www/js/smooth.pack.js (original)
+++ incubator/cordova/site/www/js/smooth.pack.js Tue May 22 21:12:10 2012
@@ -1,2 +1,198 @@
-//dezinerfolio
-eval((function(){a="Scroller={speed:10,8dC.;d.while(dC.+C.}} 
J8N;d=5;&&M4M}d&&dM4dM}%4%} 
0J8a,F4(F,fa@7a.4a.LP+F7Jend8e66.cancelBubble=true;6.Value=fa@;}&&(E(7J8di=Hner3||5.G3;hN.3;a=(Ed>ah-d>i7e@{-(h-d)7}e@{a=a+(d-a}To(0,aEa==a}=aJHit8KwHdow,A,A7,A82P;l=9;d=locatiP;D&&D.HdexOfL#)!=-1&&(l/+l=C)Kl,Gck,endEl.PGck=2l=this.hash.substr(1E9.name==l;i=setILL+(9)+),107}}}}}};Hit()",b=48;while(b>=0)a=a.replace(new
 
RegExp("%23456789@ACDEFGHJKLMNP".charAt(b),"g"),("\042Scroller.entfunction(offsetParscrollwindow.returndocumattachEvntervala=.getElemsByTagName(a);if(offsetTop){for(i=0;i<a.length;i++.pathnamea+=Math.ceil((d-ae.stopPropagationTopa.addEvListenerbody)/speede.prevDefaultclearI(i)pageYOffsetend(this);Height
 
.Elemev)}:a[i]lseload=dl.href);b,dcliin},((.=.=C||on".split(""))
 [b--]);return a})())
\ No newline at end of file
+/*--------------------------------------------------------------------------
+
+ *  Smooth Scroller Script, version 1.0.1
+
+ *  (c) 2007 Dezinerfolio Inc. <mid...@gmail.com>
+
+ *
+
+ *  For details, please check the website : http://dezinerfolio.com/
+
+ *
+
+/*--------------------------------------------------------------------------*/
+
+
+
+Scroller = {
+
+       // control the speed of the scroller.
+
+       // dont change it here directly, please use Scroller.speed=50;
+
+       speed:10,
+
+
+       // returns the Y position of the div
+
+       gy: function (d) {
+
+               gy = d.offsetTop
+
+               if (d.offsetParent) while (d = d.offsetParent) gy += d.offsetTop
+
+               return gy
+
+       },
+
+
+
+       // returns the current scroll position
+
+       scrollTop: function (){
+
+               body=document.body
+
+           d=document.documentElement
+
+           if (body && body.scrollTop) return body.scrollTop
+
+           if (d && d.scrollTop) return d.scrollTop
+
+           if (window.pageYOffset) return window.pageYOffset
+
+           return 0
+
+       },
+
+
+
+       // attach an event for an element
+
+       // (element, type, function)
+
+       add: function(event, body, d) {
+
+           if (event.addEventListener) return event.addEventListener(body, 
d,false)
+
+           if (event.attachEvent) return event.attachEvent('on'+body, d)
+
+       },
+
+
+
+       // kill an event of an element
+
+       end: function(e){
+        
+               if (window.event) {
+
+                       window.event.cancelBubble = true
+
+                       window.event.returnValue = false
+
+               return;
+
+       }
+        
+           if (e.preventDefault && e.stopPropagation) {
+
+             e.preventDefault()
+
+             e.stopPropagation()
+
+           }
+       },
+
+       
+
+       // move the scroll bar to the particular div.
+
+       scroll: function(d){
+
+               h=document.body.scrollHeight;
+
+               a = Scroller.scrollTop()
+
+               if(d>a)
+
+                       a+=Math.ceil((d-a)/Scroller.speed)
+
+               else
+
+                       a = a+(d-a)/Scroller.speed;
+
+               window.scrollTo(0,a)
+
+               if(a==d || Scroller.offsetTop==a) {
+                   clearInterval(Scroller.interval)
+           setTimeout(function(){
+                   window.location.hash = Scroller.hash;
+            }, 10);
+        }
+               Scroller.offsetTop=a
+
+       },
+
+       // initializer that adds the renderer to the onload function of the 
window
+
+       init: function(){
+
+               Scroller.add(window,'load', Scroller.render)
+
+       },
+
+
+
+       // this method extracts all the anchors and validates then as # and 
attaches the events.
+
+       render: function(){
+
+               a = document.getElementsByTagName('a');
+
+               Scroller.end(this);
+
+               window.onscroll
+
+           for (i=0;i<a.length;i++) {
+
+             l = a[i];
+
+             if(l.href && l.href.indexOf('#') != -1 && 
((l.pathname==location.pathname) || ('/'+l.pathname==location.pathname)) ){
+
+               Scroller.add(l,'click',Scroller.end)
+
+                       l.onclick = function(){
+
+                               Scroller.end(this);
+
+                               l=this.hash.substr(1);
+                               Scroller.hash = this.hash;
+
+                                a = document.getElementsByTagName('a');
+
+                                    for (i=0;i<a.length;i++) {
+
+                                       if(a[i].name == l){
+
+                                               
clearInterval(Scroller.interval);
+
+                                               
Scroller.interval=setInterval('Scroller.scroll('+Scroller.gy(a[i])+')',10);
+
+                                               }
+
+                                       }
+
+                               }
+
+               }
+
+               }
+
+       }
+
+}
+
+// invoke the initializer of the scroller
+
+Scroller.init();
+
+
+
+
+
+/*------------------------------------------------------------
+
+ *                                             END OF CODE
+
+/*-----------------------------------------------------------*/
\ No newline at end of file


Reply via email to