Giter Site home page Giter Site logo

ep_image_upload's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar ilmartyrk avatar johnmclear avatar lisandi avatar ovari avatar rhansen avatar tiblu avatar translatewiki avatar woeterman94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ep_image_upload's Issues

Support image uploads as embedded Base64 inside the document

Overview

Please add support for the uploaded files to be embedded in Base64.

Cons of external references:

  • Document should be complete, specially when we're talking about signed documents. The data needs to be in one place and not changing. When you refer images from other sources, there is no guarantee them to exist and be unmodified.
  • All migrations are a hassle - as the files are referenced from other domains, you need to migrate the images separately and then update the references in the document BUT that modifies the doc.
  • All exports are a hassle - to export a document in a different format, you need to download all the referred images and embed them.

Pros of the external references:

  • Smaller EP database size = quicker backups, less problems with disk space.
  • EP scales better as load is distributed, less data read and written.

TODO:

  • Enable uploaded image to be embedded in Base64
  • Make sure embedded Base64 images have same restrictions possible as for other images. (file size and format limits).
  • Base64 to be the default configuration.
  • IF possible, downscale oversize images to fit the limits.

Line numbering is broken -- Testing in Azure

Hello! I love this plugin, by the way.

I just got Etherpad set up and running in Azure. I mention this becausetThere were a number of issues that had to be addressed in Etherpad-Lite to support Azure, so the hosting environment might introduce some issues for the plugin as well.

Image uploading via copy/paste, drag/drop and the upload button seem to be working fine. But the line number spacing gets weird.

In this image, I added a CSS rule via the Developer Tools console to resize the images to 25%. You can see that the line numbers resize reasonably.

image

However, when I remove my CSS change, the spacing between the line numbers increases, but it seems to grow independent of the document context frame, and now I can't scroll down to view the rest of the document.

image

There are no client or server side errors.

If I disable line numbers then the extra space at the bottom goes away, but I can't scroll down to see the rest of the document.

image

I can scroll with the cursor, but there are no scroll bars. I added a bunch of text at the top of the document (to push the images off screen) and this did not cause scrollbars to appear.

Please let me know if there's any additional information that I could provide!

Add Drag and Drop feature

Amazing plugin. The only thing missing is to drag a file from the Windows Explorer into the Etherpad document, and then having the ep_image_upload plugin doing the upload (base64 conversion).

Could this be implemented?

failed to load ... for ...

Failed to load 'ep_markdownify/static/js/index' for 'ep_markdownify/main/client_hooks/aceEditorCSS': Error: The module at "ep_etherpad-lite/static/js/security.js" does not exist. 
Failed to load 'ep_markdownify/static/js/index:aceGetFilterStack' for 'ep_markdownify/main/client_hooks/aceGetFilterStack': Error: The module at "ep_etherpad-lite/static/js/security.js" does not exist. 
Failed to load 'ep_markdownify/static/js/index:aceCreateDomLine' for 'ep_markdownify/main/client_hooks/aceCreateDomLine': Error: The module at "ep_etherpad-lite/static/js/security.js" does not exist.

This results in a spinner of the left side but none of the image functionality works. Etherpad-lite 1.8.0 running inside the official etherpad docker image. settings.json had been updated with proper settings.

publish to npm?

The code installed from NPM is different than the code in this repo.
Is there a reason for this?

Add image scaling

Add functionality to scale images inside document. Best way would be, to add a scale handler that enables users to scale images to their preferred size inside document

TypeError: clientVars.ep_image_upload is undefined

etherpad 1.9.7, node 21.7.1

Attempting to install this plugin on an Etherpad lite 1.9.7 instance, however I am getting the error message TypeError: clientVars.ep_image_upload is undefined whenever I try uploading an image.

I DO have the following in my settings.json:

  "ep_image_upload": {
        "fileTypes": ["jpeg", "jpg", "bmp", "gif", "png"],
        "maxFileSize": 5000000
  }

And on the terminal where I am running the etherpad server I see:

