PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/WebContent/js/collections/EquipmentCollection.js

https://bitbucket.org/chepdev/better-portfolio-new-skills-workshop
JavaScript | 79 lines | 71 code | 6 blank | 2 comment | 0 complexity | 898d766eefce468b02e0af6aac33007d MD5 | raw file
  1. //console.log('UserCollection.js: loaded');
  2. define([
  3. 'underscore',
  4. 'backbone',
  5. // Pull in the Model module from above
  6. 'models/EquipmentModel'
  7. ], function(_, Backbone, EquipmentModel){
  8. var EquipmentCollection = Backbone.Collection.extend({
  9. model: EquipmentModel
  10. });
  11. var systemEquipmentCollection = new EquipmentCollection();
  12. var data = [{
  13. name:'Pallet',
  14. material:'Timber',
  15. dimensions: {
  16. width: '1200',
  17. length: '1200',
  18. height: '150',
  19. units: 'mm'
  20. },
  21. mass: {
  22. weight: '45',
  23. units: 'kg'
  24. },
  25. colour:'Blue'
  26. },
  27. {
  28. name:'<i><strong>Autobox</strong></i>',
  29. material:'Steel/Plastic',
  30. dimensions: {
  31. width: '1200',
  32. length: '1200',
  33. height: '150',
  34. units: 'mm'
  35. },
  36. mass: {
  37. weight: '75',
  38. units: 'kg'
  39. },
  40. colour:'Steel/Blue'
  41. },
  42. {
  43. name:'RPC',
  44. material:'Plastic',
  45. dimensions: {
  46. width: '1200',
  47. length: '1200',
  48. height: '150',
  49. units: 'mm'
  50. },
  51. mass: {
  52. weight: '3',
  53. units: 'kg'
  54. },
  55. colour:'Green'
  56. },
  57. {
  58. name:'Bulk Bin',
  59. material:'Steel/Timber',
  60. dimensions: {
  61. width: '1200',
  62. length: '1200',
  63. height: '150',
  64. units: 'mm'
  65. },
  66. mass: {
  67. weight: '100',
  68. units: 'kg'
  69. }
  70. }];
  71. systemEquipmentCollection.add(data);
  72. return systemEquipmentCollection;
  73. });