Skip to content
Browse files

Merge branch 'maint' into devel

  • Loading branch information...
2 parents a6a18fc + d1fc76f commit a71c4a7cb66ca01fcd5b39a1b7d248d45756924f @lauriro committed Mar 27, 2012
Showing with 19 additions and 13 deletions.
  1. +9 −2 boot.js
  2. +2 −2 el/slider/index.html
  3. +7 −7 el/slider/slider.js
  4. +1 −2 min.js
View
11 boot.js
@@ -106,8 +106,7 @@
s = t.pop();
a = t.pop().trim().split(/[\s,]+/);
t.length && t.push("(function("+a+"){return ("+s+")})");
- } else if (s.match(/\b_\b/)) a = "_";
- else {
+ } else {
// test whether an operator appears on the left (or right), respectively
if (t = s.match(/^\s*(?:[+*\/%&|\^\.=<>]|!=)/)) {
a.push("$1");
@@ -250,6 +249,14 @@
var fr = function(r,f){
return f(r)
}
+
+ /*
+ http://hangar.runway7.net/javascript/namespacing
+
+ S.ns = function(s){
+ return "h n -> h[n] = h[n] || {}".fold(this.split("."), s || w)
+ }
+ */
/*
// http://seanhess.github.com/2012/02/20/functional_javascript.html
// http://msdn.microsoft.com/en-us/scriptjunkie/gg575560
View
4 el/slider/index.html
@@ -20,7 +20,7 @@
</style>
<script type="text/javascript" src="../../min.js">
-load(["haml.js", "el/app.js", "el/slider/slider.js"], function(){
+load(["haml.js", "el/slider/slider.js"], function(){
function on_change(_val){
//console.log('on_change',_val);
}
@@ -30,7 +30,7 @@
min:0,
max:3,
step:1,
- //value:10,
+ value:10,
on_change:on_change
});
View
14 el/slider/slider.js
@@ -40,7 +40,7 @@ El.cache(
function move(e){
var diff = v ? maxPx - Event.pointerY(e) + offset : Event.pointerX(e) - offset;
diff = (diff>maxPx ? maxPx : (diff<0?0:diff));
- el.set( diff / px, diff );
+ el.change( diff / px, diff );
"on_move" in el && el.on_move( diff + knobLen );
return false;
}
@@ -49,10 +49,10 @@ El.cache(
fill.addClass("anim")
drag = false;
Event.remove(doc, "mouseup", stop).remove(doc, "mousemove", move);
- el.set(value);
+ el.change(value);
}
- el.set = function(val, pos, scroll){
+ el.change = function(val, pos, scroll){
px || load();
val = (val<min?min:val>max?max:val).toAccuracy(step);
;(drag || scroll) && value !== val && "on_change" in el && el.on_change(val);
@@ -62,22 +62,22 @@ El.cache(
el.append_hook = function(){
setTimeout(function(){
- el.set(value);
+ el.change(value);
}, 150);
}
el.on("mousedown", function(e){
- fill.removeClass("anim")
+ fill.rmClass("anim")
drag = true;
load();
move(e);
Event.add(doc, "mouseup", stop).add(doc, "mousemove", move).stop(e);
}).on("mousewheel", function(e,delta){
Event.stop(e);
- el.set( 1*value + delta*step, 0, 1 );
+ el.change( 1*value + delta*step, 0, 1 );
});
- Event.touch_as_mouse(el);
+ //Event.touch_as_mouse(el);
}
);
View
3 min.js
@@ -36,8 +36,7 @@ if(t.length>1)while(t.length){
s=t.pop()
a=t.pop().trim().split(/[\s,]+/)
t.length&&t.push("(function("+a+"){return ("+s+")})")
-}else if(s.match(/\b_\b/))a="_"
-else{
+}else{
if(t=s.match(/^\s*(?:[+*\/%&|\^\.=<>]|!=)/)){
a.push("$1")
s="$1"+s}

0 comments on commit a71c4a7

Please sign in to comment.
Something went wrong with that request. Please try again.