PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/client/galaxy/scripts/mvc/history/hdca-model.js

https://bitbucket.org/remy_d1/galaxy-central-manageapi
JavaScript | 82 lines | 45 code | 13 blank | 24 comment | 0 complexity | 7626cb94ae4d5f4b4455100958d64774 MD5 | raw file
Possible License(s): CC-BY-3.0
  1. define([
  2. "mvc/collection/collection-model",
  3. "mvc/history/history-content-model",
  4. "utils/localization"
  5. ], function( DC_MODEL, HISTORY_CONTENT, _l ){
  6. /*==============================================================================
  7. Models for DatasetCollections contained within a history.
  8. TODO:
  9. these might be compactable to one class if some duplication with
  10. collection-model is used.
  11. ==============================================================================*/
  12. var hcontentMixin = HISTORY_CONTENT.HistoryContentMixin,
  13. ListDC = DC_MODEL.ListDatasetCollection,
  14. PairDC = DC_MODEL.PairDatasetCollection,
  15. ListPairedDC = DC_MODEL.ListPairedDatasetCollection;
  16. //==============================================================================
  17. /** @class Backbone model for List Dataset Collection within a History.
  18. */
  19. var HistoryListDatasetCollection = ListDC.extend( hcontentMixin ).extend(
  20. /** @lends HistoryListDatasetCollection.prototype */{
  21. initialize : function( model, options ){
  22. ListDC.prototype.initialize.call( this, model, options );
  23. hcontentMixin.initialize.call( this, model, options );
  24. },
  25. /** String representation. */
  26. toString : function(){
  27. return ([ 'HistoryListDatasetCollection(', this.get( 'name' ), ')' ].join( '' ));
  28. }
  29. });
  30. //==============================================================================
  31. /** @class Backbone model for Pair Dataset Collection within a History.
  32. * @constructs
  33. */
  34. var HistoryPairDatasetCollection = PairDC.extend( hcontentMixin ).extend(
  35. /** @lends HistoryPairDatasetCollection.prototype */{
  36. initialize : function( model, options ){
  37. PairDC.prototype.initialize.call( this, model, options );
  38. hcontentMixin.initialize.call( this, model, options );
  39. },
  40. /** String representation. */
  41. toString : function(){
  42. return ([ 'HistoryPairDatasetCollection(', this.get( 'name' ), ')' ].join( '' ));
  43. }
  44. });
  45. //==============================================================================
  46. /** @class Backbone model for List of Pairs Dataset Collection within a History.
  47. * @constructs
  48. */
  49. var HistoryListPairedDatasetCollection = ListPairedDC.extend( hcontentMixin ).extend(
  50. /** @lends HistoryListPairedDatasetCollection.prototype */{
  51. initialize : function( model, options ){
  52. ListPairedDC.prototype.initialize.call( this, model, options );
  53. hcontentMixin.initialize.call( this, model, options );
  54. },
  55. /** String representation. */
  56. toString : function(){
  57. return ([ 'HistoryListPairedDatasetCollection(', this.get( 'name' ), ')' ].join( '' ));
  58. }
  59. });
  60. //==============================================================================
  61. return {
  62. HistoryListDatasetCollection : HistoryListDatasetCollection,
  63. HistoryPairDatasetCollection : HistoryPairDatasetCollection,
  64. HistoryListPairedDatasetCollection : HistoryListPairedDatasetCollection
  65. };
  66. });