[2024-03-13T12:59:16.456] [WARN] client - TypeError: clientVars.ep_image_upload
is undefined -- {
  errorId: 'eAJC4Fkkelumyyls0tm1',
  type: 'Uncaught exception',
  msg: 'TypeError: clientVars.ep_image_upload is undefined',
  url: 'http://192.168.12.80:9001/p/quartus-notes',
  source: 'http://192.168.12.80:9001/static/js/require-kernel.js?v=29e99f08 line 1 > Function',
  linenumber: 3,
  userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0',
  stack: '_isValid@http://192.168.12.80:9001/static/js/require-kernel.js?v=29e99f08 line 1 > Function:3:303\n' +
    '(module ep_image_upload/static/js/toolbar.js)/exports.postToolbarInit/</<@http://192.168.12.80:9001/static/js/require-kernel.js?v=29e99f08 line 1 > Function:3:1429\n' +
    'dispatch@http://192.168.12.80:9001/javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define&v=29e99f08:18:39815\n' +
    '(module ep_etherpad-lite/static/js/vendors/jquery.js)/</add/v.handle@http:/
/192.168.12.80:9001/javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?ca
llback=require.define&v=29e99f08:18:37806\n'
}

Yes, I have checked to make sure everything is spelled correctly, that I am NOT using smart quotes, etc.

I don't have any problems with any other plugins that store their settings in settings.json Not sure what the problem is, I can't think of anything else that could be at fault.

images uploaded with ep_copy_paste_images are not displayed

I've recently upgraded to ep_image_upload from the ep_copy_paste_images plugin, and looks like images that have been added to a pad using the old plugin are not displayed correctly. The image data is still there and it can be fixed manually.

The exported html includes the complete img tag as src like so

<img src="<img src="data:image/jpeg;base64 ... ">">

upgrade from ep_copy_paste_images fails

Hi,
this is not a bug in this package, but I don't really know,
where the "deprecation" warning of ep_copy_paste_images
is generated.
Anyway, trying to npm-install the plugin ep_copy_paste_images said,
I should use ep_upload_images instead, which does not exist.
Only on the website of copy_paste_images I found the correct link to here.

Go ahead an close this issue, if you think this is too minor to be hunted down.
Cheers

Invalid URL TypeError

Since a plugin update today to [email protected] and [email protected] we get on a EP 1.8.7 at each upload:

[2021-02-14 23:19:48.971] [ERROR] console - TypeError [ERR_INVALID_URL]: Invalid URL: testing1/ba1e83de-1b80-427a-9ce8-2c6780076.jpeg
    at new NodeError (node:internal/errors:329:5)
    at onParseError (node:internal/url:282:9)
    at new URL (node:internal/url:358:5)
    at new URL (node:internal/url:355:22)
    at Busboy.<anonymous> (/opt/etherpad-lite/node_modules/ep_image_upload/index.js:132:24)
    at Busboy.emit (node:events:378:20)
    at Busboy.EventEmitter.emit (node:domain:470:12)
    at Busboy.emit (/opt/etherpad-lite/node_modules/busboy/lib/main.js:38:33)
    at PartStream.<anonymous> (/opt/etherpad-lite/node_modules/busboy/lib/types/multipart.js:213:13)
    at PartStream.emit (node:events:378:20)
    at PartStream.EventEmitter.emit (node:domain:470:12)
    at HeaderParser.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/Dicer.js:51:16)
    at HeaderParser.emit (node:events:378:20)
    at HeaderParser.EventEmitter.emit (node:domain:470:12)
    at HeaderParser._finish (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:68:8)
    at SBMH.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:40:12)
[2021-02-14 23:19:48.971] [INFO] console - Stopping Etherpad...

settings.json includes:

"ep_image_upload": {
    "storage": {
      "type": "local",
      "baseFolder": "/mnt/data/etherpad-lite/upload",
      "baseURL": "https://ourpad.net/up/"
    },
    "fileTypes": ["jpeg","jpg","bmp","gif","png"],
    "maxFileSize": 5000000
},

