# HG changeset patch # User hamidouk # Date 1319119168 -7200 # Node ID 62da43e72e301f76f6f27f2e542219e3bcb18569 # Parent 2edab45f0e90af89c1d26d033d791e81a9b29e0a broke the serializers across multiple files. added a newline to the end of segmentsWidget.js. diff -r 2edab45f0e90 -r 62da43e72e30 sbin/build/client.xml --- a/sbin/build/client.xml Thu Oct 20 15:53:27 2011 +0200 +++ b/sbin/build/client.xml Thu Oct 20 15:59:28 2011 +0200 @@ -77,6 +77,9 @@ + + + diff -r 2edab45f0e90 -r 62da43e72e30 src/js/data.js --- a/src/js/data.js Thu Oct 20 15:53:27 2011 +0200 +++ b/src/js/data.js Thu Oct 20 15:59:28 2011 +0200 @@ -38,44 +38,6 @@ callback.apply(this, []); }; -IriSP.JSONSerializer = function(DataLoader, url) { - IriSP.Serializer.call(this, DataLoader, url); -}; - -IriSP.JSONSerializer.prototype = IriSP.Serializer; - -IriSP.JSONSerializer.prototype.serialize = function(data) { - return JSON.stringify(data); -}; - -IriSP.JSONSerializer.prototype.deserialize = function(data) { - return JSON.parse(data); -}; - -IriSP.JSONSerializer.prototype.sync = function(callback) { - /* we don't have to do much because jQuery handles json for us */ - - /* a wrapper to get a closure because we lose this in callbacks */ - var wrapper = function(obj) { - return function(data) { - obj._data = data; - // sort the data too - obj._data["annotations"].sort(function(a, b) - { var a_begin = +a.begin; - var b_begin = +b.begin; - return a_begin - b_begin; - }); - callback(data); - } - }; - - this._DataLoader.get(this._url, wrapper(this)); -}; - -IriSP.JSONSerializer.prototype.currentMedia = function() { - return this._data.medias[0]; /* FIXME: don't hardcode it */ -}; - IriSP.SerializerFactory = function(DataLoader) { this._dataloader = DataLoader; }; diff -r 2edab45f0e90 -r 62da43e72e30 src/js/serializers/JSONSerializer.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/js/serializers/JSONSerializer.js Thu Oct 20 15:59:28 2011 +0200 @@ -0,0 +1,38 @@ + +IriSP.JSONSerializer = function(DataLoader, url) { + IriSP.Serializer.call(this, DataLoader, url); +}; + +IriSP.JSONSerializer.prototype = IriSP.Serializer; + +IriSP.JSONSerializer.prototype.serialize = function(data) { + return JSON.stringify(data); +}; + +IriSP.JSONSerializer.prototype.deserialize = function(data) { + return JSON.parse(data); +}; + +IriSP.JSONSerializer.prototype.sync = function(callback) { + /* we don't have to do much because jQuery handles json for us */ + + /* a wrapper to get a closure because we lose this in callbacks */ + var wrapper = function(obj) { + return function(data) { + obj._data = data; + // sort the data too + obj._data["annotations"].sort(function(a, b) + { var a_begin = +a.begin; + var b_begin = +b.begin; + return a_begin - b_begin; + }); + callback(data); + } + }; + + this._DataLoader.get(this._url, wrapper(this)); +}; + +IriSP.JSONSerializer.prototype.currentMedia = function() { + return this._data.medias[0]; /* FIXME: don't hardcode it */ +}; diff -r 2edab45f0e90 -r 62da43e72e30 src/js/widgets/segmentsWidget.js --- a/src/js/widgets/segmentsWidget.js Thu Oct 20 15:53:27 2011 +0200 +++ b/src/js/widgets/segmentsWidget.js Thu Oct 20 15:59:28 2011 +0200 @@ -55,4 +55,4 @@ IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) { var begin = Math.round((+ annotation.begin) / 1000); this._Popcorn.currentTime(begin) -} \ No newline at end of file +};