redde 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. data/.gitignore +20 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +24 -0
  5. data/LICENSE +22 -0
  6. data/README.md +57 -0
  7. data/Rakefile +2 -0
  8. data/lib/generators/redde/deploy/deploy_generator.rb +34 -0
  9. data/lib/generators/redde/deploy/templates/Capfile +4 -0
  10. data/lib/generators/redde/deploy/templates/deploy.rb +33 -0
  11. data/lib/generators/redde/deploy/templates/recipes/base.rb +16 -0
  12. data/lib/generators/redde/deploy/templates/recipes/check.rb +13 -0
  13. data/lib/generators/redde/deploy/templates/recipes/database.rb +66 -0
  14. data/lib/generators/redde/deploy/templates/recipes/imagemagick.rb +8 -0
  15. data/lib/generators/redde/deploy/templates/recipes/memcached.rb +10 -0
  16. data/lib/generators/redde/deploy/templates/recipes/monit.rb +35 -0
  17. data/lib/generators/redde/deploy/templates/recipes/nginx.rb +26 -0
  18. data/lib/generators/redde/deploy/templates/recipes/nodejs.rb +10 -0
  19. data/lib/generators/redde/deploy/templates/recipes/postfix.rb +37 -0
  20. data/lib/generators/redde/deploy/templates/recipes/rbenv.rb +17 -0
  21. data/lib/generators/redde/deploy/templates/recipes/templates/database.yml.erb +8 -0
  22. data/lib/generators/redde/deploy/templates/recipes/templates/dkim-filter.conf.erb +57 -0
  23. data/lib/generators/redde/deploy/templates/recipes/templates/dkim-filter.defaults.erb +11 -0
  24. data/lib/generators/redde/deploy/templates/recipes/templates/dkim-keys.conf.erb +2 -0
  25. data/lib/generators/redde/deploy/templates/recipes/templates/gemrc.erb +1 -0
  26. data/lib/generators/redde/deploy/templates/recipes/templates/main.cf.erb +43 -0
  27. data/lib/generators/redde/deploy/templates/recipes/templates/memcached.erb +47 -0
  28. data/lib/generators/redde/deploy/templates/recipes/templates/monit_monitrc.erb +21 -0
  29. data/lib/generators/redde/deploy/templates/recipes/templates/monit_nginx.erb +5 -0
  30. data/lib/generators/redde/deploy/templates/recipes/templates/monit_unicorn.erb +14 -0
  31. data/lib/generators/redde/deploy/templates/recipes/templates/nginx_unicorn.erb +28 -0
  32. data/lib/generators/redde/deploy/templates/recipes/templates/unicorn.rb.erb +36 -0
  33. data/lib/generators/redde/deploy/templates/recipes/templates/unicorn_init.erb +84 -0
  34. data/lib/generators/redde/deploy/templates/recipes/unicorn.rb +27 -0
  35. data/lib/generators/redde/layout/layout_generator.rb +57 -0
  36. data/lib/generators/redde/layout/templates/assets/images/admin/addphoto.png +0 -0
  37. data/lib/generators/redde/layout/templates/assets/images/admin/ajaxloader2.gif +0 -0
  38. data/lib/generators/redde/layout/templates/assets/images/admin/arrow_down.png +0 -0
  39. data/lib/generators/redde/layout/templates/assets/images/admin/arrow_enter.png +0 -0
  40. data/lib/generators/redde/layout/templates/assets/images/admin/arrow_right.png +0 -0
  41. data/lib/generators/redde/layout/templates/assets/images/admin/coins.png +0 -0
  42. data/lib/generators/redde/layout/templates/assets/images/admin/confirm.png +0 -0
  43. data/lib/generators/redde/layout/templates/assets/images/admin/del.png +0 -0
  44. data/lib/generators/redde/layout/templates/assets/images/admin/delete.png +0 -0
  45. data/lib/generators/redde/layout/templates/assets/images/admin/email.png +0 -0
  46. data/lib/generators/redde/layout/templates/assets/images/admin/error.png +0 -0
  47. data/lib/generators/redde/layout/templates/assets/images/admin/fio.png +0 -0
  48. data/lib/generators/redde/layout/templates/assets/images/admin/folder.png +0 -0
  49. data/lib/generators/redde/layout/templates/assets/images/admin/folder_.png +0 -0
  50. data/lib/generators/redde/layout/templates/assets/images/admin/icon_eye.gif +0 -0
  51. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/css/jquery.lightbox-0.5.css +101 -0
  52. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-blank.gif +0 -0
  53. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-btn-close.gif +0 -0
  54. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-btn-next.gif +0 -0
  55. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-btn-prev.gif +0 -0
  56. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-ico-loading.gif +0 -0
  57. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.js +32 -0
  58. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.lightbox-0.5.js +477 -0
  59. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.lightbox-0.5.min.js +42 -0
  60. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.lightbox-0.5.pack.js +14 -0
  61. data/lib/generators/redde/layout/templates/assets/images/admin/logo.png +0 -0
  62. data/lib/generators/redde/layout/templates/assets/images/admin/logo_reddeshop.png +0 -0
  63. data/lib/generators/redde/layout/templates/assets/images/admin/move_handler.png +0 -0
  64. data/lib/generators/redde/layout/templates/assets/images/admin/phone.png +0 -0
  65. data/lib/generators/redde/layout/templates/assets/images/admin/photo_ico.png +0 -0
  66. data/lib/generators/redde/layout/templates/assets/images/admin/print.png +0 -0
  67. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/docstyle.css +123 -0
  68. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/redactor.css +369 -0
  69. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/style.css +119 -0
  70. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/wym.css +136 -0
  71. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/img/icons.png +0 -0
  72. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/by.js +72 -0
  73. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/de.js +75 -0
  74. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/en.js +76 -0
  75. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/es.js +76 -0
  76. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/fr.js +74 -0
  77. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/hu.js +76 -0
  78. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/it.js +76 -0
  79. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ja.js +76 -0
  80. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/lv.js +74 -0
  81. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/nl.js +76 -0
  82. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pl.js +75 -0
  83. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pt_br.js +81 -0
  84. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ru.js +75 -0
  85. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/sq.js +76 -0
  86. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/tr.js +76 -0
  87. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ua.js +75 -0
  88. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/zh_cn.js +77 -0
  89. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/file.html +3 -0
  90. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/image.html +39 -0
  91. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/image_edit.html +35 -0
  92. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/link.html +74 -0
  93. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/table.html +25 -0
  94. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/video.html +15 -0
  95. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/redactor.js.erb +2260 -0
  96. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/redactor.min.js +1 -0
  97. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/toolbars/default.js +219 -0
  98. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/toolbars/mini.js +103 -0
  99. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/_jquery.reddebox.js.erb +214 -0
  100. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/close.png +0 -0
  101. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.js.erb +246 -0
  102. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.scss +31 -0
  103. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/next.png +0 -0
  104. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/prev.png +0 -0
  105. data/lib/generators/redde/layout/templates/assets/images/admin/refresh.png +0 -0
  106. data/lib/generators/redde/layout/templates/assets/images/admin/submit.png +0 -0
  107. data/lib/generators/redde/layout/templates/assets/images/admin/submit_hover.png +0 -0
  108. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/change-log.txt +19 -0
  109. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/check-exists.php +15 -0
  110. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/index.php +50 -0
  111. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.js +888 -0
  112. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.min.js +6 -0
  113. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/license-standard.txt +71 -0
  114. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-cancel.png +0 -0
  115. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-image-only.php +66 -0
  116. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.css +100 -0
  117. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.php +33 -0
  118. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/#swfobject.js +4 -0
  119. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/cancel.png +0 -0
  120. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/jquery.uploadify.min.js +315 -0
  121. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify-cancel.png +0 -0
  122. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.css +66 -0
  123. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.swf +0 -0
  124. data/lib/generators/redde/layout/templates/assets/images/admin/view.png +0 -0
  125. data/lib/generators/redde/layout/templates/assets/images/admin/view_mk.png +0 -0
  126. data/lib/generators/redde/layout/templates/assets/javascripts/admin/jquery.ui.nestedSortable.js +390 -0
  127. data/lib/generators/redde/layout/templates/assets/javascripts/admin/swfobject.js +4 -0
  128. data/lib/generators/redde/layout/templates/assets/javascripts/admin/zen_textarea.min.js +17 -0
  129. data/lib/generators/redde/layout/templates/assets/javascripts/admin.js +88 -0
  130. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/_reset.scss +32 -0
  131. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_list.scss +22 -0
  132. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_notice.scss +39 -0
  133. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_orders.scss +22 -0
  134. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_partners.scss +15 -0
  135. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_photos.scss +31 -0
  136. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_sortable.scss +17 -0
  137. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/default.scss +127 -0
  138. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/_input.scss +43 -0
  139. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/_table.scss +24 -0
  140. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_header.scss +57 -0
  141. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_launchbar.scss +35 -0
  142. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_login.scss +10 -0
  143. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_main.scss +59 -0
  144. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_sidebar.scss +35 -0
  145. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/shop/_filter.scss +16 -0
  146. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/shop/_order-sh.scss +59 -0
  147. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/shop/_pe.scss +43 -0
  148. data/lib/generators/redde/layout/templates/assets/stylesheets/admin.scss +12 -0
  149. data/lib/generators/redde/layout/templates/controllers/base_controller.rb +6 -0
  150. data/lib/generators/redde/layout/templates/helpers/admin_helper.rb +37 -0
  151. data/lib/generators/redde/layout/templates/layouts/admin.html.haml +30 -0
  152. data/lib/generators/redde/layout/templates/layouts/login.html.haml +32 -0
  153. data/lib/generators/redde/layout/templates/shared/_header.html.haml +13 -0
  154. data/lib/generators/redde/layout/templates/shared/_launchbar.html.haml +9 -0
  155. data/lib/generators/redde/layout/templates/shared/_sidebar.html.haml +23 -0
  156. data/lib/generators/redde/scaffold/scaffold_generator.rb +114 -0
  157. data/lib/generators/redde/scaffold/templates/controllers/controller.rb +55 -0
  158. data/lib/generators/redde/scaffold/templates/edit.html.haml +36 -0
  159. data/lib/generators/redde/scaffold/templates/index.html.haml +37 -0
  160. data/lib/redde/version.rb +3 -0
  161. data/lib/redde.rb +4 -0
  162. data/redde.gemspec +26 -0
  163. data/spec/deploy_generator_spec.rb +29 -0
  164. data/spec/layout_generator_spec.rb +41 -0
  165. data/spec/scaffold_generator_spec.rb +25 -0
  166. data/spec/spec_helper.rb +10 -0
  167. metadata +327 -0