This has worked fine before. Uninstalling the plugin for now, as it causes exceptions.

Deleting locally stored images

Images do not get deleted when using storage type local. This results in a BIG images folder on my instance (many users, many pads, many images).

toolbar icon should not be visible in read-only mode

When I open a read-only link the Icon is still there and clickable. I can even write something and insert the picture. It is shown inside the document, but gladly only locally. It is not shown to other authors and visitors.

But this behaviour can be confusing to visitors.

Error: Cannot find module 'graceful-fs'

On a fresh etherpad install this plugin doesn't work.

I did the typical install:


git clone --branch master https://github.com/ether/etherpad-lite.git
cd etherpad-lite
./bin/run.sh --root

and then I installed ep_image_upload from admin page.

this is the error I'm receiving:
[2024-04-05T20:10:53.182] [ERROR] settings - Failed to load hook function "/opt/etherpad-lite-git-04042024/src/plugin_packages/ep_image_upload/index:clientVars" for plugin "ep_image_upload" part "ep_image_upload" hook set "hooks" hook "clientVars": Error: Cannot find module 'graceful-fs'

please, don't hesitate to ask for further info.

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm
npm -v
10.5.1

Show other file types as download link

Other file types than images are not shown as download link.

Bildschirmfoto_dateien_falsch

As the sister plugin ep_fileupload has an unresolved cross origin issue redhog/ep_fileupload#24 and is un-usable, it would be nice to extend the functionality by showing a download link for non-image MIME types.
"fileTypes": ["jpeg","jpg","bmp","gif","png","pdf","mp4","ogg","mp3","webm","wav","md","rtf","tex","txt","doc","docx","xls","xlsx","pptx","ods","odt","odp","html","pages","py","zip"],

TypeError of class constructor URL

We see this at each upload on a fresh EP, which causes it to stop:

[2021-02-04 09:27:09.385] [ERROR] console - TypeError: Class constructor URL cannot be invoked without 'new'
    at Busboy.<anonymous> (/opt/etherpad-lite/node_modules/ep_image_upload/index.js:153:28)
    at Busboy.emit (node:events:378:20)
    at Busboy.EventEmitter.emit (node:domain:470:12)
    at Busboy.emit (/opt/etherpad-lite/node_modules/busboy/lib/main.js:38:33)
    at PartStream.<anonymous> (/opt/etherpad-lite/node_modules/busboy/lib/types/multipart.js:213:13)
    at PartStream.emit (node:events:378:20)
    at PartStream.EventEmitter.emit (node:domain:470:12)
    at HeaderParser.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/Dicer.js:51:16)
    at HeaderParser.emit (node:events:378:20)
    at HeaderParser.EventEmitter.emit (node:domain:470:12)
    at HeaderParser._finish (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:68:8)
    at SBMH.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:40:12)
    at SBMH.emit (node:events:378:20)
    at SBMH.EventEmitter.emit (node:domain:470:12)
    at SBMH._sbmh_feed (/opt/etherpad-lite/node_modules/streamsearch/lib/sbmh.js:159:14)
    at SBMH.push (/opt/etherpad-lite/node_modules/streamsearch/lib/sbmh.js:56:14)

in settings.json:

"ep_image_upload":{
    "storage":{
      "type": "local",
      "baseFolder": "/mnt/data/etherpad-lite/upload",
      "baseURL": "https://padurl.net/up/"
    },
    "fileTypes": ["jpeg","jpg","bmp","gif","png"],
    "maxFileSize": 5000000
  },

[FR] auto create pad folder on pad creation ?

Hello
I have an issue with ab other plugin (to remove pads from admin UI)

ep_adminpads2 crash when removing a pad ... because he try to do something with the upload folder I setting up to use ep_image_upload (in local)

Maybe ep_image_upload is declaring something that dont exists ?
Or automatically do a symbolic linking to every pads (even if no image upload) ?

