Webapp 18 Highlighting
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 61
- Joined: Tue Oct 27, 2015 11:49 am
Webapp 18 Highlighting
Post by Konstantin »
Hi guys !
In Oxygen applet we use a highlighting thru:
Tags attribute:
<p audience="audience_name01">text</p>
and insert data about tag an color to:
But now in Webapp 18 is unsupported:
authorAccess.getEditorAccess().getHighlighter()
Do you have another opportunity to do this ?
Do you have plans to support getHighlighter() ?
In Oxygen applet we use a highlighting thru:
Tags attribute:
<p audience="audience_name01">text</p>
and insert data about tag an color to:
Code: Select all
final AuthorEditorAccess editorAccess = authorAccess.getEditorAccess();
final AuthorHighlighter highlighter = editorAccess.getHighlighter();
highlighter.addHighlight(element.getStartOffset(),
element.getEndOffset(),
painter,
new AuthorConditionalProcessingHighlight(element));
authorAccess.getEditorAccess().getHighlighter()
Do you have another opportunity to do this ?
Do you have plans to support getHighlighter() ?
-
- Site Admin
- Posts: 95
- Joined: Thu Jun 09, 2016 2:01 pm
Re: Webapp 18 Highlighting
Post by Gabriel Titerlea »
Hello,
Can you explain exactly what you want to achieve with the highlighter?
We do not support the AuthorHighlighter in the WebApp. We will have a method of inserting non-persistent markers on the client-side with javascript though. Would this suit your needs?
Regards,
Gabriel
Can you explain exactly what you want to achieve with the highlighter?
We do not support the AuthorHighlighter in the WebApp. We will have a method of inserting non-persistent markers on the client-side with javascript though. Would this suit your needs?
Regards,
Gabriel
-
- Posts: 61
- Joined: Tue Oct 27, 2015 11:49 am
Re: Webapp 18 Highlighting
Post by Konstantin »
We have functionality for applet to highlight text by different colors
I need do it for Webapp
https://drive.google.com/open?id=0B8kWu ... WdKQ2k3THM
I need do it for Webapp
https://drive.google.com/open?id=0B8kWu ... WdKQ2k3THM
-
- Site Admin
- Posts: 95
- Joined: Thu Jun 09, 2016 2:01 pm
Re: Webapp 18 Highlighting
Post by Gabriel Titerlea »
We don't support AuthorHighlighter, but if the only thing you want to do is change the color of elements depending on an attribute value you could add a css to the WebApp using a javascript plugin [1].
In your css you can select attributes with certain values like this:
To load your css you can use a WebappStaticResourcesFolder extension for your plugin. Check the link [1] for more info.
Once you have a static resource folder all you need to do is load your custom css into the WebApp by listening for the EDITOR_LOADED event inside a plugin:
[1] - https://www.oxygenxml.com/doc/versions/ ... gin,static
In your css you can select attributes with certain values like this:
Code: Select all
// Note that the attribute name must be prepended with "data-attr-"
*[data-attr-color="red"] {
background-color: rgba(255, 0, 0, 0.19);
}
Once you have a static resource folder all you need to do is load your custom css into the WebApp by listening for the EDITOR_LOADED event inside a plugin:
Code: Select all
(function () {
goog.events.listenOnce(workspace, sync.api.Workspace.EventType.EDITOR_LOADED, function(e) {
var doc;
// We insert the editor content inside an element with id editor-frame
var editorFrame = document.getElementById('editor-frame');
// Depending on user preferences we may insert the editor content inside an iframe.
// In that case you should load your css inside the iframe.
if (editorFrame.nodeName === 'IFRAME') {
doc = editorFrame.contentDocument;
} else {
doc = editorFrame.ownerDocument;
}
// Static resources folders are accessible at the plugin-resources endpoint.
var url = "../plugin-resources/STATIC_RESOURCES_FOLDER/highlighter.css";
if (doc.createStyleSheet) {
doc.createStyleSheet(url);
} else {
var link = goog.dom.createDom('link', {
href: url,
rel: "stylesheet",
type: "text/css"
});
goog.dom.appendChild(doc.head, link);
}
});
})();
[1] - https://www.oxygenxml.com/doc/versions/ ... gin,static
-
- Site Admin
- Posts: 95
- Joined: Thu Jun 09, 2016 2:01 pm
Re: Webapp 18 Highlighting
Post by Gabriel Titerlea »
Hello Konstantin,
There's an even better solution for highlighting specific attributes. You can use an Author Stylesheet Plugin Extension [1] in your plugin.
You can write css selectors specific to your document type without the extra "data-attr-".
example:
Regards,
Gabriel
[1] https://www.oxygenxml.com/doc/versions/ ... stylesheet
There's an even better solution for highlighting specific attributes. You can use an Author Stylesheet Plugin Extension [1] in your plugin.
You can write css selectors specific to your document type without the extra "data-attr-".
example:
Code: Select all
title[attribute="value"] {
color: red
}
Regards,
Gabriel
[1] https://www.oxygenxml.com/doc/versions/ ... stylesheet
-
- Posts: 61
- Joined: Tue Oct 27, 2015 11:49 am
Re: Webapp 18 Highlighting
Post by Konstantin »
Hello.
It's a long time passed, maybe you have new api to highlight pieces of text or still only through styles?
It's a long time passed, maybe you have new api to highlight pieces of text or still only through styles?
-
- Posts: 517
- Joined: Wed May 20, 2009 2:40 pm
Re: Webapp 18 Highlighting
Hello Konstantin,
There is no support in Web Author for editorAccess.getHighlighter() API for the moment. We will let you know when it will be implemented.
Best Regards,
Mihaela
There is no support in Web Author for editorAccess.getHighlighter() API for the moment. We will let you know when it will be implemented.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 32
- Joined: Tue May 26, 2015 10:28 am
Re: Webapp 18 Highlighting
Post by aleh.haidash »
Hello.
Do you have any news about highlighting api from js or java in Webapp 19.1? Maybe it can be done?
Thanks.
Do you have any news about highlighting api from js or java in Webapp 19.1? Maybe it can be done?
Thanks.
Best Regards,
Aleh
Aleh
-
- Posts: 517
- Joined: Wed May 20, 2009 2:40 pm
Re: Webapp 18 Highlighting
Hi,
We just released the 21.1 version of Web Author and it includes a new API for working with non persistent highlights:
https://www.oxygenxml.com/maven/com/oxy ... nager.html
Best Regards,
Mihaela
We just released the 21.1 version of Web Author and it includes a new API for working with non persistent highlights:
https://www.oxygenxml.com/maven/com/oxy ... nager.html
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service