fcfinder 1.0.0 → 1.0.1

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.
data/README.md CHANGED
@@ -1,356 +1,362 @@
1
- # Fcfinder
2
-
3
- [![Gem Version](https://badge.fury.io/rb/fcfinder.svg)](http://badge.fury.io/rb/fcfinder)
4
-
5
- Rails İçin Web Dosya Gezgini
6
- CKEditor ve Tinymce ile Hızlı ve Basit bir şekilde Entegreli olarak kullanabileceğiniz dosya gezgini.
7
-
8
- ![Arayuzu](https://raw.githubusercontent.com/furkancelik/fcfinder/master/screenshots/fcfinder_interface.png)
9
-
10
- ## Gereklilikler
11
-
12
- ###ImageMagick
13
-
14
- [imagemagick](http://github.com)'in kurulu olması gerekmektedir.
15
-
16
- Windows Kurulumu İçin;
17
- [imagemagick](http://github.com) adresinden download butonundan
18
- Windows Binary Release alanından **ruby ile uyumlu** (kurulu olan x64 x86 ile aynı)
19
- ImageMagick-******-dll.exe Dosyasını İndirip Kurabilirsiniz kurulum işleminde path ortam değişkenine eklendiğine emin olun.
20
-
21
- Komut Satırına
22
-
23
- `convert -version`
24
-
25
- yazdığınızda bu şekilde başarıyla yüklediğinizi görebilirsiniz.
26
-
27
- ```
28
- Version: ImageMagick 6.9.1-4 Q16 x86 2015-05-31 http://www.imagemagick.org
29
- Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
30
- License: http://www.imagemagick.org/script/license.php
31
- Features: Cipher DPC Modules OpenMP
32
- ...
33
- ```
34
-
35
- ### Puma Server (İsteğe Bağlı)
36
- Gereklilik şartı yok ama büyük dosyaları yükleme işleminde webrick sorun çıkartabiliyor
37
- pumanın windows için kurulumuna [buradan](https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows) bakabilirsiniz.
38
-
39
-
40
-
41
- ## Kurulum
42
-
43
- Rails uygulamaları için Gemfile dosyanıza alttaki satırı eklemelisiniz
44
-
45
- ```ruby
46
- gem 'fcfinder'
47
- ```
48
-
49
- ```
50
- $ bundle install
51
- ```
52
-
53
- ile rails için yükleme işlemini gerçekleştirebilirsiniz.
54
-
55
-
56
- ## Kullanım
57
-
58
- ###Controller Ayarı
59
-
60
- ```ruby
61
- class SizinControlleriniz < ApplicationController
62
-
63
- def index
64
- if request.post?
65
- # Alttaki Satırla Sadece Giriş Yapan Kullanıcıların (Admin'in) Finder'e erişimini Sağlayabilirsiniz
66
- # Session Adını Sisteminizde Kullandığınız Adla Aynı Olmalı
67
- # Oturu Açma İşlemi Olmayacaksa Bu Satırı Kaldırabilirsiniz
68
- if session[:user_id]
69
- # public klasörü altında istediğiniz isimde dosya oluşturabilirsiniz örnek açısından 'uploads' şeklinde oluşturuldu
70
- # File.join(Rails.public_path, 'uploads', "/*")
71
- # Paremetre olarak listelenmesini istediğiniz dosyalar,
72
- # sunucu adresi,
73
- # post paremetrleri,
74
- # Hash paremetresi bu hash içerisinde
75
- # :max_file_size = yüklenecek dosyanın boyutunu belirtiyor (byte)
76
- # :allowed_mime = ekstra olarak izin vermek istediğiniz dosya tipleri
77
- # :disallowed_mime = izin verilmeyen dosya tipleri
78
- render text: Fcfinder::Connector.new(File.join(Rails.public_path, 'uploads', "/*"), request.env["HTTP_HOST"], params[:fcfinder],
79
- {
80
- :max_file_size => 1_000_000,
81
- :allowed_mime => {'pdf' => 'application/pdf'},
82
- :disallowed_mime => {}
83
- }).run, :layout => false
84
- # Eğer Oturum Açılmamışsa
85
- #(session[:user_id] if bloğunu kaldırdıysanız bu else kısmınıda kaldırmalısınız)
86
- else
87
- # session_id değeri boş ise erişimi kapatıyor dosyalarınız güvende oluyor.
88
- render :text => "Access not allowed!".to_json, :layout => false
89
- end
90
- else
91
- #
92
- render :layout => false
93
- end
94
- end
95
-
96
-
97
- #dosya indirme işlemi için
98
- def download
99
- # 'uploads' kısmı yine public klasörü altında olan klasörünüz.
100
- send_file File.join(Rails.public_path,'uploads',params[:path].split(":").join("/")+"."+params[:format])
101
- end
102
- end
103
- ```
104
- ###Rota Ayarı
105
-
106
- ```ruby
107
- scope '/fcfinder' do
108
- match '/', to: 'sizin_controlleriniz#index', via: [:get, :post]
109
- get '/download/:path', to: 'sizin_controlleriniz#download'
110
- end
111
- ```
112
- **Eğer bir namespace altında kullanmak isterseniz bu şekilde kullanabilirsiniz**
113
-
114
- ```ruby
115
- namespace :admin do
116
- scope '/fcfinder' do
117
- match '/', to: 'sizin_controlleriniz#index', via: [:get, :post]
118
- get '/download/:path', to: 'sizin_controlleriniz#download'
119
- end
120
- end
121
- ```
122
-
123
- ###View Ayarı
124
-
125
- ####1.Yöntem
126
- **app/assets/javascripts/application.js dosyanızda**
127
-
128
- ```js
129
- //= require jquery
130
- //= require jquery_ujs
131
- ```
132
-
133
- bu satırlar ekli olmalıdır ***(jQuery'nin yüklü olduğuna emin olun!!)***
134
-
135
-
136
- **config/initializers/assets.rb** dosyasında en alta
137
-
138
- ```ruby
139
- Rails.application.config.assets.precompile += %w( fcfinder.js )
140
- Rails.application.config.assets.precompile += %w( fcfinder.css )
141
- ```
142
- satırlarını eklemelisiniz
143
-
144
- **Viewdeki dosyanızın içeriği bu şekilde olmalıdır**
145
-
146
- ```html
147
- <!DOCTYPE html>
148
- <html>
149
- <head>
150
- <title>FcFinder</title>
151
-
152
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
153
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
154
-
155
- <%= javascript_include_tag 'fcfinder', 'data-turbolinks-track' => true %>
156
- <%= stylesheet_link_tag 'fcfinder', media: 'all', 'data-turbolinks-track' => true %>
157
- <%= csrf_meta_tags %>
158
- </head>
159
- <body>
160
- <div id="fcfinder"></div>
161
-
162
- <script type="text/javascript">
163
- $(function(){
164
- $("#fcfinder").fcFinder({
165
- // bu değer rotada ayarladığınız adres olmalı
166
- url:"/fcfinder",
167
- getFileCallback: function(url) {
168
- /**
169
- Editör Entegre İşlemleri İlk Etap İçin Bu Değeri Boş Bırakabilirsiniz
170
- Varsayılan Olarak CKEditor ile Entegrebir şekilde çalışıyor
171
- */
172
- }
173
- });
174
- });
175
- </script>
176
- </body>
177
- </html>
178
- ```
179
-
180
- ####2.Yöntem
181
-
182
- **app/assets/javascripts/application.js dosyanızda**
183
- jquery Dosyalarını Yüklü Olduğuna emin olun ve
184
-
185
- ```js
186
- //= require jquery
187
- //= require jquery_ujs
188
- ```
189
- altına
190
-
191
- ```js
192
- //= require fcfinder
193
- ```
194
- satırını ekleyin
195
-
196
-
197
- **app/assets/stylesheets/application.css dosyasına**
198
-
199
- ```css
200
- *= require fcfinder
201
- ```
202
-
203
- satırını ekleyin
204
-
205
-
206
-
207
- **Viewdeki dosyanızın içeriği bu şekilde olmalıdır**
208
-
209
- ```html
210
- <!DOCTYPE html>
211
- <html>
212
- <head>
213
- <title>FcFinder</title>
214
-
215
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
216
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
217
- <%= csrf_meta_tags %>
218
-
219
- </head>
220
- <body>
221
- <div id="fcfinder"></div>
222
-
223
- <script type="text/javascript">
224
- $(function(){
225
- $("#fcfinder").fcFinder({
226
- // bu değer rotada ayarladığınız adres olmalı
227
- url:"/fcfinder",
228
- getFileCallback: function(url) {
229
- /**
230
- Editör Entegre İşlemleri İlk Etap İçin Bu Değeri Boş Bırakabilirsiniz
231
- Varsayılan Olarak CKEditor ile Entegrebir şekilde çalışıyor
232
- */
233
- }
234
- });
235
- });
236
- </script>
237
- </body>
238
- </html>
239
- ```
240
-
241
-
242
- **Şimdi Sunucunuzu Başlatıp Test Edebilirsiniz :)**
243
-
244
- ## Entegre İşlemleri
245
- ### CKEditor
246
-
247
- Varsayılan olarak ckeditor ile entegreli olarak geliyor.
248
- CKEditorün Bulunduğu Sayfada
249
- ```js
250
- CKEDITOR.replace( 'editor1',{
251
- /* Bu Şekilde CKEditorde finder yolunu belirteceksiniz. */
252
- filebrowserBrowseUrl : 'http://localhost:3000/fcfinder'
253
- });
254
- ```
255
-
256
- ### Tinymce
257
-
258
- Tinymce Editorun bulunduğu sayfada
259
- ```js
260
- function fcFinderBrowser (field_name, url, type, win) {
261
- tinymce.activeEditor.windowManager.open({
262
- /* Finder urlsi */
263
- file: "http://localhost:3000/admin/fcfinder",
264
- title: 'FCFinder Dosya Yöneticisi',
265
- width: 900,
266
- height: 450,
267
- resizable: 'yes'
268
- }, {
269
- setUrl: function (url) {
270
- win.document.getElementById(field_name).value = url;
271
- }
272
- });
273
- return false;
274
- }
275
-
276
- tinymce.init({
277
- selector: "textarea#elm1",
278
- theme: "modern",
279
- file_browser_callback : fcFinderBrowser,
280
- ....
281
- ...
282
- ..
283
- .
284
- });
285
- ```
286
-
287
- **FcFinder'in bulunduğu sayfada**
288
-
289
- ```js
290
- $("#fcfinder").fcFinder({
291
- url:"/admin/fcfinder",
292
- getFileCallback: function(url) {
293
-
294
- if (typeof(window.opener) !== 'undefined' && window.opener !== null) {
295
- window.opener.FCFinder.callBack(url);
296
- window.close();
297
- }
298
-
299
- if (typeof(top.tinymce) !== 'undefined' && typeof(top.tinymce) !== null) {
300
- top.tinymce.activeEditor.windowManager.getParams().setUrl(url);
301
- top.tinymce.activeEditor.windowManager.close();
302
- }
303
-
304
- }
305
- });
306
- ```
307
-
308
- ### Input için Entegre İşlemi
309
-
310
- **inputun bulunduğu sayfa**
311
- ```html
312
- <html>
313
- <head>
314
- <script type="text/javascript">
315
- function openFCFinder(field) {
316
- window.FCFinder = {
317
- callBack: function(url) {
318
- field.value = url;
319
- }
320
- };
321
-
322
- window.open('http://localhost:3000/admin/fcfinder', 'kcfinder_textbox',
323
- 'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
324
- 'resizable=1, scrollbars=0, width=950, height=400'
325
- );
326
- }
327
- </script>
328
- </head>
329
- <body>
330
- <input type="text" readonly="readonly" onclick="openFCFinder(this)"
331
- value="Click here and select a file double clicking on it" style="width:600px;cursor:pointer" />
332
- </body>
333
- </html>
334
- ```
335
-
336
- **Finder bulunduğu sayfa (finder paremetre ayarı)**
337
-
338
-
339
- ```js
340
- $("#fcfinders").fcFinder({
341
- url:"/admin/fcfinder",
342
- getFileCallback: function(url) {
343
-
344
- if (typeof(window.opener) !== 'undefined' && window.opener !== null) {
345
- window.opener.FCFinder.callBack(url);
346
- window.close();
347
- }
348
-
349
- if (typeof(top.tinymce) !== 'undefined' && typeof(top.tinymce) !== null) {
350
- top.tinymce.activeEditor.windowManager.getParams().setUrl(url);
351
- top.tinymce.activeEditor.windowManager.close();
352
- }
353
- }
354
- });
355
- ```
356
-
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
+ ![Arayuzu](https://raw.githubusercontent.com/furkancelik/fcfinder/master/screenshots/fcfinder_interface.png)
9
+
10
+ ## Requirements
11
+
12
+ ###ImageMagick
13
+
14
+ [imagemagick](http://github.com)'in kurulu olması gerekmektedir.
15
+
16
+ For A Windows Installation;
17
+ [imagemagick](http://github.com) from the address the Download button
18
+ Windows binary from the release area **compatible with ruby** (same as installed x86 x64)
19
+ 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.
20
+
21
+ To The Command Line
22
+
23
+ `convert -version`
24
+
25
+ when you write in this way, you can see that you have successfully installed.
26
+
27
+ ```
28
+ Version: ImageMagick 6.9.1-4 Q16 x86 2015-05-31 http://www.imagemagick.org
29
+ Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
30
+ License: http://www.imagemagick.org/script/license.php
31
+ Features: Cipher DPC Modules OpenMP
32
+ ...
33
+ ```
34
+
35
+ ### Puma Server (Optional)
36
+ Requirement requirement but not Webrick large files can give a problem in the installation process.
37
+ the Puma for Windows installation [Here](https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows) you can look at.
38
+
39
+
40
+
41
+ ## Setup
42
+
43
+ Gemfile for rails applications, you must add the following line to your file.
44
+
45
+ ```ruby
46
+ gem 'fcfinder'
47
+ ```
48
+
49
+ ```
50
+ $ bundle install
51
+ ```
52
+
53
+ with rails you can perform the installation process.
54
+
55
+
56
+ ## Use
57
+
58
+
59
+ ###Setting The Controller
60
+
61
+ ```ruby
62
+ class YourController < ApplicationController
63
+
64
+ def index
65
+ if request.post?
66
+ # The bottom line is that only the logged in user (admin) can access the Finder
67
+ # The Session Name Must Be The Same As The Name You Use On Your System
68
+ # The Logon Process Will Be If You Can Remove This Line
69
+ if session[:user_id]
70
+ # example file with the name you want under the terms you can create the public folder, 'uploads' was created in the form of
71
+ # File.join(Rails.public_path, 'uploads', "/*")
72
+ # Files you want to be listed as a parameter
73
+ # server address,
74
+ # post parameters,
75
+ # Parameter Hash in the hash
76
+ # :max_file_size = indicates the size of the file to be loaded (byte)
77
+ # :allowed_mime = the file types that you want to allow extra
78
+ # :disallowed_mime = disallowed file types
79
+ render text: Fcfinder::Connector.new(File.join(Rails.public_path, 'uploads', "/*"), request.env["HTTP_HOST"], params[:fcfinder],
80
+ {
81
+ :max_file_size => 1_000_000,
82
+ :allowed_mime => {'pdf' => 'application/pdf'},
83
+ :disallowed_mime => {}
84
+ }).run, :layout => false
85
+ # If Not Logged On
86
+ #( session[:user_id] if you must remove the else part of the if statement block is removed)
87
+ else
88
+ # if the value is null is blocking access session_id, keep your files safe.
89
+ render :text => "Access not allowed!".to_json, :layout => false
90
+ end
91
+ else
92
+ render :layout => false
93
+ end
94
+ end
95
+
96
+
97
+ #to download the file
98
+ def download
99
+ # 'uploads' folder under the public folder part again.
100
+ send_file File.join(Rails.public_path,'uploads',params[:path].split(":").join("/")+"."+params[:format])
101
+ end
102
+ end
103
+ ```
104
+
105
+ ###Route Setting
106
+
107
+ ```ruby
108
+ scope '/fcfinder' do
109
+ match '/', to: 'your_controller#index', via: [:get, :post]
110
+ get '/download/:path', to: 'your_controller#download'
111
+ end
112
+ ```
113
+
114
+ **This way if you can use a namespace if you want to use under**
115
+
116
+ ```ruby
117
+ namespace :admin do
118
+ scope '/fcfinder' do
119
+ match '/', to: 'your_controller#index', via: [:get, :post]
120
+ get '/download/:path', to: 'your_controller#download'
121
+ end
122
+ end
123
+ ```
124
+
125
+ ###View Setting
126
+
127
+ ####1.Method
128
+ **app/assets/javascripts/application.js in your file**
129
+
130
+ ```js
131
+ //= require jquery
132
+ //= require jquery_ujs
133
+ ```
134
+
135
+ these lines must be attached ***(make sure jQuery is loaded!!)***
136
+
137
+
138
+ **config/initializers/assets.rb** in the file to the bottom
139
+
140
+ ```ruby
141
+ Rails.application.config.assets.precompile += %w( fcfinder.js )
142
+ Rails.application.config.assets.precompile += %w( fcfinder.css )
143
+ ```
144
+
145
+ you must add the lines
146
+
147
+ **View the content of your file should be like this**
148
+
149
+ ```html
150
+ <!DOCTYPE html>
151
+ <html>
152
+ <head>
153
+ <title>FcFinder</title>
154
+
155
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
156
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
157
+
158
+ <%= javascript_include_tag 'fcfinder', 'data-turbolinks-track' => true %>
159
+ <%= stylesheet_link_tag 'fcfinder', media: 'all', 'data-turbolinks-track' => true %>
160
+ <%= csrf_meta_tags %>
161
+ </head>
162
+ <body>
163
+ <div id="fcfinder"></div>
164
+
165
+ <script type="text/javascript">
166
+ $(function(){
167
+ $("#fcfinder").fcFinder({
168
+ // this value must be the address that you set in the route
169
+ url:"/fcfinder",
170
+ getFileCallback: function(url) {
171
+ /**
172
+ Integrated Editor For The First Stage Of The Process, You Can Leave This Value Blank
173
+ By default CKEditor is working in an integrated manner with
174
+ */
175
+ }
176
+ });
177
+ });
178
+ </script>
179
+ </body>
180
+ </html>
181
+ ```
182
+
183
+ ####2.Method
184
+
185
+ **app/assets/javascripts/application.js in your file**
186
+ make sure that the jQuery files are installed
187
+
188
+ ```js
189
+ //= require jquery
190
+ //= require jquery_ujs
191
+ ```
192
+ under
193
+
194
+ ```js
195
+ //= require fcfinder
196
+ ```
197
+ add the line
198
+
199
+
200
+ **app/assets/stylesheets/application.css in file**
201
+
202
+ ```css
203
+ *= require fcfinder
204
+ ```
205
+
206
+ add the line
207
+
208
+
209
+
210
+ **View the content of your file should be like this**
211
+
212
+ ```html
213
+ <!DOCTYPE html>
214
+ <html>
215
+ <head>
216
+ <title>FcFinder</title>
217
+
218
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
219
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
220
+ <%= csrf_meta_tags %>
221
+
222
+ </head>
223
+ <body>
224
+ <div id="fcfinder"></div>
225
+
226
+ <script type="text/javascript">
227
+ $(function(){
228
+ $("#fcfinder").fcFinder({
229
+ // this value must be the address that you set in the route
230
+ url:"/fcfinder",
231
+ getFileCallback: function(url) {
232
+ /**
233
+ Integrated Editor For The First Stage Of The Process, You Can Leave This Value Blank
234
+ By default CKEditor is working in an integrated manner with
235
+ */
236
+ }
237
+ });
238
+ });
239
+ </script>
240
+ </body>
241
+ </html>
242
+ ```
243
+
244
+
245
+ **You Can Now Start Your Server And Test It :)**
246
+
247
+ ## Integrated Operations
248
+ ### CKEditor
249
+
250
+ Comes integrated with ckeditor by default.
251
+ Ckeditor In A Page That Contains Flour
252
+
253
+ ```js
254
+ CKEDITOR.replace( 'editor1',{
255
+ /* In this way, you will specify the path to the Ckeditor in the Finder. */
256
+ filebrowserBrowseUrl : 'http://localhost:3000/fcfinder'
257
+ });
258
+ ```
259
+
260
+ ### Tinymce
261
+
262
+ On the page that contains the TinyMCE editor
263
+
264
+ ```js
265
+ function fcFinderBrowser (field_name, url, type, win) {
266
+ tinymce.activeEditor.windowManager.open({
267
+ /* URL Finder */
268
+ file: "http://localhost:3000/admin/fcfinder",
269
+ title: 'FCFinder File Manager',
270
+ width: 900,
271
+ height: 450,
272
+ resizable: 'yes'
273
+ }, {
274
+ setUrl: function (url) {
275
+ win.document.getElementById(field_name).value = url;
276
+ }
277
+ });
278
+ return false;
279
+ }
280
+
281
+ tinymce.init({
282
+ selector: "textarea#elm1",
283
+ theme: "modern",
284
+ file_browser_callback : fcFinderBrowser,
285
+ ....
286
+ ...
287
+ ..
288
+ .
289
+ });
290
+ ```
291
+
292
+ **Resides on the page where fcfinder**
293
+
294
+ ```js
295
+ $("#fcfinder").fcFinder({
296
+ url:"/admin/fcfinder",
297
+ getFileCallback: function(url) {
298
+
299
+ if (typeof(window.opener) !== 'undefined' && window.opener !== null) {
300
+ window.opener.FCFinder.callBack(url);
301
+ window.close();
302
+ }
303
+
304
+ if (typeof(top.tinymce) !== 'undefined' && typeof(top.tinymce) !== null) {
305
+ top.tinymce.activeEditor.windowManager.getParams().setUrl(url);
306
+ top.tinymce.activeEditor.windowManager.close();
307
+ }
308
+
309
+ }
310
+ });
311
+ ```
312
+
313
+ ### Integrated process for the input
314
+
315
+ **the page where input is needed**
316
+
317
+ ```html
318
+ <html>
319
+ <head>
320
+ <script type="text/javascript">
321
+ function openFCFinder(field) {
322
+ window.FCFinder = {
323
+ callBack: function(url) {
324
+ field.value = url;
325
+ }
326
+ };
327
+
328
+ window.open('http://localhost:3000/admin/fcfinder', 'kcfinder_textbox',
329
+ 'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
330
+ 'resizable=1, scrollbars=0, width=950, height=400'
331
+ );
332
+ }
333
+ </script>
334
+ </head>
335
+ <body>
336
+ <input type="text" readonly="readonly" onclick="openFCFinder(this)"
337
+ value="Click here and select a file double clicking on it" style="width:600px;cursor:pointer" />
338
+ </body>
339
+ </html>
340
+ ```
341
+
342
+ **The page where is located the Finder (the Finder parameter setting)**
343
+
344
+
345
+ ```js
346
+ $("#fcfinders").fcFinder({
347
+ url:"/admin/fcfinder",
348
+ getFileCallback: function(url) {
349
+
350
+ if (typeof(window.opener) !== 'undefined' && window.opener !== null) {
351
+ window.opener.FCFinder.callBack(url);
352
+ window.close();
353
+ }
354
+
355
+ if (typeof(top.tinymce) !== 'undefined' && typeof(top.tinymce) !== null) {
356
+ top.tinymce.activeEditor.windowManager.getParams().setUrl(url);
357
+ top.tinymce.activeEditor.windowManager.close();
358
+ }
359
+ }
360
+ });
361
+ ```
362
+