dust-generators 0.2.8 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/lib/dust/version.rb +2 -2
  2. data/lib/generators/dust/albums/templates/app/views/albums/show.html.haml +1 -1
  3. data/lib/generators/dust/scaffold/scaffold_generator.rb +24 -24
  4. data/lib/generators/dust/scaffold/templates/actions/create.rb +1 -1
  5. data/lib/generators/dust/scaffold/templates/actions/destroy.rb +2 -2
  6. data/lib/generators/dust/scaffold/templates/actions/edit.rb +1 -1
  7. data/lib/generators/dust/scaffold/templates/actions/index.rb +1 -1
  8. data/lib/generators/dust/scaffold/templates/actions/new.rb +1 -1
  9. data/lib/generators/dust/scaffold/templates/actions/show.rb +1 -1
  10. data/lib/generators/dust/scaffold/templates/actions/update.rb +2 -2
  11. data/lib/generators/dust/scaffold/templates/controller.rb +3 -2
  12. data/lib/generators/dust/scaffold/templates/migration.rb +2 -2
  13. data/lib/generators/dust/scaffold/templates/model.rb +13 -11
  14. data/lib/generators/dust/scaffold/templates/view_controller.rb +8 -6
  15. data/lib/generators/dust/scaffold/templates/views/front_end/haml/index.html.haml +6 -5
  16. data/lib/generators/dust/scaffold/templates/views/front_end/haml/show.html.haml +11 -11
  17. data/lib/generators/dust/scaffold/templates/views/haml/_form.html.haml +1 -1
  18. data/lib/generators/dust/scaffold/templates/views/haml/_search.html.haml +1 -1
  19. data/lib/generators/dust/scaffold/templates/views/haml/index.html.haml +2 -2
  20. data/lib/generators/dust/scaffold/templates/views/haml/show.html.haml +1 -1
  21. metadata +49 -174
  22. data/rails_generators/dust_albums/USAGE +0 -6
  23. data/rails_generators/dust_albums/dust_albums_generator.rb +0 -196
  24. data/rails_generators/dust_albums/templates/README +0 -5
  25. data/rails_generators/dust_albums/templates/app/controllers/albums_controller.rb +0 -56
  26. data/rails_generators/dust_albums/templates/app/controllers/photos_controller.rb +0 -89
  27. data/rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb +0 -17
  28. data/rails_generators/dust_albums/templates/app/helpers/albums_helper.rb +0 -2
  29. data/rails_generators/dust_albums/templates/app/helpers/photos_helper.rb +0 -2
  30. data/rails_generators/dust_albums/templates/app/helpers/view_albums_helper.rb +0 -2
  31. data/rails_generators/dust_albums/templates/app/models/album.rb +0 -42
  32. data/rails_generators/dust_albums/templates/app/models/photo.rb +0 -18
  33. data/rails_generators/dust_albums/templates/app/views/albums/_form.html.erb +0 -52
  34. data/rails_generators/dust_albums/templates/app/views/albums/_search.html.erb +0 -6
  35. data/rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb +0 -37
  36. data/rails_generators/dust_albums/templates/app/views/albums/edit.html.erb +0 -5
  37. data/rails_generators/dust_albums/templates/app/views/albums/index.html.erb +0 -61
  38. data/rails_generators/dust_albums/templates/app/views/albums/manage.html.erb +0 -65
  39. data/rails_generators/dust_albums/templates/app/views/albums/new.html.erb +0 -6
  40. data/rails_generators/dust_albums/templates/app/views/albums/show.html.erb +0 -56
  41. data/rails_generators/dust_albums/templates/app/views/albums/show.js.erb +0 -1
  42. data/rails_generators/dust_albums/templates/app/views/photos/_form.html.erb +0 -23
  43. data/rails_generators/dust_albums/templates/app/views/photos/_photo.html.erb +0 -25
  44. data/rails_generators/dust_albums/templates/app/views/photos/_search.html.erb +0 -6
  45. data/rails_generators/dust_albums/templates/app/views/photos/array.js.erb +0 -3
  46. data/rails_generators/dust_albums/templates/app/views/photos/edit.html.erb +0 -28
  47. data/rails_generators/dust_albums/templates/app/views/photos/index.html.erb +0 -85
  48. data/rails_generators/dust_albums/templates/app/views/photos/new.html.erb +0 -7
  49. data/rails_generators/dust_albums/templates/app/views/photos/show.html.erb +0 -26
  50. data/rails_generators/dust_albums/templates/app/views/photos/show.js.erb +0 -9
  51. data/rails_generators/dust_albums/templates/app/views/view_albums/index.html.erb +0 -31
  52. data/rails_generators/dust_albums/templates/app/views/view_albums/show.html.erb +0 -31
  53. data/rails_generators/dust_albums/templates/images/browse.png +0 -0
  54. data/rails_generators/dust_albums/templates/images/cancel.png +0 -0
  55. data/rails_generators/dust_albums/templates/images/save_position.png +0 -0
  56. data/rails_generators/dust_albums/templates/images/upload.png +0 -0
  57. data/rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb +0 -17
  58. data/rails_generators/dust_albums/templates/initializers/session_store_middleware.rb +0 -1
  59. data/rails_generators/dust_albums/templates/javascript/dragsort.js +0 -288
  60. data/rails_generators/dust_albums/templates/javascript/dust_album.js +0 -28
  61. data/rails_generators/dust_albums/templates/javascript/uploadify/jquery.uploadify.v2.1.0.js +0 -258
  62. data/rails_generators/dust_albums/templates/javascript/uploadify/swfobject.js +0 -4
  63. data/rails_generators/dust_albums/templates/javascript/uploadify/uploadify.swf +0 -0
  64. data/rails_generators/dust_albums/templates/migration/albums_migration.rb +0 -39
  65. data/rails_generators/dust_albums/templates/stylesheets/dust_album.css +0 -16
  66. data/rails_generators/dust_albums/templates/stylesheets/dust_album_app.css +0 -15
  67. data/rails_generators/dust_albums/templates/stylesheets/uploadify.css +0 -84
  68. data/rails_generators/dust_config/USAGE +0 -23
  69. data/rails_generators/dust_config/dust_config_generator.rb +0 -32
  70. data/rails_generators/dust_config/templates/config.yml +0 -8
  71. data/rails_generators/dust_config/templates/load_config.rb +0 -2
  72. data/rails_generators/dust_scaffold/USAGE +0 -51
  73. data/rails_generators/dust_scaffold/dust_scaffold_generator.rb +0 -291
  74. data/rails_generators/dust_scaffold/templates/actions/create.rb +0 -9
  75. data/rails_generators/dust_scaffold/templates/actions/destroy.rb +0 -6
  76. data/rails_generators/dust_scaffold/templates/actions/edit.rb +0 -3
  77. data/rails_generators/dust_scaffold/templates/actions/index.rb +0 -3
  78. data/rails_generators/dust_scaffold/templates/actions/new.rb +0 -3
  79. data/rails_generators/dust_scaffold/templates/actions/show.rb +0 -3
  80. data/rails_generators/dust_scaffold/templates/actions/update.rb +0 -9
  81. data/rails_generators/dust_scaffold/templates/controller.rb +0 -9
  82. data/rails_generators/dust_scaffold/templates/fixtures.yml +0 -9
  83. data/rails_generators/dust_scaffold/templates/helper.rb +0 -2
  84. data/rails_generators/dust_scaffold/templates/migration.rb +0 -20
  85. data/rails_generators/dust_scaffold/templates/model.rb +0 -37
  86. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/create.rb +0 -11
  87. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/destroy.rb +0 -6
  88. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/edit.rb +0 -4
  89. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/index.rb +0 -4
  90. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/new.rb +0 -4
  91. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/show.rb +0 -4
  92. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/update.rb +0 -11
  93. data/rails_generators/dust_scaffold/templates/tests/rspec/controller.rb +0 -8
  94. data/rails_generators/dust_scaffold/templates/tests/rspec/model.rb +0 -7
  95. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/create.rb +0 -13
  96. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/destroy.rb +0 -8
  97. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/edit.rb +0 -6
  98. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/index.rb +0 -6
  99. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/new.rb +0 -6
  100. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/show.rb +0 -6
  101. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/update.rb +0 -13
  102. data/rails_generators/dust_scaffold/templates/tests/shoulda/controller.rb +0 -5
  103. data/rails_generators/dust_scaffold/templates/tests/shoulda/model.rb +0 -7
  104. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/create.rb +0 -11
  105. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/destroy.rb +0 -6
  106. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/edit.rb +0 -4
  107. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/index.rb +0 -4
  108. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/new.rb +0 -4
  109. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/show.rb +0 -4
  110. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/update.rb +0 -11
  111. data/rails_generators/dust_scaffold/templates/tests/testunit/controller.rb +0 -5
  112. data/rails_generators/dust_scaffold/templates/tests/testunit/model.rb +0 -7
  113. data/rails_generators/dust_scaffold/templates/view_controller.rb +0 -17
  114. data/rails_generators/dust_scaffold/templates/views/erb/_form.html.erb +0 -16
  115. data/rails_generators/dust_scaffold/templates/views/erb/_search.html.erb +0 -6
  116. data/rails_generators/dust_scaffold/templates/views/erb/edit.html.erb +0 -4
  117. data/rails_generators/dust_scaffold/templates/views/erb/index.html.erb +0 -24
  118. data/rails_generators/dust_scaffold/templates/views/erb/new.html.erb +0 -5
  119. data/rails_generators/dust_scaffold/templates/views/erb/show.html.erb +0 -23
  120. data/rails_generators/dust_scaffold/templates/views/front_end/index.html.erb +0 -14
  121. data/rails_generators/dust_scaffold/templates/views/front_end/show.html.erb +0 -17
