el-finder 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +11 -0
  3. data/LICENSE +19 -0
  4. data/README.md +66 -0
  5. data/Rakefile +21 -0
  6. data/assets/api.js +273 -0
  7. data/assets/bootstrap-contextmenu.js +147 -0
  8. data/assets/bootstrap/css/bootstrap-responsive.min.css +9 -0
  9. data/assets/bootstrap/css/bootstrap.min.css +9 -0
  10. data/assets/bootstrap/img/glyphicons-halflings-white.png +0 -0
  11. data/assets/bootstrap/img/glyphicons-halflings.png +0 -0
  12. data/assets/bootstrap/js/bootstrap.min.js +6 -0
  13. data/assets/colorbox/colorbox.css +44 -0
  14. data/assets/colorbox/images/controls.png +0 -0
  15. data/assets/colorbox/images/loading.gif +0 -0
  16. data/assets/colorbox/jquery.colorbox-min.js +6 -0
  17. data/assets/fileupload.js +31 -0
  18. data/assets/icons/Oxygen/preview.png +0 -0
  19. data/assets/icons/Oxygen/video.png +0 -0
  20. data/assets/icons/delete.png +0 -0
  21. data/assets/icons/file.png +0 -0
  22. data/assets/icons/folder.png +0 -0
  23. data/assets/jQuery-File-Upload/css/jquery.fileupload-ui-noscript.css +27 -0
  24. data/assets/jQuery-File-Upload/css/jquery.fileupload-ui.css +83 -0
  25. data/assets/jQuery-File-Upload/css/style.css +15 -0
  26. data/assets/jQuery-File-Upload/img/loading.gif +0 -0
  27. data/assets/jQuery-File-Upload/img/progressbar.gif +0 -0
  28. data/assets/jQuery-File-Upload/js/cors/jquery.postmessage-transport.js +117 -0
  29. data/assets/jQuery-File-Upload/js/cors/jquery.xdr-transport.js +87 -0
  30. data/assets/jQuery-File-Upload/js/jquery.fileupload-fp.js +227 -0
  31. data/assets/jQuery-File-Upload/js/jquery.fileupload-ui.js +807 -0
  32. data/assets/jQuery-File-Upload/js/jquery.fileupload.js +1201 -0
  33. data/assets/jQuery-File-Upload/js/jquery.iframe-transport.js +185 -0
  34. data/assets/jQuery-File-Upload/js/main.js +83 -0
  35. data/assets/jQuery-File-Upload/js/vendor/jquery.ui.widget.js +530 -0
  36. data/assets/jquery-ui/css/ui-lightness/images/animated-overlay.gif +0 -0
  37. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  38. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  39. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  40. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  41. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  42. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  43. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  44. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  45. data/assets/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  46. data/assets/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  47. data/assets/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  48. data/assets/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  49. data/assets/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  50. data/assets/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  51. data/assets/jquery-ui/css/ui-lightness/jquery-ui.css +5 -0
  52. data/assets/jquery-ui/js/jquery-ui.js +6 -0
  53. data/assets/jquery.js +5 -0
  54. data/assets/noty/jquery.noty.js +520 -0
  55. data/assets/noty/layouts/top.js +34 -0
  56. data/assets/noty/layouts/topRight.js +43 -0
  57. data/assets/noty/themes/default.js +156 -0
  58. data/assets/select2-bootstrap.css +86 -0
  59. data/assets/select2/select2-spinner.gif +0 -0
  60. data/assets/select2/select2.css +615 -0
  61. data/assets/select2/select2.min.js +22 -0
  62. data/assets/select2/select2.png +0 -0
  63. data/assets/select2/select2x2.png +0 -0
  64. data/assets/ui.css +43 -0
  65. data/assets/ui.js +34 -0
  66. data/assets/xhr.js +4 -0
  67. data/el-finder.gemspec +25 -0
  68. data/examples/basic/Gemfile +15 -0
  69. data/examples/basic/app.rb +21 -0
  70. data/lib/el-finder.rb +6 -0
  71. data/lib/el-finder/el-finder.rb +200 -0
  72. data/lib/el-finder/templates/column.slim +64 -0
  73. data/lib/el-finder/templates/index.slim +235 -0
  74. metadata +158 -0
