Skip to content

Commit bb31f7b

Browse files
code style & formatting
1 parent ad17ac4 commit bb31f7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1465
-1469
lines changed

Source/Class/Chain.Wait.js

+28-28
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,39 @@ provides: [Chain.Wait]
2525

2626
(function(){
2727

28-
var wait = {
29-
wait: function(duration){
30-
return this.chain(function(){
31-
this.callChain.delay(duration == null ? 500 : duration, this);
32-
return this;
33-
}.bind(this));
34-
}
35-
};
28+
var wait = {
29+
wait: function(duration){
30+
return this.chain(function(){
31+
this.callChain.delay(duration == null ? 500 : duration, this);
32+
return this;
33+
}.bind(this));
34+
}
35+
};
3636

37-
Chain.implement(wait);
37+
Chain.implement(wait);
3838

39-
if (this.Fx) Fx.implement(wait);
39+
if (this.Fx) Fx.implement(wait);
4040

41-
if (this.Element && Element.implement && this.Fx){
42-
Element.implement({
41+
if (this.Element && Element.implement && this.Fx){
42+
Element.implement({
4343

44-
chains: function(effects){
45-
Array.from(effects || ['tween', 'morph', 'reveal']).each(function(effect){
46-
effect = this.get(effect);
47-
if (!effect) return;
48-
effect.setOptions({
49-
link:'chain'
50-
});
51-
}, this);
52-
return this;
53-
},
44+
chains: function(effects){
45+
Array.from(effects || ['tween', 'morph', 'reveal']).each(function(effect){
46+
effect = this.get(effect);
47+
if (!effect) return;
48+
effect.setOptions({
49+
link:'chain'
50+
});
51+
}, this);
52+
return this;
53+
},
5454

55-
pauseFx: function(duration, effect){
56-
this.chains(effect).get(effect || 'tween').wait(duration);
57-
return this;
58-
}
55+
pauseFx: function(duration, effect){
56+
this.chains(effect).get(effect || 'tween').wait(duration);
57+
return this;
58+
}
5959

60-
});
61-
}
60+
});
61+
}
6262

6363
})();

Source/Class/Class.Singleton.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ provides: [Class.Singleton]
2121
*/
2222

2323
Class.Singleton = new Class({
24-
24+
2525
initialize : function(descriptor){
2626
// here we keep reference of the single instance
2727
var singleton;
@@ -34,18 +34,18 @@ Class.Singleton = new Class({
3434
return singleton;
3535
}
3636
// Obviously we instantiate that class for the first time.
37-
// Create brand new object & extend it with the prototype of the
37+
// Create brand new object & extend it with the prototype of the
3838
// original `constructor`.
3939
singleton = Object.append({}, constructor.prototype);
4040
singleton.constructor = constructor;
41-
// We also need to call the constructor as a function, passing the
41+
// We also need to call the constructor as a function, passing the
4242
// arguments object.
43-
var return_value = constructor.apply(singleton, arguments);
44-
// In case the `constructor` returns something other than `this` -
43+
var returnValue = constructor.apply(singleton, arguments);
44+
// In case the `constructor` returns something other than `this` -
4545
// return that value; otherwise return the `singleton`.
46-
singleton = typeof return_value == 'object' ? return_value : singleton;
46+
singleton = typeof returnValue == 'object' ? returnValue : singleton;
4747
return singleton;
4848
};
4949
}
50-
50+
5151
});

