I am using the LightBox plugin to display images in modal popups. It all works great in the browser with the specified extensions - png|jpg|jpeg|gif|tiff|bmp|svg - in featherlight.min.js.
I am trying to show images with .ashx extension in the modal window. But all I get is garbled text. I can get around this by adding the .ashx extension the above list.
To make upgrades easier in the future, I would like to avoid modifying the above list and add the .ashx extension outside the featherlight.min.js file. I can't find any samples on how to do that.
Is there a way to accomplish this or I just have to modify featherlight.min.js and add the .ashx extension?
Featherlight supports content filters extension: https://github.com/noelboss/featherlight#content-filters
Related
I think it should be possible.
I want to make an extension that will add a specific meta text content on specific positions in the source file (depending on its content), but this content should be just visible to the user not inserted into the source of course.
Can someone point to the VSCode API which I should use for this?
I think I found it:
https://code.visualstudio.com/api/references/vscode-api#TextEditor.setDecorations
This extensions also uses it:
https://github.com/wix/import-cost
I have a custom button that insert some HTML in the editor
First block of code is the button action and the second one is how the HTML is inserted
Any idea why it is rewriting it that way and how to stop it?
I just managed to fix it, in the init function:
valid_children : 'pre[code]'
TinyMCE includes the ability to insert code samples into the editor via its Code Sample plugin:
https://www.tinymce.com/docs/plugins/codesample/
If you want to try to do this yourself you need to do a few things like using the protect configuration option to tell TinyMCE to allow your PHP tags. See this TinyMCE Fiddle for a basic example:
http://fiddle.tinymce.com/Qdgaab
I'm displaying a TextDocumentContentProvider using previewHtml. Is it possible to track the addition of text into the textbox that i'm displaying in this previewHtml ?
We don't do this automatically but your extension can certainly use the previous html preview contents to track changes or generate a diff
I have an Extbase extension starting some background activities. To monitor the overall progress, there is a view displaying current state. How can this view be reloaded, say every 10-15 seconds? The best thing was to reload only this part of the page.
Use AJAX. To get the result of a specific action instead of the whole page, you can use the extension typoscript_rendering - it's made for this exact purpose.
To use it, you need to do something along these lines:
Create a controller action that renders the output you want to use for reloading.
In the fluid template where you want to reload the output, render the URL to use for rendering that output using the ViewHelper helhum:uri.ajaxAction from the above-mentioned extension. Put it into some data-attribute or something.
Fetch the content at that URL using AJAX - if you need adapt parameters for each call, it's probably best to do POST requests. You need to implement this manually - TYPO3 does not come with prebuilt JS for this.
Is there a function that allow me to select text when the extension
stays open. Normally when I Use the extension popup and I Click outside the
extension the extension close. Is there a wat to avoid this.
Thank you so much
Unfortunately there is currently no way to keep the popup open once you focus out of it. This is by design.
If you would like to always show something while interacting with the page, perhaps the experimental Info bars or even Desktop Notifications would work?
Hope that helped!
The only way to keep it open is to right click over the extension icon (button) and select "Inspect popup" the extension popup then show up and remain open but of course the debugger window show and this not a fix obviously still it will maybe inspire a hack... if someone is skilled enough and share the solution with all of us.
I encountered the same problem and I've thought of a possible solution (though not tested it):
Use your background.html to store the content of the popup action and upon loading the popup, you fetch the content via the default messaging for chrome extensions.
When doing all kinds of other stuff, like XHR's or something, I think you should do that in background.html too, so the requests won't abort if you close and you can do something with the result. Then when a user re-opens the popup, he'll see the result of his previous action instead of the default screen.
Anyone tried something like did already?
As far as I know you can't persist a pop up menu but my workaround has been using a content script to append a menu on page load. After the menu is appended you can toggle the menu via messaging between the background script and the content script.
If you want to encapsulate the menu from the page it's deployed on you could wrap your menu in an iframe. This could add complexity to your project since you would have to deal with cross origin issues and permissions.
There is an alternative hack for this. You can make use of chrome local storage to store the metadata as needed. Upon restart you can read that metadata and render the desired content. You will also probably clear that metadata after you have completed performing the operations based on that.