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
fbedf126
Commit
fbedf126
authored
13 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
moved footnotes and section highlighting to ne file
jquerized
parent
b546d864
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/exe/js.php
+2
-1
2 additions, 1 deletion
lib/exe/js.php
lib/scripts/script.js
+0
-133
0 additions, 133 deletions
lib/scripts/script.js
with
2 additions
and
134 deletions
lib/exe/js.php
+
2
−
1
View file @
fbedf126
...
@@ -61,8 +61,9 @@ function js_out(){
...
@@ -61,8 +61,9 @@ function js_out(){
DOKU_INC
.
'lib/scripts/media.js'
,
DOKU_INC
.
'lib/scripts/media.js'
,
DOKU_INC
.
'lib/scripts/compatibility.js'
,
DOKU_INC
.
'lib/scripts/compatibility.js'
,
# disabled for FS#1958 DOKU_INC.'lib/scripts/hotkeys.js',
# disabled for FS#1958 DOKU_INC.'lib/scripts/hotkeys.js',
DOKU_TPLINC
.
'script.js'
,
DOKU_INC
.
'lib/scripts/behaviour.js'
,
DOKU_INC
.
'lib/scripts/behaviour.js'
,
DOKU_INC
.
'lib/scripts/page.js'
,
DOKU_TPLINC
.
'script.js'
,
);
);
// add possible plugin scripts and userscript
// add possible plugin scripts and userscript
...
...
This diff is collapsed.
Click to expand it.
lib/scripts/script.js
+
0
−
133
View file @
fbedf126
...
@@ -180,104 +180,6 @@ function hideLoadBar(id){
...
@@ -180,104 +180,6 @@ function hideLoadBar(id){
if
(
obj
)
obj
.
style
.
display
=
"
none
"
;
if
(
obj
)
obj
.
style
.
display
=
"
none
"
;
}
}
/**
* Create JavaScript mouseover popup
*/
function
insitu_popup
(
target
,
popup_id
)
{
// get or create the popup div
var
fndiv
=
$
(
popup_id
);
if
(
!
fndiv
){
fndiv
=
document
.
createElement
(
'
div
'
);
fndiv
.
id
=
popup_id
;
fndiv
.
className
=
'
insitu-footnote JSpopup dokuwiki
'
;
// autoclose on mouseout - ignoring bubbled up events
addEvent
(
fndiv
,
'
mouseout
'
,
function
(
e
){
var
p
=
e
.
relatedTarget
||
e
.
toElement
;
while
(
p
&&
p
!==
this
)
{
p
=
p
.
parentNode
;
}
if
(
p
===
this
)
{
return
;
}
// okay, hide it
this
.
style
.
display
=
'
none
'
;
});
getElementsByClass
(
'
dokuwiki
'
,
document
.
body
,
'
div
'
)[
0
].
appendChild
(
fndiv
);
}
var
non_static_parent
=
fndiv
.
parentNode
;
while
(
non_static_parent
!=
document
&&
gcs
(
non_static_parent
)[
'
position
'
]
==
'
static
'
)
{
non_static_parent
=
non_static_parent
.
parentNode
;
}
var
fixed_target_parent
=
target
;
while
(
fixed_target_parent
!=
document
&&
gcs
(
fixed_target_parent
)[
'
position
'
]
!=
'
fixed
'
)
{
fixed_target_parent
=
fixed_target_parent
.
parentNode
;
}
// position the div and make it visible
if
(
fixed_target_parent
!=
document
)
{
// the target has position fixed, that means the footnote needs to be fixed, too
fndiv
.
style
.
position
=
'
fixed
'
;
}
else
{
fndiv
.
style
.
position
=
'
absolute
'
;
}
if
(
fixed_target_parent
!=
document
||
non_static_parent
==
document
)
{
fndiv
.
style
.
left
=
findPosX
(
target
)
+
'
px
'
;
fndiv
.
style
.
top
=
(
findPosY
(
target
)
+
target
.
offsetHeight
*
1.5
)
+
'
px
'
;
}
else
{
fndiv
.
style
.
left
=
(
findPosX
(
target
)
-
findPosX
(
non_static_parent
))
+
'
px
'
;
fndiv
.
style
.
top
=
(
findPosY
(
target
)
+
target
.
offsetHeight
*
1.5
-
findPosY
(
non_static_parent
))
+
'
px
'
;
}
fndiv
.
style
.
display
=
''
;
return
fndiv
;
}
/**
* Display an insitu footnote popup
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Chris Smith <chris@jalakai.co.uk>
*/
function
footnote
(
e
){
var
fndiv
=
insitu_popup
(
e
.
target
,
'
insitu__fn
'
);
// locate the footnote anchor element
var
a
=
$
(
"
fn__
"
+
e
.
target
.
id
.
substr
(
5
));
if
(
!
a
){
return
;
}
// anchor parent is the footnote container, get its innerHTML
var
content
=
new
String
(
a
.
parentNode
.
parentNode
.
innerHTML
);
// strip the leading content anchors and their comma separators
content
=
content
.
replace
(
/<sup>.*<
\/
sup>/gi
,
''
);
content
=
content
.
replace
(
/^
\s
+
(
,
\s
+
)
+/
,
''
);
// prefix ids on any elements with "insitu__" to ensure they remain unique
content
=
content
.
replace
(
/
\b
id=
([
'"
])([^
"'
]
+
)\1
/gi
,
'
id="insitu__$2
'
);
// now put the content into the wrapper
fndiv
.
innerHTML
=
content
;
}
/**
* Add the event handlers to footnotes
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
addInitEvent
(
function
(){
var
elems
=
getElementsByClass
(
'
fn_top
'
,
null
,
'
a
'
);
for
(
var
i
=
0
;
i
<
elems
.
length
;
i
++
){
addEvent
(
elems
[
i
],
'
mouseover
'
,
function
(
e
){
footnote
(
e
);});
}
});
/**
/**
* Handler to close all open Popups
* Handler to close all open Popups
*/
*/
...
@@ -314,38 +216,3 @@ addInitEvent(function(){
...
@@ -314,38 +216,3 @@ addInitEvent(function(){
}
}
});
});
/**
* Highlight the section when hovering over the appropriate section edit button
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
addInitEvent
(
function
(){
var
btns
=
getElementsByClass
(
'
btn_secedit
'
,
document
,
'
form
'
);
for
(
var
i
=
0
;
i
<
btns
.
length
;
i
++
){
addEvent
(
btns
[
i
],
'
mouseover
'
,
function
(
e
){
var
tgt
=
this
.
parentNode
;
var
nr
=
tgt
.
className
.
match
(
/
(\s
+|^
)
editbutton_
(\d
+
)(\s
+|$
)
/
)[
2
];
do
{
tgt
=
tgt
.
previousSibling
;
}
while
(
tgt
!==
null
&&
typeof
tgt
.
tagName
===
'
undefined
'
);
if
(
tgt
===
null
)
return
;
while
(
typeof
tgt
.
className
===
'
undefined
'
||
tgt
.
className
.
match
(
'
(
\\
s+|^)sectionedit
'
+
nr
+
'
(
\\
s+|$)
'
)
===
null
)
{
if
(
typeof
tgt
.
className
!==
'
undefined
'
)
{
tgt
.
className
+=
'
section_highlight
'
;
}
tgt
=
(
tgt
.
previousSibling
!==
null
)
?
tgt
.
previousSibling
:
tgt
.
parentNode
;
}
if
(
typeof
tgt
.
className
!==
'
undefined
'
)
tgt
.
className
+=
'
section_highlight
'
;
});
addEvent
(
btns
[
i
],
'
mouseout
'
,
function
(
e
){
var
secs
=
getElementsByClass
(
'
section_highlight
'
);
for
(
var
j
=
0
;
j
<
secs
.
length
;
j
++
){
secs
[
j
].
className
=
secs
[
j
].
className
.
replace
(
/section_highlight/g
,
''
);
}
});
}
});
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