Day / Night mode for webhelp stylesheets
Are you missing a feature? Request its implementation here.
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Day / Night mode for webhelp stylesheets
Post by shudson310 »
The stylesheets could incorporate code to automatically switch between day/night mode based on the local browser time:
and stylesheets for day vs night mode incorporated into the theme builder. This would be extremely helpful for webhelp and mobile help that is delivered to devices or settings that are light-sensitive, such as driving/flying/boating/security.
Code: Select all
<script>
<!--
function getStylesheet() {
var currentTime = new Date().getHours();
if (0 <= currentTime&¤tTime < 5) {
document.write("<link rel='stylesheet' href='night.css' type='text/css'>");
}
if (5 <= currentTime&¤tTime < 11) {
document.write("<link rel='stylesheet' href='day.css' type='text/css'>");
}
if (11 <= currentTime&¤tTime < 16) {
document.write("<link rel='stylesheet' href='day.css' type='text/css'>");
}
if (16 <= currentTime&¤tTime < 22) {
document.write("<link rel='stylesheet' href='night.css' type='text/css'>");
}
if (22 <= currentTime&¤tTime <= 24) {
document.write("<link rel='stylesheet' href='night.css' type='text/css'>");
}
}
getStylesheet();
-->
</script>
<noscript><link href="main.css" rel="stylesheet" /></noscript>
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
-
- Site Admin
- Posts: 275
- Joined: Thu Dec 24, 2009 11:21 am
Re: Day / Night mode for webhelp stylesheets
Hello,
Thank you for your feedback.
In order to refer a custom JavaScript file in the WebHelp Responsive output HTML files please follow these steps:
Thank you for your feedback.
In order to refer a custom JavaScript file in the WebHelp Responsive output HTML files please follow these steps:
- Include the script declaration into an well-formed XML file. For example the content of the XML file should look like:
Note: Note that the example above uses the ${oxygen-webhelp-output-dir} macro in order specify the path of the referenced JavaScript file relative to the output directory.
Code: Select all
<script type="text/javascript" src="${oxygen-webhelp-output-dir}/my-script.js"/>
Note: If you want to reference multiple JavaScript files, place the <script> elements within a <div> element. For example:Code: Select all
<div>
<script type="text/javascript" src="http://www.example.com/my-script1.js"/>
<script type="text/javascript" src="${oxygen-webhelp-output-dir}/my-script2.js"/>
</div> - Edit the WebHelp Responsive transformation scenario and set the value for the webhelp.fragment.head parameter to the absolute path of the XML file at step 1.
Note: If you want to insert the JavaScript reference in another location within the HTML page you can find the complete list of available parameters here: https://www.oxygenxml.com/doc/versions/ ... ders_usage
- Place all your JavaScript resources in the same directory.
- Edit the WebHelp Responsive transformation scenario and set the value for the webhelp.custom.resources parameter to the absolute path of the directory at step 1.
Note: All files from this directory will be copied to the root of the WebHelp output.
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 407
- Joined: Mon Dec 05, 2011 6:08 pm
Re: Day / Night mode for webhelp stylesheets
Hi,
Currently, there isn't a default dark mode theme that can be applied to the WebHelp Responsive output, but we do have various publishing templates which you can use: Publishing Templates
You might choose for example, Hightech or Mechano template and further customize it if needed.
You can choose a template by editing the DITA Map WebHelp Responsive transformation (you need to duplicate the scenario and edit a copy) and then select Templates tab.
I hope this helps.
Regards,
Ionela
Currently, there isn't a default dark mode theme that can be applied to the WebHelp Responsive output, but we do have various publishing templates which you can use: Publishing Templates
You might choose for example, Hightech or Mechano template and further customize it if needed.
You can choose a template by editing the DITA Map WebHelp Responsive transformation (you need to duplicate the scenario and edit a copy) and then select Templates tab.
I hope this helps.
Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 15
- Joined: Fri Jan 26, 2018 8:05 pm
Re: Day / Night mode for webhelp stylesheets
Hi lonela,
Thanks for the reply. The request we've gotten from the user teams is something to toggle. Although a template might be helpful. Right now, we've customized our plug-in and I'd need to talk to our developer to see how changing templates would behave with our customizations.
Justin
Thanks for the reply. The request we've gotten from the user teams is something to toggle. Although a template might be helpful. Right now, we've customized our plug-in and I'd need to talk to our developer to see how changing templates would behave with our customizations.
Justin
-
- Posts: 407
- Joined: Mon Dec 05, 2011 6:08 pm
Re: Day / Night mode for webhelp stylesheets
Hi Justin,
Thank you for these details.
I have added all your feedback to our issue tracking tool as an improvement request regarding a dark mode for the WebHelp Responsive output.
This will be analyzed by our development team.
Regards,
Ionela
Thank you for these details.
I have added all your feedback to our issue tracking tool as an improvement request regarding a dark mode for the WebHelp Responsive output.
This will be analyzed by our development team.
Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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