mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.3 KiB
2 lines
1.3 KiB
/*! grapesjs-aviary - 0.0.4 */
|
|
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["grapesjs-aviary"]=n():e["grapesjs-aviary"]=n()}(this,function(){return function(e){function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n){"use strict";var t="gjs-aviary";grapesjs.plugins.add(t,function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n,r=e.getModel(),a=void 0,i={key:"1",onApply:null,getFilename:null,closeOnApply:!0,config:{}};for(var c in i)c in o||(o[c]=i[c]);var p=o.config;p.apiKey=o.key,p.onSave=function(e,n){a.set("src",n);var t="function"==typeof o.getFilename?o.getFilename:u,r=t(a),i="function"==typeof o.onApply?o.onApply:f;i(n,r,a),o.closeOnApply&&s.close()};var s=new Aviary.Feather(p),l=e.Commands,u=function(e){var n=e.get("src").split("/").pop();return Date.now()+"_"+n.slice(-15)},f=function(n,t){e.AssetManager.add({src:n,name:t})},d=document.createElement("img");l.add("image-editor",{run:function(e,n,o){var i=o||{},c=i.model||e.getSelected();a=c,d.src=c.get("src"),s.launch({image:d}),r.trigger(t+":launch",c,s)}})})}])});
|