Thanks, very cool plugin

BUG: Error messages not looking like errors.

Error message popup looks a little weird. Probably needs some style/text update.
Probably should use gritter-container. Example from src code:
$.gritter.add({ title: 'Error', text: html10n.get('pad.noCookie'), sticky: true, class_name: 'error', });

BUG: Support to configure upload image button (addImage) in toolbar has been lost

Reproduce

This USED TO BE a valid configuration:

"toolbar": {
    "left": [
      ....
      [
        "fontColor",
        "addFootNote",
        "addImage"
      ]
    ],

But, as toolbar action addImage has been lost, this throws an error when toolbar is loaded:

TypeError: /home/m/dev/etherpad-lite-heroku/etherpad-lite/node_modules/ep_etherpad-lite/templates/pad.html:70
    68|       <ul class="menu_left" role="toolbar">
    69|           <% e.begin_block("editbarMenuLeft"); %>
 >> 70|           <%- toolbar.menu(settings.toolbar.left, isReadOnly, 'left', 'pad') %>
    71|           <% e.end_block(); %>
    72|       </ul>
    73|       <ul class="menu_right" role="toolbar">

Cannot create property 'grouping' on boolean 'false'
    at ButtonsGroup.render (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node/utils/toolbar.js:65:35)
    at _.map (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node/utils/toolbar.js:272:76)
    at Function.map (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/underscore/underscore.js:1329:24)
    at Object.menu (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node/utils/toolbar.js:272:22)
    at eval (eval at compile (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/ejs/lib/ejs.js:662:12), <anonymous>:69:25)
    at pad (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/ejs/lib/ejs.js:692:17)
    at Object.exports.require (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node/eejs/index.js:94:15)
    at args.app.get (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node/hooks/express/specialpages.js:57:19)
    at Layer.handle [as handle_request] (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/express/lib/router/layer.js:95:5)
    at /home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/express/lib/router/index.js:281:22
    at param (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/express/lib/router/index.js:354:14)
    at paramCallback (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node_modules/express/lib/router/index.js:401:21)
    at args.app.param (/home/m/dev/etherpad-lite-heroku/etherpad-lite/src/node/hooks/express/padurlsanitize.js:18:7)

Cause

does not work with etherpad 1.7.5

button works, and I can select an image, but upload fails, image does not appear (base64 method):

TypeError: Cannot convert undefined or null to object
at Function.keys ()
at Object.exports.clientVars [as hook_fn] (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_image_upload\static\js\serverHooks.js:36:23)
at normalizedhook (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\static\js\pluginfw\hooks.js:15:27)
at hookCallWrapper (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\static\js\pluginfw\hooks.js:21:14)
at C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\static\js\pluginfw\hooks.js:88:7
at C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:249:17
at C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:125:13
at Array.forEach ()
at _each (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:46:24)
at async.each (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:124:9)
at _asyncMap (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:248:13)
at Object.map (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:219:23)
at Object.exports.aCallAll (C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\static\js\pluginfw\hooks.js:85:9)
at C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node\handler\PadMessageHandler.js:1346:15
at C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:610:21
at C:\Users\Florian\Downloads\etherpad-lite-win-1.7.5-6a3e4c69b8\node_modules\ep_etherpad-lite\node_modules\async\lib\async.js:249:17

Failed to load modules

After enabling ep_image_upload in Etherpad 1.8.4, The image icon appears in the toolbar, but pressing it doesn't do anything.

The JS console shows lots of errors like this (but for various different modules):

Failed to load 'ep_image_upload/static/js/toolbar' for 'ep_image_upload/ep_image_upload/client_hooks/postToolbarInit': Error: The module at "ep_image_upload/static/js/toolbar" does not exist. ace2_common.js:36:445

Image cropping

Hi,

thanks for ep_image_upload! it's working amazingly fine.

I would like to know what is the best solution to implement an image cropping into the fileupload.
I consider using Croppie

To be honest I have not a deep understanding of how the Etherpad editor works.
By looking at your code, I don't see any custom dom events/hooks where I can put in a way my custom code (with a custom etherpad plugin) or even if it's a good practice to extend a plugin by another plugin.

So I though I can come with a PR where:

  • an option will be present in the ep_image_upload config (so we can support some options of the Croppie)
  • add Croppie as a dependency in the package.jon
  • base on the config, switch from your upload code to a croppie one
  • on the upload show a modal to display the croppie UI
  • then do the upload

What are your insights on this?

Thanks in advance

local storage in docker

Is is possible to use the local storage within a docker container?

I would like to use the plugin with my docker etherpad. I created a volume /var/www/images where i want to store my images. But the container runs in a docker network. I use the php EtherpadLiteClient https://github.com/0x46616c6b/etherpad-lite-client
The plugin makes a POST to /p/g.Ovnjr54VGyJC271h$0/pluginfw/ep_image_upload/upload which is ending in a 404 because the route does not exist, because the container does not exposes this routes throu the docker network.

Do I have to add a proxy to /p/g.Ovnjr54VGyJC271h$0/pluginfw/ep_image_upload/upload to my php server, with talks to the docker container?

Preview URL pasted image which was not uploaded

We have been promoting not always uploading images but also just to paste an image URL. This saves disc space and is the preferred method if copyrights are not cleared.

However, the ep_previewimage plugin is not intended to be used with ep_image_upload anymore
https://github.com/JohnMcLear/ep_previewimages/blob/master/README.md

So is it intended that the function will be integrated in ep_image_upload, showing images for which we only have an external image URl in the pad? Currently, no image is shown, if I add an image URl into the pad.

Compatibility with ep_align

Hi
I cant get the alignement working with the plugin ep_align ?
It seems it was working before ?

#11

Does the image tag can be in the left, center or right tag ?

Thanx for your help

[Bug Report] plugin triggers etherpad shutdown when opening any pad

After I install this plugin today, etherpad shutdowns everytime I try to open a pad, existed one or new one. But I can still access other url (e.g ip_addr:port/admin). The problem gone after the plugin uninstall.

Error log belows

[2019-02-21 03:09:42.831] [INFO] access - [CREATE] Pad "padid": Client G1IokDGNjrTTubbmAAAD with IP "ip_address" created the pad
[2019-02-21 03:09:42.832] [ERROR] console - TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.exports.clientVars [as hook_fn] (/home/etherpad/etherpad-lite/node_modules/ep_image_upload/static/js/serverHooks.js:34:23)
    at normalizedhook (/home/etherpad/etherpad-lite/src/static/js/pluginfw/hooks.js:15:27)
    at hookCallWrapper (/home/etherpad/etherpad-lite/src/static/js/pluginfw/hooks.js:21:14)
    at /home/etherpad/etherpad-lite/src/static/js/pluginfw/hooks.js:88:7
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:249:17
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:125:13
    at Array.forEach (<anonymous>)
    at _each (/home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:46:24)
    at async.each (/home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:124:9)
    at _asyncMap (/home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:248:13)
    at Object.map (/home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:219:23)
    at Object.exports.aCallAll (/home/etherpad/etherpad-lite/src/static/js/pluginfw/hooks.js:85:9)
    at /home/etherpad/etherpad-lite/src/node/handler/PadMessageHandler.js:1346:15
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:610:21
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:249:17
    at iterate (/home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:149:13)
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:160:25
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:251:21
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:615:34
    at /home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:254:17
    at done (/home/etherpad/etherpad-lite/src/node_modules/async/lib/async.js:135:19)
[2019-02-21 03:09:42.833] [INFO] console - graceful shutdown...
[2019-02-21 03:09:42.875] [INFO] ueberDB - Flushed 5 values
[2019-02-21 03:09:42.975] [INFO] console - db sucessfully closed.

Unhandled promise rejection

Looks like the image_upload and copy_paste_images plugins stopped working somewhere between etherpad versions 1.8.3 and 1.8.4.

Pads with images (working on 1.8.3 and HEAD as of May 13th) will get stuck at "Loading..." or give an error after updating to 1.8.4...

console - (node:25175) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object
     at Function.keys (<anonymous>)
     at Object.exports.clientVars [as hook_fn] (/var/www/etherpad/node_modules/ep_image_upload/static/js/serverHooks.js:36:23)
     at normalizedhook (/var/www/etherpad/src/static/js/pluginfw/hooks.js:15:27)
     at hookCallWrapper (/var/www/etherpad/src/static/js/pluginfw/hooks.js:21:14)
     at /var/www/etherpad/src/static/js/pluginfw/hooks.js:88:7
     at /var/www/etherpad/src/node_modules/async/lib/async.js:249:17
     at /var/www/etherpad/src/node_modules/async/lib/async.js:125:13
     at Array.forEach (<anonymous>)
     at _each (/var/www/etherpad/src/node_modules/async/lib/async.js:46:24)
     at async.each (/var/www/etherpad/src/node_modules/async/lib/async.js:124:9)
     at _asyncMap (/var/www/etherpad/src/node_modules/async/lib/async.js:248:13)
     at Object.map (/var/www/etherpad/src/node_modules/async/lib/async.js:219:23)
     at aCallAll (/var/www/etherpad/src/static/js/pluginfw/hooks.js:85:9)
     at /var/www/etherpad/src/static/js/pluginfw/hooks.js:100:7
     at new Promise (<anonymous>)
     at Object.exports.aCallAll (/var/www/etherpad/src/static/js/pluginfw/hooks.js:99:12)
     at handleClientReady (/var/www/etherpad/src/node/handler/PadMessageHandler.js:1142:32)
     at processTicksAndRejections (internal/process/task_queues.js:97:5)

console - (node:25175) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)

