penneo-uri-utils
v0.0.4
Published
Utilities for integrating browsers with Penneo
Downloads
127
Readme
Penneo Browser Utilities
Installation
Add the script to your HTML page. You can use the CDN version from https://cdn.jsdelivr.net/gh/penneo/browser-uri-utils/bin/browser-utils.min.js
, or host it yourself and target directly to it.
<!-- index.html -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/penneo/browser-uri-utils/bin/browser-utils.min.js"></script>
NPM and Bower installations will be available soon.
Usage
To enhance any link <a>
element in a website to integrate Penneo, you only need the link, the data and the script above to be included.
In HTML, create a link with a temporary href
.
<a id="penneo-link" href="#">Link to Penneo</a>
In javascript
- Create the payload to be sent to the Penneo Desktop application accoding to the URI Schema for the integration.
- Select the link element
- Enhance the link with the global
penneoLink
function that the script exposes.
<script type="text/javascript">
// 1. create data payload
var data = {name: 'Test Casefile'};
// 2. select link element
var link = document.getElementById('penneo-link');
// 3. enhance link
penneoLink(data, link); // This will update the href of the link to be compatible with the Penneo Desktop application.
</script>
Full example will be made available soon.