Author: ygrego Date: 2015-04-21 12:39:19 +0000 (Tue, 21 Apr 2015) New Revision: 1239 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1239 Log: Initialization of object with default properties. Implementation of method "setText" and "getText". Modified: oipf/js/impl/model/Configuration.js Modified: oipf/js/impl/model/Configuration.js =================================================================== --- oipf/js/impl/model/Configuration.js 2015-04-21 09:04:08 UTC (rev 1238) +++ oipf/js/impl/model/Configuration.js 2015-04-21 12:39:19 UTC (rev 1239) @@ -1,5 +1,19 @@ var Configuration = Class.extend({ + defaultProperties: { + preferredAudioLanguage: "fra", + preferredSubtitleLanguage: "fra", + preferredUILanguage: "fra", + countryId: "FRA", + regionId: 0, + pvrPolicy: configurationConstants.pvrPolicy.WATCHED_RECORDINGS, + pvrSaveEpisodes: 5, + pvrSaveDays: 15, + pvrStartPadding: 300, //Measured in (s) + pvrEndPadding: 300, //Measured in (s) + preferredTimeShiftMode: videoBrodcastConstants.timeShiftMode.OFF + }, + /* * Description: * A comma-separated set of languages to be used for audio playback, in order of preference. Each language SHALL be indicated by its ISO 639-2 language code as * defined in [ISO 639-2]. @@ -122,7 +136,11 @@ preferredTimeShiftMode: null, init: function() { - + var keys = Object.keys(this.defaultProperties); + for (var i = 0, l = keys.length; i < l; i++) { + this[keys[i]] = this.defaultProperties[keys[i]]; + } + this._keys = {}; }, /* @@ -135,8 +153,7 @@ * Return: String */ getText: function(key) { - - + return this._keys[key]; }, /* @@ -152,7 +169,7 @@ * no_title | Text string used as the title for programmes and channels where no guide information is available. Defaults to “No information” * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- * no_synopsis | Text string used as the synopsis for programmes where no guide information is available. Defaults to “No further information - | available” + * | available” * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- * manual_recording | Text string used to identify a manual recording. Defaults to “Manual Recording” * ----------------------------------------------------------------------------------------------------------------------------------------------------- @@ -161,8 +178,7 @@ * */ setText: function(key, value) { - - + this._keys[key] = value; } }); \ No newline at end of file
participants (1)
-
ygrego@users.nuiton.org