voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.71k stars 501 forks source link

Integrating responsivefilemanager in mosaico #587

Closed zuludevteam closed 4 years ago

zuludevteam commented 4 years ago

Hi,

I gone through your demo and found that file manager was integrated using MoxieManager and due to licensing issues didn't have that feature for us.

So, here i planned to integrate the opensource filemanager https://www.responsivefilemanager.com/ in mosaico.

Can you please help me to integrate ?

bago commented 4 years ago

You have to create a viewModel plugin: https://github.com/voidlabs/mosaico/wiki/Mosaico-Plugins#viewmodel-plugins

Then you can implement the methods:

  vm.linkDialog = function() {
    var inputElement = this;
    var href = $(inputElement).val();
   // then your code to open your file manager and to make sure to set the "href" back with the selected option:
   //  $(inputElement).val(somethingfromyourfilemanager).change();
  };

You can do something similar for selecting images or editing images by implementing the

  vm.editImage = function(src, done) {
    // here you can read the current image src with "src()" and then set the new image source with "src(newimagesource)".
  };
  vm.selectImage = function(src) {
    // here you can read the current image src with "src()" and then set the new image source with "src(newimagesource)".
  };