fdfinder 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +364 -0
- data/Rakefile +1 -0
- data/app/assets/images/fdfinder/about.png +0 -0
- data/app/assets/images/fdfinder/copy.png +0 -0
- data/app/assets/images/fdfinder/cut.png +0 -0
- data/app/assets/images/fdfinder/date_sorter.png +0 -0
- data/app/assets/images/fdfinder/delete.png +0 -0
- data/app/assets/images/fdfinder/directory-max.png +0 -0
- data/app/assets/images/fdfinder/directory.png +0 -0
- data/app/assets/images/fdfinder/directory_mini.png +0 -0
- data/app/assets/images/fdfinder/download.png +0 -0
- data/app/assets/images/fdfinder/duplicate.png +0 -0
- data/app/assets/images/fdfinder/edit.png +0 -0
- data/app/assets/images/fdfinder/files/7z.png +0 -0
- data/app/assets/images/fdfinder/files/Untitled-24.png +0 -0
- data/app/assets/images/fdfinder/files/avi.png +0 -0
- data/app/assets/images/fdfinder/files/bmp.png +0 -0
- data/app/assets/images/fdfinder/files/bz.png +0 -0
- data/app/assets/images/fdfinder/files/bz2.png +0 -0
- data/app/assets/images/fdfinder/files/css.png +0 -0
- data/app/assets/images/fdfinder/files/doc.png +0 -0
- data/app/assets/images/fdfinder/files/docx.png +0 -0
- data/app/assets/images/fdfinder/files/dv.png +0 -0
- data/app/assets/images/fdfinder/files/flv.png +0 -0
- data/app/assets/images/fdfinder/files/gif.png +0 -0
- data/app/assets/images/fdfinder/files/gz.png +0 -0
- data/app/assets/images/fdfinder/files/htm.png +0 -0
- data/app/assets/images/fdfinder/files/html.png +0 -0
- data/app/assets/images/fdfinder/files/ico.png +0 -0
- data/app/assets/images/fdfinder/files/jpeg.png +0 -0
- data/app/assets/images/fdfinder/files/jpg.png +0 -0
- data/app/assets/images/fdfinder/files/js.png +0 -0
- data/app/assets/images/fdfinder/files/mid.png +0 -0
- data/app/assets/images/fdfinder/files/mkv.png +0 -0
- data/app/assets/images/fdfinder/files/mov.png +0 -0
- data/app/assets/images/fdfinder/files/mp3.png +0 -0
- data/app/assets/images/fdfinder/files/mp4.png +0 -0
- data/app/assets/images/fdfinder/files/mp4a.png +0 -0
- data/app/assets/images/fdfinder/files/mpg.png +0 -0
- data/app/assets/images/fdfinder/files/ogg.png +0 -0
- data/app/assets/images/fdfinder/files/other.png +0 -0
- data/app/assets/images/fdfinder/files/pdf.png +0 -0
- data/app/assets/images/fdfinder/files/php.png +0 -0
- data/app/assets/images/fdfinder/files/png.png +0 -0
- data/app/assets/images/fdfinder/files/pps.png +0 -0
- data/app/assets/images/fdfinder/files/ppt.png +0 -0
- data/app/assets/images/fdfinder/files/pptx.png +0 -0
- data/app/assets/images/fdfinder/files/psd.png +0 -0
- data/app/assets/images/fdfinder/files/rar.png +0 -0
- data/app/assets/images/fdfinder/files/rb.png +0 -0
- data/app/assets/images/fdfinder/files/swf.png +0 -0
- data/app/assets/images/fdfinder/files/tar.png +0 -0
- data/app/assets/images/fdfinder/files/tbz.png +0 -0
- data/app/assets/images/fdfinder/files/tga.png +0 -0
- data/app/assets/images/fdfinder/files/tgz.png +0 -0
- data/app/assets/images/fdfinder/files/tif.png +0 -0
- data/app/assets/images/fdfinder/files/tiff.png +0 -0
- data/app/assets/images/fdfinder/files/txt.png +0 -0
- data/app/assets/images/fdfinder/files/wav.png +0 -0
- data/app/assets/images/fdfinder/files/wm.png +0 -0
- data/app/assets/images/fdfinder/files/wma.png +0 -0
- data/app/assets/images/fdfinder/files/xls.png +0 -0
- data/app/assets/images/fdfinder/files/xlsx.png +0 -0
- data/app/assets/images/fdfinder/files/xml.png +0 -0
- data/app/assets/images/fdfinder/files/zip.png +0 -0
- data/app/assets/images/fdfinder/finder.png +0 -0
- data/app/assets/images/fdfinder/icon_view.png +0 -0
- data/app/assets/images/fdfinder/info.png +0 -0
- data/app/assets/images/fdfinder/info2.png +0 -0
- data/app/assets/images/fdfinder/kind_sorter.png +0 -0
- data/app/assets/images/fdfinder/list_view.png +0 -0
- data/app/assets/images/fdfinder/name_sorter.png +0 -0
- data/app/assets/images/fdfinder/new_folder.png +0 -0
- data/app/assets/images/fdfinder/paste.png +0 -0
- data/app/assets/images/fdfinder/preview.png +0 -0
- data/app/assets/images/fdfinder/refresh.png +0 -0
- data/app/assets/images/fdfinder/rename.png +0 -0
- data/app/assets/images/fdfinder/settings.png +0 -0
- data/app/assets/images/fdfinder/show_date.png +0 -0
- data/app/assets/images/fdfinder/show_size.png +0 -0
- data/app/assets/images/fdfinder/size_sorter.png +0 -0
- data/app/assets/images/fdfinder/sort.png +0 -0
- data/app/assets/images/fdfinder/tree/folder.png +0 -0
- data/app/assets/images/fdfinder/tree/loader.gif +0 -0
- data/app/assets/images/fdfinder/tree/minus.png +0 -0
- data/app/assets/images/fdfinder/tree/plus.png +0 -0
- data/app/assets/images/fdfinder/up_folder.png +0 -0
- data/app/assets/images/fdfinder/upload.png +0 -0
- data/app/assets/javascripts/fdfinder.js +1697 -0
- data/app/assets/stylesheets/fdfinder.css +347 -0
- data/app/assets/stylesheets/fdfinder.css.scss +347 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/fdfinder.gemspec +31 -0
- data/lib/fdfinder.rb +7 -0
- data/lib/fdfinder/connector.rb +612 -0
- data/lib/fdfinder/engine.rb +12 -0
- data/lib/fdfinder/version.rb +3 -0
- data/lib/fdfinder/zip_file_generator.rb +47 -0
- data/screenshots/fcfinder_interface.png +0 -0
- data/vendor/assets/images/fcfinder/about.png +0 -0
- data/vendor/assets/images/fcfinder/copy.png +0 -0
- data/vendor/assets/images/fcfinder/cut.png +0 -0
- data/vendor/assets/images/fcfinder/date_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/delete.png +0 -0
- data/vendor/assets/images/fcfinder/directory-max.png +0 -0
- data/vendor/assets/images/fcfinder/directory.png +0 -0
- data/vendor/assets/images/fcfinder/directory_mini.png +0 -0
- data/vendor/assets/images/fcfinder/download.png +0 -0
- data/vendor/assets/images/fcfinder/duplicate.png +0 -0
- data/vendor/assets/images/fcfinder/edit.png +0 -0
- data/vendor/assets/images/fcfinder/files/7z.png +0 -0
- data/vendor/assets/images/fcfinder/files/Untitled-24.png +0 -0
- data/vendor/assets/images/fcfinder/files/avi.png +0 -0
- data/vendor/assets/images/fcfinder/files/bmp.png +0 -0
- data/vendor/assets/images/fcfinder/files/bz.png +0 -0
- data/vendor/assets/images/fcfinder/files/bz2.png +0 -0
- data/vendor/assets/images/fcfinder/files/css.png +0 -0
- data/vendor/assets/images/fcfinder/files/doc.png +0 -0
- data/vendor/assets/images/fcfinder/files/docx.png +0 -0
- data/vendor/assets/images/fcfinder/files/dv.png +0 -0
- data/vendor/assets/images/fcfinder/files/flv.png +0 -0
- data/vendor/assets/images/fcfinder/files/gif.png +0 -0
- data/vendor/assets/images/fcfinder/files/gz.png +0 -0
- data/vendor/assets/images/fcfinder/files/htm.png +0 -0
- data/vendor/assets/images/fcfinder/files/html.png +0 -0
- data/vendor/assets/images/fcfinder/files/ico.png +0 -0
- data/vendor/assets/images/fcfinder/files/jpeg.png +0 -0
- data/vendor/assets/images/fcfinder/files/jpg.png +0 -0
- data/vendor/assets/images/fcfinder/files/js.png +0 -0
- data/vendor/assets/images/fcfinder/files/mid.png +0 -0
- data/vendor/assets/images/fcfinder/files/mkv.png +0 -0
- data/vendor/assets/images/fcfinder/files/mov.png +0 -0
- data/vendor/assets/images/fcfinder/files/mp3.png +0 -0
- data/vendor/assets/images/fcfinder/files/mp4.png +0 -0
- data/vendor/assets/images/fcfinder/files/mp4a.png +0 -0
- data/vendor/assets/images/fcfinder/files/mpg.png +0 -0
- data/vendor/assets/images/fcfinder/files/ogg.png +0 -0
- data/vendor/assets/images/fcfinder/files/other.png +0 -0
- data/vendor/assets/images/fcfinder/files/pdf.png +0 -0
- data/vendor/assets/images/fcfinder/files/php.png +0 -0
- data/vendor/assets/images/fcfinder/files/png.png +0 -0
- data/vendor/assets/images/fcfinder/files/pps.png +0 -0
- data/vendor/assets/images/fcfinder/files/ppt.png +0 -0
- data/vendor/assets/images/fcfinder/files/pptx.png +0 -0
- data/vendor/assets/images/fcfinder/files/psd.png +0 -0
- data/vendor/assets/images/fcfinder/files/rar.png +0 -0
- data/vendor/assets/images/fcfinder/files/rb.png +0 -0
- data/vendor/assets/images/fcfinder/files/swf.png +0 -0
- data/vendor/assets/images/fcfinder/files/tar.png +0 -0
- data/vendor/assets/images/fcfinder/files/tbz.png +0 -0
- data/vendor/assets/images/fcfinder/files/tga.png +0 -0
- data/vendor/assets/images/fcfinder/files/tgz.png +0 -0
- data/vendor/assets/images/fcfinder/files/tif.png +0 -0
- data/vendor/assets/images/fcfinder/files/tiff.png +0 -0
- data/vendor/assets/images/fcfinder/files/txt.png +0 -0
- data/vendor/assets/images/fcfinder/files/wav.png +0 -0
- data/vendor/assets/images/fcfinder/files/wm.png +0 -0
- data/vendor/assets/images/fcfinder/files/wma.png +0 -0
- data/vendor/assets/images/fcfinder/files/xls.png +0 -0
- data/vendor/assets/images/fcfinder/files/xlsx.png +0 -0
- data/vendor/assets/images/fcfinder/files/xml.png +0 -0
- data/vendor/assets/images/fcfinder/files/zip.png +0 -0
- data/vendor/assets/images/fcfinder/finder.png +0 -0
- data/vendor/assets/images/fcfinder/icon_view.png +0 -0
- data/vendor/assets/images/fcfinder/info.png +0 -0
- data/vendor/assets/images/fcfinder/info2.png +0 -0
- data/vendor/assets/images/fcfinder/kind_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/list_view.png +0 -0
- data/vendor/assets/images/fcfinder/name_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/new_folder.png +0 -0
- data/vendor/assets/images/fcfinder/paste.png +0 -0
- data/vendor/assets/images/fcfinder/preview.png +0 -0
- data/vendor/assets/images/fcfinder/refresh.png +0 -0
- data/vendor/assets/images/fcfinder/rename.png +0 -0
- data/vendor/assets/images/fcfinder/settings.png +0 -0
- data/vendor/assets/images/fcfinder/show_date.png +0 -0
- data/vendor/assets/images/fcfinder/show_size.png +0 -0
- data/vendor/assets/images/fcfinder/size_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/sort.png +0 -0
- data/vendor/assets/images/fcfinder/tree/folder.png +0 -0
- data/vendor/assets/images/fcfinder/tree/loader.gif +0 -0
- data/vendor/assets/images/fcfinder/tree/minus.png +0 -0
- data/vendor/assets/images/fcfinder/tree/plus.png +0 -0
- data/vendor/assets/images/fcfinder/up_folder.png +0 -0
- data/vendor/assets/images/fcfinder/upload.png +0 -0
- data/vendor/assets/javascripts/fcfinder.js +1698 -0
- data/vendor/assets/stylesheets/fcfinder.css +347 -0
- data/vendor/assets/stylesheets/fcfinder.css.erb +347 -0
- metadata +297 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 37f75b157a003d9cadb6534b334ebc596f89c81a
|
4
|
+
data.tar.gz: a545654082eb724c66fca4a23f4ecbad8900d7c6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 90ac9da43e1da15971d45a6e1c06040b493db7964ceeba01e642e0f8616358dc64d546381a978578aa81e272eec2d50d3cecea6b029975c9079dcbc93daa6547
|
7
|
+
data.tar.gz: 63da65041d1218eb2fb59c8963199c5bea337d3238d922e6a602d7ec6b62130a348adfc8662f99491bea3f750d848ccea837a94186365c50a0d6cc953534925c
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Furkan Çelik
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,364 @@
|
|
1
|
+
# Fcfinder
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/fcfinder.svg)](http://badge.fury.io/rb/fcfinder)
|
4
|
+
|
5
|
+
Web File Manager For The Rails
|
6
|
+
Integrated in ckeditor and TinyMCE with File Explorer you can use as a quick and simple way.
|
7
|
+
|
8
|
+
Fdfinder is English version of Fcfinder (I'm still translating and setting all the things around)
|
9
|
+
|
10
|
+
![Arayuzu](https://raw.githubusercontent.com/furkancelik/fcfinder/master/screenshots/fcfinder_interface.png)
|
11
|
+
|
12
|
+
## Requirements
|
13
|
+
|
14
|
+
###ImageMagick
|
15
|
+
|
16
|
+
[imagemagick](http://github.com)'in kurulu olması gerekmektedir.
|
17
|
+
|
18
|
+
For A Windows Installation;
|
19
|
+
[imagemagick](http://github.com) from the address the Download button
|
20
|
+
Windows binary from the release area **compatible with ruby** (same as installed x86 x64)
|
21
|
+
ImageMagick -******-dll.exe download the file and you can install it in the installation process, make sure that is added to the PATH environment variable.
|
22
|
+
|
23
|
+
To The Command Line
|
24
|
+
|
25
|
+
`convert -version`
|
26
|
+
|
27
|
+
when you write in this way, you can see that you have successfully installed.
|
28
|
+
|
29
|
+
```
|
30
|
+
Version: ImageMagick 6.9.1-4 Q16 x86 2015-05-31 http://www.imagemagick.org
|
31
|
+
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
|
32
|
+
License: http://www.imagemagick.org/script/license.php
|
33
|
+
Features: Cipher DPC Modules OpenMP
|
34
|
+
...
|
35
|
+
```
|
36
|
+
|
37
|
+
### Puma Server (Optional)
|
38
|
+
Requirement requirement but not Webrick large files can give a problem in the installation process.
|
39
|
+
the Puma for Windows installation [Here](https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows) you can look at.
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
## Setup
|
44
|
+
|
45
|
+
Gemfile for rails applications, you must add the following line to your file.
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
gem 'fcfinder'
|
49
|
+
```
|
50
|
+
|
51
|
+
```
|
52
|
+
$ bundle install
|
53
|
+
```
|
54
|
+
|
55
|
+
with rails you can perform the installation process.
|
56
|
+
|
57
|
+
|
58
|
+
## Use
|
59
|
+
|
60
|
+
|
61
|
+
###Setting The Controller
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
class YourController < ApplicationController
|
65
|
+
|
66
|
+
def index
|
67
|
+
if request.post?
|
68
|
+
# The bottom line is that only the logged in user (admin) can access the Finder
|
69
|
+
# The Session Name Must Be The Same As The Name You Use On Your System
|
70
|
+
# The Logon Process Will Be If You Can Remove This Line
|
71
|
+
if session[:user_id]
|
72
|
+
# example file with the name you want under the terms you can create the public folder, 'uploads' was created in the form of
|
73
|
+
# File.join(Rails.public_path, 'uploads', "/*")
|
74
|
+
# Files you want to be listed as a parameter
|
75
|
+
# server address,
|
76
|
+
# post parameters,
|
77
|
+
# Parameter Hash in the hash
|
78
|
+
# :max_file_size = indicates the size of the file to be loaded (byte)
|
79
|
+
# :allowed_mime = the file types that you want to allow extra
|
80
|
+
# :disallowed_mime = disallowed file types
|
81
|
+
render text: Fcfinder::Connector.new(File.join(Rails.public_path, 'uploads', "/*"), request.env["HTTP_HOST"], params[:fcfinder],
|
82
|
+
{
|
83
|
+
:max_file_size => 1_000_000,
|
84
|
+
:allowed_mime => {'pdf' => 'application/pdf'},
|
85
|
+
:disallowed_mime => {}
|
86
|
+
}).run, :layout => false
|
87
|
+
# If Not Logged On
|
88
|
+
#( session[:user_id] if you must remove the else part of the if statement block is removed)
|
89
|
+
else
|
90
|
+
# if the value is null is blocking access session_id, keep your files safe.
|
91
|
+
render :text => "Access not allowed!".to_json, :layout => false
|
92
|
+
end
|
93
|
+
else
|
94
|
+
render :layout => false
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
#to download the file
|
100
|
+
def download
|
101
|
+
# 'uploads' folder under the public folder part again.
|
102
|
+
send_file File.join(Rails.public_path,'uploads',params[:path].split(":").join("/")+"."+params[:format])
|
103
|
+
end
|
104
|
+
end
|
105
|
+
```
|
106
|
+
|
107
|
+
###Route Setting
|
108
|
+
|
109
|
+
```ruby
|
110
|
+
scope '/fcfinder' do
|
111
|
+
match '/', to: 'your_controller#index', via: [:get, :post]
|
112
|
+
get '/download/:path', to: 'your_controller#download'
|
113
|
+
end
|
114
|
+
```
|
115
|
+
|
116
|
+
**This way if you can use a namespace if you want to use under**
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
namespace :admin do
|
120
|
+
scope '/fcfinder' do
|
121
|
+
match '/', to: 'your_controller#index', via: [:get, :post]
|
122
|
+
get '/download/:path', to: 'your_controller#download'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
```
|
126
|
+
|
127
|
+
###View Setting
|
128
|
+
|
129
|
+
####1.Method
|
130
|
+
**app/assets/javascripts/application.js in your file**
|
131
|
+
|
132
|
+
```js
|
133
|
+
//= require jquery
|
134
|
+
//= require jquery_ujs
|
135
|
+
```
|
136
|
+
|
137
|
+
these lines must be attached ***(make sure jQuery is loaded!!)***
|
138
|
+
|
139
|
+
|
140
|
+
**config/initializers/assets.rb** in the file to the bottom
|
141
|
+
|
142
|
+
```ruby
|
143
|
+
Rails.application.config.assets.precompile += %w( fcfinder.js )
|
144
|
+
Rails.application.config.assets.precompile += %w( fcfinder.css )
|
145
|
+
```
|
146
|
+
|
147
|
+
you must add the lines
|
148
|
+
|
149
|
+
**View the content of your file should be like this**
|
150
|
+
|
151
|
+
```html
|
152
|
+
<!DOCTYPE html>
|
153
|
+
<html>
|
154
|
+
<head>
|
155
|
+
<title>FcFinder</title>
|
156
|
+
|
157
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
158
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
159
|
+
|
160
|
+
<%= javascript_include_tag 'fcfinder', 'data-turbolinks-track' => true %>
|
161
|
+
<%= stylesheet_link_tag 'fcfinder', media: 'all', 'data-turbolinks-track' => true %>
|
162
|
+
<%= csrf_meta_tags %>
|
163
|
+
</head>
|
164
|
+
<body>
|
165
|
+
<div id="fcfinder"></div>
|
166
|
+
|
167
|
+
<script type="text/javascript">
|
168
|
+
$(function(){
|
169
|
+
$("#fcfinder").fcFinder({
|
170
|
+
// this value must be the address that you set in the route
|
171
|
+
url:"/fcfinder",
|
172
|
+
getFileCallback: function(url) {
|
173
|
+
/**
|
174
|
+
Integrated Editor For The First Stage Of The Process, You Can Leave This Value Blank
|
175
|
+
By default CKEditor is working in an integrated manner with
|
176
|
+
*/
|
177
|
+
}
|
178
|
+
});
|
179
|
+
});
|
180
|
+
</script>
|
181
|
+
</body>
|
182
|
+
</html>
|
183
|
+
```
|
184
|
+
|
185
|
+
####2.Method
|
186
|
+
|
187
|
+
**app/assets/javascripts/application.js in your file**
|
188
|
+
make sure that the jQuery files are installed
|
189
|
+
|
190
|
+
```js
|
191
|
+
//= require jquery
|
192
|
+
//= require jquery_ujs
|
193
|
+
```
|
194
|
+
under
|
195
|
+
|
196
|
+
```js
|
197
|
+
//= require fcfinder
|
198
|
+
```
|
199
|
+
add the line
|
200
|
+
|
201
|
+
|
202
|
+
**app/assets/stylesheets/application.css in file**
|
203
|
+
|
204
|
+
```css
|
205
|
+
*= require fcfinder
|
206
|
+
```
|
207
|
+
|
208
|
+
add the line
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
**View the content of your file should be like this**
|
213
|
+
|
214
|
+
```html
|
215
|
+
<!DOCTYPE html>
|
216
|
+
<html>
|
217
|
+
<head>
|
218
|
+
<title>FcFinder</title>
|
219
|
+
|
220
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
221
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
222
|
+
<%= csrf_meta_tags %>
|
223
|
+
|
224
|
+
</head>
|
225
|
+
<body>
|
226
|
+
<div id="fcfinder"></div>
|
227
|
+
|
228
|
+
<script type="text/javascript">
|
229
|
+
$(function(){
|
230
|
+
$("#fcfinder").fcFinder({
|
231
|
+
// this value must be the address that you set in the route
|
232
|
+
url:"/fcfinder",
|
233
|
+
getFileCallback: function(url) {
|
234
|
+
/**
|
235
|
+
Integrated Editor For The First Stage Of The Process, You Can Leave This Value Blank
|
236
|
+
By default CKEditor is working in an integrated manner with
|
237
|
+
*/
|
238
|
+
}
|
239
|
+
});
|
240
|
+
});
|
241
|
+
</script>
|
242
|
+
</body>
|
243
|
+
</html>
|
244
|
+
```
|
245
|
+
|
246
|
+
|
247
|
+
**You Can Now Start Your Server And Test It :)**
|
248
|
+
|
249
|
+
## Integrated Operations
|
250
|
+
### CKEditor
|
251
|
+
|
252
|
+
Comes integrated with ckeditor by default.
|
253
|
+
Ckeditor In A Page That Contains Flour
|
254
|
+
|
255
|
+
```js
|
256
|
+
CKEDITOR.replace( 'editor1',{
|
257
|
+
/* In this way, you will specify the path to the Ckeditor in the Finder. */
|
258
|
+
filebrowserBrowseUrl : 'http://localhost:3000/fcfinder'
|
259
|
+
});
|
260
|
+
```
|
261
|
+
|
262
|
+
### Tinymce
|
263
|
+
|
264
|
+
On the page that contains the TinyMCE editor
|
265
|
+
|
266
|
+
```js
|
267
|
+
function fcFinderBrowser (field_name, url, type, win) {
|
268
|
+
tinymce.activeEditor.windowManager.open({
|
269
|
+
/* URL Finder */
|
270
|
+
file: "http://localhost:3000/admin/fcfinder",
|
271
|
+
title: 'FCFinder File Manager',
|
272
|
+
width: 900,
|
273
|
+
height: 450,
|
274
|
+
resizable: 'yes'
|
275
|
+
}, {
|
276
|
+
setUrl: function (url) {
|
277
|
+
win.document.getElementById(field_name).value = url;
|
278
|
+
}
|
279
|
+
});
|
280
|
+
return false;
|
281
|
+
}
|
282
|
+
|
283
|
+
tinymce.init({
|
284
|
+
selector: "textarea#elm1",
|
285
|
+
theme: "modern",
|
286
|
+
file_browser_callback : fcFinderBrowser,
|
287
|
+
....
|
288
|
+
...
|
289
|
+
..
|
290
|
+
.
|
291
|
+
});
|
292
|
+
```
|
293
|
+
|
294
|
+
**Resides on the page where fcfinder**
|
295
|
+
|
296
|
+
```js
|
297
|
+
$("#fcfinder").fcFinder({
|
298
|
+
url:"/admin/fcfinder",
|
299
|
+
getFileCallback: function(url) {
|
300
|
+
|
301
|
+
if (typeof(window.opener) !== 'undefined' && window.opener !== null) {
|
302
|
+
window.opener.FCFinder.callBack(url);
|
303
|
+
window.close();
|
304
|
+
}
|
305
|
+
|
306
|
+
if (typeof(top.tinymce) !== 'undefined' && typeof(top.tinymce) !== null) {
|
307
|
+
top.tinymce.activeEditor.windowManager.getParams().setUrl(url);
|
308
|
+
top.tinymce.activeEditor.windowManager.close();
|
309
|
+
}
|
310
|
+
|
311
|
+
}
|
312
|
+
});
|
313
|
+
```
|
314
|
+
|
315
|
+
### Integrated process for the input
|
316
|
+
|
317
|
+
**the page where input is needed**
|
318
|
+
|
319
|
+
```html
|
320
|
+
<html>
|
321
|
+
<head>
|
322
|
+
<script type="text/javascript">
|
323
|
+
function openFCFinder(field) {
|
324
|
+
window.FCFinder = {
|
325
|
+
callBack: function(url) {
|
326
|
+
field.value = url;
|
327
|
+
}
|
328
|
+
};
|
329
|
+
|
330
|
+
window.open('http://localhost:3000/admin/fcfinder', 'kcfinder_textbox',
|
331
|
+
'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
|
332
|
+
'resizable=1, scrollbars=0, width=950, height=400'
|
333
|
+
);
|
334
|
+
}
|
335
|
+
</script>
|
336
|
+
</head>
|
337
|
+
<body>
|
338
|
+
<input type="text" readonly="readonly" onclick="openFCFinder(this)"
|
339
|
+
value="Click here and select a file double clicking on it" style="width:600px;cursor:pointer" />
|
340
|
+
</body>
|
341
|
+
</html>
|
342
|
+
```
|
343
|
+
|
344
|
+
**The page where is located the Finder (the Finder parameter setting)**
|
345
|
+
|
346
|
+
|
347
|
+
```js
|
348
|
+
$("#fcfinders").fcFinder({
|
349
|
+
url:"/admin/fcfinder",
|
350
|
+
getFileCallback: function(url) {
|
351
|
+
|
352
|
+
if (typeof(window.opener) !== 'undefined' && window.opener !== null) {
|
353
|
+
window.opener.FCFinder.callBack(url);
|
354
|
+
window.close();
|
355
|
+
}
|
356
|
+
|
357
|
+
if (typeof(top.tinymce) !== 'undefined' && typeof(top.tinymce) !== null) {
|
358
|
+
top.tinymce.activeEditor.windowManager.getParams().setUrl(url);
|
359
|
+
top.tinymce.activeEditor.windowManager.close();
|
360
|
+
}
|
361
|
+
}
|
362
|
+
});
|
363
|
+
```
|
364
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|