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
e422a60a
Commit
e422a60a
authored
9 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
added color picker support
I'm not too hapy with it
parent
82f9aff6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/plugins/styler/admin.php
+27
-1
27 additions, 1 deletion
lib/plugins/styler/admin.php
lib/plugins/styler/iris.js
+1488
-0
1488 additions, 0 deletions
lib/plugins/styler/iris.js
lib/plugins/styler/script.js
+10
-3
10 additions, 3 deletions
lib/plugins/styler/script.js
with
1525 additions
and
4 deletions
lib/plugins/styler/admin.php
+
27
−
1
View file @
e422a60a
...
...
@@ -84,7 +84,7 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
foreach
(
$replacements
as
$key
=>
$value
)
{
echo
'<tr>'
;
echo
'<td>'
.
$key
.
'</td>'
;
echo
'<td><input name="tpl['
.
hsc
(
$key
)
.
']" value="'
.
hsc
(
$value
)
.
'" />'
;
echo
'<td><input name="tpl['
.
hsc
(
$key
)
.
']" value="'
.
hsc
(
$value
)
.
'"
'
.
$this
->
colorClass
(
$key
)
.
'
/>'
;
echo
'</tr>'
;
}
echo
'</table>'
;
...
...
@@ -107,6 +107,32 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
}
}
/**
* set the color class attribute
*/
protected
function
colorClass
(
$key
)
{
static
$colors
=
array
(
'text'
,
'background'
,
'text_alt'
,
'background_alt'
,
'text_neu'
,
'background_neu'
,
'border'
,
'highlight'
,
'background_site'
,
'link'
,
'existing'
,
'missing'
,
);
if
(
preg_match
(
'/colou?r/'
,
$key
)
||
in_array
(
trim
(
$key
,
'_'
),
$colors
))
{
return
'class="color"'
;
}
else
{
return
''
;
}
}
/**
* saves the preview.ini
*/
...
...
This diff is collapsed.
Click to expand it.
lib/plugins/styler/iris.js
0 → 100644
+
1488
−
0
View file @
e422a60a
This diff is collapsed.
Click to expand it.
lib/plugins/styler/script.js
+
10
−
3
View file @
e422a60a
/* DOKUWIKI:include_once iris.js */
jQuery
(
function
()
{
// user openend the admin page, set cookie and redirect
if
(
jQuery
(
'
#plugin__styler
'
).
length
)
{
if
(
jQuery
(
'
#plugin__styler
'
).
length
)
{
DokuCookie
.
setValue
(
'
styler_plugin
'
,
1
);
document
.
location
.
href
=
DOKU_BASE
;
}
...
...
@@ -22,11 +24,12 @@ jQuery(function () {
$style
.
attr
(
'
href
'
,
DOKU_BASE
+
'
lib/exe/css.php?preview=1&tseed=
'
+
now
);
// open the dialog
$dialog
.
dialog
({
var
$dlg
=
$dialog
.
dialog
({
'
title
'
:
LANG
.
plugins
.
styler
.
menu
,
'
width
'
:
500
,
'
top
'
:
50
,
'
position
'
:
{
'
my
'
:
'
left top
'
,
'
at
'
:
'
left top
'
,
'
of
'
:
window
},
'
maxHeight
'
:
500
,
'
position
'
:
{
'
my
'
:
'
left bottom
'
,
'
at
'
:
'
left bottom
'
,
'
of
'
:
window
},
// bring everything back to normal
'
close
'
:
function
(
event
,
ui
)
{
// disable the styler plugin again
...
...
@@ -35,6 +38,10 @@ jQuery(function () {
document
.
location
.
reload
()
}
});
jQuery
(
'
.styler .color
'
).
iris
({
});
}
);
}
...
...
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