Source/Drag/Drag.Move.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Drag.Move = new Class({
6262
this.addEvent('start', this.checkDroppables, true);
6363
this.overed = null;
6464
},
65-
66-
setContainer: function(container) {
65+
66+
setContainer: function(container){
6767
this.container = document.id(container);
6868
if (this.container && typeOf(this.container) != 'element'){
6969
this.container = document.id(this.container.getDocument().body);

Source/Drag/Drag.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ var Drag = this.Drag = new Class({
135135

136136
start: function(event){
137137
if (this.options.unDraggableTags.contains(event.target.get('tag'))) return;
138-
138+
139139
var options = this.options;
140140

141141
if (event.rightClick) return;

Source/Drag/Slider.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ var Slider = this.Slider = new Class({
168168
if (range) this.set(Array.pick([pos, this.step]).limit(this.min,this.max), silently);
169169
return this;
170170
},
171-
171+
172172
setModulus: function(){
173173
var decimals = ((this.stepSize + '').split('.')[1] || []).length,
174174
modulus = 1 + '';

Source/Drag/Sortables.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ var Sortables = this.Sortables = new Class({
105105
return list;
106106
}, this));
107107
},
108-
109-
getDroppableCoordinates: function (element){
108+
109+
getDroppableCoordinates: function(element){
110110
var offsetParent = element.getOffsetParent();
111111
var position = element.getPosition(offsetParent);
112112
var scroll = {
@@ -121,7 +121,7 @@ var Sortables = this.Sortables = new Class({
121121
position.y -= scroll.w.y;
122122
}
123123

124-
return position;
124+
return position;
125125
},
126126

127127
getClone: function(event, element){
@@ -227,7 +227,7 @@ var Sortables = this.Sortables = new Class({
227227
this.clone.destroy();
228228
self.reset();
229229
}
230-
230+
231231
},
232232

233233
reset: function(){

Source/Element/Element.Event.Pseudos.Keys.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ DOMEvent.defineKeys({
8080
'107': '+',
8181
'109': '-', // subtract
8282
'189': '-' // dash
83-
})
83+
});
8484

8585
})();

Source/Element/Element.Measure.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,16 @@ Element.implement({
100100
} else if (parent){
101101
try { //safari sometimes crashes here, so catch it
102102
dim = getSize(this, options);
103-
}catch(e){}
103+
} catch (e){}
104104
}
105105

106106
return Object.append(dim, (dim.x || dim.x === 0) ? {
107-
width: dim.x,
108-
height: dim.y
109-
} : {
110-
x: dim.width,
111-
y: dim.height
112-
}
113-
);
107+
width: dim.x,
108+
height: dim.y
109+
} : {
110+
x: dim.width,
111+
y: dim.height
112+
});
114113
},
115114

116115
getComputedSize: function(options){

Source/Element/Element.Pin.js

+89-89
Original file line numberDiff line numberDiff line change
@@ -24,106 +24,106 @@ provides: [Element.Pin]
2424
*/
2525

2626
(function(){
27-
var supportsPositionFixed = false,
28-
supportTested = false;
29-
30-
var testPositionFixed = function(){
31-
var test = new Element('div').setStyles({
32-
position: 'fixed',
33-
top: 0,
34-
right: 0
35-
}).inject(document.body);
36-
supportsPositionFixed = (test.offsetTop === 0);
37-
test.dispose();
38-
supportTested = true;
39-
};
40-
41-
Element.implement({
42-
43-
pin: function(enable, forceScroll){
44-
if (!supportTested) testPositionFixed();
45-
if (this.getStyle('display') == 'none') return this;
46-
47-
var pinnedPosition,
48-
scroll = window.getScroll(),
49-
parent,
50-
scrollFixer;
51-
52-
if (enable !== false){
53-
pinnedPosition = this.getPosition();
54-
if (!this.retrieve('pin:_pinned')) {
55-
var currentPosition = {
56-
top: pinnedPosition.y - scroll.y,
57-
left: pinnedPosition.x - scroll.x,
58-
margin: '0px',
59-
padding: '0px'
27+
var supportsPositionFixed = false,
28+
supportTested = false;
29+
30+
var testPositionFixed = function(){
31+
var test = new Element('div').setStyles({
32+
position: 'fixed',
33+
top: 0,
34+
right: 0
35+
}).inject(document.body);
36+
supportsPositionFixed = (test.offsetTop === 0);
37+
test.dispose();
38+
supportTested = true;
39+
};
40+
41+
Element.implement({
42+
43+
pin: function(enable, forceScroll){
44+
if (!supportTested) testPositionFixed();
45+
if (this.getStyle('display') == 'none') return this;
46+
47+
var pinnedPosition,
48+
scroll = window.getScroll(),
49+
parent,
50+
scrollFixer;
51+
52+
if (enable !== false){
53+
pinnedPosition = this.getPosition();
54+
if (!this.retrieve('pin:_pinned')){
55+
var currentPosition = {
56+
top: pinnedPosition.y - scroll.y,
57+
left: pinnedPosition.x - scroll.x,
58+
margin: '0px',
59+
padding: '0px'
60+
};
61+
62+
if (supportsPositionFixed && !forceScroll){
63+
this.setStyle('position', 'fixed').setStyles(currentPosition);
64+
} else {
65+
66+
parent = this.getOffsetParent();
67+
var position = this.getPosition(parent),
68+
styles = this.getStyles('left', 'top');
69+
70+
if (parent && styles.left == 'auto' || styles.top == 'auto') this.setPosition(position);
71+
if (this.getStyle('position') == 'static') this.setStyle('position', 'absolute');
72+
73+
position = {
74+
x: styles.left.toInt() - scroll.x,
75+
y: styles.top.toInt() - scroll.y
6076
};
6177

62-
if (supportsPositionFixed && !forceScroll){
63-
this.setStyle('position', 'fixed').setStyles(currentPosition);
64-
} else {
65-
66-
parent = this.getOffsetParent();
67-
var position = this.getPosition(parent),
68-
styles = this.getStyles('left', 'top');
69-
70-
if (parent && styles.left == 'auto' || styles.top == 'auto') this.setPosition(position);
71-
if (this.getStyle('position') == 'static') this.setStyle('position', 'absolute');
72-
73-
position = {
74-
x: styles.left.toInt() - scroll.x,
75-
y: styles.top.toInt() - scroll.y
76-
};
77-
78-
scrollFixer = function(){
79-
if (!this.retrieve('pin:_pinned')) return;
80-
var scroll = window.getScroll();
81-
this.setStyles({
82-
left: position.x + scroll.x,
83-
top: position.y + scroll.y
84-
});
85-
}.bind(this);
86-
87-
this.store('pin:_scrollFixer', scrollFixer);
88-
window.addEvent('scroll', scrollFixer);
89-
}
90-
this.store('pin:_pinned', true);
78+
scrollFixer = function(){
79+
if (!this.retrieve('pin:_pinned')) return;
80+
var scroll = window.getScroll();
81+
this.setStyles({
82+
left: position.x + scroll.x,
83+
top: position.y + scroll.y
84+
});
85+
}.bind(this);
86+
87+
this.store('pin:_scrollFixer', scrollFixer);
88+
window.addEvent('scroll', scrollFixer);
9189
}
90+
this.store('pin:_pinned', true);
91+
}
9292

93-
} else {
94-
if (!this.retrieve('pin:_pinned')) return this;
93+
} else {
94+
if (!this.retrieve('pin:_pinned')) return this;
9595

96-
parent = this.getParent();
97-
var offsetParent = (parent.getComputedStyle('position') != 'static' ? parent : parent.getOffsetParent());
96+
parent = this.getParent();
97+
var offsetParent = (parent.getComputedStyle('position') != 'static' ? parent : parent.getOffsetParent());
9898

99-
pinnedPosition = this.getPosition();
99+
pinnedPosition = this.getPosition();
100100

101-
this.store('pin:_pinned', false);
102-
scrollFixer = this.retrieve('pin:_scrollFixer');
103-
if (!scrollFixer){
104-
this.setStyles({
105-
position: 'absolute',
106-
top: pinnedPosition.y + scroll.y,
107-
left: pinnedPosition.x + scroll.x
108-
});
109-
} else {
110-
this.store('pin:_scrollFixer', null);
111-
window.removeEvent('scroll', scrollFixer);
112-
}
113-
this.removeClass('isPinned');
101+
this.store('pin:_pinned', false);
102+
scrollFixer = this.retrieve('pin:_scrollFixer');
103+
if (!scrollFixer){
104+
this.setStyles({
105+
position: 'absolute',
106+
top: pinnedPosition.y + scroll.y,
107+
left: pinnedPosition.x + scroll.x
108+
});
109+
} else {
110+
this.store('pin:_scrollFixer', null);
111+
window.removeEvent('scroll', scrollFixer);
114112
}
115-
return this;
116-
},
113+
this.removeClass('isPinned');
114+
}
115+
return this;
116+
},
117117

118-
unpin: function(){
119-
return this.pin(false);
120-
},
118+
unpin: function(){
119+
return this.pin(false);
120+
},
121121

122-
togglePin: function(){
123-
return this.pin(!this.retrieve('pin:_pinned'));
124-
}
122+
togglePin: function(){
123+
return this.pin(!this.retrieve('pin:_pinned'));
124+
}
125125

126-
});
126+
});
127127

128128
//<1.2compat>
129129
Element.alias('togglepin', 'togglePin');

0 commit comments

Comments
 (0)