diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8d4c7a9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# CHANGELOG + +## 1.0.0-FINAL (2018-10-05) + + - initial version diff --git a/PRIVACY.md b/PRIVACY.md new file mode 100644 index 0000000..9ab814c --- /dev/null +++ b/PRIVACY.md @@ -0,0 +1,5 @@ +# Privacy Statement + +The plugin clickable-anchors-plugins does not collect any user data nor does it collect any usage data. + +For everything else, the official [Atlassian Privacy Policy](https://www.atlassian.com/legal/privacy-policy) applies. diff --git a/README.md b/README.md index 972e53f..7a38d0e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,34 @@ # clickable-anchors-plugin -The plugin provides for clickable anchors in Confluence. +The plugin provides for clickable headings and anchors that have been placed by the Anchor Macro. +The plugin is meant for use with Atlassian Confluence. +## Motivation + +Coming over from Trac, I was accustomed to clickable headings, so I can just click and copy the link. +And while Trac, at least on the desktop, will only display the link on mouse over, I needed something that can be +navigated at all times, especially when using mobile devices. + +## How Does it Work? + +The plugin will run a JQuery script that augments all content level headings into links. The same goes for anchors +that have been placed using the Anchor macro. + +For the latter, a "#" link will be rendered in place of the anchor, so extra care must be taken on where you place your +Anchor macros. + +The so augmented headings and anchors are also available in the page preview. + +## Usage + +Install and enjoy. + +## How to Build + +You can build this yourself, but first you have to install the Atlassian SDK. +Using ``atlas-run`` allows you to try out the plugin locally. + +## Additional License Information + +Part of the logo (the hand icon) was adapted from the free Font Awesome icon library and is licensed +under [CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/legalcode). diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100644 index 0000000..74fef48 --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1,104 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + # + + + + + + + diff --git a/pom.xml b/pom.xml index 06be473..791bb23 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ 4.0.0 eu.coldrye.confluence.plugins clickable-anchors-plugin - 1.0.2-SNAPSHOT + 1.0.2-FINAL coldrye @@ -15,7 +15,7 @@ clickable-anchors-plugin - This is the eu.coldrye.confluence.plugins:clickable-anchors-plugin plugin for Atlassian Confluence. + Clickable headings and anchors for Atlassian Confluence. atlassian-plugin diff --git a/src/main/resources/atlassian-plugin.xml b/src/main/resources/atlassian-plugin.xml index fd493fa..baf0e13 100644 --- a/src/main/resources/atlassian-plugin.xml +++ b/src/main/resources/atlassian-plugin.xml @@ -4,12 +4,12 @@ ${project.description} ${project.version} - images/pluginIcon.png + images/pluginLogo.png images/pluginLogo.png - + ${project.artifactId} @@ -24,8 +24,8 @@ diff --git a/src/main/resources/img/pluginLogo.png b/src/main/resources/img/pluginLogo.png new file mode 100644 index 0000000..bfe97dc Binary files /dev/null and b/src/main/resources/img/pluginLogo.png differ diff --git a/src/main/resources/js/clickable-anchors-plugin-page.js b/src/main/resources/js/clickable-anchors-plugin-page.js index 6e9ce8a..33c23f1 100644 --- a/src/main/resources/js/clickable-anchors-plugin-page.js +++ b/src/main/resources/js/clickable-anchors-plugin-page.js @@ -1,25 +1,24 @@ AJS.$(document).ready(function () { - var anchors = AJS.$("#content span.confluence-anchor-link"); - anchors.each(function (index, elt) { + var createAnchor = function (id) { - var span = $(elt); - var anchor = $(document.createElement("a")); - anchor.attr("href", "#" + elt.id); - anchor.attr("alt", elt.id); - anchor.text("#"); - anchor.addClass("clickable-anchors-plugin-link"); - anchor.appendTo(span); + return $(document.createElement("a")) + .attr("href", "#" + id) + .attr("alt", id) + .addClass("clickable-anchors-plugin-link"); + }; + + AJS.$("#content span.confluence-anchor-link").each(function (_, elt) { + + createAnchor(elt.id) + .text("#") + .appendTo(elt); }); - var headings = AJS.$("#content :header[id]"); - headings.each(function (index, elt) { + AJS.$("#content :header[id]").each(function (_, elt) { - var heading = $(elt); - var anchor = $(document.createElement("a")); - anchor.attr("href", "#" + elt.id); - anchor.addClass("clickable-anchors-plugin-link"); - heading.contents().appendTo(anchor); - anchor.appendTo(heading); + createAnchor(elt.id) + .append($(elt).contents()) + .appendTo(elt); }); });