define('application/models/halo/editorialblock', [
'rofl/models/api/abstract',
'rofl/lib/l10n',
'application/models/uibuilder/watchall'
], function (
Abstract,
L10N,
WatchAll
) {
'use strict';
var l10n = L10N.getInstance(),
language = l10n.getLanguage();
return Abstract.extend({
init: function (editorialBlock) {
var title = editorialBlock.title[language];
this._title = title;
this._description = editorialBlock.description[language];
this._contentType = editorialBlock.content_type;
this._imageUrl = editorialBlock.tv_image || editorialBlock.tablet_image;
this._watchAll = new WatchAll({
title: title,
url: editorialBlock.content_endpath
});
},
/**
* Returns watchall model.
*
* @returns {Object} The watchall model of the editorial block.
*/
getWatchAll: function () {
return this._watchAll;
},
/**
* Returns editorial block's title.
*
* @returns {string} The title for the editorial block.
*/
getTitle: function () {
return this._title;
},
/**
* Returns editorial block's description.
*
* @returns {string} The description text for the editorial block.
*/
getDescription: function () {
return this._description;
},
/**
* Returns editorial block's image url.
*
* @returns {string} The image URL for the editorial block.
*/
getImageUrl: function () {
return this._imageUrl;
},
/**
* Returns true if the carousel's layout is EPG styled.
*
* @returns {boolean} - True for sports editorial block.
*/
isEpgLayout: function () {
return this._contentType === 'epg';
}
});
});