Show:
  1. /**
  2. * @module Player
  3. */
  4.  
  5.  
  6. /**
  7. * I am the type definition of an Hypervideo (as an item in the overview mode or in project manager).
  8. * __Do not confuse me__ with the data model of the current hypervideo stored
  9. * in {{#crossLink "HypervideoModel"}}HypervideoModel{{/crossLink}}!
  10. *
  11. * @class Hypervideo
  12. * @category TypeDefinition
  13. */
  14.  
  15.  
  16. FrameTrail.defineType(
  17.  
  18. 'Hypervideo',
  19.  
  20. function(data){
  21.  
  22. this.data = data;
  23.  
  24.  
  25. },
  26.  
  27. {
  28. /**
  29. * I render a thumb for the hypervideo data in my this.data attribute.
  30. *
  31. * The jquery-enabled HTMLElement which I return contains all necessary meta information needed by
  32. * e.g. the {{#crossLink "ViewOverview"}}ViewOverview{{/crossLink}}.
  33. *
  34. * @method renderThumb
  35. * @return HTMLElement
  36. */
  37. renderThumb: function() {
  38.  
  39. var hypervideoID = FrameTrail.module('Database').getIdOfHypervideo(this.data),
  40.  
  41. href = '?project='
  42. + FrameTrail.module('RouteNavigation').projectID
  43. + '&hypervideo='
  44. + hypervideoID,
  45.  
  46. thumbBackground = (this.data.thumb ?
  47. 'background-image: url('+ FrameTrail.module('RouteNavigation').getResourceURL(this.data.thumb) +');' : '' );
  48.  
  49. thumbElement = $('<div class="hypervideoThumb" data-hypervideoID="'+ hypervideoID +'" data-name="'+ this.data.name +'" style="'+ thumbBackground +'">'
  50. + ' <div class="hypervideoThumbContent">'
  51. + ' <a href="'+ href +'" class="hypervideoIcon"></a>'
  52. + ' </div>'
  53. + ' <div class="hypervideoTitle">'+ this.data.name +'</div>'
  54. + '</div>');
  55.  
  56. return thumbElement;
  57.  
  58.  
  59. }
  60.  
  61.  
  62.  
  63. }
  64.  
  65. );
  66.