Skip to content

Commit

Permalink
Merge pull request SammyLin#108 from redvulps/master
Browse files Browse the repository at this point in the history
Updated redactor to version 9.1.9
  • Loading branch information
SammyLin committed May 14, 2014
2 parents a475901 + 23430ba commit cda4f82
Show file tree
Hide file tree
Showing 7 changed files with 1,258 additions and 758 deletions.
2 changes: 1 addition & 1 deletion lib/redactor-rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RedactorRails
VERSION = "0.4.3"
VERSION = "0.4.4"
end
14 changes: 11 additions & 3 deletions vendor/assets/javascripts/redactor-rails/plugins/fontcolor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ if (!RedactorPlugins) var RedactorPlugins = {};
RedactorPlugins.fontcolor = {
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 = [
'#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 buttons = ['fontcolor', 'backcolor'];

this.buttonAddSeparator();
Expand All @@ -12,7 +20,7 @@ RedactorPlugins.fontcolor = {
{
var name = buttons[i];

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

this.pickerBuild($dropdown, name, colors);
$(this.$toolbar).append($dropdown);
Expand Down Expand Up @@ -44,7 +52,7 @@ RedactorPlugins.fontcolor = {
{
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>');
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>');
$swatch.css('background-color', color);
$dropdown.append($swatch);
$swatch.on('click', onSwatch);
Expand Down
14 changes: 5 additions & 9 deletions vendor/assets/javascripts/redactor-rails/plugins/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ RedactorPlugins.fullscreen = {

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

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

this.tmpspan = $('<span></span>');
this.$box.addClass('redactor_box_fullscreen').after(this.tmpspan);

this.$box.addClass('redactor_box_fullscreen');
$('body, html').css('overflow', 'hidden');
$('body').prepend(this.$box);

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

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

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

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

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

if (this.opts.toolbarExternal)
{
Expand All @@ -90,10 +88,8 @@ RedactorPlugins.fullscreen = {
},
fullscreenIframe: function(html)
{
this.$editor = this.$frame.contents().find('body').attr({
'contenteditable': true,
'dir': this.opts.direction
});
this.$editor = this.$frame.contents().find('body');
this.$editor.attr({ 'contenteditable': true, 'dir': this.opts.direction });

// set document & window
if (this.$editor[0])
Expand Down
Loading

0 comments on commit cda4f82

Please sign in to comment.