pupu 0.0.1 → 0.0.2.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +12 -1
- data/README.textile +38 -104
- data/Rakefile +17 -54
- data/TODO.txt +11 -6
- data/examples/merb/README.textile +7 -0
- data/examples/merb/Rakefile +30 -0
- data/examples/merb/application.rb +13 -0
- data/examples/merb/config/framework.rb +7 -0
- data/examples/merb/config/init.rb +48 -0
- data/examples/{blog/media/pupu/autocompleter → merb/public}/javascripts/initializers/autocompleter.js +0 -0
- data/examples/{blog/media/pupu/flash → merb/public}/javascripts/initializers/flash.js +0 -0
- data/examples/{blog/media/pupu/lighter → merb/public/javascripts}/initializers/lighter.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/CHANGELOG +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/LICENSE +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/README.textile +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/Rakefile +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/TODO +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/config.rb +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/images/spinner.gif +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/autocompleter.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/autocompleter.local.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/autocompleter.request.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/observer.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/metadata.yml +0 -0
- data/examples/{blog/media → merb/public}/pupu/autocompleter/stylesheets/autocompleter.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/CHANGELOG +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/LICENSE +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/README.textile +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/Rakefile +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/TODO +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/config.rb +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/metadata.yml +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/ie.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/icons/cross.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/icons/key.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/icons/tick.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/readme.txt +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/screen.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/fancy-type/readme.txt +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/fancy-type/screen.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/doc.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/email.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/external.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/feed.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/im.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/pdf.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/visited.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/xls.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/readme.txt +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/screen.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/rtl/readme.txt +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/rtl/screen.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/print.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/screen.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/forms.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/grid.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/grid.png +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/ie.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/print.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/reset.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/typography.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/CHANGELOG +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/LICENSE +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/README.textile +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/Rakefile +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/TODO +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/config.rb +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/javascripts/flash.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/flash/metadata.yml +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/CHANGELOG +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/LICENSE +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/README.textile +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/TODO.txt +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/config.rb +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.css.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.html.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.js.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.md.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.php.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.ruby.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.shell.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.sql.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.template.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/ZeroClipboard.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/lighter.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/media/ZeroClipboard.swf +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/metadata.yml +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.git.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.mocha.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.panic.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.standard.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.template.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.tutti.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.twilight.css +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/CHANGELOG +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/LICENSE +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/README.textile +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/Rakefile +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/TODO +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/config.rb +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/javascripts/mootools-1.2-core.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/javascripts/mootools-1.2-more.js +0 -0
- data/examples/{blog/media → merb/public}/pupu/mootools/metadata.yml +0 -0
- data/examples/{blog/media/pupu/flash → merb/public}/stylesheets/initializers/flash.css +0 -0
- data/examples/merb/spec/application_spec.rb +37 -0
- data/examples/merb/spec/spec_helper.rb +16 -0
- data/examples/merb/views/examples/arguments.html.erb +0 -0
- data/examples/merb/views/examples/dependencies.html.erb +0 -0
- data/examples/merb/views/examples/simple.html.erb +4 -0
- data/examples/merb/views/index.html.erb +7 -0
- data/examples/merb/views/layout.html.erb +12 -0
- data/examples/rango/README.textile +7 -0
- data/examples/{blog → rango}/Rakefile +0 -0
- data/examples/{blog → rango}/config.ru +2 -3
- data/examples/{blog → rango}/init.rb +6 -5
- data/examples/{blog → rango}/media/javascripts/initializers/lighter.js +0 -0
- data/examples/rango/media/pupu/autocompleter/CHANGELOG +1 -0
- data/examples/rango/media/pupu/autocompleter/LICENSE +20 -0
- data/examples/rango/media/pupu/autocompleter/README.textile +26 -0
- data/examples/rango/media/pupu/autocompleter/Rakefile +29 -0
- data/examples/rango/media/pupu/autocompleter/TODO +1 -0
- data/examples/rango/media/pupu/autocompleter/config.rb +12 -0
- data/examples/rango/media/pupu/autocompleter/images/spinner.gif +0 -0
- data/examples/rango/media/pupu/autocompleter/javascripts/autocompleter.js +442 -0
- data/examples/rango/media/pupu/autocompleter/javascripts/autocompleter.local.js +31 -0
- data/examples/rango/media/pupu/autocompleter/javascripts/autocompleter.request.js +109 -0
- data/examples/rango/media/pupu/autocompleter/javascripts/initializers/autocompleter.js +26 -0
- data/examples/rango/media/pupu/autocompleter/javascripts/observer.js +69 -0
- data/examples/rango/media/pupu/autocompleter/metadata.yml +5 -0
- data/examples/rango/media/pupu/autocompleter/stylesheets/autocompleter.css +68 -0
- data/examples/rango/media/pupu/blueprint/CHANGELOG +1 -0
- data/examples/rango/media/pupu/blueprint/LICENSE +20 -0
- data/examples/rango/media/pupu/blueprint/README.textile +22 -0
- data/examples/rango/media/pupu/blueprint/Rakefile +29 -0
- data/examples/rango/media/pupu/blueprint/TODO +3 -0
- data/examples/rango/media/pupu/blueprint/config.rb +18 -0
- data/examples/rango/media/pupu/blueprint/metadata.yml +5 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/ie.css +26 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/icons/cross.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/icons/key.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/icons/tick.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/readme.txt +32 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/screen.css +97 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/fancy-type/readme.txt +14 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/fancy-type/screen.css +71 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/doc.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/email.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/external.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/feed.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/im.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/pdf.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/visited.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/xls.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/readme.txt +18 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/screen.css +40 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/rtl/readme.txt +10 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/plugins/rtl/screen.css +109 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/print.css +30 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/screen.css +251 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/src/forms.css +49 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/src/grid.css +212 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/src/grid.png +0 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/src/ie.css +59 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/src/print.css +85 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/src/reset.css +38 -0
- data/examples/rango/media/pupu/blueprint/stylesheets/src/typography.css +105 -0
- data/examples/rango/media/pupu/flash/CHANGELOG +1 -0
- data/examples/rango/media/pupu/flash/LICENSE +20 -0
- data/examples/rango/media/pupu/flash/README.textile +22 -0
- data/examples/rango/media/pupu/flash/Rakefile +37 -0
- data/examples/rango/media/pupu/flash/TODO +1 -0
- data/examples/rango/media/pupu/flash/config.rb +11 -0
- data/examples/rango/media/pupu/flash/javascripts/flash.js +63 -0
- data/examples/rango/media/pupu/flash/javascripts/initializers/flash.js +12 -0
- data/examples/rango/media/pupu/flash/metadata.yml +5 -0
- data/examples/rango/media/pupu/flash/stylesheets/initializers/flash.css +21 -0
- data/examples/rango/media/pupu/lighter/CHANGELOG +2 -0
- data/examples/rango/media/pupu/lighter/LICENSE +20 -0
- data/examples/rango/media/pupu/lighter/README.textile +19 -0
- data/examples/rango/media/pupu/lighter/TODO.txt +4 -0
- data/examples/rango/media/pupu/lighter/config.rb +20 -0
- data/examples/rango/media/pupu/lighter/initializers/lighter.js +11 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.css.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.html.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.js.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.md.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.php.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.ruby.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.shell.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.sql.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/Fuel.template.js +45 -0
- data/examples/rango/media/pupu/lighter/javascripts/ZeroClipboard.js +1 -0
- data/examples/rango/media/pupu/lighter/javascripts/lighter.js +1 -0
- data/examples/rango/media/pupu/lighter/media/ZeroClipboard.swf +0 -0
- data/examples/rango/media/pupu/lighter/metadata.yml +5 -0
- data/examples/rango/media/pupu/lighter/stylesheets/Flame.git.css +1 -0
- data/examples/rango/media/pupu/lighter/stylesheets/Flame.mocha.css +1 -0
- data/examples/rango/media/pupu/lighter/stylesheets/Flame.panic.css +1 -0
- data/examples/rango/media/pupu/lighter/stylesheets/Flame.standard.css +1 -0
- data/examples/rango/media/pupu/lighter/stylesheets/Flame.template.css +101 -0
- data/examples/rango/media/pupu/lighter/stylesheets/Flame.tutti.css +1 -0
- data/examples/rango/media/pupu/lighter/stylesheets/Flame.twilight.css +1 -0
- data/examples/rango/media/pupu/mootools/CHANGELOG +2 -0
- data/examples/rango/media/pupu/mootools/LICENSE +20 -0
- data/examples/rango/media/pupu/mootools/README.textile +19 -0
- data/examples/rango/media/pupu/mootools/Rakefile +29 -0
- data/examples/rango/media/pupu/mootools/TODO +1 -0
- data/examples/rango/media/pupu/mootools/config.rb +8 -0
- data/examples/rango/media/pupu/mootools/javascripts/mootools-1.2-core.js +350 -0
- data/examples/rango/media/pupu/mootools/javascripts/mootools-1.2-more.js +154 -0
- data/examples/rango/media/pupu/mootools/metadata.yml +5 -0
- data/examples/rango/spec/pupu_spec.rb +37 -0
- data/examples/rango/spec/spec_helper.rb +15 -0
- data/examples/{blog → rango}/templates/base.html.haml +2 -3
- data/examples/rango/templates/examples/arguments.html.haml +7 -0
- data/examples/{blog → rango}/templates/examples/base.html.haml +3 -3
- data/examples/{blog → rango}/templates/examples/dependencies.html.haml +1 -1
- data/examples/{blog → rango}/templates/examples/simple.html.haml +1 -1
- data/examples/{blog → rango}/templates/index.html.haml +0 -0
- data/lib/pupu.rb +1 -1
- data/lib/pupu/adapters/merb.rb +4 -10
- data/lib/pupu/adapters/rails.rb +6 -0
- data/lib/pupu/adapters/rango.rb +0 -1
- data/lib/pupu/cli.rb +7 -3
- data/lib/pupu/github.rb +1 -1
- data/pupu.pre.gemspec +44 -0
- data/script/spec +2 -0
- data/tasks/benchmark.rake +11 -0
- data/tasks/gem.rake +23 -0
- data/tasks/hooks.rake +12 -0
- data/tasks/release.rake +68 -0
- data/tasks/spec.rake +27 -0
- data/tasks/submodules.rake +33 -0
- data/tasks/yardoc.rake +9 -0
- metadata +227 -115
- data/examples/blog/Thorfile +0 -9
- data/examples/blog/bin/pupu +0 -4
- data/examples/blog/config/pupu.rb +0 -4
- data/examples/blog/templates/examples/arguments.html.haml +0 -7
- data/url.rb +0 -20
- data/url_spec.rb +0 -35
@@ -0,0 +1,154 @@
|
|
1
|
+
// Full version of MooTools More 1.2.1
|
2
|
+
//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2008 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
|
3
|
+
|
4
|
+
Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(B,A){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);
|
5
|
+
if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=$(B);this.parent(A);var C=this.element.retrieve("wrapper");
|
6
|
+
this.wrapper=C||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);
|
7
|
+
this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";
|
8
|
+
this.layout="width";this.offset=this.element.offsetWidth;},set:function(A){this.element.setStyle(this.margin,A[0]);this.wrapper.setStyle(this.layout,A[1]);
|
9
|
+
return this;},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B[F]=Fx.compute(E[F],D[F],C);});return B;},start:function(B,E){if(!this.check(arguments.callee,B,E)){return this;
|
10
|
+
}this[E||this.options.mode]();var D=this.element.getStyle(this.margin).toInt();var C=this.wrapper.getStyle(this.layout).toInt();var A=[[D,C],[0,this.offset]];
|
11
|
+
var G=[[D,C],[-this.offset,0]];var F;switch(B){case"in":F=A;break;case"out":F=G;break;case"toggle":F=(this.wrapper["offset"+this.layout.capitalize()]==0)?A:G;
|
12
|
+
}return this.parent(F[0],F[1]);},slideIn:function(A){return this.start("in",A);},slideOut:function(A){return this.start("out",A);},hide:function(A){this[A||this.options.mode]();
|
13
|
+
this.open=false;return this.set([-this.offset,0]);},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(A){return this.start("toggle",A);
|
14
|
+
}});Element.Properties.slide={set:function(B){var A=this.retrieve("slide");if(A){A.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},B));
|
15
|
+
},get:function(A){if(A||!this.retrieve("slide")){if(A||!this.retrieve("slide:options")){this.set("slide",A);}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));
|
16
|
+
}return this.retrieve("slide");}};Element.implement({slide:function(D,E){D=D||"toggle";var B=this.get("slide"),A;switch(D){case"hide":B.hide(E);break;case"show":B.show(E);
|
17
|
+
break;case"toggle":var C=this.retrieve("slide:flag",B.open);B[(C)?"slideOut":"slideIn"](E);this.store("slide:flag",!C);A=true;break;default:B.start(D,E);
|
18
|
+
}if(!A){this.eliminate("slide:flag");}return this;}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);
|
19
|
+
this.parent(A);var D=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body);}var C=this.element;
|
20
|
+
if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D);},true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D);
|
21
|
+
},true);}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1]);},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B.push(Fx.compute(E[F],D[F],C));
|
22
|
+
});return B;},start:function(C,H){if(!this.check(arguments.callee,C,H)){return this;}var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};
|
23
|
+
for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A;}else{D[G]=B[G];}D[G]+=this.options.offset[G];}return this.parent([B.x,B.y],[D.x,D.y]);
|
24
|
+
},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);},toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");
|
25
|
+
},toElement:function(B){var A=$(B).getPosition(this.element);return this.start(A.x,A.y);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.subject=$$(B);
|
26
|
+
this.parent(A);},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};for(var B in A){F[B]=this.parent(A[B],E[B],I);}}return C;
|
27
|
+
},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D],this.options.unit);}}return this;},start:function(C){if(!this.check(arguments.callee,C)){return this;
|
28
|
+
}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);A[B]=E.from;G[B]=E.to;}}return this.parent(H,I);
|
29
|
+
}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});
|
30
|
+
this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=(A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle)||this.element;
|
31
|
+
this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};
|
32
|
+
this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);
|
33
|
+
return this;},start:function(C){if(this.options.preventDefault){C.preventDefault();}this.fireEvent("beforeStart",this.element);this.mouse.start=C.page;
|
34
|
+
var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue;}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();
|
35
|
+
}else{this.value.now[D]=this.element[this.options.modifiers[D]];}if(this.options.invert){this.value.now[D]*=-1;}this.mouse.pos[D]=C.page[D]-this.value.now[D];
|
36
|
+
if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};
|
37
|
+
}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(A){if(this.options.preventDefault){A.preventDefault();
|
38
|
+
}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});
|
39
|
+
this.fireEvent("start",this.element).fireEvent("snap",this.element);}},drag:function(A){if(this.options.preventDefault){A.preventDefault();}this.mouse.now=A.page;
|
40
|
+
for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue;}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1;
|
41
|
+
}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];
|
42
|
+
}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B]);}if(this.options.style){this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit);
|
43
|
+
}else{this.element[this.options.modifiers[B]]=this.value.now[B];}}this.fireEvent("drag",this.element);},cancel:function(A){this.document.removeEvent("mousemove",this.bound.check);
|
44
|
+
this.document.removeEvent("mouseup",this.bound.cancel);if(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);
|
45
|
+
}},stop:function(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);
|
46
|
+
if(A){this.fireEvent("complete",this.element);}}});Element.implement({makeResizable:function(A){return new Drag(this,$merge({modifiers:{x:"width",y:"height"}},A));
|
47
|
+
}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false},initialize:function(C,B){this.parent(C,B);this.droppables=$$(this.options.droppables);
|
48
|
+
this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body);}C=this.element;
|
49
|
+
var D=C.getStyle("position");var A=(D!="static")?D:"absolute";if(C.getStyle("left")=="auto"||C.getStyle("top")=="auto"){C.position(C.getPosition(C.offsetParent));
|
50
|
+
}C.setStyle("position",A);this.addEvent("start",function(){this.checkDroppables();},true);},start:function(B){if(this.container){var D=this.element,J=this.container,E=J.getCoordinates(D.offsetParent),F={},A={};
|
51
|
+
["top","right","bottom","left"].each(function(K){F[K]=J.getStyle("padding-"+K).toInt();A[K]=D.getStyle("margin-"+K).toInt();},this);var C=D.offsetWidth+A.left+A.right,I=D.offsetHeight+A.top+A.bottom;
|
52
|
+
var H=[E.left+F.left,E.right-F.right-C];var G=[E.top+F.top,E.bottom-F.bottom-I];this.options.limit={x:H,y:G};}this.parent(B);},checkAgainst:function(B){B=B.getCoordinates();
|
53
|
+
var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top);},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();
|
54
|
+
if(this.overed!=A){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(A){this.overed=A;this.fireEvent("enter",[this.element,A]);}else{this.overed=null;
|
55
|
+
}}},drag:function(A){this.parent(A);if(this.droppables.length){this.checkDroppables();}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed]);
|
56
|
+
this.overed=null;return this.parent(A);}});Element.implement({makeDraggable:function(A){return new Drag.Move(this,A);}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(B,A){this.parent(B,A);
|
57
|
+
this.load();},save:function(){var A=JSON.encode(this.hash);if(!A||A.length>4096){return false;}if(A=="{}"){this.dispose();}else{this.write(A);}return true;
|
58
|
+
},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this;}});Hash.Cookie.implement((function(){var A={};Hash.each(Hash.prototype,function(C,B){A[B]=function(){var D=C.apply(this.hash,arguments);
|
59
|
+
if(this.options.autoSave){this.save();}return D;};});return A;})());var Color=new Native({initialize:function(B,C){if(arguments.length>=3){C="rgb";B=Array.slice(arguments,0,3);
|
60
|
+
}else{if(typeof B=="string"){if(B.match(/rgb/)){B=B.rgbToHex().hexToRgb(true);}else{if(B.match(/hsb/)){B=B.hsbToRgb();}else{B=B.hexToRgb(true);}}}}C=C||"rgb";
|
61
|
+
switch(C){case"hsb":var A=B;B=B.hsbToRgb();B.hsb=A;break;case"hex":B=B.hexToRgb(true);break;}B.rgb=B.slice(0,3);B.hsb=B.hsb||B.rgbToHsb();B.hex=B.rgbToHex();
|
62
|
+
return $extend(B,this);}});Color.implement({mix:function(){var A=Array.slice(arguments);var C=($type(A.getLast())=="number")?A.pop():50;var B=this.slice();
|
63
|
+
A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C));}});return new Color(B,"rgb");},invert:function(){return new Color(this.map(function(A){return 255-A;
|
64
|
+
}));},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb");},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb");
|
65
|
+
},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb");}});function $RGB(C,B,A){return new Color([C,B,A],"rgb");}function $HSB(C,B,A){return new Color([C,B,A],"hsb");
|
66
|
+
}function $HEX(A){return new Color(A,"hex");}Array.implement({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);
|
67
|
+
var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0;}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A;}else{if(C==I){G=2+D-L;}else{G=4+A-D;}}G/=6;
|
68
|
+
if(G<0){G++;}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)];},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C];
|
69
|
+
}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);
|
70
|
+
switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D];
|
71
|
+
}}return false;}});String.implement({rgbToHsb:function(){var A=this.match(/\d{1,3}/g);return(A)?hsb.rgbToHsb():null;},hsbToRgb:function(){var A=this.match(/\d{1,3}/g);
|
72
|
+
return(A)?A.hsbToRgb():null;}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={};},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};
|
73
|
+
this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false;}else{this.events[B].push(A);}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]));
|
74
|
+
},this);return this;},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false;},this);if(!D){return ;
|
75
|
+
}this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A);},this);}});var Asset=new Hash({javascript:function(F,D){D=$extend({onload:$empty,document:document,check:$lambda(true)},D);
|
76
|
+
var B=new Element("script",{src:F,type:"text/javascript"});var E=D.onload.bind(B),A=D.check,G=D.document;delete D.onload;delete D.check;delete D.document;
|
77
|
+
B.addEvents({load:E,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){E();}}}).setProperties(D);if(Browser.Engine.webkit419){var C=(function(){if(!$try(A)){return ;
|
78
|
+
}$clear(C);E();}).periodical(50);}return B.inject(G.head);},css:function(B,A){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:B},A)).inject(document.head);
|
79
|
+
},image:function(C,B){B=$merge({onload:$empty,onabort:$empty,onerror:$empty},B);var D=new Image();var A=$(D)||new Element("img");["load","abort","error"].each(function(E){var F="on"+E;
|
80
|
+
var G=B[F];delete B[F];D[F]=function(){if(!D){return ;}if(!A.parentNode){A.width=D.width;A.height=D.height;}D=D.onload=D.onabort=D.onerror=null;G.delay(1,A,A);
|
81
|
+
A.fireEvent(E,A,1);};});D.src=A.src=C;if(D&&D.complete){D.onload.delay(1);}return A.setProperties(B);},images:function(D,C){C=$merge({onComplete:$empty,onProgress:$empty},C);
|
82
|
+
if(!D.push){D=[D];}var A=[];var B=0;D.each(function(F){var E=new Asset.image(F,{onload:function(){C.onProgress.call(this,B,D.indexOf(F));B++;if(B==D.length){C.onComplete();
|
83
|
+
}}});A.push(E);});return new Elements(A);}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(A,B){this.setOptions(B);
|
84
|
+
this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(A)||A));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert));
|
85
|
+
}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(A){this.elements.push(A);
|
86
|
+
var B=A.retrieve("sortables:start",this.start.bindWithEvent(this,A));(this.options.handle?A.getElement(this.options.handle)||A:A).addEvent("mousedown",B);
|
87
|
+
},this);return this;},addLists:function(){Array.flatten(arguments).each(function(A){this.lists.push(A);this.addItems(A.getChildren());},this);return this;
|
88
|
+
},removeItems:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.elements.erase(B);var C=B.retrieve("sortables:start");(this.options.handle?B.getElement(this.options.handle)||B:B).removeEvent("mousedown",C);
|
89
|
+
},this);return $$(A);},removeLists:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.lists.erase(B);this.removeItems(B.getChildren());
|
90
|
+
},this);return $$(A);},getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body);}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list);
|
91
|
+
}return A.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width")}).inject(this.list).position(A.getPosition(A.getOffsetParent()));
|
92
|
+
},getDroppables:function(){var A=this.list.getChildren();if(!this.options.constrain){A=this.lists.concat(A).erase(this.list);}return A.erase(this.clone).erase(this.element);
|
93
|
+
},insert:function(C,B){var A="inside";if(this.lists.contains(B)){this.list=B;this.drag.droppables=this.getDroppables();}else{A=this.element.getAllPrevious().contains(B)?"before":"after";
|
94
|
+
}this.element.inject(B,A);this.fireEvent("sort",[this.element,this.clone]);},start:function(B,A){if(!this.idle){return ;}this.idle=false;this.element=A;
|
95
|
+
this.opacity=A.get("opacity");this.list=A.getParent();this.clone=this.getClone(B,A);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){B.stop();
|
96
|
+
this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});
|
97
|
+
this.clone.inject(this.element,"before");this.drag.start(B);},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var A=this.element.getStyles("width","height");
|
98
|
+
var B=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:B.top,left:B.left,width:A.width,height:A.height,opacity:0.25}).chain(this.reset.bind(this));
|
99
|
+
}else{this.reset();}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element);},serialize:function(){var C=Array.link(arguments,{modifier:Function.type,index:$defined});
|
100
|
+
var B=this.lists.map(function(D){return D.getChildren().map(C.modifier||function(E){return E.get("id");},this);},this);var A=C.index;if(this.lists.length==1){A=0;
|
101
|
+
}return $chk(A)&&A>=0&&A<this.lists.length?B[A]:B;}});var Tips=new Class({Implements:[Events,Options],options:{onShow:function(A){A.setStyle("visibility","visible");
|
102
|
+
},onHide:function(A){A.setStyle("visibility","hidden");},showDelay:100,hideDelay:100,className:null,offsets:{x:16,y:16},fixed:false},initialize:function(){var C=Array.link(arguments,{options:Object.type,elements:$defined});
|
103
|
+
this.setOptions(C.options||null);this.tip=new Element("div").inject(document.body);if(this.options.className){this.tip.addClass(this.options.className);
|
104
|
+
}var B=new Element("div",{"class":"tip-top"}).inject(this.tip);this.container=new Element("div",{"class":"tip"}).inject(this.tip);var A=new Element("div",{"class":"tip-bottom"}).inject(this.tip);
|
105
|
+
this.tip.setStyles({position:"absolute",top:0,left:0,visibility:"hidden"});if(C.elements){this.attach(C.elements);}},attach:function(A){$$(A).each(function(D){var G=D.retrieve("tip:title",D.get("title"));
|
106
|
+
var F=D.retrieve("tip:text",D.get("rel")||D.get("href"));var E=D.retrieve("tip:enter",this.elementEnter.bindWithEvent(this,D));var C=D.retrieve("tip:leave",this.elementLeave.bindWithEvent(this,D));
|
107
|
+
D.addEvents({mouseenter:E,mouseleave:C});if(!this.options.fixed){var B=D.retrieve("tip:move",this.elementMove.bindWithEvent(this,D));D.addEvent("mousemove",B);
|
108
|
+
}D.store("tip:native",D.get("title"));D.erase("title");},this);return this;},detach:function(A){$$(A).each(function(C){C.removeEvent("mouseenter",C.retrieve("tip:enter")||$empty);
|
109
|
+
C.removeEvent("mouseleave",C.retrieve("tip:leave")||$empty);C.removeEvent("mousemove",C.retrieve("tip:move")||$empty);C.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");
|
110
|
+
var B=C.retrieve("tip:native");if(B){C.set("title",B);}});return this;},elementEnter:function(B,A){$A(this.container.childNodes).each(Element.dispose);
|
111
|
+
var D=A.retrieve("tip:title");if(D){this.titleElement=new Element("div",{"class":"tip-title"}).inject(this.container);this.fill(this.titleElement,D);}var C=A.retrieve("tip:text");
|
112
|
+
if(C){this.textElement=new Element("div",{"class":"tip-text"}).inject(this.container);this.fill(this.textElement,C);}this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this);
|
113
|
+
this.position((!this.options.fixed)?B:{page:A.getPosition()});},elementLeave:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this);
|
114
|
+
},elementMove:function(A){this.position(A);},position:function(D){var B=window.getSize(),A=window.getScroll();var E={x:this.tip.offsetWidth,y:this.tip.offsetHeight};
|
115
|
+
var C={x:"left",y:"top"};for(var F in C){var G=D.page[F]+this.options.offsets[F];if((G+E[F]-A[F])>B[F]){G=D.page[F]-this.options.offsets[F]-E[F];}this.tip.setStyle(C[F],G);
|
116
|
+
}},fill:function(A,B){(typeof B=="string")?A.set("html",B):A.adopt(B);},show:function(){this.fireEvent("show",this.tip);},hide:function(){this.fireEvent("hide",this.tip);
|
117
|
+
}});var SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(B,C){C=C||document;var E=C.getDocument(),D=C.getWindow();this.parent(E,B);this.links=(this.options.links)?$$(this.options.links):$$(E.links);
|
118
|
+
var A=D.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(G){if(G.href.indexOf(A)!=0){return ;}var F=G.href.substr(A.length);if(F&&$(F)){this.useLink(G,F);
|
119
|
+
}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){D.location.hash=this.anchor;},true);}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;
|
120
|
+
this.toElement(A);C.stop();}.bind(this));}});var Slider=new Class({Implements:[Events,Options],options:{onTick:function(A){if(this.options.snap){A=this.toPosition(this.step);
|
121
|
+
}this.knob.setStyle(this.property,A);},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(E,A,D){this.setOptions(D);
|
122
|
+
this.element=$(E);this.knob=$(A);this.previousChange=this.previousEnd=this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bind(this));if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement.bindWithEvent(this));
|
123
|
+
}var F,B={},C={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";F="offsetHeight";break;case"horizontal":this.axis="x";
|
124
|
+
this.property="left";F="offsetWidth";}this.half=this.knob[F]/2;this.full=this.element[F]-this.knob[F]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;
|
125
|
+
this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;
|
126
|
+
this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);C[this.axis]=this.property;
|
127
|
+
B[this.axis]=[-this.options.offset,this.full-this.options.offset];this.drag=new Drag(this.knob,{snap:0,limit:B,modifiers:C,onDrag:this.draggedKnob.bind(this),onStart:this.draggedKnob.bind(this),onComplete:function(){this.draggedKnob();
|
128
|
+
this.end();}.bind(this)});if(this.options.snap){this.drag.options.grid=Math.ceil(this.stepWidth);this.drag.options.limit[this.axis][1]=this.full;}},set:function(A){if(!((this.range>0)^(A<this.min))){A=this.min;
|
129
|
+
}if(!((this.range>0)^(A>this.max))){A=this.max;}this.step=Math.round(A);this.checkStep();this.end();this.fireEvent("tick",this.toPosition(this.step));return this;
|
130
|
+
},clickedElement:function(C){var B=this.range<0?-1:1;var A=C.page[this.axis]-this.element.getPosition()[this.axis]-this.half;A=A.limit(-this.options.offset,this.full-this.options.offset);
|
131
|
+
this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();this.end();this.fireEvent("tick",A);},scrolledElement:function(A){var B=(this.options.mode=="horizontal")?(A.wheel<0):(A.wheel>0);
|
132
|
+
this.set(B?this.step-this.stepSize:this.step+this.stepSize);A.stop();},draggedKnob:function(){var B=this.range<0?-1:1;var A=this.drag.value.now[this.axis];
|
133
|
+
A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;
|
134
|
+
this.fireEvent("change",this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"");
|
135
|
+
}},toStep:function(A){var B=(A+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(B-=B%this.stepSize):B;},toPosition:function(A){return(this.full*Math.abs(this.min-A))/(this.steps*this.stepSize)-this.options.offset;
|
136
|
+
}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B);}},initialize:function(B,A){this.setOptions(A);
|
137
|
+
this.element=$(B);this.listener=($type(this.element)!="element")?$(this.element.getDocument().body):this.element;this.timer=null;this.coord=this.getCoords.bind(this);
|
138
|
+
},start:function(){this.listener.addEvent("mousemove",this.coord);},stop:function(){this.listener.removeEvent("mousemove",this.coord);this.timer=$clear(this.timer);
|
139
|
+
},getCoords:function(A){this.page=(this.listener.get("tag")=="body")?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this);}},scroll:function(){var B=this.element.getSize(),A=this.element.getScroll(),E=this.element.getPosition(),D={x:0,y:0};
|
140
|
+
for(var C in this.page){if(this.page[C]<(this.options.area+E[C])&&A[C]!=0){D[C]=(this.page[C]-this.options.area-E[C])*this.options.velocity;}else{if(this.page[C]+this.options.area>(B[C]+E[C])&&B[C]+B[C]!=A[C]){D[C]=(this.page[C]-B[C]+this.options.area-E[C])*this.options.velocity;
|
141
|
+
}}}if(D.y||D.x){this.fireEvent("change",[A.x+D.x,A.y+D.y]);}}});var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});
|
142
|
+
this.parent(C.elements,C.options);this.togglers=$$(C.togglers);this.container=$(C.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true;
|
143
|
+
}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}if(this.options.start){this.options.display=false;this.options.show=false;
|
144
|
+
}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity";}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";
|
145
|
+
}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight";}for(var B=0,A=this.togglers.length;B<A;B++){this.addSection(this.togglers[B],this.elements[B]);
|
146
|
+
}this.elements.each(function(E,D){if(this.options.show===D){this.fireEvent("active",[this.togglers[D],E]);}else{for(var F in this.effects){E.setStyle(F,0);
|
147
|
+
}}},this);if($chk(this.options.display)){this.display(this.options.display);}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);
|
148
|
+
var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.inject(this.togglers[G],"before");C.inject(E,"after");
|
149
|
+
}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container);}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));
|
150
|
+
if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"});}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"});
|
151
|
+
}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth;}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight;}C.setStyle("overflow","hidden");
|
152
|
+
if(!F){for(var D in this.effects){C.setStyle(D,0);}}return this;},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this;
|
153
|
+
}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"background":"active",[this.togglers[D],E]);
|
154
|
+
for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]];}},this);return this.start(B);}});
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative "spec_helper"
|
2
|
+
|
3
|
+
describe "Simle example" do
|
4
|
+
before(:each) do
|
5
|
+
@response = get("/examples/simple")
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should be successful" do
|
9
|
+
@response.should be_successful
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should be successful" do
|
13
|
+
@response.should be_successful
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should link to"
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "Examples with arguments" do
|
20
|
+
before(:each) do
|
21
|
+
@response = get("/examples/arguments")
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should be successful" do
|
25
|
+
@response.should be_successful
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "Examples with dependencies" do
|
30
|
+
before(:each) do
|
31
|
+
@response = get("/examples/dependencies")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should be successful" do
|
35
|
+
@response.should be_successful
|
36
|
+
end
|
37
|
+
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
/ extend_block helper can be used as well, but it would change the block,
|
4
4
|
/ so the code would include the lighter and we don't want that
|
5
5
|
- block(:head) do
|
6
|
-
|
7
|
-
|
6
|
+
= pupu :lighter, syntax: "html", theme: "standard"
|
7
|
+
= block(:pupu)
|
8
8
|
|
9
9
|
- block(:content) do
|
10
10
|
%a{href:"/examples/simple"} Simple Example
|
@@ -12,4 +12,4 @@
|
|
12
12
|
%a{href:"/examples/dependencies"} Example With Dependencies
|
13
13
|
|
|
14
14
|
%a{href:"/examples/arguments"} Example With Arguments
|
15
|
-
%pre.code.html~ block(:pupu)
|
15
|
+
%pre.code.html~ html_escape block(:pupu)
|
File without changes
|
data/lib/pupu.rb
CHANGED
data/lib/pupu/adapters/merb.rb
CHANGED
@@ -1,14 +1,8 @@
|
|
1
|
+
require "pupu"
|
1
2
|
require "pupu/helpers"
|
2
3
|
|
3
|
-
Merb::Controller.send(:include, Pupu::Helpers)
|
4
|
-
|
5
|
-
Merb::Plugins.config[:pupu] = {
|
6
|
-
:root => ""
|
7
|
-
}
|
8
|
-
|
9
4
|
Merb::BootLoader.before_app_loads do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
Merb::BootLoader.after_app_loads do
|
5
|
+
Pupu.root = Merb.root
|
6
|
+
Pupu.media_root = File.join(Merb.root, "public")
|
7
|
+
Merb::Controller.send(:include, Pupu::Helpers)
|
14
8
|
end
|
data/lib/pupu/adapters/rails.rb
CHANGED
data/lib/pupu/adapters/rango.rb
CHANGED
data/lib/pupu/cli.rb
CHANGED
@@ -42,9 +42,10 @@ module Pupu
|
|
42
42
|
attr_reader :args
|
43
43
|
def initialize(args)
|
44
44
|
@args = args
|
45
|
+
self.detect
|
45
46
|
self.load_config
|
46
47
|
self.parse_argv
|
47
|
-
self.
|
48
|
+
self.check_setup
|
48
49
|
note "Using media directory: #{::Pupu.media_root}"
|
49
50
|
note "Using strategy: #{Pupu.strategy}"
|
50
51
|
end
|
@@ -78,13 +79,16 @@ module Pupu
|
|
78
79
|
Pupu.strategy ||= :copy
|
79
80
|
end
|
80
81
|
|
82
|
+
def check_setup
|
83
|
+
abort "You have to provide media directory (use --media-root=path)" unless ::Pupu.media_root
|
84
|
+
end
|
85
|
+
|
81
86
|
def install
|
82
87
|
self.args.each do |pupu|
|
83
88
|
begin
|
84
89
|
GitHub.install(pupu)
|
85
90
|
rescue PluginIsAlreadyInstalled
|
86
|
-
|
87
|
-
info "Plugin #{pupu} is already installed, updating"
|
91
|
+
info "Plugin #{pupu} is already installed, skipping"
|
88
92
|
end
|
89
93
|
end
|
90
94
|
end
|
data/lib/pupu/github.rb
CHANGED
data/pupu.pre.gemspec
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env gem1.9 build
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
Dir[File.join(File.dirname(__FILE__), "vendor", "*")].each do |path|
|
5
|
+
if File.directory?(path) && Dir["#{path}/*"].empty?
|
6
|
+
warn "Dependency #{File.basename(path)} in vendor seems to be empty. Run git submodule init && git submodule update to checkout it."
|
7
|
+
elsif File.directory?(path) && File.directory?(File.join(path, "lib"))
|
8
|
+
$:.unshift File.join(path, "lib")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# NOTE: we can't use require_relative because when we run gem build, it use eval for executing this file
|
13
|
+
$:.unshift File.join(File.dirname(__FILE__), "lib")
|
14
|
+
require "pupu"
|
15
|
+
|
16
|
+
Gem::Specification.new do |s|
|
17
|
+
s.name = "pupu"
|
18
|
+
s.version = '0.0.2.pre'
|
19
|
+
s.authors = ["Jakub Šťastný aka Botanicus"]
|
20
|
+
s.homepage = "http://github.com/botanicus/pupu"
|
21
|
+
s.summary = "Framework-agnostic package system for media files"
|
22
|
+
s.description = "Pupu is a plugin system for media like mootools plugins, icon sets etc. It knows dependencies and it has CLI interface, so it's really easy to bundle such pupus into your app."
|
23
|
+
s.cert_chain = nil
|
24
|
+
s.email = ["knava.bestvinensis", "gmail.com"].join("@")
|
25
|
+
|
26
|
+
# files
|
27
|
+
s.files = Dir.glob("**/*") - Dir.glob("pkg/*")
|
28
|
+
s.executables = ["pupu"]
|
29
|
+
s.default_executable = "pupu"
|
30
|
+
s.require_paths = ["lib"]
|
31
|
+
|
32
|
+
# Ruby version
|
33
|
+
s.required_ruby_version = ::Gem::Requirement.new(">= 1.9.1")
|
34
|
+
|
35
|
+
# runtime dependencies
|
36
|
+
s.add_dependency "media-path"
|
37
|
+
|
38
|
+
# development dependencies
|
39
|
+
# use gem install pupu --development if you want to install them
|
40
|
+
s.add_development_dependency "simple-templater"
|
41
|
+
|
42
|
+
# RubyForge
|
43
|
+
s.rubyforge_project = "pupu"
|
44
|
+
end
|
data/script/spec
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# http://github.com/somebee/rbench/tree/master
|
4
|
+
desc "Run all benchmarks"
|
5
|
+
task :bm do
|
6
|
+
abort "Benchmarks doesn't work at the moment"
|
7
|
+
require "rbench"
|
8
|
+
Dir["#{Dir.pwd}/benchmarks/bm/*.rb"].each do |benchmark|
|
9
|
+
load benchmark
|
10
|
+
end
|
11
|
+
end
|
data/tasks/gem.rake
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
desc "Build the gem"
|
4
|
+
task :build do
|
5
|
+
sh "gem build pupu.gemspec"
|
6
|
+
end
|
7
|
+
|
8
|
+
namespace :build do
|
9
|
+
desc "Build the prerelease gem"
|
10
|
+
task :prerelease do
|
11
|
+
gemspec = "pupu.gemspec"
|
12
|
+
content = File.read(gemspec)
|
13
|
+
prename = "#{gemspec.split(".").first}.pre.gemspec"
|
14
|
+
# 0.1.1 => 0.2
|
15
|
+
version = Pupu::VERSION.sub(/^(\d+)\.(\d+\.){2}.*$/) { "#$1.#{$2.to_i + 1}" }
|
16
|
+
puts "Current #{Pupu::VERSION} => #{version} pre"
|
17
|
+
File.open(prename, "w") do |file|
|
18
|
+
file.puts(content.gsub(/(\w+::VERSION)/, "'#{version}.pre'"))
|
19
|
+
end
|
20
|
+
sh "gem build #{prename}"
|
21
|
+
rm prename
|
22
|
+
end
|
23
|
+
end
|