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
c2f2dedb
Commit
c2f2dedb
authored
9 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
reset page back to normal on closing dialog
parent
bcea9d64
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/plugins/styling/script.js
+27
-4
27 additions, 4 deletions
lib/plugins/styling/script.js
with
27 additions
and
4 deletions
lib/plugins/styling/script.js
+
27
−
4
View file @
c2f2dedb
...
...
@@ -2,12 +2,15 @@
jQuery
(
function
()
{
var
doreload
=
1
;
var
$styling_plugin
=
jQuery
(
'
#plugin__styling
'
);
if
(
!
$styling_plugin
.
length
)
return
;
// add the color picker
$styling_plugin
.
find
(
'
.color
'
).
iris
({});
// add button on main page
if
(
!
$styling_plugin
.
hasClass
(
'
ispopup
'
))
{
var
$hl
=
$styling_plugin
.
find
(
'
h1
'
).
first
();
var
$btn
=
jQuery
(
'
<button class="btn">
'
+
LANG
.
plugins
.
styling
.
popup
+
'
</button>
'
);
...
...
@@ -20,6 +23,23 @@ jQuery(function () {
return
;
}
// reload the main page on close
window
.
onunload
=
function
(
e
)
{
if
(
doreload
)
{
window
.
opener
.
document
.
location
.
reload
();
}
return
null
;
};
// don't reload on our own buttons
jQuery
(
'
input[type=submit]
'
).
click
(
function
(
e
){
doreload
=
false
;
});
// remove style
var
$style
=
window
.
opener
.
jQuery
(
'
link[rel=stylesheet][href*="lib/exe/css.php"]
'
);
$style
.
attr
(
'
href
'
,
''
);
// append the loader screen
$loader
=
window
.
opener
.
jQuery
(
'
#plugin__styling_loader
'
);
if
(
!
$loader
.
length
)
{
...
...
@@ -41,8 +61,11 @@ jQuery(function () {
window
.
opener
.
jQuery
(
'
body
'
).
append
(
$loader
);
}
// load preview in main window
var
now
=
new
Date
().
getTime
();
var
$style
=
window
.
opener
.
jQuery
(
'
link[rel=stylesheet][href*="lib/exe/css.php"]
'
);
$style
.
attr
(
'
href
'
,
DOKU_BASE
+
'
lib/exe/css.php?preview=1&tseed=
'
+
now
);
// load preview in main window (timeout works around chrome updating CSS weirdness)
window
.
setTimeout
(
function
()
{
var
now
=
new
Date
().
getTime
();
$style
.
attr
(
'
href
'
,
DOKU_BASE
+
'
lib/exe/css.php?preview=1&tseed=
'
+
now
);
},
500
);
});
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