1 | /* ************************************************** */ |
---|
2 | /* ****************** LISTS ************************* */ |
---|
3 | /* ************************************************** */ |
---|
4 | |
---|
5 | var ListPlatforms = Class.create( ListItem, { |
---|
6 | |
---|
7 | createItemDiv: function( itemHash, objectParameter ) |
---|
8 | { |
---|
9 | return new Plateform( itemHash, objectParameter ); |
---|
10 | } |
---|
11 | } ); |
---|
12 | |
---|
13 | var ListParameters = Class.create( ListItem, { |
---|
14 | |
---|
15 | createItemDiv: function( itemHash, objectParameter ) |
---|
16 | { |
---|
17 | return new Parameter( itemHash, objectParameter ); |
---|
18 | }, |
---|
19 | |
---|
20 | displayByCategory : function( parentNode, idIfNoItem, textIfNoItem, className ) |
---|
21 | { |
---|
22 | parentNode.empty(); |
---|
23 | if( 0 >= this.array.length ) |
---|
24 | this.displayNoItem( parentNode, idIfNoItem, textIfNoItem ); |
---|
25 | else |
---|
26 | { |
---|
27 | var categoryName; |
---|
28 | jQuery.each( this.array, jQuery.proxy( function( i, item ) |
---|
29 | { |
---|
30 | if( categoryName != item.jsonElement[0].categoryName ) |
---|
31 | { |
---|
32 | var divCategory = $( document.createElement( "div" ) ); |
---|
33 | divCategory.html( item.jsonElement[0].categoryName ); |
---|
34 | parentNode.append( divCategory ); |
---|
35 | categoryName = item.jsonElement[0].categoryName; |
---|
36 | } |
---|
37 | if( className ) |
---|
38 | item.divItem.display( parentNode, className, true ); |
---|
39 | else |
---|
40 | item.divItem.display( parentNode, true ); |
---|
41 | }, this ) ); |
---|
42 | } |
---|
43 | } |
---|
44 | } ); |
---|
45 | |
---|
46 | |
---|
47 | /* ***************************************************** */ |
---|
48 | /* ****************** ELEMENTS ************************* */ |
---|
49 | /* ***************************************************** */ |
---|
50 | var Plateform = Class.create( Item, { |
---|
51 | |
---|
52 | display : function( parentNode, className ) |
---|
53 | { |
---|
54 | if( className ) |
---|
55 | this.createContainer( "containerPlateform", "containerElement " + className ); |
---|
56 | else |
---|
57 | this.createContainer( "containerPlateform", "containerElement" ); |
---|
58 | this.addName( "plateform_name" ); |
---|
59 | this.appendContainer( parentNode ); |
---|
60 | this.addObservers(); |
---|
61 | }, |
---|
62 | |
---|
63 | select: function() |
---|
64 | { |
---|
65 | this.selectWithParameter( "plateform_selected" ); |
---|
66 | }, |
---|
67 | |
---|
68 | unselect: function() |
---|
69 | { |
---|
70 | this.unselectWithParameter( "plateform_selected" ); |
---|
71 | } |
---|
72 | } ); |
---|
73 | |
---|
74 | var Parameter = Class.create( Item, { |
---|
75 | |
---|
76 | display: function( parentNode, className, isArrowFirst ) |
---|
77 | { |
---|
78 | if( className ) |
---|
79 | this.createContainer( "containerParameter", "containerElement " + className ); |
---|
80 | else |
---|
81 | this.createContainer( "containerParameter", "containerElement" ); |
---|
82 | this.addNameWithMenus( "parameter_name", isArrowFirst ); |
---|
83 | this.appendContainer( parentNode ); |
---|
84 | this.addObservers(); |
---|
85 | }, |
---|
86 | |
---|
87 | select: function() |
---|
88 | { |
---|
89 | this.selectWithParameter( "parameter_selected" ); |
---|
90 | }, |
---|
91 | |
---|
92 | unselect: function() |
---|
93 | { |
---|
94 | this.unselectWithParameter( "parameter_selected" ); |
---|
95 | } |
---|
96 | } ); |
---|