Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elfinder does not open #3

Closed
Ande1232 opened this issue Nov 25, 2016 · 15 comments
Closed

Elfinder does not open #3

Ande1232 opened this issue Nov 25, 2016 · 15 comments

Comments

@Ande1232
Copy link

Hi, I have followed the readme file, the "file manager" button appears, but when I click the button, the error from console

Uncaught TypeError: $(...).dialogelfinder is not a function(…)

elfinderDialog @ admin.php?p=articolo&sk=crea:157

click @ summernote-ext-elfinder.js:35

dispatch @ jquery.js:4435

elemData.handle @ jquery.js:4121

This is my source:

http://pastebin.com/MZacyRVk

@Ande1232
Copy link
Author

I solved the problem, only that when I double-click on an image, is entered in the editor.

I have the same error of this person. You can help us find a solution?

@semplon
Copy link
Owner

semplon commented Jan 5, 2017

@Ande1232 let me know the browser console log for the error

@moxley5658
Copy link

@Ande1232, can you post you solution so that others with that issue can use that.. Like me :)

@semplon
Copy link
Owner

semplon commented Sep 24, 2017

@moxley5658 can you share your code ? so i can inspect it ?

@moxley5658
Copy link

moxley5658 commented Sep 24, 2017 via email

@ghost
Copy link

ghost commented Sep 24, 2017

You asked me via email, This is what I'm pulling in to make things work.

<script src="core/js/jquery-2.1.3.min.js"></script>
<script src="core/js/jquery-ui.min.js"></script>
<script src="core/js/bootstrap.min.js"></script>
<script src="core/js/summernote.js"></script>
<script src="core/js/plugin/elfinder/elfinder.js"></script>
<script src="core/elfinder/js/elfinder.min.js"></script>

The script second from bottom contains the scripting needed to tie Summernote to elFinder.
And you need the below inlined into the page


function mediaDialog(id,t,c){
 var fm=$('<div/>').dialogelfinder({
 url:'http://localhost/LibreCMS/core/elfinder/php/connector.php',
/* Change the above location to suite your installation */
  lang:'en',
  width:840,
  height:450,
  destroyOnClose:true,
  useBrowserHistory:false,
  uiOptions:{
    cwd:{
      getClass:function(file){
        if(file.name.match(/archive/i)){
          return'archive-folder';
       }else if(file.name.match(/attachment/i)){
         return'attachments-folder';
       }else if(file.name.match(/avatar\|user\|users/i)){
         return'users-folder';
       }else if(file.name.match(/backup/i)){
         return'backup-folder';
       }else if(file.name.match(/carousel\|featured/i)){
         return'featured-folder';
       }else if(file.name.match(/order/i)){
         return'orders-folder';
       }else if(file.name.match(/photo\|picture\|image/i)){
         return'picture-folder';
       }else if(file.name.match(/doc/i)){
         return'document-folder';
       }else if(file.name.match(/vid\|mov/i)){
         return'video-folder';
       }else{
         return'';
       }
     }
   }
  },
  getFileCallback:function(files,fm){
/* This section is for using elFinder within a form file input */
    if(id>0){
      $('#'+c).val(files.url);
        if(t!='media'){
          $('#'+c+'image').attr('src',files.url);
          update(id,t,c,files.url);
        }
/* End: This section is for using elFinder within a form file input */
     }else{
       if(files.url.match(/\.(jpeg\|jpg\|gif\|png)$/)){
         $('.summernote').summernote('editor.insertImage',files.url);
       }else{
         $('.summernote').summernote('createLink',{
           text:files.name,
           url:files.url,
           newWindow:true
         });
       }
   }
   },
   commandsOptions:{
    getfile:{
     oncomplete:'close',
     folders:false
    }
   }
  }).dialogelfinder('instance');
 }

@semplon
Copy link
Owner

semplon commented Sep 24, 2017

@moxley5658 did you had load the jquery-ui ? jquery-ui must be loaded to make this work

@ghost
Copy link

ghost commented Sep 24, 2017

You also need to watch the order of loading the scripts in the document.

@moxley5658
Copy link

moxley5658 commented Sep 24, 2017 via email

@moxley5658
Copy link

moxley5658 commented Sep 24, 2017 via email

@moxley5658
Copy link

moxley5658 commented Sep 24, 2017 via email

@semplon
Copy link
Owner

semplon commented Sep 24, 2017

okay, awsome. now please take a look at this part.
url : 'js/plugins/summernote/connector.minimal.php', // change with the url of your connector

this should be the url with http protocol where your connector located. it's usually at the elfinder itself.

@ngrcode
Copy link

ngrcode commented Nov 23, 2018

please help me I dont have this file connector.php how can I get it?

@semplon
Copy link
Owner

semplon commented Dec 20, 2019

@ngrcode the connector file can be found at your elfinder folder.

studio-42:

  • elfinder
    • connector.minimal.php-dist

open this file. rename it or copy it to other file. you can insert this connector to the js code.

@semplon semplon closed this as completed Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants