semplon / summernote-ext-elfinder

Summernote Plugin for elFinder File Manager
MIT License
24 stars 21 forks source link

Uncaught ReferenceError: elfinderDialog is not defined #6

Open mcpdeveloper443 opened 3 years ago

mcpdeveloper443 commented 3 years ago

Hi @semplon semplon ,

I followed below url for summernote-ext-elfinder.js:35 Uncaught ReferenceError: elfinderDialog is not defined

I could not able to solve this issue , please help on this, When i click on file manager , i am getting above error i tried all possibilities. but no luck!

2 (comment)

also my reference is like below scripts/jquery-2.14.js, scripts/jquery-ui-1.9.0.js scripts/summernote/summernote.min.js scripts/elFinder-2.1.57/js/elfinder.min.js scripts/summernote/summernote-ext-elfinder.js

Thanks for your help appreciated !

semplon commented 3 years ago

hello @mcpdeveloper443 for this version please refer to this wiki page https://github.com/Studio-42/elFinder/wiki/Integration-with-Multiple-Summernote-(fixed-functions)

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Thanks for that ..it worked with older version , it was issue in calling elfinderDialog , now i am able to open file manager , but after that below error occuring.

Uncaught Error: cannot call methods on tooltip prior to initialization; attempted to call method 'hide'

I have used below scripts order too : scripts/jquery-2.14.js, scripts/jquery-ui-1.9.0.js scripts/bootstrap.js scripts/summernote/summernote.min.js scripts/elFinder-2.1.57/js/elfinder.min.js scripts/summernote/summernote-ext-elfinder.js

but no use : please help on this.

semplon commented 3 years ago

okay I will try to run test with your specification I will let You know when it's worked.

semplon commented 3 years ago

Hi, i've tried it and it worked fine

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Jekyll v4.1.1">
    <title>Starter Template · Bootstrap</title>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha512-Dop/vW3iOtayerlYAqCgkVr2aTr2ErwwTYOvRFUpzl2VhCMJyjQF0Q9TjUXIo6JhuM/3i0vVEt2e/7QQmnHQqw==" crossorigin="anonymous" />
    <!-- Custom styles for this template -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/elfinder/2.1.3/css/elfinder.min.css" integrity="sha512-O8KRDwVBd1xG5U9Y3m+IeoywscB4K/M6hrBSX0Bd0PL9tlbLhKdtPtIPOPQPE1nVvxi0nQRFkV5SMMdZceZiVA==" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.0/themes/base/jquery-ui.min.css" integrity="sha512-lE0QNAJLkgJOpwIyd/QjUtOPpASCh63P8GMoWXoP/uINWjM/w33Me0ypq8tntHFZqxo20+qfjvOFFZfi4uSCsA==" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.0/css/font-awesome.min.css" integrity="sha512-qzsydzu6gfStN6UWt9NizKtvHV1hEagyv1teXmjtgDkV7MG/dFrjAtY81gAlJh2NAkYrSGDPc/iW25JKvtSdfw==" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.10/summernote.css" integrity="sha512-XL6+jEjiH475eq0Y+dianRPgwgJ1GO0dCzYGlYkbeCSAZI0Q0APd+CkyoNfo6Sw4pW6Zz+5cQjCSCV43ZdRsNg==" crossorigin="anonymous" />
  </head>
  <body>

<main role="main" class="container">

    <textarea id="summernote" name="editordata"></textarea>

