el_vfs_client 0.0.4.1 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,24 +1,2 @@
1
1
  #!/usr/bin/env rake
2
- begin
3
- require 'bundler/setup'
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
- end
7
- begin
8
- require 'rdoc/task'
9
- rescue LoadError
10
- require 'rdoc/rdoc'
11
- require 'rake/rdoctask'
12
- RDoc::Task = Rake::RDocTask
13
- end
14
-
15
- RDoc::Task.new(:rdoc) do |rdoc|
16
- rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'ElVfsClient'
18
- rdoc.options << '--line-numbers'
19
- rdoc.rdoc_files.include('README.rdoc')
20
- rdoc.rdoc_files.include('lib/**/*.rb')
21
- end
22
-
23
- Bundler::GemHelper.install_tasks
24
-
2
+ require "bundler/gem_tasks"
@@ -1,10 +1,14 @@
1
1
  require 'curb'
2
2
  require 'configliere'
3
+ require 'uuid'
4
+
3
5
  module ElVfsClient
4
6
  class ElFinderController < ApplicationController
5
7
  respond_to :json, :html
6
8
 
7
9
  def show
10
+ session[:root_path] = session[:root_path] || (params[:root_path] ? params[:root_path] : generate_folder_uuid)
11
+
8
12
  render :file => 'el_finder/layout', :layout => false
9
13
  end
10
14
 
@@ -12,7 +16,8 @@ module ElVfsClient
12
16
  params.delete(:format)
13
17
  params.delete(:controller)
14
18
  params.delete(:action)
15
- c = Curl::Easy.new("#{Settings[:el_vfs][:protocol]}://#{Settings[:el_vfs][:host]}:#{Settings[:el_vfs][:port]}/api/el_finder/v2") do |curl|
19
+
20
+ c = Curl::Easy.new(url) do |curl|
16
21
  curl.headers['User-Agent'] = request.user_agent
17
22
  curl.headers['Accept'] = 'application/json'
18
23
  curl.headers['CLIENT_IP'] = request.env['HTTP_CLIENT_IP']
@@ -36,5 +41,15 @@ module ElVfsClient
36
41
  format.json { render :json => c.body_str }
37
42
  end
38
43
  end
44
+
45
+ private
46
+ def url
47
+ url = "#{Settings[:el_vfs][:protocol]}://#{Settings[:el_vfs][:host]}:#{Settings[:el_vfs][:port]}/api/el_finder/v2"
48
+ url << "/#{Settings[:el_vfs][:root_path]}/#{session[:root_path]}" if session[:root_path]
49
+ end
50
+
51
+ def generate_folder_uuid
52
+ "#{Time.now.year}_#{Time.now.month}_#{Time.now.day}_#{Time.now.hour}_#{Time.now.min}_#{UUID.generate.split('-').first}"
53
+ end
39
54
  end
40
55
  end
@@ -18,6 +18,7 @@
18
18
 
19
19
  $('#elfinder').elfinder({
20
20
  url: '/api/el_finder/v2',
21
+ height: window.innerHeight - 23,
21
22
  lang: 'ru',
22
23
  getFileCallback : function(file) {
23
24
  window.opener.CKEDITOR.tools.callFunction(funcNum, file);
@@ -25,6 +26,8 @@
25
26
  },
26
27
  resizable: false
27
28
  }).elfinder('instance');
29
+
30
+ $('#root_path', window.parent.document).val('<%= session[:root_path] %>');
28
31
  });
29
32
  //]]>
30
33
  </script>
@@ -1,3 +1,3 @@
1
1
  module ElVfsClient
2
- VERSION = "0.0.4.1"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: el_vfs_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.1
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-11-29 00:00:00.000000000 Z
14
+ date: 2011-11-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: configliere
18
- requirement: &13436880 !ruby/object:Gem::Requirement
18
+ requirement: &5696660 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *13436880
26
+ version_requirements: *5696660
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: curb
29
- requirement: &13436440 !ruby/object:Gem::Requirement
29
+ requirement: &5695760 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,7 +34,29 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *13436440
37
+ version_requirements: *5695760
38
+ - !ruby/object:Gem::Dependency
39
+ name: uuid
40
+ requirement: &5694480 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: *5694480
49
+ - !ruby/object:Gem::Dependency
50
+ name: rails
51
+ requirement: &5693280 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: *5693280
38
60
  description: Description of ElVfsClient.
39
61
  email:
40
62
  - mail@openteam.ru
@@ -100,7 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
122
  version: '0'
101
123
  segments:
102
124
  - 0
103
- hash: -3193506943565488734
125
+ hash: 4227916524854329935
104
126
  required_rubygems_version: !ruby/object:Gem::Requirement
105
127
  none: false
106
128
  requirements:
@@ -109,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
131
  version: '0'
110
132
  segments:
111
133
  - 0
112
- hash: -3193506943565488734
134
+ hash: 4227916524854329935
113
135
  requirements: []
114
136
  rubyforge_project:
115
137
  rubygems_version: 1.8.10