Not logged in. · Lost password · Register
Forum: General Help and Support Plugins Plugin Wishlist RSS
Copy internal section link
Page:  previous  1  2 
Avatar
SFITCS #16
User title: Scott Ferguson
Member since Dec 2014 · 463 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
In reply to post ID 20117
There's a plugin for that. TitlesAnchorLink Plugin (similar to PurpleNumbers).
Avatar
sancaya #17
Member since Aug 2013 · 37 posts · Location: Vnukovo
Group memberships: Members
Show profile · Link to this post
Quote by SFITCS:
There's a plugin for that. TitlesAnchorLink Plugin (similar to PurpleNumbers).
TitlesAnchorLink Plugin is for external links, so it's different.
Avatar
SFITCS #18
User title: Scott Ferguson
Member since Dec 2014 · 463 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
Quote by sancaya:
TitlesAnchorLink Plugin is for external links, so it's different.
Agreed. In English similar != same. :)

Note also that:-
;this subject has been covered before in the forums.
;Ach's script works well, your modified version gives a javascript error.

It seems simpler to just use one of the many Clipboard tools and a little RegEx, than add userstyles, userscripts, and add a class to entire pages - however, choices are good.
Avatar
sancaya #19
Member since Aug 2013 · 37 posts · Location: Vnukovo
Group memberships: Members
Show profile · Link to this post
Quote by SFITCS:
;this subject has been covered before in the forums.
The problem described in this topic is actually different:
- We have a section with a headline (rather than ready html link).
- For this headline/section, our JS constructs inner DW reference (like [[:ns1:ns2:title#section|Section]]).

That's why JS is needed - to construct an inner DW reference.
And CSS is needed to hide/show that construction on hover.
Alternatively, instead of JS, we would need to modify the PHP output of sections' headers.
Also, JS is needed for making automatic text selections.

Quote by SFITCS:
;Ach's script works well, your modified version gives a javascript error.
Sorrry. In Palemoon and Opera it worked.
I'm not proficient in JS, so if anyone could, please help to debug it.
Avatar
SFITCS #20
User title: Scott Ferguson
Member since Dec 2014 · 463 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
Quote by sancaya:
The problem described in this topic is actually different:
Agreed - the OP requested a different solution. Though often it's the case that the person seeking a solution is focused on an approach which may not be the only/optimal one.
After consideration I can see an advantage to that approach - better suited to low level users; and a disadvantage - not well suited to situations where you wish to work with a list of internal links.
It also occurs to me that there may be a third approach (which may already have a plugin solution I haven't noticed/looked for) - a link plugin that allows a user to select internal links by first choosing the namespace, then page, then page anchors.
Sorrry. In Palemoon and Opera it worked.
I'm not proficient in JS, so if anyone could, please help to debug it.
If I get time soon I'll take a look, from memory it's just missing a ";" somewhere.
Avatar
sancaya #21
Member since Aug 2013 · 37 posts · Location: Vnukovo
Group memberships: Members
Show profile · Link to this post
Quote by SFITCS:
After consideration I can see an advantage to that approach - better suited to low level users; and a disadvantage - not well suited to situations where you wish to work with a list of internal links.
It also occurs to me that there may be a third approach (which may already have a plugin solution I haven't noticed/looked for) - a link plugin that allows a user to select internal links by first choosing the namespace, then page, then page anchors.
Definitely click + Ctrl-C is faster and easier than selecting several times (among dozens or hundreds of objects).
And if we want to get links to other pages or other pages' sections, then indexmenu plugin in a sidebar works well. Right-click on the needed page in a list, select "Preview" and see there links of sections that we could copy.

Quote by SFITCS:
If I get time soon I'll take a look, from memory it's just missing a ";" somewhere.
Thanks! Missing ";" happened there as I copypasted that piece of code.
PS. Now it should work.
This post was edited on 2016-10-21, 05:06 by sancaya.
Avatar
danmundy #22
Member since Oct 2016 · 2 posts
Group memberships: Members
Show profile · Link to this post
Does anyone know how to modify this code so that the links aren't shown when I print a wiki page on paper? (using CTRL+P)

It makes the headings look quite ugly on paper when it's eg:

Heading[[:pagename#heading|Heading]]

Thanks,
Dan
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  previous  1  2 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-02-19, 20:17:00 (UTC +01:00)