Skip to content

Commit 4fbbc59

Browse files
committed
converted tabs to spaces
1 parent 84a0cdb commit 4fbbc59

5 files changed

Lines changed: 90 additions & 90 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See [stripjs.com](http://www.stripjs.com) for demos and docs.
1010

1111
## License
1212

13-
Strip may be used in commercial projects and applications with the one-time purchase of a commercial license. If you are paid to do your job, and part of your job is implementing Strip, a commercial license is required.
13+
Strip may be used in commercial projects and applications with a one-time purchase of a commercial license. If you are paid to do your job, and part of your job is implementing Strip, a commercial license is required.
1414

1515
http://www.stripjs.com/license
1616

src/js/helpers/imageready.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $.extend(ImageReady.prototype, {
88

99
initialize: function(img, callback, errorCallback) {
1010
this.img = $(img);
11-
this.callback = callback;
11+
this.callback = callback;
1212
this.errorCallback = errorCallback;
1313

1414
// fallback for browsers without support for naturalWidth/Height
@@ -20,28 +20,28 @@ $.extend(ImageReady.prototype, {
2020

2121
this.img.bind('error', $.proxy(this.error, this));
2222

23-
this.intervals = [
24-
[1 * 1000, 10],
25-
[2 * 1000, 50],
26-
[4 * 1000, 100],
23+
this.intervals = [
24+
[1 * 1000, 10],
25+
[2 * 1000, 50],
26+
[4 * 1000, 100],
2727
[20 * 1000, 500]
28-
];
28+
];
2929

3030
// for testing, 2sec delay
3131
//this.intervals = [[20 * 1000, 2000]];
3232

33-
this._ipos = 0;
34-
this._time = 0;
35-
this._delay = this.intervals[this._ipos][1];
33+
this._ipos = 0;
34+
this._time = 0;
35+
this._delay = this.intervals[this._ipos][1];
3636

3737
this.tick();
3838
},
3939

4040
tick: function() {
41-
this._ticking = setTimeout($.proxy(function() {
41+
this._ticking = setTimeout($.proxy(function() {
4242
if (this.img[0].naturalWidth > 0) {
43-
this.callback(this.img[0]);
44-
return;
43+
this.callback(this.img[0]);
44+
return;
4545
}
4646

4747
// update time spend
@@ -52,8 +52,8 @@ $.extend(ImageReady.prototype, {
5252
// if there's no next interval, we asume
5353
// the image image errored out
5454
if (!this.intervals[this._ipos + 1]) {
55-
this.error();
56-
return;
55+
this.error();
56+
return;
5757
}
5858

5959
this._ipos++;
@@ -63,7 +63,7 @@ $.extend(ImageReady.prototype, {
6363
}
6464

6565
this.tick();
66-
}, this), this._delay);
66+
}, this), this._delay);
6767
},
6868

6969
fallback: function() {
@@ -90,10 +90,10 @@ $.extend(ImageReady.prototype, {
9090
this._fallbackImg.onload = function() { };
9191
}
9292

93-
if (this._ticking) {
94-
clearTimeout(this._ticking);
95-
this._ticking = 0;
96-
}
93+
if (this._ticking) {
94+
clearTimeout(this._ticking);
95+
this._ticking = 0;
96+
}
9797
},
9898

9999
error: function() {

src/js/helpers/vimeoready.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ var VimeoReady = (function() {
33
var VimeoReady = function() { return this.initialize.apply(this, _slice.call(arguments)); };
44
$.extend(VimeoReady.prototype, {
55
initialize: function(url, callback) {
6-
this.url = url;
7-
this.callback = callback;
6+
this.url = url;
7+
this.callback = callback;
88

99
this.load();
1010
},
@@ -38,9 +38,9 @@ $.extend(VimeoReady.prototype, {
3838

3939
abort: function() {
4040
if (this._xhr) {
41-
this._xhr.abort();
42-
this._xhr = null;
43-
}
41+
this._xhr.abort();
42+
this._xhr = null;
43+
}
4444
}
4545
});
4646

src/js/page.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ var Page = (function() {
55
var Page = function() { return this.initialize.apply(this, _slice.call(arguments)); };
66
$.extend(Page.prototype, {
77
initialize: function(view, position, total) {
8-
this.view = view;
9-
this.dimensions = { width: 0, height: 0 };
10-
this.uid = uid++;
8+
this.view = view;
9+
this.dimensions = { width: 0, height: 0 };
10+
this.uid = uid++;
1111

1212
// store position/total views for later use
1313
this._position = position;
@@ -16,8 +16,8 @@ $.extend(Page.prototype, {
1616
this.animated = false;
1717
this.visible = false;
1818

19-
this.queues = {};
20-
this.queues.showhide = $({});
19+
this.queues = {};
20+
this.queues.showhide = $({});
2121
},
2222

2323
// create the page, this doesn't mean it's loaded
@@ -55,11 +55,11 @@ $.extend(Page.prototype, {
5555
}
5656

5757
switch (this.view.type) {
58-
case 'image':
58+
case 'image':
5959
this.container.append(this.content = $('<img>')
6060
.attr({ src: this.view.url })
6161
);
62-
break;
62+
break;
6363

6464
case 'vimeo':
6565
case 'youtube':
@@ -144,14 +144,14 @@ $.extend(Page.prototype, {
144144
// the purpose of load is to set dimensions
145145
// we use it to set dimensions even for content that doesn't load like youtube
146146
load: function(callback, isPreload) {
147-
// make sure the page is created
147+
// make sure the page is created
148148
this.create();
149149

150150

151151
// exit early if already loaded
152152
if (this.loaded) {
153-
if (callback) callback();
154-
return;
153+
if (callback) callback();
154+
return;
155155
}
156156

157157
// abort possible previous (pre)load
@@ -287,7 +287,7 @@ $.extend(Page.prototype, {
287287
},
288288

289289
show: function(callback) {
290-
var shq = this.queues.showhide;
290+
var shq = this.queues.showhide;
291291
shq.queue([]); // clear queue
292292

293293
this.animated = true;
@@ -296,7 +296,7 @@ $.extend(Page.prototype, {
296296

297297
shq.queue(function(next_stopped_inactive) {
298298
Pages.stopInactive();
299-
next_stopped_inactive();
299+
next_stopped_inactive();
300300
});
301301

302302
shq.queue($.proxy(function(next_side) {
@@ -317,11 +317,11 @@ $.extend(Page.prototype, {
317317
this.load($.proxy(function() {
318318
this.preloadSurroundingImages();
319319
next_loaded();
320-
}, this));
320+
}, this));
321321
}, this));
322322

323323
shq.queue($.proxy(function(next_utility) {
324-
this.raise();
324+
this.raise();
325325

326326
Window.setSkin(this.view.options.skin);
327327
Window.bindUI(); // enable ui controls
@@ -355,12 +355,12 @@ $.extend(Page.prototype, {
355355
}, duration);
356356

357357
this._show(function() {
358-
if (--fx < 1) next_shown_and_resized();
359-
}, duration);
358+
if (--fx < 1) next_shown_and_resized();
359+
}, duration);
360360

361-
Window.adjustPrevNext(function(){
362-
if (--fx < 1) next_shown_and_resized();
363-
}, duration);
361+
Window.adjustPrevNext(function(){
362+
if (--fx < 1) next_shown_and_resized();
363+
}, duration);
364364

365365
// we don't sync this because hovering UI can stop it and cancel the callback
366366
// if someone decides to hover the UI before it faded it this'll instantly show it
@@ -378,7 +378,7 @@ $.extend(Page.prototype, {
378378

379379
this.animated = false;
380380

381-
this.visible = true;
381+
this.visible = true;
382382

383383
Window.startUITimer();
384384

@@ -465,8 +465,8 @@ $.extend(Page.prototype, {
465465

466466
abort: function() {
467467
if (this.imageReady && !this.preloading) {
468-
this.imageReady.abort();
469-
this.imageReady = null;
468+
this.imageReady.abort();
469+
this.imageReady = null;
470470
}
471471

472472
if (this.vimeoReady) {
@@ -496,7 +496,7 @@ $.extend(Page.prototype, {
496496
},
497497

498498
fitToWindow: function() {
499-
var page = this.element,
499+
var page = this.element,
500500
dimensions = this._getDimensionsFitToView(),
501501
viewport = Bounds.viewport(),
502502
bounds = $.extend({}, viewport),

src/js/pages.js

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
var Pages = {
2-
initialize: function(element) {
3-
this.element = element;
4-
this.pages = {};
5-
this.uid = 1;
2+
initialize: function(element) {
3+
this.element = element;
4+
this.pages = {};
5+
this.uid = 1;
66

77
this._loading = {};
8-
},
8+
},
99

10-
add: function(views) {
11-
this.uid++;
10+
add: function(views) {
11+
this.uid++;
1212

1313
this.views = views;
1414

1515
this.pages[this.uid] = []; // create room for these pages
1616

1717
// add pages for all these views
1818
$.each(views, $.proxy(function(i, view) {
19-
this.pages[this.uid].push(new Page(view, i + 1, this.views.length));
19+
this.pages[this.uid].push(new Page(view, i + 1, this.views.length));
2020
}, this));
21-
},
21+
},
2222

23-
show: function(position, callback) {
23+
show: function(position, callback) {
2424
var page = this.pages[this.uid][position - 1];
2525

2626
// never try to reload the exact same frame
@@ -30,7 +30,7 @@ var Pages = {
3030

3131
this.removeHiddenAndLoadingInactive();
3232
page.show(callback);
33-
},
33+
},
3434

3535
getLoadingCount: function() {
3636
// we only stop loading if all the frames we have are not loading anymore
@@ -61,48 +61,48 @@ var Pages = {
6161
},
6262

6363
// remove pages not matching the current id
64-
removeExpired: function(instantly) {
64+
removeExpired: function(instantly) {
6565
$.each(this.pages, function(id, pages) {
66-
if (id != this._id) {
67-
$.each(pages, function(j, page) {
68-
page.remove(instantly);
69-
});
66+
if (id != this._id) {
67+
$.each(pages, function(j, page) {
68+
page.remove(instantly);
69+
});
7070
}
7171
});
72-
},
72+
},
7373

7474

7575
// Window.hide will call thise when fully closed
76-
removeAll: function() {
76+
removeAll: function() {
7777
$.each(this.pages, function(id, pages) {
78-
$.each(pages, function(j, page) {
78+
$.each(pages, function(j, page) {
7979
page.remove();
80-
});
80+
});
8181
});
8282

8383
// empty out pages
8484
this.pages = {};
85-
},
86-
87-
hideVisibleInactive: function(alternateDuration) {
88-
$.each(this.pages, $.proxy(function(id, pages) {
89-
$.each(pages, $.proxy(function(j, page) {
90-
if (page.uid != this.page.uid) {
91-
page.hide(null, alternateDuration);
92-
}
93-
}, this));
85+
},
86+
87+
hideVisibleInactive: function(alternateDuration) {
88+
$.each(this.pages, $.proxy(function(id, pages) {
89+
$.each(pages, $.proxy(function(j, page) {
90+
if (page.uid != this.page.uid) {
91+
page.hide(null, alternateDuration);
92+
}
93+
}, this));
9494
}, this));
95-
},
95+
},
9696

97-
stopInactive: function() {
98-
$.each(this.pages, $.proxy(function(id, pages) {
99-
$.each(pages, $.proxy(function(j, page) {
97+
stopInactive: function() {
98+
$.each(this.pages, $.proxy(function(id, pages) {
99+
$.each(pages, $.proxy(function(j, page) {
100100
if (page.uid != this.page.uid && !page.preloading) {
101-
page.stop();
101+
page.stop();
102102
}
103-
}, this));
103+
}, this));
104104
}, this));
105-
},
105+
},
106106

107107
// TODO: might be nice to have a hide animation before removal, it's instant now
108108
removeHiddenAndLoadingInactive: function() {
@@ -138,11 +138,11 @@ var Pages = {
138138

139139
},
140140

141-
stop: function() {
142-
$.each(this.pages, function(id, pages) {
143-
$.each(pages, function(j, page) {
144-
page.stop();
145-
});
141+
stop: function() {
142+
$.each(this.pages, function(id, pages) {
143+
$.each(pages, function(j, page) {
144+
page.stop();
145+
});
146146
});
147-
}
147+
}
148148
};

0 commit comments

Comments
 (0)