This repository has been archived by the owner on Jan 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
559a3ff
commit 54ffa74
Showing
8 changed files
with
167 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# CHANGELOG | ||
|
||
## 1.0.0-FINAL (2018-10-05) | ||
|
||
- initial version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); |