@@ -0,0 +1,235 @@
1
+ - assets_mapper route(:assets), suffix: ASSETS_EXT do
2
+ == js_tag 'api'
3
+ == css_tag 'ui'
4
+ == css_tag 'colorbox/colorbox'
5
+ == css_tag 'jquery-ui/css/ui-lightness/jquery-ui'
6
+ == css_tag 'jQuery-File-Upload/css/jquery.fileupload-ui'
7
+
8
+ javascript:
9
+ var ELFinderLoader = new ELFinderAPI(), ELFinderColorboxes = [];
10
+ ELFinderLoader.loadScript(
11
+ '#{asset_url('jquery.js')}',
12
+ function () { return typeof window.jQuery == "function"; },
13
+ function () {
14
+
15
+ ELFinderLoader.loadScript(
16
+ '#{ asset_url "jquery-ui/js/jquery-ui.js" }',
17
+ function () { return jQuery.ui == "function" },
18
+ function () { ELFinderLoader.loadScript('#{ asset_url "ui.js" }'); }
19
+ );
20
+
21
+ ELFinderLoader.loadScript(
22
+ '#{ asset_url "jQuery-File-Upload/js/vendor/jquery.ui.widget.js" }', null,
23
+ function () {
24
+ ELFinderLoader.loadScript(
25
+ '#{ asset_url "jQuery-File-Upload/js/jquery.fileupload.js" }',
26
+ function () { return typeof $().fileupload == "function"; },
27
+ function () { ELFinderLoader.loadScript('#{ asset_url "fileupload.js" }'); }
28
+ );
29
+ }
30
+ );
31
+
32
+ ELFinderLoader.loadScript(
33
+ '#{ asset_url "noty/jquery.noty.js" }',
34
+ function () { return typeof window.noty == "function"; },
35
+ function () {
36
+ ELFinderLoader.loadScript('#{ asset_url "noty/layouts/top.js" }');
37
+ ELFinderLoader.loadScript('#{ asset_url "noty/layouts/topRight.js" }');
38
+ ELFinderLoader.loadScript('#{ asset_url "noty/themes/default.js" }');
39
+ }
40
+ );
41
+
42
+ ELFinderLoader.loadScript(
43
+ '#{ asset_url "colorbox/jquery.colorbox-min.js" }',
44
+ function () { return typeof $().colorbox == "function"; },
45
+ function () {
46
+ $(function() {
47
+ jQuery.each(ELFinderColorboxes, function(i, callback) { callback() });
48
+ });
49
+ }
50
+ );
51
+
52
+ ELFinderLoader.loadScript(
53
+ '#{ asset_url "bootstrap/js/bootstrap.min.js" }',
54
+ function() { return typeof $().dropdown == "function"; },
55
+ function() { $('.dropdown-toggle').dropdown() }
56
+ );
57
+ ELFinderLoader.loadStylesheet(
58
+ '#{{ asset_url "bootstrap/css/bootstrap.min.css" }}',
59
+ '.span12'
60
+ );
61
+ }
62
+ );
63
+
64
+ - given = [:location, :file].inject({}) do |units,unit|
65
+ - url, units[unit] = params[unit], nil
66
+ - if url || unit == :location
67
+ - url = EUtils.normalize_path(url.to_s.gsub(/\/+Z/, ''))
68
+ - units[unit] = {}
69
+ - units[unit][:URL ] = url
70
+ - units[unit][:name] = name = File.basename(url)
71
+ - units[unit][:path] = File.dirname(url)
72
+ - units[unit][:fullpath ] = File.join(root, url)
73
+ - units[unit][:path_array] = url.split('/')
74
+ - units[unit][:path_array].unshift('') unless units[unit][:path_array].first == ''
75
+ - units
76
+ - given = Struct.new(*given.keys).new(*given.values)
77
+
78
+ - editor_opts = Hash[env[:EDITOR_OPTS]||{}]
79
+ - editor = editor_opts.delete(:editor)
80
+
81
+ .container-fluid
82
+ .row-fluid
83
+ .span
84
+ ul.breadcrumb
85
+ li
86
+ a href=parent_route
87
+ i.icon-home
88
+ |  
89
+ = File.basename(root)
90
+ - path_array = given.file ? given.file[:path_array] : given.location[:path_array]
91
+ - path_array.inject([]) do |path,unit|
92
+ - path << unit
93
+ - active = path == path_array
94
+ li class=('active' if active)
95
+ - if active
96
+ = unit
97
+ - else
98
+ a href=parent_route(location: File.join(*path))
99
+ = unit
100
+ span.divider
101
+ | /
102
+ - path
103
+
104
+ .form-inline
105
+ - if given.location[:path_array].size > 1 || given.file
106
+ - value = given.file ? given.file[:name] : given.location[:name]
107
+ .input-append
108
+ input.input-rename#input-rename type="text" value=value
109
+ button.btn type="button" onclick="ELFinder.rename();"
110
+ | rename&nbsp;
111
+ i.icon-pencil
112
+ | &nbsp;
113
+
114
+ - if given.file
115
+ - editable = editable?(given.file[:fullpath]) || params[:force_edit]
116
+ javascript:
117
+ var ELFinder = new ELFinderAPI('#{parent_route}', {
118
+ location: {
119
+ path: '#{given.location[:path]}',
120
+ name: '#{given.location[:name]}',
121
+ URL: '#{given.location[:URL]}'
122
+ },
123
+ file: {
124
+ path: '#{given.file[:path]}',
125
+ name: '#{given.file[:name]}',
126
+ URL: '#{given.file[:URL]}'
127
+ }
128
+ });
129
+
130
+ .btn-group
131
+ button.btn type="button" onclick="ELFinder.download();"
132
+ i.icon-download-alt
133
+ | &nbsp;download
134
+
135
+ - if editable
136
+ button.btn.btn-info.input-medium.saveButton type="button" onclick="ELFinder.save_file();"
137
+ i.icon-edit
138
+ | &nbsp;SAVE
139
+
140
+ .btn-group
141
+ button.btn.btn-warning type="button" onclick="ELFinder.delete('file');"
142
+ i.icon-trash
143
+ | &nbsp;delete
144
+ a.btn href=parent_route(location: given.location[:URL])
145
+ | close&nbsp;
146
+ i.icon-remove
147
+
148
+ p
149
+ - if image?(given.file[:name])
150
+
151
+ ul.thumbnails
152
+ li.span12
153
+ .thumbnail
154
+ == img_tag src: parent_route(:image, image: given.file[:URL])
155
+
156
+ - elsif editable
157
+ p
158
+ textarea.text_editor.input-block-level#ELFinderEditor = File.read(given.file[:fullpath])
159
+ - if editor == :ace
160
+ == ace('ELFinderEditor', editor_opts.merge(file: given.file[:name]))
161
+ - elsif editor == :ckeditor
162
+ == ckeditor('ELFinderEditor', editor_opts)
163
+
164
+ - else
165
+ ul.thumbnails
166
+ li.span12
167
+ .thumbnail
168
+ h4
169
+ | Was unable to find a suitable editor for this type of file.&nbsp;
170
+ a href=parent_route(location: given.location[:URL], file: given.file[:URL], force_edit: 'true')
171
+ | Open it as a text file.
172
+
173
+ - else
174
+ javascript:
175
+ var ELFinder = new ELFinderAPI('#{parent_route}', {
176
+ location: {
177
+ path: '#{given.location[:path]}',
178
+ name: '#{given.location[:name]}',
179
+ URL: '#{given.location[:URL]}'
180
+ }
181
+ });
182
+
183
+ .input-append
184
+ input.input-mini#input-create type="text" onfocus="$(this).removeClass('input-mini');"
185
+ button.btn type="button" onclick="ELFinder.create('file');"
186
+ i.icon-file
187
+ | new file
188
+ button.btn type="button" onclick="ELFinder.create('folder');"
189
+ i.icon-folder-close
190
+ | new folder
191
+ | &nbsp;
192
+
193
+ span.btn.fileinput-button
194
+ input#fileupload type="file" name="files[]" multiple=true data-url=parent_route(:upload, path: given.location[:URL])
195
+ i.icon-upload
196
+ | &nbsp;upload
197
+
198
+ - if given.location[:path_array].size > 1
199
+ .btn-group
200
+ button.btn.btn-warning type="button" onclick="ELFinder.delete('folder');"
201
+ i.icon-trash
202
+ | &nbsp;delete
203
+ a.btn href=parent_route(location: given.location[:path])
204
+ | close&nbsp;
205
+ i.icon-remove
206
+
207
+ hr
208
+ table
209
+ tr
210
+ - given.location[:path_array].inject([]) do |path_array,dir|
211
+ - fullpath = File.join(root, *path_array, dir)
212
+ - if File.directory?(fullpath)
213
+ - path_array << dir
214
+
215
+ td.column
216
+ - context = {path_array: path_array, fullpath: fullpath, given: given}
217
+ == render_p :column, context
218
+ javascript:
219
+ ELFinderColorboxes.push(function() {
220
+ $('.slider-#{fullpath.hash}').colorbox({
221
+ rel: 'slider-#{fullpath.hash}',
222
+ width: '80%',
223
+ height: '80%'
224
+ });
225
+ });
226
+ - path_array
227
+ td#right_edge
228
+
229
+ #progress_modal.modal.hide
230
+ .modal-header Uploading file(s), please wait ...
231
+ .modal-body
232
+ #progress_bar.progress.progress-striped.active
233
+ .bar style="width: 0%;"
234
+
235
+ iframe#ELFinderDownloadIframe
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: el-finder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Silviu Rusu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: el
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.4.8
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.4.8
27
+ - !ruby/object:Gem::Dependency
28
+ name: slim
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Web-based File Manager for Espresso applications
56
+ email:
57
+ - slivuz@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - assets/api.js
63
+ - assets/bootstrap/css/bootstrap-responsive.min.css
64
+ - assets/bootstrap/css/bootstrap.min.css
65
+ - assets/bootstrap/img/glyphicons-halflings-white.png
66
+ - assets/bootstrap/img/glyphicons-halflings.png
67
+ - assets/bootstrap/js/bootstrap.min.js
68
+ - assets/bootstrap-contextmenu.js
69
+ - assets/colorbox/colorbox.css
70
+ - assets/colorbox/images/controls.png
71
+ - assets/colorbox/images/loading.gif
72
+ - assets/colorbox/jquery.colorbox-min.js
73
+ - assets/fileupload.js
74
+ - assets/icons/delete.png
75
+ - assets/icons/file.png
76
+ - assets/icons/folder.png
77
+ - assets/icons/Oxygen/preview.png
78
+ - assets/icons/Oxygen/video.png
79
+ - assets/jQuery-File-Upload/css/jquery.fileupload-ui-noscript.css
80
+ - assets/jQuery-File-Upload/css/jquery.fileupload-ui.css
81
+ - assets/jQuery-File-Upload/css/style.css
82
+ - assets/jQuery-File-Upload/img/loading.gif
83
+ - assets/jQuery-File-Upload/img/progressbar.gif
84
+ - assets/jQuery-File-Upload/js/cors/jquery.postmessage-transport.js
85
+ - assets/jQuery-File-Upload/js/cors/jquery.xdr-transport.js
86
+ - assets/jQuery-File-Upload/js/jquery.fileupload-fp.js
87
+ - assets/jQuery-File-Upload/js/jquery.fileupload-ui.js
88
+ - assets/jQuery-File-Upload/js/jquery.fileupload.js
89
+ - assets/jQuery-File-Upload/js/jquery.iframe-transport.js
90
+ - assets/jQuery-File-Upload/js/main.js
91
+ - assets/jQuery-File-Upload/js/vendor/jquery.ui.widget.js
92
+ - assets/jquery-ui/css/ui-lightness/images/animated-overlay.gif
93
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
94
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
95
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
96
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
97
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
98
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
99
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
100
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
101
+ - assets/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
102
+ - assets/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png
103
+ - assets/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png
104
+ - assets/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
105
+ - assets/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
106
+ - assets/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png
107
+ - assets/jquery-ui/css/ui-lightness/jquery-ui.css
108
+ - assets/jquery-ui/js/jquery-ui.js
109
+ - assets/jquery.js
110
+ - assets/noty/jquery.noty.js
111
+ - assets/noty/layouts/top.js
112
+ - assets/noty/layouts/topRight.js
113
+ - assets/noty/themes/default.js
114
+ - assets/select2/select2-spinner.gif
115
+ - assets/select2/select2.css
116
+ - assets/select2/select2.min.js
117
+ - assets/select2/select2.png
118
+ - assets/select2/select2x2.png
119
+ - assets/select2-bootstrap.css
120
+ - assets/ui.css
121
+ - assets/ui.js
122
+ - assets/xhr.js
123
+ - el-finder.gemspec
124
+ - examples/basic/app.rb
125
+ - examples/basic/Gemfile
126
+ - Gemfile
127
+ - lib/el-finder/el-finder.rb
128
+ - lib/el-finder/templates/column.slim
129
+ - lib/el-finder/templates/index.slim
130
+ - lib/el-finder.rb
131
+ - LICENSE
132
+ - Rakefile
133
+ - README.md
134
+ homepage: https://github.com/slivu/el-finder
135
+ licenses:
136
+ - MIT
137
+ metadata: {}
138
+ post_install_message:
139
+ rdoc_options: []
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ! '>='
145
+ - !ruby/object:Gem::Version
146
+ version: 1.9.2
147
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ! '>='
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ requirements: []
153
+ rubyforge_project:
154
+ rubygems_version: 2.0.4
155
+ signing_key:
156
+ specification_version: 4
157
+ summary: el-finder-0.1.0
158
+ test_files: []