Plugin Directory

Changeset 3589267


Ignore:
Timestamp:
06/28/2026 09:38:09 PM (4 months ago)
Author:
Einden Studio
Message:

Set url link

Location:
ephoto-plugin/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ephoto-plugin/trunk/dist/api.js

    r3509773 r3589267  
    66        /**
    77         * Plugin Ephoto Dam ID
     8         *
     9         * @const {string}
    810         */             
    911        CLIENT_ID : '6BRfJb8u',
    … …  
    1618        /**
    1719         * callback function
     20         *
     21         * @var {null|function}
    1822         */     
    1923        callback : null,
    … …  
    2125        /**
    2226         * instance of Ephoto Dam API
     27         *
     28         * @var {null|object}
    2329         */
    2430        instance : null,
    … …  
    2632        /**
    2733         * connected to Ephoto Dam API
     34         *
     35         * @var {boolean}
    2836         */             
    2937        connected: false,
    … …  
    3139        /**
    3240         * version of Ephoto Dam API
     41         *
     42         * @var {number}
    3343         */     
    3444        version: 0,
    … …  
    3848         *
    3949         * @param {function} callback Set callback after enable function
     50         * @return {void}
    4051         */
    4152        enable: function(callback) {
    42                 if (typeof window.wp === 'undefined'){
     53                if (typeof window.wp === 'undefined') {
    4354                        console.log('Error loading the Wordpress API');
    4455                        return;
    … …  
    123134        /**
    124135         * Set callback function
    125          * 
     136         *
    126137         * @param {function} callback Set callback function
     138         * @return {void}
    127139         */     
    128140        setCallback: function(callback) {
    … …  
    132144        /**
    133145         * Call API
     146         *
     147         * @return {void}
    134148         */     
    135149        call: function() {
    … …  
    147161         * @param {string} html
    148162         * @param {object} dcore
     163         * @return {void}
    149164         */             
    150165        insert: function(html, dcore) {
    151166                if (!html || html === 'not logged in' || !dcore) {
     167                        console.warn('[insert] early return: invalid html or dcore', { html, dcore });
    152168                        return;
    153169                }
    154170
    155                 let self = this;
    156 
    157                 let embed = this.getURLFromString(html, 'embed');
    158                 if (!embed) return;
    159                
    160                 fetch(embed).then(
    161                         function(response) {
    162                                 return response.text();
    163                         }
    164                 )
    165                 .then(
    166                         function(data) {
    167                                 let dctype = self.getValueOfXmlNode(dcore, 'dc:type');
    168        
    169                                 const nodes = jQuery.parseHTML(data);
    170                                 let ogwidth = 0, ogheight = 0, property;
    171 
    172                                 nodes.forEach(function(node) {
    173                                         property = node.getAttribute('property');
    174                                        
    175                                         if (property === 'og:image:width') { ogwidth = node.getAttribute('content'); }
    176                                         if (property === 'og:image:height') { ogheight = node.getAttribute('content'); }
    177                                 });
    178                                
    179                                 let maxsize = 550;
    180 
    181                                 if (ogwidth > maxsize || ogheight > maxsize) {
    182                                         let ratio = ogwidth / ogheight;
    183                                        
    184                                         if (ratio >= 1.0) {
    185                                                 ogwidth = maxsize;
    186                                                 ogheight = Math.round(maxsize  * (1 / ratio));
    187                                         }
    188 
    189                                         else {
    190                                                 ogheight = maxsize ;
    191                                                 ogwidth = Math.round(maxsize  * ratio);
    192                                         }
    193                                 }
    194 
    195                                 let src, type;
     171                let identifier = 0;
     172                const identifierNodes = dcore.getElementsByTagName('dc:identifier');
     173
     174                for (let i = 0; i < identifierNodes.length; i++) {
     175                        const type = identifierNodes[i].getAttribute('ephotodam-dc:type');
     176
     177                        if (type === 'number') {
     178                                identifier = parseInt(identifierNodes[i].textContent.trim(), 10);
     179                                break;
     180                        }
     181                }
     182
     183                if (!identifier) {
     184                        console.error('[insert] dublincore values missing');
     185                        return;
     186                }
     187
     188                const self = this;
     189
     190                const urlInfo = this.instance.getServer() + 'api/' + this.instance.getAuthID() + '/link/getToShare?files[]=' + identifier + '&deadline=-1';
     191
     192                const conn = new XMLHttpRequest();
     193                conn.open("GET", urlInfo);
     194                conn.send();
     195
     196                const parser = new DOMParser();
     197
     198                conn.onreadystatechange = function () {
     199                        if (conn.readyState === 4 && conn.status === 200) {
     200                                const xmlDoc = parser.parseFromString(conn.responseText, "text/xml");
     201                                let src_media = xmlDoc.querySelector('link') ? xmlDoc.querySelector('link').getAttribute("url") : null;
     202
     203                                src_media = src_media ? decodeURIComponent(src_media) : null;
     204
     205                                if (!src_media) {
     206                                        console.error('[insert] Link to share not found');
     207                                        return;
     208                                }
     209
     210                                // Get type of file with dcore and build the embed url and the source url for image if necessary
     211                                const dctype = dcore.getElementsByTagName('dc:type')[0].textContent.trim();
     212                                let type, embed = "";
    196213
    197214                                switch (dctype) {
    198215                                        case 'Image':
    199216                                                type = 'image';
    200                                                 src = self.getURLFromString(data, 'pubpreview');
    201                                                 embed = '';
    202217                                                break;
    203218
    … …  
    205220                                        case 'Sound':
    206221                                                type = 'video';
    207                                                 src = self.getURLFromString(data, 'pubscreenshot');
    208222                                                break;
    209223
    210224                                        case 'Dataset':
     225                                        case 'Text':
     226                                        case 'InteractiveResource':
    211227                                                type = 'book';
    212                                                 src = self.getURLFromString(data, 'pubbook') + '0';
    213228                                                break;
    214229                                }
    215230
    216                                 self.callback({
    217                                         'type' : type,
    218                                         'src' : src,
    219                                         'embed' : embed,
    220                                         'width' : ogwidth,
    221                                         'height' : ogheight,
    222                                         'caption_data': self.buildCaption(dcore)
    223                                 });
    224                         }
    225                 );
    226         },
    227        
     231                                if (type === 'image') {
     232                                        self.getImageSize(src_media, function(w, h) {
     233                                                self.callback({
     234                                                        'type' : type,
     235                                                        'src' : src_media,
     236                                                        'width' : w,
     237                                                        'height' : h,
     238                                                        'caption_data': self.buildCaption(dcore)
     239                                                });
     240                                        });
     241                                }
     242                               
     243                                else {
     244                                        const hasPart = dcore.getElementsByTagName('dcterms:hasPart')[0];
     245                                        const url_small = hasPart ? hasPart.textContent.trim() : null;
     246
     247                                        if (type === 'video') {
     248                                                if (!url_small) {
     249                                                        console.error('[insert] Thumbnail URL not found for video');
     250                                                        return;
     251                                                }
     252
     253                                                self.getVideoSize(src_media, function(w, h) {
     254                                                        const url_medium = url_small.replace('/small/', '/medium/');
     255                                                        const tryImg = new window.Image();
     256
     257                                                        tryImg.onload = function() {
     258                                                                self.callback({
     259                                                                        'type' : type,
     260                                                                        'src' : url_medium,
     261                                                                        'embed' : src_media,
     262                                                                        'width' : w,
     263                                                                        'height' : h,
     264                                                                        'caption_data': self.buildCaption(dcore)
     265                                                                });
     266                                                        };
     267
     268                                                        tryImg.onerror = function() {
     269                                                                self.callback({
     270                                                                        'type' : type,
     271                                                                        'src' : url_small,
     272                                                                        'embed' : src_media,
     273                                                                        'width' : w,
     274                                                                        'height' : h,
     275                                                                        'caption_data': self.buildCaption(dcore)
     276                                                                });
     277                                                        };
     278
     279                                                        tryImg.src = url_medium;
     280                                                });
     281                                        }
     282                                       
     283                                        else if (type === 'book') {
     284                                                const urlBook = self.instance.getServer() + 'api/' + self.instance.getAuthID() + '/file/getInfo?id=' + identifier;
     285                                                const connBook = new XMLHttpRequest();
     286                                                connBook.open("GET", urlBook);
     287                                                connBook.send();
     288
     289                                                connBook.onreadystatechange = function() {
     290                                                        if (connBook.readyState === 4 && connBook.status === 200) {
     291                                                                const xmlBook = parser.parseFromString(connBook.responseText, "text/xml");
     292                                                                const fileNode = xmlBook.querySelector('file');
     293
     294                                                                if (!fileNode) {
     295                                                                        console.error('[insert] <file> not found in getInfo for book');
     296                                                                        return;
     297                                                                }
     298
     299                                                                const embed = decodeURIComponent(fileNode.getAttribute('preview') || '');
     300                                                                const src   = decodeURIComponent(fileNode.getAttribute('medium') || fileNode.getAttribute('small') || '');
     301                                                                let w     = parseInt(fileNode.getAttribute('width'), 10) || 550;
     302                                                                let h     = parseInt(fileNode.getAttribute('height'), 10) || 550;
     303
     304                                                                const maxsize = 550;
     305
     306                                                                if (w > maxsize || h > maxsize) {
     307                                                                        const ratio = w / h;
     308                                                                        if (ratio >= 1.0) { w = maxsize; h = Math.round(maxsize * (1 / ratio)); }
     309                                                                       
     310                                                                        else { h = maxsize; w = Math.round(maxsize * ratio); }
     311                                                                }
     312
     313                                                                if (!embed) {
     314                                                                        console.error('[insert] preview attribute not found in getInfo for book');
     315                                                                        return;
     316                                                                }
     317
     318                                                                self.callback({
     319                                                                        'type' : type,
     320                                                                        'src' : src,
     321                                                                        'embed' : embed,
     322                                                                        'width' : w,
     323                                                                        'height' : h,
     324                                                                        'caption_data': self.buildCaption(dcore)
     325                                                                });
     326                                                        }
     327                                                };
     328                                        }
     329                                }
     330
     331                        }
     332                }
     333
     334        },
     335       
     336       
     337        /**
     338         * Get the dimensions of a video, capped at maxsize
     339         *
     340         * @param {string} src
     341         * @param {function} callback Called with (width, height)
     342         * @return {void}
     343         */
     344        getVideoSize: function(src, callback) {
     345                const maxsize = 550;
     346                const vid = document.createElement('video');
     347
     348                vid.onloadedmetadata = function() {
     349                        let w = vid.videoWidth;
     350                        let h = vid.videoHeight;
     351                        if (w > maxsize || h > maxsize) {
     352                                const ratio = w / h;
     353                                if (ratio >= 1.0) {
     354                                        w = maxsize; h = Math.round(maxsize * (1 / ratio));
     355                                }
     356                               
     357                                else {
     358                                        h = maxsize; w = Math.round(maxsize * ratio);
     359                                }
     360                        }
     361                        callback(w, h);
     362                };
     363
     364                vid.onerror = function() {
     365                        console.error('[getVideoSize] Failed to load video:', src);
     366                        callback(maxsize, maxsize);
     367                };
     368
     369                vid.src = src;
     370        },
     371
     372        /**
     373         * Get the natural dimensions of an image, capped at maxsize
     374         *
     375         * @param {string} src
     376         * @param {function} callback Called with (width, height)
     377         * @return {void}
     378         */
     379        getImageSize: function(src, callback) {
     380                const maxsize = 550;
     381                const img = new window.Image();
     382
     383                img.onload = function() {
     384                        let w = img.naturalWidth;
     385                        let h = img.naturalHeight;
     386                        if (w > maxsize || h > maxsize) {
     387                                const ratio = w / h;
     388                                if (ratio >= 1.0) {
     389                                        w = maxsize; h = Math.round(maxsize * (1 / ratio));
     390                                }
     391                               
     392                                else {
     393                                        h = maxsize; w = Math.round(maxsize * ratio);
     394                                }
     395                        }
     396                        callback(w, h);
     397                };
     398
     399                img.onerror = function() {
     400                        console.error('[getImageSize] Failed to load image:', src);
     401                        callback(maxsize, maxsize);
     402                };
     403
     404                img.src = src;
     405        },
     406
    228407        /**
    229408         * Build the caption width a DublinCore XML Tag DC = [dc:xxxxx]
    … …  
    295474         */             
    296475        getURLFromString: function(str, filter) {
    297                 var re = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-]*)?\??(?:[-+=&;%@.\w]*)#?\w*)?)/gm;
    298                 var m, result = null;
     476                const re = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-]*)?\??(?:[-+=&;%@.\w]*)#?\w*)?)/gm;
     477                let m, result = null;
    299478
    300479                while ((m = re.exec(str)) !== null) {
    … …  
    334513         * @param {boolean} secure Active la sécurisation SSL
    335514         * @param {string} samesite Défini l'option Samesite "Strict" (par défaut), "Lax" ou "None"
     515         * @return {void}
    336516         */
    337517        setCookie: function(name, value, maxage, path, domain, secure, samesite) {
    … …  
    340520                if (samesite === undefined) samesite = 'Strict';
    341521
    342                 var data = name + '=' + escape(value);
     522                let data = name + '=' + escape(value);
    343523                data += maxage!=0 ? '; max-age=' + maxage : '';
    344524                data += (path) ? '; path=' + path : '';
    … …  
    358538         */
    359539        getCookie: function(name) {
    360                 var dc = document.cookie;
    361                 var prefix = name + "=";
    362                 var begin = dc.indexOf("; " + prefix);
     540                const dc = document.cookie;
     541                const prefix = name + "=";
     542                let begin = dc.indexOf("; " + prefix);
    363543               
    364544                if (begin === -1) {
    … …  
    374554                }
    375555               
    376                 var end = document.cookie.indexOf(";", begin);
     556                let end = dc.indexOf(";", begin);
    377557               
    378558                if (end === -1) {
  • ephoto-plugin/trunk/dist/blocks.build.js

    r3509773 r3589267  
    1 !function(e){function t(n){if(a[n])return a[n].exports;var l=a[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var a={};t.m=e,t.c=a,t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});a(1)},function(e,t,a){"use strict";var n=a(2),l=a(3);!function(e){if("undefined"!==typeof e){var t=e.ephotodam.api,__=e.i18n.__,a=e.blocks.registerBlockType,o=e.components,r=o.Placeholder,i=o.Button,m=o.ExternalLink,c=o.ResizableBox;a("ephoto-dam/embed",{title:"Ephoto Dam",description:__("Import your media files from Ephoto Dam software.","ephoto"),icon:n.a.logo,category:"embed",keywords:["Ephoto Dam","Ephoto","Dam"],supports:{align:!0},edit:function(a){var o=a.attributes,p=a.setAttributes,s=a.isSelected,h=a.toggleSelection;if(s&&t.enable(p),o.src){var f=o.type,u=o.src,d=o.embed,g=o.alt,w=o.align,b=o.caption,E=o.caption_data,v=(o.zoom,o.width),k=o.height;if(!v||!k){var L=u&&u.match(/width=(\d+)&(?:amp;)?height=(\d+)/);L&&(v=parseInt(L[1]),k=parseInt(L[2]))}if("image"===f&&!("wide"===w||"full"===w))return[!!s&&l.a.sidebar(o,p),l.a.toolsbar(t),e.element.createElement("figure",{class:"wp-block-image"},e.element.createElement(c,{size:{width:v,height:k},minWidth:"50",minHeight:"50",lockAspectRatio:!0,showHandle:s,enable:{left:"left"!==w,right:"right"!==w,bottom:!0},onResizeStop:function(e,t,a,n){var l="image"===f?"":d.split("?")[0]+"?width="+a.clientWidth+"&height="+a.clientHeight;p({width:a.clientWidth,height:a.clientHeight,embed:l}),h(!0)},onResizeStart:function(){h(!1)}},e.element.createElement("img",{src:u,alt:g})),b?e.element.createElement("figcaption",null,E):"")];if("image"===f)return[!!s&&l.a.sidebar(o,p),l.a.toolsbar(t),e.element.createElement("figure",{class:"wp-block-image"},e.element.createElement("img",{src:u,alt:g}),b?e.element.createElement("figcaption",null,E):"")];var y="p-block-embed wp-block-image wp-block-embed-ephoto-dam is-type-video wp-has-aspect-ratio";"left"!==w&&"right"!==w||(y+=" ephoto-dam-block-align-leftright");var x={maxWidth:v||"",maxHeight:k||"",width:v?"":"auto",height:k?"":"auto"};return[!!s&&l.a.sidebar(o,p),l.a.toolsbar(t),e.element.createElement("figure",{class:y},e.element.createElement("img",{src:u,alt:g,style:x}),b?e.element.createElement("figcaption",null,E):"")]}return[e.element.createElement(r,{className:"wp-block-embed",instructions:__("Import your media files from Ephoto Dam software.","ephoto"),label:"Ephoto Dam",icon:n.a.logo},e.element.createElement("form",null,e.element.createElement(i,{onClick:t.call.bind(t),isSecondary:!0,isLarge:!0},__("Select a file","ephoto"))),e.element.createElement("div",{className:"components-placeholder__learn-more"},e.element.createElement(m,{href:__("https://www.ephoto.fr/")},__("Learn more about Ephoto Dam plugin","ephoto"))))]}})}}(window.wp)},function(e,t,a){"use strict";var n={logo:wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.42 13.98"},wp.element.createElement("path",{d:"M10.63,10.56h0a.33.33,0,0,1-.48,0L9.61,10a.36.36,0,0,1,0-.51h0a.33.33,0,0,1,.48,0l.54.57A.35.35,0,0,1,10.63,10.56Z",transform:"translate(-0.27 -3.03)",fill:"#d91e21"}),wp.element.createElement("path",{d:"M19.56,10.09a.45.45,0,0,0-.64,0l-4.11,4.33a5.24,5.24,0,0,1-7.64,0L5.44,12.56a.43.43,0,0,0-.64,0,.48.48,0,0,0,0,.66l1.73,1.88a6.13,6.13,0,0,0,8.93,0l4.11-4.33A.5.5,0,0,0,19.56,10.09Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M18.21,8.14l-4.67,4.92a3.51,3.51,0,0,1-5.11,0L6.65,11.19a.45.45,0,0,0-.64,0,.5.5,0,0,0,0,.67L7.8,13.73a4.37,4.37,0,0,0,6.37,0l4.68-4.92a.5.5,0,0,0,0-.67A.45.45,0,0,0,18.21,8.14Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M12.19,11.63a1.65,1.65,0,0,1-2.41,0L8,9.78a.43.43,0,0,0-.64,0,.47.47,0,0,0,0,.66L9.14,12.3a2.53,2.53,0,0,0,3.69,0l6-6.32h0L19,5.12l-.82.19h0Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M5.15,5.64a5.24,5.24,0,0,1,7.64,0L14.52,7.5a.44.44,0,0,0,.64,0,.49.49,0,0,0,0-.67L13.44,5A6.11,6.11,0,0,0,4.51,5L.4,9.3A.49.49,0,0,0,.4,10a.47.47,0,0,0,.32.14A.45.45,0,0,0,1,10Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M13.93,8.21,12.15,6.34a4.36,4.36,0,0,0-6.35,0L1.13,11.26a.47.47,0,0,0,0,.64.39.39,0,0,0,.3.13.43.43,0,0,0,.31-.13L6.41,7a3.52,3.52,0,0,1,5.13,0l1.78,1.87a.41.41,0,0,0,.61,0A.47.47,0,0,0,13.93,8.21Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M7.76,8.41a1.66,1.66,0,0,1,2.43,0L12,10.27a.43.43,0,0,0,.61,0,.47.47,0,0,0,0-.64L10.81,7.77a2.53,2.53,0,0,0-3.67,0l-6,6.32h0L1,14.92l.79-.19h0Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}))};t.a=n},function(e,t,a){"use strict";var __=wp.i18n.__,n=wp.editor.InspectorControls,l=wp.blockEditor.BlockControls,o=wp.components,r=o.TextareaControl,i=o.ToggleControl,m=o.PanelBody,c=o.Toolbar,p=(o.AlignmentToolbar,o.IconButton),s={sidebar:function(e,t){var a=e.alt,l=e.caption,o=e.caption_data,c=e.zoom;return wp.element.createElement(n,null,wp.element.createElement(m,{title:__("Settings Ephoto Dam File","ephoto")},wp.element.createElement(i,{label:__("Zoom","ephoto"),checked:!!c,onChange:function(){return t({zoom:!c})}}),wp.element.createElement(r,{label:__("Alternative text (alt)","ephoto"),onChange:function(e){return t({alt:e})},value:a,type:"string",help:__("Describe the object of the image. Leave blank if the image is purely decorative.","ephoto")}),wp.element.createElement(i,{label:__("Caption","ephoto"),checked:!!l,onChange:function(){return t({caption:!l})}}),wp.element.createElement(r,{label:__("Caption format","ephoto"),onChange:function(e){return t({caption_data:e})},value:o,type:"string"})))},toolsbar:function(e){return wp.element.createElement(l,null,wp.element.createElement(c,null,wp.element.createElement(p,{label:__("Change file"),icon:"edit",onClick:e.call.bind(e)})))}};t.a=s}]);
     1!function(e){function t(n){if(a[n])return a[n].exports;var l=a[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var a={};t.m=e,t.c=a,t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});a(1)},function(e,t,a){"use strict";var n=a(2),l=a(3);!function(e){if("undefined"!==typeof e){var t=e.ephotodam.api,__=e.i18n.__,a=e.blocks.registerBlockType,o=e.components,r=o.Placeholder,i=o.Button,m=o.ExternalLink,c=o.ResizableBox;a("ephoto-dam/embed",{title:"Ephoto Dam",description:__("Import your media files from Ephoto Dam software.","ephoto"),icon:n.a.logo,category:"embed",keywords:["Ephoto Dam","Ephoto","Dam"],supports:{align:!0},edit:function(a){var o=a.attributes,p=a.setAttributes,s=a.isSelected,h=a.toggleSelection;if(s&&t.enable(p),o.src){var f=o.type,u=o.src,d=o.embed,g=o.alt,w=o.align,b=o.caption,E=o.caption_data,v=(o.zoom,o.width),k=o.height;if(!v||!k){var L=u&&u.match(/width=(\d+)&(?:amp;)?height=(\d+)/);L&&(v=parseInt(L[1]),k=parseInt(L[2]))}if("image"===f&&!("wide"===w||"full"===w))return[!!s&&l.a.sidebar(o,p),l.a.toolsbar(t),e.element.createElement("figure",{class:"wp-block-image"},e.element.createElement(c,{size:{width:v,height:k},minWidth:"50",minHeight:"50",lockAspectRatio:!0,showHandle:s,enable:{left:"left"!==w,right:"right"!==w,bottom:!0},onResizeStop:function(e,t,a,n){var l="image"===f?"":d.split("?")[0]+"?width="+a.clientWidth+"&height="+a.clientHeight;p({width:a.clientWidth,height:a.clientHeight,embed:l}),h(!0)},onResizeStart:function(){h(!1)}},e.element.createElement("img",{src:u,alt:g})),b?e.element.createElement("figcaption",null,E):"")];if("image"===f)return[!!s&&l.a.sidebar(o,p),l.a.toolsbar(t),e.element.createElement("figure",{class:"wp-block-image"},e.element.createElement("img",{src:u,alt:g}),b?e.element.createElement("figcaption",null,E):"")];var y="p-block-embed wp-block-image wp-block-embed-ephoto-dam is-type-video wp-has-aspect-ratio";"left"!==w&&"right"!==w||(y+=" ephoto-dam-block-align-leftright");var x={width:v?v+"px":"auto",height:k?k+"px":"auto",objectFit:"cover"};return[!!s&&l.a.sidebar(o,p),l.a.toolsbar(t),e.element.createElement("figure",{class:y},e.element.createElement("img",{src:u,alt:g,style:x}),b?e.element.createElement("figcaption",null,E):"")]}return[e.element.createElement(r,{className:"wp-block-embed",instructions:__("Import your media files from Ephoto Dam software.","ephoto"),label:"Ephoto Dam",icon:n.a.logo},e.element.createElement("form",null,e.element.createElement(i,{onClick:t.call.bind(t),isSecondary:!0,isLarge:!0},__("Select a file","ephoto"))),e.element.createElement("div",{className:"components-placeholder__learn-more"},e.element.createElement(m,{href:__("https://www.ephoto.fr/")},__("Learn more about Ephoto Dam plugin","ephoto"))))]}})}}(window.wp)},function(e,t,a){"use strict";var n={logo:wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.42 13.98"},wp.element.createElement("path",{d:"M10.63,10.56h0a.33.33,0,0,1-.48,0L9.61,10a.36.36,0,0,1,0-.51h0a.33.33,0,0,1,.48,0l.54.57A.35.35,0,0,1,10.63,10.56Z",transform:"translate(-0.27 -3.03)",fill:"#d91e21"}),wp.element.createElement("path",{d:"M19.56,10.09a.45.45,0,0,0-.64,0l-4.11,4.33a5.24,5.24,0,0,1-7.64,0L5.44,12.56a.43.43,0,0,0-.64,0,.48.48,0,0,0,0,.66l1.73,1.88a6.13,6.13,0,0,0,8.93,0l4.11-4.33A.5.5,0,0,0,19.56,10.09Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M18.21,8.14l-4.67,4.92a3.51,3.51,0,0,1-5.11,0L6.65,11.19a.45.45,0,0,0-.64,0,.5.5,0,0,0,0,.67L7.8,13.73a4.37,4.37,0,0,0,6.37,0l4.68-4.92a.5.5,0,0,0,0-.67A.45.45,0,0,0,18.21,8.14Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M12.19,11.63a1.65,1.65,0,0,1-2.41,0L8,9.78a.43.43,0,0,0-.64,0,.47.47,0,0,0,0,.66L9.14,12.3a2.53,2.53,0,0,0,3.69,0l6-6.32h0L19,5.12l-.82.19h0Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M5.15,5.64a5.24,5.24,0,0,1,7.64,0L14.52,7.5a.44.44,0,0,0,.64,0,.49.49,0,0,0,0-.67L13.44,5A6.11,6.11,0,0,0,4.51,5L.4,9.3A.49.49,0,0,0,.4,10a.47.47,0,0,0,.32.14A.45.45,0,0,0,1,10Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M13.93,8.21,12.15,6.34a4.36,4.36,0,0,0-6.35,0L1.13,11.26a.47.47,0,0,0,0,.64.39.39,0,0,0,.3.13.43.43,0,0,0,.31-.13L6.41,7a3.52,3.52,0,0,1,5.13,0l1.78,1.87a.41.41,0,0,0,.61,0A.47.47,0,0,0,13.93,8.21Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}),wp.element.createElement("path",{d:"M7.76,8.41a1.66,1.66,0,0,1,2.43,0L12,10.27a.43.43,0,0,0,.61,0,.47.47,0,0,0,0-.64L10.81,7.77a2.53,2.53,0,0,0-3.67,0l-6,6.32h0L1,14.92l.79-.19h0Z",transform:"translate(-0.27 -3.03)",fill:"#20325f"}))};t.a=n},function(e,t,a){"use strict";var __=wp.i18n.__,n=wp.editor.InspectorControls,l=wp.blockEditor.BlockControls,o=wp.components,r=o.TextareaControl,i=o.ToggleControl,m=o.PanelBody,c=o.Toolbar,p=(o.AlignmentToolbar,o.IconButton),s={sidebar:function(e,t){var a=e.alt,l=e.caption,o=e.caption_data,c=e.zoom;return wp.element.createElement(n,null,wp.element.createElement(m,{title:__("Settings Ephoto Dam File","ephoto")},wp.element.createElement(i,{label:__("Zoom","ephoto"),checked:!!c,onChange:function(){return t({zoom:!c})}}),wp.element.createElement(r,{label:__("Alternative text (alt)","ephoto"),onChange:function(e){return t({alt:e})},value:a,type:"string",help:__("Describe the object of the image. Leave blank if the image is purely decorative.","ephoto")}),wp.element.createElement(i,{label:__("Caption","ephoto"),checked:!!l,onChange:function(){return t({caption:!l})}}),wp.element.createElement(r,{label:__("Caption format","ephoto"),onChange:function(e){return t({caption_data:e})},value:o,type:"string"})))},toolsbar:function(e){return wp.element.createElement(l,null,wp.element.createElement(c,null,wp.element.createElement(p,{label:__("Change file"),icon:"edit",onClick:e.call.bind(e)})))}};t.a=s}]);
  • ephoto-plugin/trunk/readme.txt

    r3509775 r3589267  
    44Requires at least: 6.0
    55Tested up to: 7.0.0
    6 Stable tag: 3.2.0
     6Stable tag: 3.2.1
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    2626
    2727== Changelog ==
     28
     29= 3.2.1 =
     30* Set url link
     31* Minor bug fix
    2832
    2933= 3.2.0 =
Note: See TracChangeset for help on using the changeset viewer.