edition
This commit is contained in:
parent
66e95d7401
commit
84c708a6be
@ -8268,4 +8268,88 @@
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
||||
|
||||
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||
|
||||
RedactorPlugins.fontcolor = {
|
||||
init: function()
|
||||
{
|
||||
var colors = [
|
||||
'#ffffff','#000000',"#993300","#333300","#003300","#003366","#000080","#333399","#333333","#800000","#FF6600","#808000","#008000","#008080","#0000FF","#666699","#808080","#FF0000","#FF9900","#99CC00","#339966","#33CCCC","#3366FF","#800080","#999999","#FF00FF","#FFCC00","#FFFF00","#00FF00","#00FFFF","#00CCFF","#993366","#C0C0C0","#FF99CC","#FFCC99","#FFFF99","#CCFFCC","#CCFFFF","#99CCFF","#CC99FF",
|
||||
'#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'];
|
||||
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
var name = buttons[i];
|
||||
|
||||
var $dropdown = $('<div class="redactor_dropdown redactor_dropdown_box_' + name + '" style="display: none; width: 243px;">');
|
||||
|
||||
this.pickerBuild($dropdown, name, colors);
|
||||
$(this.$toolbar).append($dropdown);
|
||||
|
||||
var btn = this.buttonAdd(name, this.opts.curLang[name], $.proxy(function(btnName, $button, btnObject, e)
|
||||
{
|
||||
this.dropdownShow(e, btnName);
|
||||
|
||||
}, this));
|
||||
|
||||
btn.data('dropdown', $dropdown);
|
||||
}
|
||||
},
|
||||
pickerBuild: function($dropdown, name, colors)
|
||||
{
|
||||
var rule = 'color';
|
||||
if (name === 'backcolor') rule = 'background-color';
|
||||
|
||||
var _self = this;
|
||||
var onSwatch = function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
var $this = $(this);
|
||||
_self.pickerSet($this.data('rule'), $this.attr('rel'));
|
||||
|
||||
}
|
||||
|
||||
var len = colors.length;
|
||||
for (var z = 0; z < len; z++)
|
||||
{
|
||||
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: 20px; height: 20px;"></a>');
|
||||
$swatch.css('background-color', color);
|
||||
$dropdown.append($swatch);
|
||||
$swatch.on('click', onSwatch);
|
||||
}
|
||||
|
||||
var $elNone = $('<a href="#" style="display: block; clear: both; padding: 4px 0; font-size: 11px; line-height: 1;"></a>')
|
||||
.html(this.opts.curLang.none)
|
||||
.on('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
_self.pickerSet(rule, false);
|
||||
});
|
||||
|
||||
$dropdown.append($elNone);
|
||||
},
|
||||
pickerSet: function(rule, type)
|
||||
{
|
||||
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();
|
||||
}
|
||||
};
|
@ -7,13 +7,12 @@
|
||||
|
||||
|
||||
|
||||
|
||||
-if TextContent::STYLES.size > 0
|
||||
Style :
|
||||
= f.select :style, TextContent::STYLES
|
||||
|
||||
|
||||
|
||||
|
||||
:javascript
|
||||
$("#element_form form").submit(function (e){
|
||||
|
||||
@ -23,8 +22,9 @@
|
||||
});
|
||||
|
||||
$('#portlet_'+$("#element_form form").data("portlet-id")+' .content').redactor({
|
||||
plugins: ['fontcolor'],
|
||||
toolbarExternal: '#toolbar-text',
|
||||
buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
|
||||
buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'fontcolor','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
|
||||
|
||||
|
||||
|
||||
@ -58,12 +58,14 @@
|
||||
:javascript
|
||||
|
||||
$('.redactor_content').redactor({
|
||||
plugins: ['fontcolor'],
|
||||
toolbarExternal: '#toolbar-text',
|
||||
buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'fontcolor','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
.portlet.link_content
|
||||
- if input.cible
|
||||
-url = input.cible.cible_url
|
||||
-else
|
||||
-url = ""
|
||||
=link_to input.name.to_s, url.to_s, :class => "external_link", :target => ("_blank" if input.popup).to_s
|
||||
- if input.cible
|
||||
-url = input.cible.cible_url
|
||||
-else
|
||||
-url = ""
|
||||
=link_to input.name.to_s, url.to_s, :class => "external_link", :target => ("_blank" if input.popup).to_s
|
Loading…
x
Reference in New Issue
Block a user