...also submitted here

The cursor always moves to the left of the image while clicking the image.

the cursor always moves to the left of the image while clicking the image.

version

  1. etherpad V.1.8.0
  2. [email protected]

system

  • mac ox/window
  • chrome v79.03

description

  1. upload an image
  2. click/move cursor to the right of the image
  3. the cursor moves to the left of the image automatically

just like this

image

find the problem

In order to find what makes the cursor move, I find the code that makes the cursor change in etherpad/src/static/js/ace2_inner.js: 4013

the start.offset/ end. offset always be zero while clicking the image

                if (selection) {
                    isCollapsed = (selection.startPoint.node === selection.endPoint.node && selection.startPoint.index === selection.endPoint.index);
                    var start = pointToRangeBound(selection.startPoint);
                    var end = pointToRangeBound(selection.endPoint);

                    if ((!isCollapsed) && selection.focusAtStart && browserSelection.collapse && browserSelection.extend) {
                        // can handle "backwards"-oriented selection, shift-arrow-keys move start
                        // of selection
                        browserSelection.collapse(end.container, end.offset);
                        // console.trace();
                        // console.log(htmlPrettyEscape(rep.alltext));
                        // console.log("%o %o", rep.selStart, rep.selEnd);
                        // console.log("%o %d", start.container, start.offset);
                        browserSelection.extend(start.container, start.offset);
                    } else {
                        var range = doc.createRange();
                        range.setStart(start.container, start.offset);
                        range.setEnd(end.container, end.offset);

                        browserSelection.removeAllRanges();
                        browserSelection.addRange(range);
                    }
                }

