Skip to content

Commit a811c56

Browse files
committed
more changes for demo time
1 parent 6d4d44d commit a811c56

File tree

4 files changed

+25
-26
lines changed

4 files changed

+25
-26
lines changed

dist/x-gif.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,8 +2000,9 @@ var $__default = (function() {
20002000
"use strict";
20012001
var Playback = $traceurRuntime.assertObject(require('./playback.js')).default;
20022002
var Strategies = $traceurRuntime.assertObject(require('./strategies.js')).default;
2003-
var XGif = function() {
2004-
this.ready = function() {
2003+
var XGif = function XGif() {};
2004+
($traceurRuntime.createClass)(XGif, {
2005+
ready: function() {
20052006
if (this.exploded != null) {
20062007
this.playbackStrategy = 'noop';
20072008
} else if (this.sync != null) {
@@ -2014,42 +2015,42 @@ var XGif = function() {
20142015
this.speed = this.speed || 1.0;
20152016
this.playbackStrategy = 'speed';
20162017
}
2017-
};
2018-
this.srcChanged = function() {
2018+
},
2019+
srcChanged: function() {
20192020
var playbackStrategy = Strategies[this.playbackStrategy];
20202021
this.playback = new Playback(this, this.$.frames, this.src, {
20212022
pingPong: this['ping-pong'] != null,
20222023
fill: this.fill != null,
20232024
stopped: this.stopped != null
20242025
});
20252026
this.playback.ready.then(playbackStrategy.bind(this));
2026-
};
2027-
this.speedChanged = function(oldVal, newVal) {
2027+
},
2028+
speedChanged: function(oldVal, newVal) {
20282029
if (this.playback)
20292030
this.playback.speed = newVal;
2030-
};
2031-
this.stoppedChanged = function(oldVal, newVal) {
2031+
},
2032+
stoppedChanged: function(oldVal, newVal) {
20322033
var nowStop = newVal != null;
20332034
if (this.playback && nowStop && !this.playback.stopped) {
20342035
this.playback.stop();
20352036
} else if (this.playback && !nowStop && this.playback.stopped) {
20362037
this.playback.start();
20372038
}
2038-
};
2039-
this.togglePingPong = function() {
2039+
},
2040+
togglePingPong: function() {
20402041
this['ping-pong'] = (this['ping-pong'] != null) ? null : true;
20412042
if (this.playback)
20422043
this.playback.pingPong = this['ping-pong'] != null;
2043-
};
2044-
this.clock = function(beatNr, beatDuration, beatFraction) {
2044+
},
2045+
clock: function(beatNr, beatDuration, beatFraction) {
20452046
if (this.playback && this.playback.gif)
20462047
this.playback.fromClock(beatNr, beatDuration, beatFraction);
2047-
};
2048-
this.relayout = function() {
2048+
},
2049+
relayout: function() {
20492050
if (this.fill != null)
20502051
this.playback.scaleToFill();
2051-
};
2052-
};
2052+
}
2053+
}, {});
20532054
Polymer('x-gif', new XGif());
20542055

20552056

dist/x-gif.raw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2099,7 +2099,6 @@ var $XGif = XGif;
20992099
};
21002100
},
21012101
attributeChangedCallback: function(attribute, oldVal, newVal) {
2102-
console.log(attribute);
21032102
if (attribute == "src") {
21042103
this.controller.srcChanged(newVal);
21052104
} else if (attribute == "speed") {

src/x-gif.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Playback from './playback.js';
22
import Strategies from './strategies.js';
33

4-
var XGif = function () {
5-
this.ready = function () {
4+
class XGif {
5+
ready() {
66
if (this.exploded != null) {
77
this.playbackStrategy = 'noop'
88
} else if (this.sync != null) {
@@ -17,7 +17,7 @@ var XGif = function () {
1717
}
1818
};
1919

20-
this.srcChanged = function () {
20+
srcChanged() {
2121
var playbackStrategy = Strategies[this.playbackStrategy];
2222
this.playback = new Playback(this, this.$.frames, this.src, {
2323
pingPong: this['ping-pong'] != null,
@@ -27,11 +27,11 @@ var XGif = function () {
2727
this.playback.ready.then(playbackStrategy.bind(this));
2828
};
2929

30-
this.speedChanged = function (oldVal, newVal) {
30+
speedChanged(oldVal, newVal) {
3131
if (this.playback) this.playback.speed = newVal;
3232
}
3333

34-
this.stoppedChanged = function (oldVal, newVal) {
34+
stoppedChanged(oldVal, newVal) {
3535
var nowStop = newVal != null;
3636
if (this.playback && nowStop && !this.playback.stopped) {
3737
this.playback.stop();
@@ -40,16 +40,16 @@ var XGif = function () {
4040
}
4141
}
4242

43-
this.togglePingPong = function () {
43+
togglePingPong() {
4444
this['ping-pong'] = (this['ping-pong'] != null) ? null : true;
4545
if (this.playback) this.playback.pingPong = this['ping-pong'] != null;
4646
}
4747

48-
this.clock = function (beatNr, beatDuration, beatFraction) {
48+
clock(beatNr, beatDuration, beatFraction) {
4949
if (this.playback && this.playback.gif) this.playback.fromClock(beatNr, beatDuration, beatFraction);
5050
};
5151

52-
this.relayout = function () {
52+
relayout() {
5353
if (this.fill != null) this.playback.scaleToFill();
5454
}
5555
}

src/x-gif.raw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ class XGif extends HTMLElement {
114114
}
115115

116116
attributeChangedCallback(attribute, oldVal, newVal) {
117-
console.log(attribute)
118117
if (attribute == "src") {
119118
this.controller.srcChanged(newVal)
120119
} else if (attribute == "speed") {

0 commit comments

Comments
 (0)