Redactor Plugins
Permalink
I have built a set of Redactor plugins. They are all working and in place, but would need a little polishing before being posted.
Just wanted to know if anyone is interested in them before I go to the trouble. I have a graphic artist for a client who wanted a lot of custom stuff.
I have:
Kerning
Leading
Change Case
Advanced Color Picker
Font Size
Fonts
Just wanted to know if anyone is interested in them before I go to the trouble. I have a graphic artist for a client who wanted a lot of custom stuff.
I have:
Kerning
Leading
Change Case
Advanced Color Picker
Font Size
Fonts
I think this would be a useful addon. I know I have need for these!
Hi il2k,
These would be very useful. A few of these are on the Redactor plugin todo list, so they would be very welcome additions.
What does your Advanced Color Picker plugin do?
These would be very useful. A few of these are on the Redactor plugin todo list, so they would be very welcome additions.
What does your Advanced Color Picker plugin do?
It creates a popup that utilizes Kendo Color Picker right now. But the built in color picker in Chrome works too. Biggest thing I wanted was the ability to type in a color.
I'm going to try and get these packaged up this weekend. The only one that will take more than commenting and clean up is the fonts. Right now it is lazy loading as needed like 30 different fonts from google web fonts. I need to make that something that is easier to edit. Right now you need to look in like 2 or 3 locations to update it with more fonts.
Some of them like the font sizer just shows the font size in the menu but it also has a popup that lets you type a number directly in.
I'm going to try and get these packaged up this weekend. The only one that will take more than commenting and clean up is the fonts. Right now it is lazy loading as needed like 30 different fonts from google web fonts. I need to make that something that is easier to edit. Right now you need to look in like 2 or 3 locations to update it with more fonts.
Some of them like the font sizer just shows the font size in the menu but it also has a popup that lets you type a number directly in.
@il2k
I might recommend using the Spectrum color picker that comes with concrete5. It would be one less asset to require. I can provide you with the code to use it in a plugin.
https://bgrins.github.io/spectrum...
Currently the Font Color plugin that comes with concrete5 (font colors and text background colors) uses colors that are hard coded in the plugin itself. This makes the plugin very inflexible. If your Advanced Color Picker handled those two areas, that would make it an excellent replacement.
Your Font Size plugin will be an excellent replacement for the default Font Size plugin that comes with concrete5 (it has hard coded font sizes and no option to enter a custom size).
I might recommend using the Spectrum color picker that comes with concrete5. It would be one less asset to require. I can provide you with the code to use it in a plugin.
https://bgrins.github.io/spectrum...
Currently the Font Color plugin that comes with concrete5 (font colors and text background colors) uses colors that are hard coded in the plugin itself. This makes the plugin very inflexible. If your Advanced Color Picker handled those two areas, that would make it an excellent replacement.
Your Font Size plugin will be an excellent replacement for the default Font Size plugin that comes with concrete5 (it has hard coded font sizes and no option to enter a custom size).
Yes please. I used Kendo because I had the code already included.
Example: Spectrum color picker in Redactor plugin
- in the modal
- after this.modal.show();
Get a color picker value
Example:
- hex is a tinycolor object
- tinycolor objects have an assortment of methods for returning colors in different formats
returns:
"ff4500"
"rgb(255, 69, 0)"
Set a color picker value
Example:
- the second argument is a string with the color
- in the modal
<input type="text" id="ccm-colorpicker-test">
- after this.modal.show();
ccm_addHeaderItem("/concrete5/concrete/css/spectrum.css", "CSS"); ccm_addHeaderItem("/concrete5/concrete/js/spectrum.js", "JAVASCRIPT"); // the ID of the input field needs the "ccm-colorpicker-" prefix $('#ccm-colorpicker-test').spectrum({ // initial color on open color: '#f00', // value: '#f00', className: 'ccm-widget-colorpicker', showInitial: true, showInput: true, allowEmpty: true, cancelText: 'Cancel', chooseText: 'Choose', // preferredFormat: 'hex', showAlpha: true,
Viewing 15 lines of 18 lines. View entire code block.
Get a color picker value
Example:
var hex = $('#preferredHex').spectrum('get');
- hex is a tinycolor object
- tinycolor objects have an assortment of methods for returning colors in different formats
hex.toHex()
returns:
"ff4500"
hex.toRgbString()
"rgb(255, 69, 0)"
Set a color picker value
Example:
$('#ccm-colorpicker-test').spectrum('set', 'blue');
- the second argument is a string with the color
Great. I changed the color picker over to use Spectrum and works like a charm.
I uploaded all the plugins except the font. That one needs a little work, too much is hard coded.
I uploaded all the plugins except the font. That one needs a little work, too much is hard coded.
I just want to say that this is my first time submitting addons for C5 and while at first I didn't like the idea of the Peer review process, it is actually pretty good. They found a couple things I missed and suggested other features. The color picker should be the first one up followed by the rest but I thought it would be a good idea to slow down and do one at a time.