Expect for your reply

Does S3 bucket credentials are exposed while uploading ?

I have two questions related to the plug-in
When the image is uploaded through the plug-in to s3

  1. "addImage" in toolbar is not relfecting perfectly, it shows only at the top right corner of screen
  2. Are the s3 credentials in settings.json are exposed in front while uploading

image export

Is there a way to export the images in the documents?

migrating from ep_copy_images

Hello,

Trying to migrate/update an installation using the ep_copy_images plugin, I get the following error for pages that already have images from the old install.

EP + ep_image_upload seem to work fine. But it crashes for my legacy pages. Any suggestions?

This is running on top of RockyLinux8 + NodeJS16 + Postgresql

Thanks!

type: 'Unhandled Promise rejection',
msg: 'TypeError: /src\s*=\s*"([^\\s]+\/\/[^/]+.\/[^\\s]+\.\w*)/gi.exec(...) is null',
url: 'https:///p/oldPage',
source: 'https:///static/js/require-kernel.js?v=12388c46 line 1 > Function',
linenumber: 3,
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0',
stack: '(module ep_image_upload/static/js/clientHooks.js)/exports.aceAttribsToClasses@https:///static/js/require-kernel.js?v=12388c46 line 1 > Function:3:480\n' +
'callHookFnSync@https:///javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define&v=12388c46:43:1543\n' +
'(module ep_etherpad-lite/static/js/pluginfw/hooks.js)/exports.callAll/<@https:///javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define&v=12388c46:43:2259\n' +
'(module ep_etherpad-lite/static/js/pluginfw/hooks.js)/exports.callAll@https:///javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define&v=12388c46:43:2236\n' +
'f/g</<@https:///static/js/require-kernel.js?v=12388c46 line 1 > Function:19:1411\n' +

