Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
5382ed1a
Commit
5382ed1a
authored
13 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
aliased some vars in linkwiz for brevity
parent
6d23f6ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/scripts/linkwiz.js
+29
-33
29 additions, 33 deletions
lib/scripts/linkwiz.js
with
29 additions
and
33 deletions
lib/scripts/linkwiz.js
+
29
−
33
View file @
5382ed1a
...
...
@@ -176,16 +176,17 @@ var dw_linkwiz = {
* Handles the "click" on a given result anchor
*/
resultClick
:
function
(
a
){
var
L
=
dw_linkwiz
;
var
id
=
a
.
title
;
if
(
id
==
''
||
id
.
substr
(
id
.
length
-
1
)
==
'
:
'
){
dw_linkwiz
.
entry
.
value
=
id
;
dw_linkwiz
.
autocomplete_exec
();
L
.
entry
.
value
=
id
;
L
.
autocomplete_exec
();
}
else
{
dw_linkwiz
.
entry
.
value
=
id
;
L
.
entry
.
value
=
id
;
if
(
a
.
nextSibling
&&
a
.
nextSibling
.
tagName
==
'
SPAN
'
){
dw_linkwiz
.
insertLink
(
a
.
nextSibling
.
innerHTML
);
L
.
insertLink
(
a
.
nextSibling
.
innerHTML
);
}
else
{
dw_linkwiz
.
insertLink
(
''
);
L
.
insertLink
(
''
);
}
}
},
...
...
@@ -197,10 +198,12 @@ var dw_linkwiz = {
* as link title instead
*/
insertLink
:
function
(
title
){
if
(
!
dw_linkwiz
.
entry
.
value
)
return
;
var
L
=
dw_linkwiz
;
var
E
=
L
.
entry
;
if
(
!
E
.
value
)
return
;
var
sel
=
getSelection
(
dw_linkwiz
.
textArea
);
if
(
sel
.
start
==
0
&&
sel
.
end
==
0
)
sel
=
dw_linkwiz
.
selection
;
var
sel
=
getSelection
(
L
.
textArea
);
if
(
sel
.
start
==
0
&&
sel
.
end
==
0
)
sel
=
L
.
selection
;
var
stxt
=
sel
.
getText
();
...
...
@@ -213,22 +216,22 @@ var dw_linkwiz = {
if
(
!
stxt
&&
!
DOKU_UHC
)
stxt
=
title
;
// prepend colon inside namespaces for non namespace pages
if
(
dw_linkwiz
.
textArea
.
form
[
'
id
'
].
value
.
indexOf
(
'
:
'
)
!=
-
1
&&
dw_linkwiz
.
entry
.
value
.
indexOf
(
'
:
'
)
==
-
1
){
dw_linkwiz
.
entry
.
value
=
'
:
'
+
dw_linkwiz
.
entry
.
value
;
if
(
L
.
textArea
.
form
[
'
id
'
].
value
.
indexOf
(
'
:
'
)
!=
-
1
&&
E
.
value
.
indexOf
(
'
:
'
)
==
-
1
){
E
.
value
=
'
:
'
+
E
.
value
;
}
var
link
=
'
[[
'
+
dw_linkwiz
.
entry
.
value
+
'
|
'
;
var
link
=
'
[[
'
+
E
.
value
+
'
|
'
;
if
(
stxt
)
link
+=
stxt
;
link
+=
'
]]
'
;
var
so
=
dw_linkwiz
.
entry
.
value
.
length
+
3
;
var
so
=
E
.
value
.
length
+
3
;
var
eo
=
2
;
pasteText
(
sel
,
link
,{
startofs
:
so
,
endofs
:
eo
});
dw_linkwiz
.
hide
();
L
.
hide
();
// reset the entry to the parent namespace and remove : at the beginning
dw_linkwiz
.
entry
.
value
=
dw_linkwiz
.
entry
.
value
.
replace
(
/
(
^:
)?[^
:
]
*$/
,
''
);
E
.
value
=
E
.
value
.
replace
(
/
(
^:
)?[^
:
]
*$/
,
''
);
},
/**
...
...
@@ -268,32 +271,25 @@ var dw_linkwiz = {
},
/**
* Clears the result area
* @fixme localize
*/
clear
:
function
(){
dw_linkwiz
.
result
.
innerHTML
=
'
Search for a matching page name above, or browse through the pages on the right
'
;
dw_linkwiz
.
entry
.
value
=
''
;
},
/**
* Show the dw_linkwizard
* Show the link wizard
*/
show
:
function
(){
dw_linkwiz
.
selection
=
getSelection
(
dw_linkwiz
.
textArea
);
dw_linkwiz
.
$wiz
.
css
(
'
marginLeft
'
,
'
0
'
);
dw_linkwiz
.
$wiz
.
css
(
'
marginTop
'
,
'
0
'
);
dw_linkwiz
.
entry
.
focus
();
dw_linkwiz
.
autocomplete
();
var
L
=
dw_linkwiz
;
L
.
selection
=
getSelection
(
dw_linkwiz
.
textArea
);
L
.
$wiz
.
css
(
'
marginLeft
'
,
'
0
'
);
L
.
$wiz
.
css
(
'
marginTop
'
,
'
0
'
);
L
.
entry
.
focus
();
L
.
autocomplete
();
},
/**
* Hide the link wizard
*/
hide
:
function
(){
dw_linkwiz
.
$wiz
.
css
(
'
marginLeft
'
,
'
-10000px
'
);
dw_linkwiz
.
$wiz
.
css
(
'
marginTop
'
,
'
-10000px
'
);
dw_linkwiz
.
textArea
.
focus
();
var
L
=
dw_linkwiz
;
L
.
$wiz
.
css
(
'
marginLeft
'
,
'
-10000px
'
);
L
.
$wiz
.
css
(
'
marginTop
'
,
'
-10000px
'
);
L
.
textArea
.
focus
();
},
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment