Skip to content
Snippets Groups Projects
Commit de3a74c5 authored by Jared Hancock's avatar Jared Hancock
Browse files

Upgrade to Redactor 9.2.1

parent 6f9c14b2
No related branches found
No related tags found
No related merge requests found
File added
This diff is collapsed.
...@@ -62,6 +62,8 @@ class DraftAjaxAPI extends AjaxController { ...@@ -62,6 +62,8 @@ class DraftAjaxAPI extends AjaxController {
if (!$draft->setBody($body)) if (!$draft->setBody($body))
return Http::response(500, "Unable to update draft body"); return Http::response(500, "Unable to update draft body");
echo "{}";
} }
function _uploadInlineImage($draft) { function _uploadInlineImage($draft) {
......
if (!RedactorPlugins) var RedactorPlugins = {}; if (!RedactorPlugins) var RedactorPlugins = {};
RedactorPlugins.fontfamily = { RedactorPlugins.fontfamily = {
init: function () init: function ()
{ {
var fonts = [ 'Arial', 'Helvetica', 'Georgia', 'Times New Roman', 'Monospace' ]; var fonts = [ 'Arial', 'Helvetica', 'Georgia', 'Times New Roman', 'Monospace' ];
var that = this; var that = this;
var dropdown = {}; var dropdown = {};
$.each(fonts, function(i, s) $.each(fonts, function(i, s)
{ {
dropdown['s' + i] = { dropdown['s' + i] = { title: '<span style="font-family:'+s+';">'+s+'</style>', callback: function() { that.setFontfamily(s); }};
title: '<span style="font-family:'+s+';">'+s+'</style>' , });
callback: function() { that.setFontfamily(s); }};
}); dropdown['remove'] = { title: 'Remove font', callback: function() { that.resetFontfamily(); }};
dropdown['remove'] = { title: 'Remove font', callback: function() { that.resetFontfamily(); }}; this.buttonAddBefore('bold', 'fontfamily', 'Change font family', false, dropdown);
},
this.buttonAddBefore('bold', 'fontfamily', 'Change font family', false, dropdown); setFontfamily: function (value)
}, {
setFontfamily: function (value) this.inlineSetStyle('font-family', value);
{ },
this.inlineSetStyle('font-family', value); resetFontfamily: function()
}, {
resetFontfamily: function() this.inlineRemoveStyle('font-family');
{ }
this.inlineRemoveStyle('font-family');
}
}; };
RedactorPlugins.fontcolor = { RedactorPlugins.fontcolor = {
init: function() init: function()
{ {
var colors = ['#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00', '#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca', '#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694', '#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314', '#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100', '#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000']; var colors = [
var buttons = ['fontcolor', 'backcolor']; '#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00',
'#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca',
for (var i = 1; i >= 0 ; i--) '#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694',
{ '#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314',
var name = buttons[i]; '#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100',
'#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'
var $dropdown = $('<div class="redactor_dropdown redactor_dropdown_box_' + name + '" style="display: none; width: 210px;">'); ];
this.pickerBuild($dropdown, name, colors); var buttons = ['fontcolor', 'backcolor'];
$(this.$toolbar).append($dropdown);
for (var i = 0; i < 2; i++)
this.buttonAddAfter('deleted', name, this.opts.curLang[name], $.proxy(function(btnName, $button, btnObject, e) {
{ var name = buttons[i];
this.dropdownShow(e, btnName);
var $dropdown = $('<div class="redactor_dropdown redactor_dropdown_box_' + name + '" style="display: none; width: 265px;">');
}, this));
} this.pickerBuild($dropdown, name, colors);
this.buttonAddSeparatorBefore(buttons[0]); $(this.$toolbar).append($dropdown);
}, this.buttonAddBefore('deleted', name, this.opts.curLang[name], $.proxy(function(btnName, $button, btnObject, e)
pickerBuild: function($dropdown, name, colors) {
{ this.dropdownShow(e, btnName);
var rule = 'color';
if (name === 'backcolor') rule = 'background-color'; }, this));
}
var _self = this; },
var onSwatch = function(e) pickerBuild: function($dropdown, name, colors)
{ {
e.preventDefault(); var rule = 'color';
if (name === 'backcolor') rule = 'background-color';
var $this = $(this);
_self.pickerSet($this.data('rule'), $this.attr('rel')); var _self = this;
var onSwatch = function(e)
} {
e.preventDefault();
var len = colors.length;
for (var z = 0; z < len; z++) var $this = $(this);
{ _self.pickerSet($this.data('rule'), $this.attr('rel'));
var color = colors[z];
};
var $swatch = $('<a rel="' + color + '" data-rule="' + rule +'" href="#" style="float: left; font-size: 0; border: 2px solid #fff; padding: 0; margin: 0; width: 15px; height: 15px;"></a>');
$swatch.css('background-color', color); var len = colors.length;
$dropdown.append($swatch); for (var z = 0; z < len; z++)
$swatch.on('click', onSwatch); {
} var color = colors[z];
var $elNone = $('<a href="#" style="display: block; clear: both; padding: 4px 0; font-size: 11px; line-height: 1;"></a>') var $swatch = $('<a rel="' + color + '" data-rule="' + rule +'" href="#" style="float: left; font-size: 0; border: 2px solid #fff; padding: 0; margin: 0; width: 20px; height: 20px;"></a>');
.html(this.opts.curLang.none) $swatch.css('background-color', color);
.on('click', function(e) $dropdown.append($swatch);
{ $swatch.on('click', onSwatch);
e.preventDefault(); }
_self.pickerSet(rule, false);
}); var $elNone = $('<a href="#" style="display: block; clear: both; padding: 4px 0; font-size: 11px; line-height: 1;"></a>')
.html(this.opts.curLang.none)
$dropdown.append($elNone); .on('click', function(e)
}, {
pickerSet: function(rule, type) e.preventDefault();
{ _self.pickerSet(rule, false);
this.bufferSet(); });
this.$editor.focus(); $dropdown.append($elNone);
this.inlineRemoveStyle(rule); },
if (type !== false) this.inlineSetStyle(rule, type); pickerSet: function(rule, type)
if (this.opts.air) this.$air.fadeOut(100); {
this.sync(); this.bufferSet();
}
this.$editor.focus();
this.inlineRemoveStyle(rule);
if (type !== false) this.inlineSetStyle(rule, type);
if (this.opts.air) this.$air.fadeOut(100);
this.sync();
}
}; };
RedactorPlugins.fontsize = { RedactorPlugins.fontsize = {
......
...@@ -223,7 +223,8 @@ $(function() { ...@@ -223,7 +223,8 @@ $(function() {
'imageGetJson': 'ajax.php/draft/images/browse', 'imageGetJson': 'ajax.php/draft/images/browse',
'syncBeforeCallback': captureImageSizes, 'syncBeforeCallback': captureImageSizes,
'linebreaks': true, 'linebreaks': true,
'tabFocus': false 'tabFocus': false,
'toolbarFixedBox': true
}; };
if (el.data('redactor')) return; if (el.data('redactor')) return;
var reset = $('input[type=reset]', el.closest('form')); var reset = $('input[type=reset]', el.closest('form'));
......
This diff is collapsed.
...@@ -1281,6 +1281,9 @@ time { ...@@ -1281,6 +1281,9 @@ time {
.redactor_air { .redactor_air {
z-index: 7 !important; z-index: 7 !important;
} }
.redactor_editor {
font-size: 11pt;
}
.dialog#advanced-search { .dialog#advanced-search {
width:640px !important; width:640px !important;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment