So let's get started.
1) First, you'll need to get a copy of the Liferay Plugins SDK if you don't already have it.
2) From a command prompt, navigate to <plugins-sdk>/portlets/ and type
create logos-reftagger "Logos RefTagger"
This will automatically create a barebone portlet from which we can start building our portlet.
3) Navigate to <plugins-sdk>/portlets/logos-reftagger-portlet/docroot/ and open view.jsp
4) Change the content of view.jsp to the following:
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
Logos.ReferenceTagging.lbsBibleVersion = "ESV";
Logos.ReferenceTagging.lbsLinksOpenNewWindow = true;
Logos.ReferenceTagging.lbsLibronixLinkIcon = "dark";
Logos.ReferenceTagging.lbsNoSearchTagNames = [ "h1", "h2", "h3" ];
For you portlet, just replace the the <script> tags with your own script tags.
Now here's the neat part. Take a look at the <liferay-util:html-bottom> tag. This tag will force whatever is within the tag to the bottom of the page (between </body> and </html>).
If you script needs to appear within the <head> section of the page, you can use <liferay-util:html-top> instead.
All that is left to do now is just make sure this portlet appears on every page.
5) Create a liferay-hook.xml in <plugins-sdk>/portlets/logos-reftagger-portlet/docroot/WEB-INF/.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 5.3.0//EN" "http://www.liferay.com/dtd/liferay-hook_5_3_0.dtd">
And create a portal.property in <plugins-sdk>/portlets/logos-reftagger-portlet/docroot/WEB-INF/src/
For more information on the property layout.static.portlets.all, take a look at the portal.properties file in the Liferay source code.
6) Since we don't want users adding this portlet to a page and don't want the portlet border to appear, we need to set "system" to true and "use-default-template" to false in <plugins-sdk>/portlets/logos-reftagger-portlet/docroot/WEB-INF/liferay-portlet.xml.like so:
You can get this portlet from our public SVN or download the war below: