Page 1 of 1

Hiding folded placeholder

Posted: Tue Oct 29, 2019 9:39 am
by Patrik
Hi,

I have a custom framework with foldable elements and in the desktop version everything looks fine. But in teh web author there is the text "(Folded)" shown below by non-foldable child when the element is folded. How can I get rid of this? I could not find any documentation about a pseudo-class ":folded" (only a feature request) or something like that!?

Thans and regards,
Patrik

Re: Hiding folded placeholder

Posted: Tue Oct 29, 2019 11:50 am
by cristi_talau
Hello,

Web Author's default styling is different from the one in the desktop editor. I also found the feature request to add a pseudo-class for folded elements and I added your vote to it.

A non-API way to get rid of that text is to add a custom CSS to Web Author [1] and to add the following selector:

Code: Select all

.folded[folded-placeholder]:after, .non-folded-child[folded-placeholder]:after {
   display: none !important;
}
Note that this code is not guarateed to work in future versions of Web Author. However, by that point the pseudo-class may be already added.

Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... 3j_p1x_3bb

Re: Hiding folded placeholder

Posted: Tue Oct 29, 2019 4:20 pm
by Patrik
Hi Cristian,

thanks for the hint. Unfortunately adding a custom css seems not to be as easy as it sounds.

Inspired by the web-author-sample-plugins I tried it with this plugin.xml:

Code: Select all

<plugin id="hide-folded-placeholder"
	name="hide-folded-placeholder"
	description="Hides the placeholder when an element is folded"
	version="1.0"
	vendor="GDV DL">
	
	<extension type="WebappCSSResource" href="hide-folded-placeholder.css"/>
	
</plugin>
But I got Exception java.lang.ClassNotFoundException (got the same trying to use the sample plugin - added an issue there).

So I really have to write some java code just to add my css file?

Regards,
Patrik

Re: Hiding folded placeholder

Posted: Tue Oct 29, 2019 4:34 pm
by cristi_talau
Hello,

The "WebappCSSResource" extension point was added in version 21.1.1. Prior to this release you have to use JS to load the CSS and the "WebappStaticResourcesFolder" extension point. You can see some examples here [1] and here [2].

Best,
Cristian

[1] https://github.com/oxygenxml/web-author ... in.xml#L18
[2] https://github.com/oxygenxml/web-author ... ugin.js#L3

Re: Hiding folded placeholder

Posted: Fri Nov 01, 2019 11:50 am
by Patrik
Hi Christian,

thanks for the explanation. However, I still fail getting it to work.

my files:

plugin.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plugin SYSTEM "../plugin.dtd">
<plugin id="hide-folded-placeholder"
	name="Hide Folded Placeholder"
	description="Hides the placeholder for folded elements."
	version="1.0"
	vendor="GDV DL">
	
	<extension type="WebappStaticResourcesFolder" path="resources/" href="man-sp/"/>
</plugin>

web/plugin.js

Code: Select all

(function () {
  var cssFile;
  cssFile = goog.dom.createDom('link');
  cssFile.rel = "stylesheet";
  cssFile.type = "text/css";
  cssFile.href = "../plugin-resources/man-sp/hide-folded-placeholder.css";
  goog.dom.appendChild(document.head, cssFile);
});

resources/hide-folded-placeholder.css

Code: Select all

.folded[folded-placeholder]:after, .non-folded-child[folded-placeholder]:after {
   display: none !important;
}

When installing the plugin I can't activate it and it shows two times "Exception java.lang.ClassNotFoundException".

Any hints on what I did wrong or was missing?

Thanks and regards,
Patrik

Re: Hiding folded placeholder

Posted: Fri Nov 01, 2019 1:11 pm
by mihai_coanda
Hello Patrik,

I recreated the plugin based on your information and deployed it into the WebAuthor.
The function from your javascript code was not called, only declared so i changed it to (only added () at the end to call it) :

Code: Select all

(function () {
  var cssFile;
  cssFile = goog.dom.createDom('link');
  cssFile.rel = "stylesheet";
  cssFile.type = "text/css";
  cssFile.href = "../plugin-resources/man-sp/hide-folded-placeholder.css";
  goog.dom.appendChild(document.head, cssFile);  
})();
It work well on my side.
This plugin should not shows "Exception java.lang.ClassNotFoundException" as it does not contain any java code and does not declare any java extension in the plugin.xml descriptor.

On what Web Author version and build number are you working on and what are the complete exceptions the plugin displays (the classes it tries to load and fails are of interest) ?

It would be great if you could try remove and redeploy the plugin :
  • from the admin page delete the plugin
  • restart the WebAuthor
  • reinstall the plugin archive containing only the files that you mentioned with the exact content
  • restart the WebAuthor
Regards,
Michael

Re: Hiding folded placeholder

Posted: Fri Nov 01, 2019 2:12 pm
by Patrik
Hi Michael,

thanks a lot. I followed your steps and now it works.

Just for completion: the version shown on the license page: oXygen XML Web Author: 21.1, build 2019052218/2019052201

On the plugin page it did not give any additional information beside the exception.

(That's only version I could find, so I hope it's the version of the installed Software not from the license.)

Thanks and regards,
Patrik