@@ -0,0 +1,246 @@
1
+ /**
2
+ * jQuery lightBox plugin
3
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
4
+ * and adapted to me for use like a plugin from jQuery.
5
+ * @name jquery-lightbox-0.5.js
6
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
7
+ * @version 0.5
8
+ * @date April 11, 2008
9
+ * @category jQuery plugin
10
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
11
+ * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
12
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
13
+ */
14
+
15
+ // Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
16
+ (function($) {
17
+ /**
18
+ * $ is an alias to jQuery object
19
+ *
20
+ */
21
+ $.fn.reddeBox = function(settings) {
22
+ // Settings to configure the jQuery lightBox plugin how you like
23
+ var settings = jQuery.extend({
24
+ // Configuration related to overlay
25
+ overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
26
+ // Configuration related to navigation
27
+ //fixedNavigation: true, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
28
+ // Configuration related to images
29
+ classWrapper: "",
30
+ //imageLoading: '<%= asset_path("reddebox/103.gif") %>', // (string) Path and the name of the loading icon
31
+ //imageBtnPrev: '<%= asset_path("reddebox/previous.png") %>', // (string) Path and the name of the prev button image
32
+ //imageBtnNext: '<%= asset_path("reddebox/next.png") %>', // (string) Path and the name of the next button image
33
+ //imageBtnClose: '<%= asset_path("reddebox/close.png") %>', // (string) Path and the name of the close btn
34
+ // Configuration related to container image box
35
+ //containerBorderSize: 0, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
36
+ //containerResizeSpeed: 0, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
37
+ // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
38
+ //txtImage: 'Изображение', // (string) Specify text "Image"
39
+ //txtOf: 'из', // (string) Specify text "of"
40
+ // Configuration related to keyboard navigation
41
+ //keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
42
+ //keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image
43
+ //keyToNext: 'n', // (string) (n = next) Letter to show the next image.
44
+ // Don�t alter these variables in any way
45
+ usedThisLink: true, // включить в набор текущий линк или линки
46
+ imageArray: [],
47
+ activeImage: 0
48
+ },settings);
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+ var elems = this;
57
+
58
+ return this.unbind('click.reddebox').bind("click.reddebox",function(e){
59
+ new Bilder(this,elems,settings);
60
+ e.preventDefault();
61
+ });
62
+ };
63
+
64
+ function Bilder(el,elems,settings) {
65
+ var arr = $.map(settings.imageArray,function(n){
66
+ return $("<a />").attr("href",n)[0];
67
+ });
68
+ if (settings.usedThisLink) {
69
+ this.jQueryMatchedObj = $.merge($.merge([],elems), arr);
70
+ } else {
71
+ this.jQueryMatchedObj = arr;
72
+ };
73
+
74
+ this.activeIndex = $.map(elems,function(n,i){
75
+ if (n == el) {
76
+ return i;
77
+ };
78
+ })[0] || 0;
79
+ this.setInterface(el,settings);
80
+ };
81
+
82
+ Bilder.prototype = {
83
+ removeReddeBox: function() {
84
+ $("#redde-overlay, #redde-box").remove();
85
+ },
86
+
87
+ setActiveIndex: function(linkActiveHref) {
88
+ for(var i = this.jQueryMatchedObj.length; i--;) {
89
+ if (this.jQueryMatchedObj[i].href == linkActiveHref) {
90
+ activeIndex = i;
91
+ break;
92
+ }
93
+ };
94
+ },
95
+
96
+ updateNavi: function(linkActive) {
97
+ var maxLength = this.jQueryMatchedObj.length;
98
+ this.setActiveIndex(linkActive.attr("href"));
99
+ this.container.find("a.redde-next, a.redde-prev").css("visibility","visible");
100
+ if (this.activeIndex == 0) {
101
+ $("a.redde-prev").css("visibility","hidden");
102
+ };
103
+ if (this.activeIndex == maxLength-1) {
104
+ $("a.redde-next").css("visibility","hidden");
105
+ };
106
+ if (linkActive.attr("title")) {
107
+ this.container.find("div.redde-desc").html(linkActive.attr("title")).css("visibility","visible");
108
+ } else {
109
+ this.container.find("div.redde-desc").empty().css("visibility","hidden");
110
+ };
111
+ },
112
+
113
+ showImage: function(me) {
114
+ var self = this;
115
+ this.updateNavi(me);
116
+ if (/\.(jpg|jpeg|gif|png)$/i.test($(me).attr("href"))) {
117
+ $("<img />").attr("src",me.attr("href")).fadeTo(0,0).load(function(){
118
+ //alert("test")
119
+ $("#redde-container #wrap-redde-container").html(this);
120
+ self.setCenter.call(self,$(this));
121
+ });
122
+ } else {
123
+ this.container.find("#wrap-redde-container").html('<iframe src="'+ me.attr("href") +'" frameborder="0" width="600" height="600" />');
124
+ self.setCenter.call(self,this.container.find("iframe"));
125
+ }
126
+
127
+ },
128
+
129
+ setCenter: function(el) {
130
+ var w = el.width(),
131
+ h = el.height();
132
+ this.container.addClass("resize-show-photo").stop(false,false).animate({
133
+ width: w,
134
+ height: h,
135
+ "margin-left": -w/2-1, // -1 - поправка на border
136
+ "margin-top": -h/2-1,
137
+ top: "50%",
138
+ left: "50%"
139
+ },400,function(){
140
+ $(this).removeClass("resize-show-photo");
141
+ if ($.isFunction($.fn.draggable)) {
142
+ $(this).draggable({
143
+ stop: function(){
144
+ var obj = {},
145
+ x1 = parseInt($(this).css("left")),
146
+ y1 = parseInt($(this).css("top")),
147
+ xy2 = $(this).offsetParent(),
148
+ x2 = parseInt(xy2.width()),
149
+ y2 = parseInt(xy2.height());
150
+
151
+ if (x2 > w) {
152
+ if (x1 < 0) {
153
+ obj.left = 0;
154
+ } else if (x1 > x2) {
155
+ obj.left = x2;
156
+ };
157
+ } else {
158
+ if (x2/2-x1 > w/2) {
159
+ obj.left = (x2-w)/2;
160
+ } else if (x1-x2/2 > w/2) {
161
+ obj.left = (x2+w)/2;
162
+ };
163
+ };
164
+
165
+ if (y2 > h) {
166
+ if (y1 < 0) {
167
+ obj.top = 0
168
+ } else if (y1 > y2) {
169
+ obj.top = y2
170
+ };
171
+ } else {
172
+ if (y2/2-y1 > h/2) {
173
+ obj.top = (y2-h)/2;
174
+ } else if (y1-y2/2 > h/2) {
175
+ obj.top = (y2+h)/2;
176
+ };
177
+ }
178
+
179
+ $(this).animate(obj);
180
+ }
181
+ });
182
+ };
183
+ }).find("img").fadeTo(0,1.0);
184
+ },
185
+
186
+ setInterface: function(linkActive,settings) {
187
+ if (settings.classWrapper) {
188
+ settings.classWrapper = ' class="' + settings.classWrapper + '"';
189
+ };
190
+ var navigation =
191
+ '<a href="#" class="redde-prev"></a>' +
192
+ '<a href="#" class="redde-close"></a>' +
193
+ '<a href="#" class="redde-next"></a>' +
194
+ '<div class="redde-desc"></div>';
195
+ var cont =
196
+ '<div id="redde-overlay"></div>' +
197
+ '<div id="redde-box"' + settings.classWrapper + '>' +
198
+ '<div id="redde-container"><div id="wrap-redde-container"></div>' + navigation + '</div>' +
199
+ '</div>';
200
+ $("body").append(cont);
201
+ this.container = $("#redde-container"); // обертка
202
+ $("#redde-overlay").fadeTo(400,settings.overlayOpacity);
203
+ var self = this;
204
+
205
+ $("#redde-box").fadeTo(400,1.0/*,
206
+ //закрываем лайтбокс при клике на подложку
207
+ function(){
208
+ $(this).bind("click",function(e){
209
+ if (e.target == this) {
210
+ self.removeReddeBox();
211
+ };
212
+ });
213
+ }*/);
214
+
215
+ if (!settings.imageArray.length) {
216
+ this.showImage($(linkActive));
217
+ } else {
218
+ if (settings.activeImage) {
219
+ this.activeIndex = settings.activeImage;
220
+ };
221
+ this.showImage($(this.jQueryMatchedObj[this.activeIndex]));
222
+ }
223
+
224
+ this.container.find("a").click(function(e){
225
+ switch (this.className) {
226
+ case "redde-next":
227
+ case "redde-prev":
228
+ {
229
+ self.container.stop(true,true);
230
+ var delta = this.className == "redde-prev" ? -1 : 1;
231
+ if (self.jQueryMatchedObj[self.activeIndex+delta] != undefined) {
232
+ self.activeIndex = self.activeIndex+delta;
233
+ self.showImage($(self.jQueryMatchedObj[self.activeIndex]));
234
+ };
235
+ break;
236
+ };
237
+ case "redde-close": {
238
+ self.removeReddeBox();
239
+ break;
240
+ };
241
+ }
242
+ e.preventDefault();
243
+ });
244
+ }
245
+ };
246
+ })(jQuery); // Call and execute the function immediately passing the jQuery object
@@ -0,0 +1,31 @@
1
+ #redde-overlay {
2
+ position:fixed; top:0; left:0; width:100%; height:100%; z-index:9000; background:#42332b;
3
+ opacity:0; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);
4
+ }
5
+
6
+ #redde-box {
7
+ position:fixed; top:0; left:0; width:100%; height:100%; z-index:9000;
8
+ opacity:0; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);
9
+ #redde-container {
10
+ position:absolute; top:50%; left:50%; width:200px; height:200px; margin:-101px 0 0 -101px; border:1px solid #edbb69; background-color:#42332b;
11
+ background-repeat:no-repeat; background-position:center; box-shadow:0 0 10px rgba(#fff,0.26);
12
+ #wrap-redde-container {width:100%; height:100%;}
13
+ &.resize-show-photo {
14
+ img {width:100%; height:100%;}
15
+ .redde-close,
16
+ .redde-prev,
17
+ .redde-next {display:none;}
18
+ }
19
+ &.ui-draggable img {cursor:move;}
20
+ }
21
+ .redde-close,
22
+ .redde-prev,
23
+ .redde-next,
24
+ .redde-desc {display:block; position:absolute;}
25
+ .redde-close {top:-11px; right:-11px; width:22px; height:22px; background:image-url("reddebox/close.png") no-repeat 0 0;}
26
+ .redde-prev,
27
+ .redde-next {width:19px; height:47px; top:50%; margin-top:-24px; }
28
+ .redde-prev {background:image-url("reddebox/prev.png") no-repeat 0 0; left:0; margin-left:-34px;}
29
+ .redde-next {background:image-url("reddebox/next.png") no-repeat 0 0; right:0; margin-right:-34px;}
30
+ .redde-desc {left:0; top:100%; margin-top:5px; width:100%; text-align:center; font-style:italic;}
31
+ }
@@ -0,0 +1,19 @@
1
+ UploadiFive Change Log
2
+
3
+ v1.0.4
4
+ * Added compatibility with Safari
5
+
6
+ v1.0.3
7
+ * Using new and faster FormData object if available
8
+ * Added extra security and image only uploadifive.php file
9
+ * formData is sent to the check script along with the filename
10
+ * Removed index from Filedata object
11
+
12
+ v1.0.2
13
+ * Changed $data.uploadFile method to use boundary for uploads
14
+
15
+ v1.0.1
16
+ * Fixed bug with onQueueComplete event
17
+
18
+ v1.0
19
+ * Initial creation of UploadiFive plugin
@@ -0,0 +1,15 @@
1
+ <?php
2
+ /*
3
+ UploadiFive
4
+ Copyright (c) 2012 Reactive Apps, Ronnie Garcia
5
+ */
6
+
7
+ // Define a destination
8
+ $targetFolder = '/uploads'; // Relative to the root and should match the upload folder in the uploader script
9
+
10
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . $targetFolder . '/' . $_POST['filename'])) {
11
+ echo 1;
12
+ } else {
13
+ echo 0;
14
+ }
15
+ ?>
@@ -0,0 +1,50 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>UploadiFive Test</title>
6
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
7
+ <script src="jquery.uploadifive-v1.0.js" type="text/javascript"></script>
8
+ <link rel="stylesheet" type="text/css" href="uploadifive.css">
9
+ <style type="text/css">
10
+ body {
11
+ font: 13px Arial, Helvetica, Sans-serif;
12
+ }
13
+ .uploadifive-button {
14
+ float: left;
15
+ margin-right: 10px;
16
+ }
17
+ #queue {
18
+ border: 1px solid #E5E5E5;
19
+ height: 177px;
20
+ overflow: auto;
21
+ margin-bottom: 10px;
22
+ padding: 0 3px 3px;
23
+ width: 300px;
24
+ }
25
+ </style>
26
+ </head>
27
+
28
+ <body>
29
+ <h1>UploadiFive Demo</h1>
30
+ <form>
31
+ <div id="queue"></div>
32
+ <input id="file_upload" name="file_upload" type="file" multiple="true">
33
+ <a style="position: relative; top: 8px;" href="javascript:$('#file_upload').uploadifive('upload')">Upload Files</a>
34
+ </form>
35
+
36
+ <script type="text/javascript">
37
+ $(function() {
38
+ $('#file_upload').uploadifive({
39
+ 'auto' : false,
40
+ 'formData' : {'test' : 'something'},
41
+ 'queueID' : 'queue',
42
+ 'uploadScript' : 'uploadifive.php',
43
+ 'onUploadComplete' : function(file, data) {
44
+ console.log(data);
45
+ }
46
+ });
47
+ });
48
+ </script>
49
+ </body>
50
+ </html>