Search popular tech forums for questions and answers related to this document, a standards-based DOM Component
npm install rwt-xenotools

##### Open Source DOM Component
by Read Write Tools | Abstract |
|---|
| The rwt-xenotools DOM component links to popular tech forums to search for questions and answers related to this document's topic. |
Sometimes visitors are unsatisfied with the information provided in your
document and need to further research the topic. As a convenience to your
visitors you can provide quick links to external forums that may have additional
information about the your document's main topic.
The rwt-xenotools DOM component facilitates this by
keeping a social-media style linkbar hidden at the bottom of the page until the
user needs it.
When activated, the linkbar slides over the page content, showing a collection
of icons associated with popular tech forums.
Activation may also be initiated through the component's toggleMenu method or
through its event interface.
The component has these features:
* Each third-party link is prefilled with a query value that is determined by the
document's value.
* When appropriate, some links are prefilled with a hashtag values that are
determined by the document's value.
* The Reddit link uses any value provided by the document's
value.
* The Github link uses any value provided by the document's
value.
* The linkbar has an event interface for showing and hiding itself.
* The linkbar emits a custom event to close sibling menus and dialog boxes.
* A keyboard listener is provided to allow a shortcut key to open/close the
linkbar.
#### In the wild
To see an example of this component in use, visit the BLUEPHRASE
website and press F6 "Link to Q&A forums". To understand what's going
on under the hood, use the browser's inspector to view the HTML source code and
network activity, and follow along as you read this documentation.
#### Prerequisites
The rwt-xenotools DOM component works in any browser that
supports modern W3C standards. Templates are written using BLUE
PHRASE notation, which can be compiled into HTML using the free Read Write View
desktop app. It has no other prerequisites. Distribution and installation are
done with either NPM or via Github.
#### Download
OPTION 1: Familiar with Node.js and the OPTION 2: No prior experience using NPM? Important note: This DOM component uses Node.js and NPM and
Download using NPM
package.json file?
Great. Install the component with this command:
npm install rwt-xenotools
Just follow these general steps:
package.json file in the root of your web project using the command:
npm init
npm install rwt-xenotools
package.json as a convenient distribution and installation mechanism. The DOM component itself does not need them.
If you prefer using Github directly, simply follow these steps:
Download using Github
node_modules directory in the root of your web project.
git clone https://github.com/readwritetools/rwt-xenotools.git
After installation, you need to add two things to your HTML page to make use of
it.
* Add a script tag to load the component's rwt-xenotools.js file:
``html`
* Add the component tag somewhere on the page:
`html`
#### Self identification
The linkbar's inputs are prefilled with values provided in the document's
tags. Here's an example:
`html`
#### Dialog size and position
The linkbar is positioned in a fixed location at the bottom of the viewport. Its
position and size may be overridden using CSS by defining new values for the
bottom, width and height variables.
`css`
rwt-xenotools {
--bottom: 3rem;
--height: 11rem;
--width: 30rem;
--z-index: 1;
}
#### Dialog color scheme
The default color palette for the dialog uses a dark mode theme. You can use CSS
to override the variables' defaults:
`css``
rwt-xenotools {
--color: var(--white);
--accent-color1: var(--pure-white);
--background-color: var(--nav-black);
--accent-background1: var(--pure-black);
--accent-background2: var(--medium-black);
--accent-background3: var(--light-black);
--accent-background4: var(--title-blue);
--border-color1: var(--gray);
--border-color2: var(--pure-white);
--border-color3: var(--pure-black);
}
The component issues life-cycle events.
component-loadedwaitOnLoading() method which returns a promise that resolves when the component-loaded event is received. Call this asynchronously with await.---
| Documentation | READ WRITE HUB | |
| Source code | github | |
| Component catalog | DOM COMPONENTS | |
| Package installation | npm | |
| Publication venue | READ WRITE STACK |
The rwt-xenotools DOM component is licensed under the MIT
License.

Copyright © 2020 Read Write Tools. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT License