|
22 | 22 | <script src="../../external/requirejs/require.js"></script> |
23 | 23 | <script src="../bootstrap.js" data-modules="dialog"> |
24 | 24 |
|
25 | | - // there's the gallery and the trash |
| 25 | + // There's the gallery and the trash |
26 | 26 | var $gallery = $( "#gallery" ), |
27 | 27 | $trash = $( "#trash" ); |
28 | 28 |
|
29 | | - // let the gallery items be draggable |
| 29 | + // Let the gallery items be draggable |
30 | 30 | $( "li", $gallery ).draggable({ |
31 | 31 | cancel: "a.ui-icon", // clicking an icon won't initiate dragging |
32 | 32 | revert: "invalid", // when not dropped, the item will revert back to its initial position |
|
35 | 35 | cursor: "move" |
36 | 36 | }); |
37 | 37 |
|
38 | | - // let the trash be droppable, accepting the gallery items |
| 38 | + // Let the trash be droppable, accepting the gallery items |
39 | 39 | $trash.droppable({ |
40 | 40 | accept: "#gallery > li", |
41 | 41 | classes: { |
|
46 | 46 | } |
47 | 47 | }); |
48 | 48 |
|
49 | | - // let the gallery be droppable as well, accepting items from the trash |
| 49 | + // Let the gallery be droppable as well, accepting items from the trash |
50 | 50 | $gallery.droppable({ |
51 | 51 | accept: "#trash li", |
52 | 52 | classes: { |
|
57 | 57 | } |
58 | 58 | }); |
59 | 59 |
|
60 | | - // image deletion function |
| 60 | + // Image deletion function |
61 | 61 | var recycle_icon = "<a href='link/to/recycle/script/when/we/have/js/off' title='Recycle this image' class='ui-icon ui-icon-refresh'>Recycle image</a>"; |
62 | 62 | function deleteImage( $item ) { |
63 | 63 | $item.fadeOut(function() { |
|
75 | 75 | }); |
76 | 76 | } |
77 | 77 |
|
78 | | - // image recycle function |
| 78 | + // Image recycle function |
79 | 79 | var trash_icon = "<a href='link/to/trash/script/when/we/have/js/off' title='Delete this image' class='ui-icon ui-icon-trash'>Delete image</a>"; |
80 | 80 | function recycleImage( $item ) { |
81 | 81 | $item.fadeOut(function() { |
|
93 | 93 | }); |
94 | 94 | } |
95 | 95 |
|
96 | | - // image preview function, demonstrating the ui.dialog used as a modal window |
| 96 | + // Image preview function, demonstrating the ui.dialog used as a modal window |
97 | 97 | function viewLargerImage( $link ) { |
98 | 98 | var src = $link.attr( "href" ), |
99 | 99 | title = $link.siblings( "img" ).attr( "alt" ), |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 |
|
117 | | - // resolve the icons behavior with event delegation |
| 117 | + // Resolve the icons behavior with event delegation |
118 | 118 | $( "ul.gallery > li" ).on( "click", function( event ) { |
119 | 119 | var $item = $( this ), |
120 | 120 | $target = $( event.target ); |
|
0 commit comments