mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Fix to drop pretty redundant Expert mode to: Basic, Simple, Advanced
This commit is contained in:
@@ -51,7 +51,7 @@ if ($opts->{'extra'}->{'js'}) {
|
||||
|
||||
# Automatically load dependencies
|
||||
# based on editor mode
|
||||
if ($opts->{'type'} =~ /^(advanced|expert)$/) {
|
||||
if ($opts->{'type'} eq "advanced") {
|
||||
my $highlight_bundle = ['highlight/highlight'];
|
||||
my @highlight_bundle = @{$highlight_bundle};
|
||||
if ($opts->{'_'}->{'client'}->{'palette'} eq 'dark') {
|
||||
@@ -174,7 +174,8 @@ if ($opts->{'type'} eq 'basic') {
|
||||
return
|
||||
<<EOF;
|
||||
[
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
['bold', 'italic'],
|
||||
[{'color': []}],
|
||||
['blockquote']
|
||||
]
|
||||
EOF
|
||||
@@ -185,36 +186,18 @@ if ($opts->{'type'} eq 'simple') {
|
||||
[
|
||||
[{'font': [false, 'monospace']},
|
||||
{'size': ['0.75em', false, "1.15em", '1.3em']}],
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
['bold', 'italic', 'underline'],
|
||||
[{'color': []}, {'background': []}],
|
||||
[{'align': []}],
|
||||
['blockquote'],
|
||||
['link'],
|
||||
['image'],
|
||||
['clean']
|
||||
]
|
||||
EOF
|
||||
}
|
||||
if ($opts->{'type'} eq 'advanced') {
|
||||
return
|
||||
<<EOF;
|
||||
[
|
||||
[{'font': [false, 'monospace']},
|
||||
{'size': ['0.75em', false, "1.15em", '1.3em']}],
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
[{'color': []}, {'background': []}],
|
||||
[{'align': []}],
|
||||
[{'list': 'ordered'}, {'list': 'bullet'}],
|
||||
[{'indent': '-1'}, {'indent': '+1'}],
|
||||
['blockquote'],
|
||||
(typeof hljs === 'object' ? ['code-block'] : []),
|
||||
['link'],
|
||||
['image'],
|
||||
[{'direction': 'rtl'}],
|
||||
['clean']
|
||||
]
|
||||
EOF
|
||||
}
|
||||
if ($opts->{'type'} eq 'expert') {
|
||||
return
|
||||
<<EOF;
|
||||
[
|
||||
[{'font': [false, 'monospace']},
|
||||
@@ -229,12 +212,12 @@ if ($opts->{'type'} eq 'expert') {
|
||||
['blockquote'],
|
||||
(typeof hljs === 'object' ? ['code-block'] : []),
|
||||
['link'],
|
||||
['image', 'video'],
|
||||
['image'],
|
||||
[{'direction': 'rtl'}],
|
||||
['clean']
|
||||
]
|
||||
EOF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub html_editor_init_script
|
||||
@@ -247,9 +230,7 @@ my $target_type = $target_text->{'type'} || '=';
|
||||
my $target_name = $target_text->{'name'};
|
||||
|
||||
# HTML editor toolbar mode
|
||||
my $iframe_styles_mode =
|
||||
$opts->{'type'} =~ /(^advanced|expert$)/ ? 'advanced' :
|
||||
$opts->{'type'} eq 'basic' ? 'basic' : 'simple';
|
||||
my $iframe_styles_mode = $opts->{'type'};
|
||||
my $iframe_styles =
|
||||
"e_escape(
|
||||
&read_file_contents("$root_directory/unauthenticated/css/_iframe/$iframe_styles_mode.min.css"), '"');
|
||||
|
||||
@@ -26,7 +26,7 @@ no_crlf=0
|
||||
sync_perms=0700
|
||||
show_mail=0
|
||||
html_edit=2
|
||||
html_edit_mode=advanced
|
||||
html_edit_mode=simple
|
||||
check_mod=1
|
||||
spam_buttons=mail
|
||||
show_delall=0
|
||||
|
||||
@@ -12,7 +12,7 @@ delete_warn=Ask for confirmation before deleting?,10,y-Yes,n-No,For mbox files l
|
||||
view_html=Show message body as,4,0-Always plain text,1-Text if possible, HTML otherwise,2-HTML if possible, text otherwise,3-Convert HTML to plain text
|
||||
view_images=Show inline images by default?,1,0-Yes, client fetched,3-Yes, server fetched,1-No external images,2-No
|
||||
html_edit=Use HTML editor for composing?,4,2-Always,1-When replying to HTML email,0-Never
|
||||
html_edit_mode=HTML editor toolbar mode?,4,basic-Basic,simple-Simple,advanced-Advanced,expert-Expert
|
||||
html_edit_mode=HTML editor toolbar mode?,4,basic-Basic,simple-Simple,advanced-Advanced
|
||||
html_quote=HTML quoting mode,1,1-Message below <hr>,0-Message inside <blockquote>
|
||||
log_read=Record the reading of mail in the Webmin Actions Log?,1,1-Yes,0-No
|
||||
bcc_to=Bcc: sent messages to,0
|
||||
|
||||
@@ -460,7 +460,7 @@ my $html_editor = &html_editor(
|
||||
data => [ { iframe => '#quote-mail-iframe',
|
||||
elements => ['#webmin-iframe-quote'] } ] }
|
||||
},
|
||||
type => $config{'html_edit_mode'} || 'advanced',
|
||||
type => $config{'html_edit_mode'} || 'simple',
|
||||
after =>
|
||||
{ editor => $iframe_quote }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user