Skip to content

Commit cda4f82

Browse files
committed
Merge pull request SammyLin#108 from redvulps/master
Updated redactor to version 9.1.9
2 parents a475901 + 23430ba commit cda4f82

File tree

7 files changed

+1258
-758
lines changed

7 files changed

+1258
-758
lines changed

lib/redactor-rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module RedactorRails
2-
VERSION = "0.4.3"
2+
VERSION = "0.4.4"
33
end

vendor/assets/javascripts/redactor-rails/plugins/fontcolor.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ if (!RedactorPlugins) var RedactorPlugins = {};
33
RedactorPlugins.fontcolor = {
44
init: function()
55
{
6-
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'];
6+
var colors = [
7+
'#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00',
8+
'#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca',
9+
'#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694',
10+
'#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314',
11+
'#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100',
12+
'#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'
13+
];
14+
715
var buttons = ['fontcolor', 'backcolor'];
816

917
this.buttonAddSeparator();
@@ -12,7 +20,7 @@ RedactorPlugins.fontcolor = {
1220
{
1321
var name = buttons[i];
1422

15-
var $dropdown = $('<div class="redactor_dropdown redactor_dropdown_box_' + name + '" style="display: none; width: 210px;">');
23+
var $dropdown = $('<div class="redactor_dropdown redactor_dropdown_box_' + name + '" style="display: none; width: 243px;">');
1624

1725
this.pickerBuild($dropdown, name, colors);
1826
$(this.$toolbar).append($dropdown);
@@ -44,7 +52,7 @@ RedactorPlugins.fontcolor = {
4452
{
4553
var color = colors[z];
4654

47-
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>');
55+
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>');
4856
$swatch.css('background-color', color);
4957
$dropdown.append($swatch);
5058
$swatch.on('click', onSwatch);

vendor/assets/javascripts/redactor-rails/plugins/fullscreen.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ RedactorPlugins.fullscreen = {
3232

3333
this.fsheight = this.$editor.height();
3434

35+
if (this.opts.maxHeight) this.$editor.css('max-height', '');
3536
if (this.opts.iframe) html = this.get();
3637

37-
this.tmpspan = $('<span></span>');
38-
this.$box.addClass('redactor_box_fullscreen').after(this.tmpspan);
39-
38+
this.$box.addClass('redactor_box_fullscreen');
4039
$('body, html').css('overflow', 'hidden');
41-
$('body').prepend(this.$box);
4240

4341
if (this.opts.iframe) this.fullscreenIframe(html);
4442

@@ -62,13 +60,13 @@ RedactorPlugins.fullscreen = {
6260
this.$box.removeClass('redactor_box_fullscreen').css({ width: 'auto', height: 'auto' });
6361

6462
if (this.opts.iframe) html = this.$editor.html();
65-
this.tmpspan.after(this.$box).remove();
6663

6764
if (this.opts.iframe) this.fullscreenIframe(html);
6865
else this.sync();
6966

7067
var height = this.fsheight;
7168
if (this.opts.autoresize) height = 'auto';
69+
if (this.opts.maxHeight) this.$editor.css('max-height', this.opts.maxHeight);
7270

7371
if (this.opts.toolbarExternal)
7472
{
@@ -90,10 +88,8 @@ RedactorPlugins.fullscreen = {
9088
},
9189
fullscreenIframe: function(html)
9290
{
93-
this.$editor = this.$frame.contents().find('body').attr({
94-
'contenteditable': true,
95-
'dir': this.opts.direction
96-
});
91+
this.$editor = this.$frame.contents().find('body');
92+
this.$editor.attr({ 'contenteditable': true, 'dir': this.opts.direction });
9793

9894
// set document & window
9995
if (this.$editor[0])

0 commit comments

Comments
 (0)