summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe2015-09-28 13:38:53 (GMT)
committerElan Ruusamäe2015-09-28 13:46:43 (GMT)
commitf60638d4aaff7fa06412a263e37a5510f53ee8af (patch)
tree56ae3539f0da42cb4a8fac6fb77cd19593e78694
parent0148f071add9094943238a55058de31097f5716d (diff)
downloaddokuwiki-plugin-titlesanchorlink-auto/th/dokuwiki-plugin-titlesanchorlink-20130301-2.zip
dokuwiki-plugin-titlesanchorlink-auto/th/dokuwiki-plugin-titlesanchorlink-20130301-2.tar.gz
fix anchor links appearing in site headerauto/th/dokuwiki-plugin-titlesanchorlink-20130301-2
https://github.com/Dric/dokuwiki-titlesanchorlink/issues/1
-rw-r--r--dokuwiki-plugin-titlesanchorlink.spec4
-rw-r--r--heading-link.patch13
2 files changed, 16 insertions, 1 deletions
diff --git a/dokuwiki-plugin-titlesanchorlink.spec b/dokuwiki-plugin-titlesanchorlink.spec
index ade7b9d..562fe7b 100644
--- a/dokuwiki-plugin-titlesanchorlink.spec
+++ b/dokuwiki-plugin-titlesanchorlink.spec
@@ -6,11 +6,12 @@
Summary: DokuWiki TitlesAnchorLink Plugin
Name: dokuwiki-plugin-%{plugin}
Version: %{ver}
-Release: 1
+Release: 2
License: GPL v2
Group: Applications/WWW
Source0: https://github.com/Dric/dokuwiki-titlesanchorlink/archive/3ca9927/%{plugin}-%{subver}.tar.gz
# Source0-md5: 2ac066f5186ca085fc3e9e3193211398
+Patch0: heading-link.patch
URL: https://www.dokuwiki.org/plugin:titlesanchorlink
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.553
@@ -30,6 +31,7 @@ similar way to Github.
%prep
%setup -qc
mv *-%{plugin}-*/* .
+%patch0 -p1
%build
version=$(awk '/^date/{print $2}' plugin.info.txt)
diff --git a/heading-link.patch b/heading-link.patch
new file mode 100644
index 0000000..7e4d8e9
--- /dev/null
+++ b/heading-link.patch
@@ -0,0 +1,13 @@
+--- titlesanchorlink/script.js~ 2013-03-05 12:27:46.000000000 +0200
++++ titlesanchorlink/script.js 2015-09-28 16:36:26.690647453 +0300
+@@ -1,6 +1,10 @@
+ jQuery(function () {
+ jQuery(':header').each(function(){
+ var id = jQuery(this).attr('id');
++ if (!id) {
++ // https://github.com/Dric/dokuwiki-titlesanchorlink/issues/1
++ return;
++ }
+ var name = jQuery(this).text();
+ jQuery(this).append('<a title="Link to '+name+'" id="anchor__'+id+'" class="__anchor" href="#'+id+'"><img src="'+DOKU_BASE+'lib/plugins/titlesanchorlink/images/anchor.png" class="__anchor_icon" /></a>');
+ });