@@ -1,288 +0,0 @@
1
- // jQuery List DragSort v0.4
2
- // Website: http://dragsort.codeplex.com/
3
- // License: http://dragsort.codeplex.com/license
4
-
5
- (function($) {
6
-
7
- $.fn.dragsort = function(options) {
8
- var opts = $.extend({}, $.fn.dragsort.defaults, options);
9
- var lists = [];
10
- var list = null, lastPos = null;
11
- if (this.selector)
12
- $("head").append("<style type='text/css'>" + (this.selector.split(",").join(" " + opts.dragSelector + ",") + " " + opts.dragSelector) + " { cursor: pointer; }</style>");
13
-
14
- this.each(function(i, cont) {
15
-
16
- if ($(cont).is("table") && $(cont).children().size() == 1 && $(cont).children().is("tbody"))
17
- cont = $(cont).children().get(0);
18
-
19
- var newList = {
20
- draggedItem: null,
21
- placeHolderItem: null,
22
- pos: null,
23
- offset: null,
24
- offsetLimit: null,
25
- scroll: null,
26
- container: cont,
27
-
28
- init: function() {
29
- $(this.container).attr("data-listIdx", i).mousedown(this.grabItem).find(opts.dragSelector).css("cursor", "pointer");
30
- $(this.container).children(opts.itemSelector).each(function(j) { $(this).attr("data-itemIdx", j); });
31
- },
32
-
33
- grabItem: function(e) {
34
- if (e.which != 1 || $(e.target).is(opts.dragSelectorExclude))
35
- return;
36
-
37
- var elm = e.target;
38
- while (!$(elm).is("[data-listIdx='" + $(this).attr("data-listIdx") + "'] " + opts.dragSelector)) {
39
- if (elm == this) return;
40
- elm = elm.parentNode;
41
- }
42
-
43
- if (list != null && list.draggedItem != null)
44
- list.dropItem();
45
-
46
- $(e.target).css("cursor", "move");
47
-
48
- list = lists[$(this).attr("data-listIdx")];
49
- list.draggedItem = $(elm).closest(opts.itemSelector);
50
- var mt = parseInt(list.draggedItem.css("marginTop"));
51
- var ml = parseInt(list.draggedItem.css("marginLeft"));
52
- list.offset = list.draggedItem.offset();
53
- list.offset.top = e.pageY - list.offset.top + (isNaN(mt) ? 0 : mt) - 1;
54
- list.offset.left = e.pageX - list.offset.left + (isNaN(ml) ? 0 : ml) - 1;
55
-
56
- if (!opts.dragBetween) {
57
- var containerHeight = $(list.container).outerHeight() == 0 ? Math.max(1, Math.round(0.5 + $(list.container).children(opts.itemSelector).size() * list.draggedItem.outerWidth() / $(list.container).outerWidth())) * list.draggedItem.outerHeight() : $(list.container).outerHeight();
58
- list.offsetLimit = $(list.container).offset();
59
- list.offsetLimit.right = list.offsetLimit.left + $(list.container).outerWidth() - list.draggedItem.outerWidth();
60
- list.offsetLimit.bottom = list.offsetLimit.top + containerHeight - list.draggedItem.outerHeight();
61
- }
62
-
63
- var h = list.draggedItem.height();
64
- var w = list.draggedItem.width();
65
- var orig = list.draggedItem.attr("style");
66
- list.draggedItem.attr("data-origStyle", orig ? orig : "");
67
- if (opts.itemSelector == "tr") {
68
- list.draggedItem.children().each(function() { $(this).width($(this).width()); });
69
- list.placeHolderItem = list.draggedItem.clone().attr("data-placeHolder", true);
70
- list.draggedItem.after(list.placeHolderItem);
71
- list.placeHolderItem.children().each(function() { $(this).css({ borderWidth:0, width: $(this).width() + 1, height: $(this).height() + 1 }).html("&nbsp;"); });
72
- } else {
73
- list.draggedItem.after(opts.placeHolderTemplate);
74
- list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeHolder", true);
75
- }
76
- list.draggedItem.css({ position: "absolute", opacity: 0.8, "z-index": 999, height: h, width: w });
77
-
78
- $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
79
-
80
- list.scroll = { moveX: 0, moveY: 0, maxX: $(document).width() - $(window).width(), maxY: $(document).height() - $(window).height() };
81
- list.scroll.scrollY = window.setInterval(function() {
82
- if (opts.scrollContainer != window) {
83
- $(opts.scrollContainer).scrollTop($(opts.scrollContainer).scrollTop() + list.scroll.moveY);
84
- return;
85
- }
86
- var t = $(opts.scrollContainer).scrollTop();
87
- if (list.scroll.moveY > 0 && t < list.scroll.maxY || list.scroll.moveY < 0 && t > 0) {
88
- $(opts.scrollContainer).scrollTop(t + list.scroll.moveY);
89
- list.draggedItem.css("top", list.draggedItem.offset().top + list.scroll.moveY + 1);
90
- }
91
- }, 10);
92
- list.scroll.scrollX = window.setInterval(function() {
93
- if (opts.scrollContainer != window) {
94
- $(opts.scrollContainer).scrollLeft($(opts.scrollContainer).scrollLeft() + list.scroll.moveX);
95
- return;
96
- }
97
- var l = $(opts.scrollContainer).scrollLeft();
98
- if (list.scroll.moveX > 0 && l < list.scroll.maxX || list.scroll.moveX < 0 && l > 0) {
99
- $(opts.scrollContainer).scrollLeft(l + list.scroll.moveX);
100
- list.draggedItem.css("left", list.draggedItem.offset().left + list.scroll.moveX + 1);
101
- }
102
- }, 10);
103
-
104
- list.setPos(e.pageX, e.pageY);
105
- $(document).bind("selectstart", list.stopBubble); //stop ie text selection
106
- $(document).bind("mousemove", list.swapItems);
107
- $(document).bind("mouseup", list.dropItem);
108
- if (opts.scrollContainer != window)
109
- $(window).bind("DOMMouseScroll mousewheel", list.wheel);
110
- return false; //stop moz text selection
111
- },
112
-
113
- setPos: function(x, y) {
114
- var top = y - this.offset.top;
115
- var left = x - this.offset.left;
116
-
117
- if (!opts.dragBetween) {
118
- top = Math.min(this.offsetLimit.bottom, Math.max(top, this.offsetLimit.top));
119
- left = Math.min(this.offsetLimit.right, Math.max(left, this.offsetLimit.left));
120
- }
121
-
122
- this.draggedItem.parents().each(function() {
123
- if ($(this).css("position") != "static" && (!$.browser.mozilla || $(this).css("display") != "table")) {
124
- var offset = $(this).offset();
125
- top -= offset.top;
126
- left -= offset.left;
127
- return false;
128
- }
129
- });
130
-
131
- if (opts.scrollContainer == window) {
132
- y -= $(window).scrollTop();
133
- x -= $(window).scrollLeft();
134
- y = Math.max(0, y - $(window).height() + 5) + Math.min(0, y - 5);
135
- x = Math.max(0, x - $(window).width() + 5) + Math.min(0, x - 5);
136
- } else {
137
- var cont = $(opts.scrollContainer);
138
- var offset = cont.offset();
139
- y = Math.max(0, y - cont.height() - offset.top) + Math.min(0, y - offset.top);
140
- x = Math.max(0, x - cont.width() - offset.left) + Math.min(0, x - offset.left);
141
- }
142
-
143
- list.scroll.moveX = x == 0 ? 0 : x * opts.scrollSpeed / Math.abs(x);
144
- list.scroll.moveY = y == 0 ? 0 : y * opts.scrollSpeed / Math.abs(y);
145
-
146
- this.draggedItem.css({ top: top, left: left });
147
- },
148
-
149
- wheel: function(e) {
150
- if (($.browser.safari || $.browser.mozilla) && list && opts.scrollContainer != window) {
151
- var cont = $(opts.scrollContainer);
152
- var offset = cont.offset();
153
- if (e.pageX > offset.left && e.pageX < offset.left + cont.width() && e.pageY > offset.top && e.pageY < offset.top + cont.height()) {
154
- var delta = e.detail ? e.detail * 5 : e.wheelDelta / -2;
155
- cont.scrollTop(cont.scrollTop() + delta);
156
- e.preventDefault();
157
- }
158
- }
159
- },
160
-
161
- buildPositionTable: function() {
162
- var item = this.draggedItem == null ? null : this.draggedItem.get(0);
163
- var pos = [];
164
- $(this.container).children(opts.itemSelector).each(function(i, elm) {
165
- if (elm != item) {
166
- var loc = $(elm).offset();
167
- loc.right = loc.left + $(elm).width();
168
- loc.bottom = loc.top + $(elm).height();
169
- loc.elm = elm;
170
- pos.push(loc);
171
- }
172
- });
173
- this.pos = pos;
174
- },
175
-
176
- dropItem: function() {
177
- if (list.draggedItem == null)
178
- return;
179
-
180
- $(list.container).find(opts.dragSelector).css("cursor", "pointer");
181
- list.placeHolderItem.before(list.draggedItem);
182
-
183
- var orig = list.draggedItem.attr("data-origStyle");
184
- if (orig == "")
185
- list.draggedItem.removeAttr("style");
186
- else
187
- list.draggedItem.attr("style", orig);
188
- list.draggedItem.removeAttr("data-origStyle");
189
- list.placeHolderItem.remove();
190
-
191
- $("[data-dropTarget]").remove();
192
-
193
- window.clearInterval(list.scroll.scrollY);
194
- window.clearInterval(list.scroll.scrollX);
195
-
196
- var changed = false;
197
- $(lists).each(function() {
198
- $(this.container).children(opts.itemSelector).each(function(j) {
199
- if (parseInt($(this).attr("data-itemIdx")) != j) {
200
- changed = true;
201
- $(this).attr("data-itemIdx", j);
202
- }
203
- });
204
- });
205
- if (changed)
206
- opts.dragEnd.apply(list.draggedItem);
207
- list.draggedItem = null;
208
- $(document).unbind("selectstart", list.stopBubble);
209
- $(document).unbind("mousemove", list.swapItems);
210
- $(document).unbind("mouseup", list.dropItem);
211
- if (opts.scrollContainer != window)
212
- $(window).unbind("DOMMouseScroll mousewheel", list.wheel);
213
- return false;
214
- },
215
-
216
- stopBubble: function() { return false; },
217
-
218
- swapItems: function(e) {
219
- if (list.draggedItem == null)
220
- return false;
221
-
222
- list.setPos(e.pageX, e.pageY);
223
-
224
- var ei = list.findPos(e.pageX, e.pageY);
225
- var nlist = list;
226
- for (var i = 0; ei == -1 && opts.dragBetween && i < lists.length; i++) {
227
- ei = lists[i].findPos(e.pageX, e.pageY);
228
- nlist = lists[i];
229
- }
230
-
231
- if (ei == -1 || $(nlist.pos[ei].elm).attr("data-placeHolder"))
232
- return false;
233
-
234
- if (lastPos == null || lastPos.top > list.draggedItem.offset().top || lastPos.left > list.draggedItem.offset().left)
235
- $(nlist.pos[ei].elm).before(list.placeHolderItem);
236
- else
237
- $(nlist.pos[ei].elm).after(list.placeHolderItem);
238
-
239
- $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
240
- lastPos = list.draggedItem.offset();
241
- return false;
242
- },
243
-
244
- findPos: function(x, y) {
245
- for (var i = 0; i < this.pos.length; i++) {
246
- if (this.pos[i].left < x && this.pos[i].right > x && this.pos[i].top < y && this.pos[i].bottom > y)
247
- return i;
248
- }
249
- return -1;
250
- },
251
-
252
- createDropTargets: function() {
253
- if (!opts.dragBetween)
254
- return;
255
-
256
- $(lists).each(function() {
257
- var ph = $(this.container).find("[data-placeHolder]");
258
- var dt = $(this.container).find("[data-dropTarget]");
259
- if (ph.size() > 0 && dt.size() > 0)
260
- dt.remove();
261
- else if (ph.size() == 0 && dt.size() == 0) {
262
- //list.placeHolderItem.clone().removeAttr("data-placeHolder") crashes in IE7 and jquery 1.5.1 (doesn't in jquery 1.4.2 or IE8)
263
- $(this.container).append(list.placeHolderItem.removeAttr("data-placeHolder").clone().attr("data-dropTarget", true));
264
- list.placeHolderItem.attr("data-placeHolder", true);
265
- }
266
- });
267
- }
268
- };
269
-
270
- newList.init();
271
- lists.push(newList);
272
- });
273
-
274
- return this;
275
- };
276
-
277
- $.fn.dragsort.defaults = {
278
- itemSelector: "li",
279
- dragSelector: "li",
280
- dragSelectorExclude: "input, textarea, a[href]",
281
- dragEnd: function() { },
282
- dragBetween: false,
283
- placeHolderTemplate: "<li>&nbsp;</li>",
284
- scrollContainer: window,
285
- scrollSpeed: 5
286
- };
287
-
288
- })(jQuery);
@@ -1,28 +0,0 @@
1
- $(document).ready(function(){
2
-
3
- // <%=child_singular_name%> management /////////////////////////////////////////////////////////////////////////////////////////////
4
- $("#uploads").dragsort({
5
- dragSelector: "div",
6
- dragEnd: notice,
7
- placeHolderTemplate: "<li class='placeHolder'><div></div></li>"
8
- });
9
-
10
- $("#reorder").hide();
11
- function notice() {
12
- $("#reorder").slideDown();
13
- }
14
-
15
- $(function () { // this line makes sure this code runs on page load
16
- $('.checkall').click(function () {
17
- $(this).parents('form:eq(0)').find(':checkbox').attr('checked', this.checked);
18
- });
19
- });
20
-
21
- $("#order_<%=child_plural_name%>").click(function(){
22
- mylist = $('#uploads').serializelist();
23
- $.post("/<%=child_plural_name%>/array", mylist);
24
- $.fancybox.showActivity();
25
- return false;
26
- });
27
-
28
- });
@@ -1,258 +0,0 @@
1
- /*
2
- Uploadify v2.1.0
3
- Release Date: August 24, 2009
4
-
5
- Copyright (c) 2009 Ronnie Garcia, Travis Nickels
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in
15
- all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- THE SOFTWARE.
24
- */
25
-
26
- if(jQuery)(
27
- function(jQuery){
28
- jQuery.extend(jQuery.fn,{
29
- uploadify:function(options) {
30
- jQuery(this).each(function(){
31
- settings = jQuery.extend({
32
- id : jQuery(this).attr('id'), // The ID of the object being Uploadified
33
- uploader : 'uploadify.swf', // The path to the uploadify swf file
34
- script : 'uploadify.php', // The path to the uploadify backend upload script
35
- expressInstall : null, // The path to the express install swf file
36
- folder : '', // The path to the upload folder
37
- height : 30, // The height of the flash button
38
- width : 110, // The width of the flash button
39
- cancelImg : 'cancel.png', // The path to the cancel image for the default file queue item container
40
- wmode : 'opaque', // The wmode of the flash file
41
- scriptAccess : 'sameDomain', // Set to "always" to allow script access across domains
42
- fileDataName : 'Filedata', // The name of the file collection object in the backend upload script
43
- method : 'POST', // The method for sending variables to the backend upload script
44
- queueSizeLimit : 999, // The maximum size of the file queue
45
- simUploadLimit : 1, // The number of simultaneous uploads allowed
46
- queueID : false, // The optional ID of the queue container
47
- displayData : 'percentage', // Set to "speed" to show the upload speed in the default queue item
48
- onInit : function() {}, // Function to run when uploadify is initialized
49
- onSelect : function() {}, // Function to run when a file is selected
50
- onQueueFull : function() {}, // Function to run when the queue reaches capacity
51
- onCheck : function() {}, // Function to run when script checks for duplicate files on the server
52
- onCancel : function() {}, // Function to run when an item is cleared from the queue
53
- onError : function() {}, // Function to run when an upload item returns an error
54
- onProgress : function() {}, // Function to run each time the upload progress is updated
55
- onComplete : function() {}, // Function to run when an upload is completed
56
- onAllComplete : function() {} // Functino to run when all uploads are completed
57
- }, options);
58
- var pagePath = location.pathname;
59
- pagePath = pagePath.split('/');
60
- pagePath.pop();
61
- pagePath = pagePath.join('/') + '/';
62
- var data = {};
63
- data.uploadifyID = settings.id;
64
- data.pagepath = pagePath;
65
- if (settings.buttonImg) data.buttonImg = escape(settings.buttonImg);
66
- if (settings.buttonText) data.buttonText = escape(settings.buttonText);
67
- if (settings.rollover) data.rollover = true;
68
- data.script = settings.script;
69
- data.folder = escape(settings.folder);
70
- if (settings.scriptData) {
71
- var scriptDataString = '';
72
- for (var name in settings.scriptData) {
73
- scriptDataString += '&' + name + '=' + settings.scriptData[name];
74
- }
75
- data.scriptData = escape(scriptDataString.substr(1));
76
- }
77
- data.width = settings.width;
78
- data.height = settings.height;
79
- data.wmode = settings.wmode;
80
- data.method = settings.method;
81
- data.queueSizeLimit = settings.queueSizeLimit;
82
- data.simUploadLimit = settings.simUploadLimit;
83
- if (settings.hideButton) data.hideButton = true;
84
- if (settings.fileDesc) data.fileDesc = settings.fileDesc;
85
- if (settings.fileExt) data.fileExt = settings.fileExt;
86
- if (settings.multi) data.multi = true;
87
- if (settings.auto) data.auto = true;
88
- if (settings.sizeLimit) data.sizeLimit = settings.sizeLimit;
89
- if (settings.checkScript) data.checkScript = settings.checkScript;
90
- if (settings.fileDataName) data.fileDataName = settings.fileDataName;
91
- if (settings.queueID) data.queueID = settings.queueID;
92
- if (settings.onInit() !== false) {
93
- jQuery(this).css('display','none');
94
- jQuery(this).after('<div id="' + jQuery(this).attr('id') + 'Uploader"></div>');
95
- swfobject.embedSWF(settings.uploader, settings.id + 'Uploader', settings.width, settings.height, '9.0.24', settings.expressInstall, data, {'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess});
96
- if (settings.queueID == false) {
97
- jQuery("#" + jQuery(this).attr('id') + "Uploader").after('<div id="' + jQuery(this).attr('id') + 'Queue" class="uploadifyQueue"></div>');
98
- }
99
- }
100
- if (typeof(settings.onOpen) == 'function') {
101
- jQuery(this).bind("uploadifyOpen", settings.onOpen);
102
- }
103
- jQuery(this).bind("uploadifySelect", {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {
104
- if (event.data.action(event, ID, fileObj) !== false) {
105
- var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;
106
- var suffix = 'KB';
107
- if (byteSize > 1000) {
108
- byteSize = Math.round(byteSize *.001 * 100) * .01;
109
- suffix = 'MB';
110
- }
111
- var sizeParts = byteSize.toString().split('.');
112
- if (sizeParts.length > 1) {
113
- byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
114
- } else {
115
- byteSize = sizeParts[0];
116
- }
117
- if (fileObj.name.length > 20) {
118
- fileName = fileObj.name.substr(0,20) + '...';
119
- } else {
120
- fileName = fileObj.name;
121
- }
122
- queue = '#' + jQuery(this).attr('id') + 'Queue';
123
- if (event.data.queueID) {
124
- queue = '#' + event.data.queueID;
125
- }
126
- jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\
127
- <div class="cancel">\
128
- <a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\
129
- </div>\
130
- <span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\
131
- <div class="uploadifyProgress">\
132
- <div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\
133
- </div>\
134
- </div>');
135
- }
136
- });
137
- if (typeof(settings.onSelectOnce) == 'function') {
138
- jQuery(this).bind("uploadifySelectOnce", settings.onSelectOnce);
139
- }
140
- jQuery(this).bind("uploadifyQueueFull", {'action': settings.onQueueFull}, function(event, queueSizeLimit) {
141
- if (event.data.action(event, queueSizeLimit) !== false) {
142
- alert('The queue is full. The max size is ' + queueSizeLimit + '.');
143
- }
144
- });
145
- jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {
146
- var postData = new Object();
147
- postData = fileQueueObj;
148
- postData.folder = pagePath + folder;
149
- if (single) {
150
- for (var ID in fileQueueObj) {
151
- var singleFileID = ID;
152
- }
153
- }
154
- jQuery.post(checkScript, postData, function(data) {
155
- for(var key in data) {
156
- if (event.data.action(event, checkScript, fileQueueObj, folder, single) !== false) {
157
- var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");
158
- if (!replaceFile) {
159
- document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key, true,true);
160
- }
161
- }
162
- }
163
- if (single) {
164
- document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);
165
- } else {
166
- document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);
167
- }
168
- }, "json");
169
- });
170
- jQuery(this).bind("uploadifyCancel", {'action': settings.onCancel}, function(event, ID, fileObj, data, clearFast) {
171
- if (event.data.action(event, ID, fileObj, data, clearFast) !== false) {
172
- var fadeSpeed = (clearFast == true) ? 0 : 250;
173
- jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(fadeSpeed, function() { jQuery(this).remove() });
174
- }
175
- });
176
- if (typeof(settings.onClearQueue) == 'function') {
177
- jQuery(this).bind("uploadifyClearQueue", settings.onClearQueue);
178
- }
179
- var errorArray = [];
180
- jQuery(this).bind("uploadifyError", {'action': settings.onError}, function(event, ID, fileObj, errorObj) {
181
- if (event.data.action(event, ID, fileObj, errorObj) !== false) {
182
- var fileArray = new Array(ID, fileObj, errorObj);
183
- errorArray.push(fileArray);
184
- jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(" - " + errorObj.type + " Error");
185
- jQuery("#" + jQuery(this).attr('id') + ID).addClass('uploadifyError');
186
- }
187
- });
188
- jQuery(this).bind("uploadifyProgress", {'action': settings.onProgress, 'toDisplay': settings.displayData}, function(event, ID, fileObj, data) {
189
- if (event.data.action(event, ID, fileObj, data) !== false) {
190
- jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").css('width', data.percentage + '%');
191
- if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';
192
- if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';
193
- if (event.data.toDisplay == null) displayData = ' ';
194
- jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(displayData);
195
- }
196
- });
197
- jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {
198
- if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {
199
- jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(' - Completed');
200
- jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(250, function() { jQuery(this).remove()});
201
- }
202
- });
203
- if (typeof(settings.onAllComplete) == 'function') {
204
- jQuery(this).bind("uploadifyAllComplete", {'action': settings.onAllComplete}, function(event, uploadObj) {
205
- if (event.data.action(event, uploadObj) !== false) {
206
- errorArray = [];
207
- }
208
- });
209
- }
210
- });
211
- },
212
- uploadifySettings:function(settingName, settingValue, resetObject) {
213
- var returnValue = false;
214
- jQuery(this).each(function() {
215
- if (settingName == 'scriptData' && settingValue != null) {
216
- if (resetObject) {
217
- var scriptData = settingValue;
218
- } else {
219
- var scriptData = jQuery.extend(settings.scriptData, settingValue);
220
- }
221
- var scriptDataString = '';
222
- for (var name in scriptData) {
223
- scriptDataString += '&' + name + '=' + escape(scriptData[name]);
224
- }
225
- settingValue = scriptDataString.substr(1);
226
- }
227
- returnValue = document.getElementById(jQuery(this).attr('id') + 'Uploader').updateSettings(settingName, settingValue);
228
- });
229
- if (settingValue == null) {
230
- if (settingName == 'scriptData') {
231
- var returnSplit = unescape(returnValue).split('&');
232
- var returnObj = new Object();
233
- for (var i = 0; i < returnSplit.length; i++) {
234
- var iSplit = returnSplit[i].split('=');
235
- returnObj[iSplit[0]] = iSplit[1];
236
- }
237
- returnValue = returnObj;
238
- }
239
- return returnValue;
240
- }
241
- },
242
- uploadifyUpload:function(ID) {
243
- jQuery(this).each(function() {
244
- document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);
245
- });
246
- },
247
- uploadifyCancel:function(ID) {
248
- jQuery(this).each(function() {
249
- document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, false);
250
- });
251
- },
252
- uploadifyClearQueue:function() {
253
- jQuery(this).each(function() {
254
- document.getElementById(jQuery(this).attr('id') + 'Uploader').clearFileUploadQueue(false);
255
- });
256
- }
257
- })
258
- })(jQuery);
@@ -1,4 +0,0 @@
1
- /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
2
- is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
3
- */
4
- var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
@@ -1,39 +0,0 @@
1
- class Create<%=parent_plural_class_name%> < ActiveRecord::Migration
2
- def self.up
3
- create_table :<%=parent_plural_name%> do |t|
4
- t.string :title
5
- t.string :filename
6
- t.text :desc
7
- t.boolean :active
8
- t.string :heading
9
- t.string :nav
10
- t.integer :position
11
- t.timestamps
12
- end
13
-
14
- AdminMenuItem.create({:title =>"<%=parent_plural_class_name%>", :controller_name => "<%=parent_plural_name%>", :url => "/<%=parent_plural_name%>"})
15
- MenuItem.create({:title => "All <%=parent_plural_class_name%>", :url => "/all/<%=parent_plural_name%>", :active => true})
16
-
17
- create_table :<%=child_plural_name%> do |t|
18
- t.string :title
19
- t.text :desc
20
- t.date :date_shot
21
- t.string :location
22
- t.integer :<%=parent_singular_name%>_id
23
- t.string :file_file_name
24
- t.string :file_content_type
25
- t.integer :file_file_size
26
- t.datetime :file_updated_at
27
- t.integer :parent_id
28
- t.integer :lft
29
- t.integer :rgt
30
- t.timestamps
31
- end
32
-
33
- end
34
-
35
- def self.down
36
- drop_table :<%=parent_plural_name%>
37
- drop_table :<%=child_plural_name%>
38
- end
39
- end
@@ -1,16 +0,0 @@
1
- #uploadify h3 { display:block; text-align:center; color:#767D87; font-weight: normal; }
2
-
3
- #uploads{overflow:hidden;}
4
- .<%=child_singular_name%> { text-align:center; float:left; width:100px; height:150px; margin: 5px; }
5
-
6
- tr.even td { background: #fff;}
7
-
8
- table.<%=child_plural_name%>{ margin: 0 auto; width:100%; border:1px solid #C5CCD6; }
9
- table.<%=child_plural_name%> tr th { background: #D3DAE6; padding:5px; }
10
- table.<%=child_plural_name%> tr.even td { background: #D3DAE6; padding:15px;}
11
- table.<%=child_plural_name%> tr.odd td { padding:15px;}
12
-
13
- #uploads li{ float:left; padding:5px; width:100px; height:125px; }
14
- .<%=child_singular_name%>{ width:90px; height:125px; padding:5px; text-align:center; }
15
-
16
- .placeHolder div { background-color:transparent !important; border:dashed 1px gray !important; width:100px; height: 125px; }