Functionality report Firefox and Chrome

Edited, bold notes by JM

Motivated by the issue and @JohnMcLear answer it wanted to write an report!

Still left to do:

  • Drag and drop shouldn't create duplicates
  • #8

Details

OS: Win 8.1
Browser: Firefox 75.0
Testpad: https://board.net/ (I suppose they have ep_copy_paste_images as well as ep_image_upload installed)

Drag and Drop inside Pad

  • Drag and Drop onto a blank line Works (image is copied so we have it twice) - confirmed, will fix today
  • Drag and drop onto content with a line doesn't work (neither left nor right nor in beetween) ** - it puts it on the prior line**

Copy to clipboard/ Paste (using control c / v) inside Pad

  • Paste onto a blank line doesn't work
  • Paste onto a line populated with content doesn't work
  • right click copy/paste doesn't work - confirmed, due to #8

Cut to clipboard/ Paste (using control x / v)

  • Paste onto a blank line doesn't work
  • Paste onto a line populated with content doesn't work
  • right click cut/paste doesn't work

Image appearance

  • Image is never distorted correct
  • Image has correct color balance correct

Alignment

  • Image can be aligned using ep_align no statement possible

Resize

  • Can resize the image yes, using tab (resize smaller) or shift+tab (resize larger until original size is reached) when the cursor is left of the image ** I love this hack but I don't think it's suitable as it's not a clear UX, still, I can't fault you 👯 **

Browser Resize

  • Can still nagivate the page yes
  • Images can be moved / selected / resized
    • select Image can never be selected by tipping it, but it can be selected by dragging the cursor over several lines. But then ctrl+c/ctrl+x works to move it for example to libre office (so it's in the clipboard), but when it's copied to another place in the pad it disappears) - confirmed, due to #8
    • resize works with tab/shift+tab like described above

Keyboard

  • Caret can be moved between images yes, but when we have 2 images and the caret is in beetween these two, delete doesn't delete the respective line but rather the image below - confirmed, due to #8
  • Backspace deletes an image when caret is placed after the image not possible, because caret/cursor always jumps to the left - confirmed, due to #8
  • Delete removes an image when caret is placed before the image yes
  • Backspace doesn't deletes an image when caret is placed before the image - - confirmed, due to #8

Further observations

  • when I delete an image, it can be restored with ctrl+z (doesn't work with ep_copy_paste_images)
  • being in line below and Backspace doesn't delete the image but rather jumps to the left of the image - confirmed, due to #8
  • when image is in the last line, it isn't possible to create an new line below. Enter moves the image below to the new line. Moving the cursor to right of the image isn't possbile as it moves directly back left - confirmed, due to #8
  • when several images are inside the pad, ctrl+z destorys several and then they can't be restored - ** unable to replicate **

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.