</main><!-- /.container -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha512-AFwxAkWdvxRd9qhYYp1qbeRZj6/iTNmJ2GFwcxsMOzwwTaRwz2a/2TX225Ebcj3whXte1WGQb38cXE5j7ZQw3g==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js" integrity="sha512-vg90JFVLzr2nqlpxo2N2XiSRzbnYny4KFQCC5lJ9MvvROQkyQIVaor5CKl46ZPYBAB0WgSliOj9pBuTESp2PHw==" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha512-oBTprMeNEKCnqfuqKd6sbvFzmFQtlXS3e0C/RGFV0hD6QzhHV+ODfaQbAlmY6/q0ubbwlAM/nCJjkrgA3waLzg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.10/summernote.min.js" integrity="sha512-ApMvhtP5ffHldKYU0ELi1WUvtjROaDS5YsKD5I6QYJDHU5ToKXqcBODSz5kqo17ZS2PzanGF3+8WlupZeWnV/Q==" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/elfinder/2.1.3/js/elfinder.min.js" integrity="sha512-kz5Sk3oIsB1CxO1j2+pgeZjpRn8Tn864/Efi5kIdbjtWoyv57n0OuRHtiXlV08DR2c/jaCV/UprNPmZ9ygzYkQ==" crossorigin="anonymous"></script>
<script src="ext-elfinder.js"></script>
<script>
$(document).ready(function() {
  $('#summernote').summernote({
    height: 200,
    tabsize: 2,
    toolbar: [
        ['style', ['bold', 'italic', 'underline', 'clear']],
        ['insert', ['elfinder']]
    ]
  });
});

function elfinderDialog() {
    var fm = $('<div/>').dialogelfinder({
        url : 'https://path.to/your/connector.php', // change with the url of your connector
        lang : 'en',
        width : 840,
        height: 450,
        destroyOnClose : true,
        getFileCallback : function(files, fm) {
            console.log(files);
            $('#summernote').summernote('editor.insertImage', files.url);
        },
        commandsOptions : {
            getfile : {
            oncomplete : 'close',
            folders : false
            }
        }
    }).dialogelfinder('instance');
  }
</script>
</html>

it worked fine,

image

please try it and let me know if it;s work.

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Sorry to ask what is the latest changes you have done above ? i could not able to identify ....

Please help on this ..

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

I tried your above code alone into separate new HTML page , below error occurs.

I called php connector page exactly , dont know how to load images on this file manger.

Do i need to edit any thing in php connector page ?

image

semplon commented 3 years ago

to work with elfinder, you should define the php connector, see this sample at elfinder repository https://github.com/Studio-42/elFinder/blob/master/php/connector.minimal.php-dist .

run it on xampp webserver. so the php file can be called correctly.

image

see this part, this must be accessible via browser using http.

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Thanks for information.

Also i dont know about PHP . can we call this php connector in my c# application directly , do we need extra server to support PHP ?

semplon commented 3 years ago

it can, just upload the php directory of elfinder and fit it with your requirement. it's best to upload on a webhosting. so it can be accessed online via internet.

mcpdeveloper443 commented 3 years ago

Hi @semplon , THanks . I have uploaded PHP folder in my IIS. then below error occurs image

Also on my html page below error

image

Please help on this. Thanks in advance.

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Some progress now , i added few php modules in IIS and uploaded PHP folder into IIS, below error is occuring now.

image

Below error in html page :

image

semplon commented 3 years ago

try this https://stackoverflow.com/questions/13421463/htaccess-access-control-allow-origin

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Thanks.

With samples , i can able to open elfinder finally ,

image

May i know some special characters are adding into URL , may i know what is this .

I want to implement the same in my appplication , but due to this specialcharatcer in url , i dont know about it.

elfinder.src.html#elf_l1_Lw

Please help o this......

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Please show some light on this :)))

semplon commented 3 years ago

elfinder.src.html#elf_l1_Lw

that url generated automatically by elfinder, i think you should try to make your application can follow redirect

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Thanks for that. I have added the same into my dotnet application.

But i am getting below error , not sure.

Invalid backend response. Data is not JSON.

Is it due to that taken redirection cause ?

image

also noticed below url call .

image

Please help on this...thanks always for your help !

mcpdeveloper443 commented 3 years ago

Hi @semplon ,

Thanks for your efforts and time , please show some light on this issue.....

semplon commented 3 years ago

your application is working fine, this problem occur with php output. try to modify php-connector and see what happen.

mcpdeveloper443 commented 3 years ago

Hi @semplon

I tried by uncommenting //'debug' => true in conector.minimal.php ,

but no change.....any clue how to resolve further , thanks always for your help !

semplon commented 3 years ago

Hi @mcpdeveloper443 there are several ways to check what's going on with the php connector.

  1. see the error log, and find the error when accessing the file manager.
  2. try to modify the php-connector with standard/default configuration and see what happen.

the php connector didn't output the correct json data for elfinder. it could be there are something wrong with the settings.