Forward porting TinyMCE ask user fix for FF browsers on Windows.
This commit is contained in:
parent
fe99aa7665
commit
0175abdfc5
3 changed files with 33 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
- fixed #10724: gotcha.txt for 7.7.17 enhanced
|
||||
- fixed #10316: Cannot view pending version tags
|
||||
- fixed #10710: testEnvironment 7.6.33
|
||||
- fixed #9777: Cursor disappears in non-Rich Editor window
|
||||
- fixed #10667: cannot change size of template editor
|
||||
- fixed #10654: Story Archive: Search not working properly
|
||||
- fixed #10692: Unprivileged users can stop spectre
|
||||
|
|
|
|||
|
|
@ -489,7 +489,8 @@ sub getRichEditor {
|
|||
theme_advanced_resizing => JSON::true(),
|
||||
(map { "theme_advanced_buttons".($_+1) => (join ',', @{$toolbarRows[$_]}) }
|
||||
(0..$#toolbarRows)),
|
||||
ask => $self->getValue("askAboutRichEdit") ? JSON::true() : JSON::false(),
|
||||
#ask => $self->getValue("askAboutRichEdit") ? JSON::true() : JSON::false(),
|
||||
ask => JSON::false(),
|
||||
preformatted => $self->getValue("preformatted") ? JSON::true() : JSON::false(),
|
||||
force_br_newlines => $self->getValue("useBr") ? JSON::true() : JSON::false(),
|
||||
force_p_newlines => $self->getValue("useBr") ? JSON::false() : JSON::true(),
|
||||
|
|
@ -502,6 +503,10 @@ sub getRichEditor {
|
|||
valid_elements => $self->getValue("validElements"),
|
||||
wg_userIsVisitor => $self->session->user->isVisitor ? JSON::true() : JSON::false(),
|
||||
);
|
||||
my $ask = $self->getValue("askAboutRichEdit");
|
||||
if ($ask) {
|
||||
$config{oninit} = 'turnOffTinyMCE_'.$nameId;
|
||||
}
|
||||
foreach my $button (@toolbarButtons) {
|
||||
if ($button eq "spellchecker" && $self->session->config->get('availableDictionaries')) {
|
||||
push(@plugins,"-wgspellchecker");
|
||||
|
|
@ -569,12 +574,29 @@ sub getRichEditor {
|
|||
|
||||
$self->session->style->setScript($self->session->url->extras('tinymce/jscripts/tiny_mce/tiny_mce.js'),{type=>"text/javascript"});
|
||||
$self->session->style->setScript($self->session->url->extras("tinymce-webgui/callbacks.js"),{type=>"text/javascript"});
|
||||
my $out = "<script type=\"text/javascript\">\n";
|
||||
my $out = '';
|
||||
if ($ask) {
|
||||
$out = q|<a style="display: block;" href="javascript:toggleEditor('|.$nameId.q|')">|.$i18n->get('Toggle editor').q|</a>|;
|
||||
}
|
||||
$out .= q|<script type="text/javascript">|;
|
||||
while (my ($plugin, $path) = each %loadPlugins) {
|
||||
$out .= "tinymce.PluginManager.load('$plugin', '$path');\n";
|
||||
}
|
||||
$out .= "\ttinyMCE.init(" . JSON->new->pretty->encode(\%config) . " )\n"
|
||||
. "</script>";
|
||||
$out .= "\ttinyMCE.init(" . JSON->new->pretty->encode(\%config) . " );\n";
|
||||
if ($ask) {
|
||||
$out .= <<"EOHTML1";
|
||||
function toggleEditor(id) {
|
||||
if (!tinyMCE.get(id))
|
||||
tinyMCE.execCommand('mceAddControl', false, id);
|
||||
else
|
||||
tinyMCE.execCommand('mceRemoveControl', false, id);
|
||||
}
|
||||
function turnOffTinyMCE_$nameId () {
|
||||
tinyMCE.execCommand( 'mceRemoveControl', false, '$nameId');
|
||||
}
|
||||
EOHTML1
|
||||
}
|
||||
$out .= "</script>";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -457,6 +457,12 @@ option is set to Yes, then all whitespace entered into the form will be preserve
|
|||
lastUpdated => 1206653834,
|
||||
},
|
||||
|
||||
'Toggle editor' => {
|
||||
message => q{Toggle editor},
|
||||
lastUpdated => 0,
|
||||
context => q{Toggle, to switch between on and off},
|
||||
},
|
||||
|
||||
'editForm allowMedia label' => {
|
||||
message => q{Allow Media},
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue