Missing captioned images feature in TinyMCE and Plone5 - tinymce

I'm missing the function to enable captioned images in TinyMCE/Plone5. It was possible to enable that in the control panel with Plone4 (https://plone.org/documentation/manual/plone-4-user-manual/using-tinymce-as-visual-editor/images).
Now I'm using the new Plone5rc3 with TinyMCE 1.4.3, but the properties of TinyMCE in the control panel don't have the needed checkbox.
Does anybody know how to get that?
Thanks a lot!

So here's an answer in parts: you need several things for the captions to work:
Your <img> tags need to have the class captioned. I still need to find a good way to do that. The image picker will remove all other classes everytime you open it, so I guess a good way would be to change the classes that are added by the inline/left/right selection, but I've not easily found where those are defined.
You need the output filter, but fortunately, that is still there. However, the filter wants to see an IImageCaptioningEnabler, which is essentially a flag to turn the captioning mechanism on, and the old editors used to have that and currently, nothing in standard Plone does provide such a beast. If you're comfortable with add-on development, the class you want is
from plone.outputfilters.filters.resolveuid_and_caption import IImageCaptioningEnabler
from zope.interface import implements
class CaptioningAlwaysEnabled(object):
implements(IImageCaptioningEnabler)
available = True
with corresponding configure.zcml stanza
<utility factory=".resolveuid_and_caption.CaptioningAlwaysEnabled"
name="plone5-captions-always-enabled"
zcml:condition="have plone-5" />
(you can tell I patched buildout-cache/plone.outputfilters-2.1-py2.7.egg/plone/outputfilters/filters/configure.zcml and resolveuid_and_caption.py to include that, but of course, you shouldn't do that.)
If you're not comfortable with add-on development, you could, bizarrely enough, see if another editor provides that global switch, you don't need to have it set as your editor or the default editor. (Products.kupu would, but it doesn't install in 5.0. collective.ckeditor might, I can't try that right now due to missing dependencies.)
So, summary: no, you can't easily turn it on; you can turn it on with a bit of hacking; and if you file it as a feature request, it's the kind of thing that takes about fifteen minutes to fix for somebody who knows their way around the code.

Related

2sxc 10+, is it possible to add menu/commands to the TinyMCE WYSIWYG Editor?

I have a client hoping that we can get 1 or more custom menu commands added in to the default or advanced TinyMCE toolbar used in 2sxc. Is that possible? If yes, how/where do I get started?
There is no quick & simple way to do it, as there is no "injection" point for this. There is so much you could do with tinymce it's a difficult to provide a clear place to inject changes.
So as of now the best way would be to replicate the existing input-component and register your modified one as another input-field. For 2sxc 9 there are some blogs explaining how to do this, in 10.x the API isn't official yet - we want to be really sure it will be long term.

Can Emmet Be Used to Create FXML?

I have a scalaFX app that currently has its views created programmatically. I am wondering if I can use the Emmet tool to create FXML (particularly ScalaFXML) because I want to recreate my views in ScalaFXML to separate my views from my controllers more effectively. I have searched the internet and cannot find out if this is possible. So far I have only used Emmet for HTML. Thanks in advance for the help!
I have been looking around for something for PrimeFaces; I had trouble finding anything. I guess maybe it's because people who are using it are actually writing "normal" HTML with JS frameworks.
The good news is, it's completely (and easily!) customizable: just find the installation directory, and edit the "snippets.json" file, or create a new one called (for example) snippets-scalaFX.json. Mine on a Windows 10 machine, installed as a plugin for NPP, was C:\Program Files (x86)\Notepad++\plugins\EmmetNPP\emmet\snippets.json.
It's pretty obvious once you get in there, but inside the "snippets" object just add some more fields for yourself. For example, to make a PrimeFaces commandButton tag I added:
"pc": "p:commandButton"
You can use $0 or ${<placeholder text>} to define tabstops for expanded snippets, and | to define the caret starting point.
Full docs on editing snippets are here.

Notepad++ Auto-Complete

I am looking to see if anyone can guide me to constructing an Auto-Complete XML plugin for Lua. I know all about the LOVE thing, but I have no idea how to set it up so it supports metatables too.
For example
local npc = Npc(getNpcCid()) -- This creates an instance of Npc metatable
npc:getName()
Does anyone know how I can make it so it shows a list of all methods in the Npc() metatable when I type "npc:"?
Check out this YouTube video: http://www.youtube.com/watch?v=muJvM-Hz6w4
The person that made that video is showing that something like this is possible, but I don't know how to make that possible in the XML plugin.
afaik np++ is not able to search and parse the class outline of separated files. So custom class methods are not able to be detected.
It's auto-complete setting is only for pre-defined static functions only.

Which eclipse listener should I use to add annotations to a text editor

I am an eclipse newbie. I have a long term goal which is to add my own annotations to the java editor: a bit like FindBugs. I want my own static code analysers, and to be able to add markers/annotations to resources.
So I have read a lot of excellent documentation, and undertaken a load of tutorials. The most helpful was probably http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-commplgin2/section9.html. A lot of the Lars Vogel documents have been useful too. I can now make TextEditors with syntax highlighters. I am however struggling with the best approach for adding annotations.
I understand roughly how to do this: the text editor has a DocumentProvider. The DocumentProvider has an AnnotationModel. It is possible to add annotations to the annotation model.
My question is "where do I put this code" specifically the code that scans the text in the editor and updates the annotation model. It seems clear that this should be in response to a listener...but which one?
I have tried a ResourceChangeListener. This seems to only fire on a save option, rather than when text is typed. In addition I don't know how to get the editor from the resource. ("The" editor is probably a misnomer as presumably the resource can be open in multiple editors). I can find the current editor via IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor(), but this seems the wrong approach, as I want to update all relevant annotation models.
I have tried adding an ElementStateListener to the text editor. None of the events seem to be the one I want.
I've looked at DamageRepairers...these seem to nearly be what I want, except that long term I want to tie into the JavaEditor, so I don't want to change the default DamageRepair.
Thanks for all the help
I found that this question can be answered, by mentioning the following resource: www.ibm.com/developerworks/opensource/tutorials/os-eclipse-plugin-guide/index.html
The question author also mentions here:
I add the annotations to the resource, and the annotations are
auto-magically added to the editor.
So when my plugin starts I run through the active resources, add
annotations to them if needed, then add a resource changed listener
which adds them as the resource is opened.

Using custom styles with Basic4Android

As a follow on to the hide activity questions here, I started looking through the Andoid documentation for more information on styles and themes and found it is possible to apply different themes for different API levels.
With this I can get my transparent activity on API levels that support it properly.
What I'd like to know is, is it safe to play with the styles within the Basic4Android environment, or will it comeback to bite me later on?
The xml has to be stored in res/values or res/values-v(API level) which are deleted on compile unless made read-only. I just wanted to check if this was to stop these being changed for a reason, other than keeping the app tidy?.
Edit:
I assume some things that it is possible to put in these files would overwrite or be overwritten by settings in the Designer.
Steve
I don't see any problem with using styles. Make sure to set your xml files to be read-only.
The designer doesn't change anything except of creating the bal files.