Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Commit

Permalink
preparing release 1.0.2-FINAL
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Oct 5, 2018
1 parent 559a3ff commit 54ffa74
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

## 1.0.0-FINAL (2018-10-05)

- initial version
5 changes: 5 additions & 0 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -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.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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).
104 changes: 104 additions & 0 deletions assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.coldrye.confluence.plugins</groupId>
<artifactId>clickable-anchors-plugin</artifactId>
<version>1.0.2-SNAPSHOT</version>
<version>1.0.2-FINAL</version>

<organization>
<name>coldrye</name>
<url>http://coldrye.eu/</url>
</organization>

<name>clickable-anchors-plugin</name>
<description>This is the eu.coldrye.confluence.plugins:clickable-anchors-plugin plugin for Atlassian Confluence.</description>
<description>Clickable headings and anchors for Atlassian Confluence.</description>
<packaging>atlassian-plugin</packaging>

<dependencies>
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/atlassian-plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}"/>
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-icon">images/pluginLogo.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>

<web-resource key="${atlassian.plugin.key}-resources" name="${atlassian.plugin.key} Common Web Resources">
<resource type="download" name="images/" location="/images"/>
<resource type="download" name="images/" location="/img"/>
<context>${project.artifactId}</context>
</web-resource>

Expand All @@ -24,8 +24,8 @@
<!--
<web-resource key="${atlassian.plugin.key}-editor-resources" name="${atlassian.plugin.key} Editor Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="${project.artifactId}-editor.css" location="/css/editor.css"/>
<resource type="download" name="${project.artifactId}-editor.js" location="/js/editor.js"/>
<resource type="download" name="${project.artifactId}-editor.css" location="/css/${project.artifactId}-editor.css"/>
<resource type="download" name="${project.artifactId}-editor.js" location="/js/${project.artifactId}-editor.js"/>
<context>editor</context>
</web-resource>
-->
Expand Down
Binary file added src/main/resources/img/pluginLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 16 additions & 17 deletions src/main/resources/js/clickable-anchors-plugin-page.js
Original file line number Diff line number Diff line change
@@ -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);
});
});

0 comments on commit 54ffa74

Please sign in to comment.