Problem installing redactor plug-in

hi guys! im having trouble installing these redactor plugins:

-properties
-inline style

could it be that the versions aren’t compatible? i am using pulse 4.7 which uses Redactor 10.2.3 from end 2015. “propeties” doesn’t even generate a new button on the toolbar.

i dont really need inline styles since i alreaddy altered “formatting” in redactor, but properties is kinda a must for the next project. any ideas? if someone could test this i would really appreciate it!

plugin:
https://imperavi.com/redactor/plugins/properties/

cheers
santiago

PS: i know its not directly a bug, but since the editor is a core element i thought plug-in compatibility should be guaranteed

EDIT: or is there a way to update redactor without causing problems to the CMS? i can’t find a download link or anything :confused:

EDIT 2: i obvioulsy updated the redactor_options.js and uploaded the scripts :slight_smile:

Currently, Imperavi does not provide plugins for Redactor1.
You already know that.
The use of Redactor2 in Pulse4 is possible = (copyright).
All settings and scripts are the same.
The demo of Redactor2 and the number of plugins can be found here.
I am preparing a manual Pulse4 = Redactor

3 Likes

dear sir,

i must test stability now, but you have saved my life :slight_smile: thx!

sadly img insertion is not working :confused: neither on my website nor in your demos. the tags get created but the linking of tag and image source is not working. any ideas?

the “files” and/or “images” overlays appear, i can upload them, but they dont get linked in the source.

i had to make changes to the redactor imaagemanager nad redactor-v2 files. redactor v2 uses “url” for the image source, but the images have only the json “image” property. by setting

json.url = json.image

i solved this problem for the “choose” function. also redactor wasn’t generating a correct json after uploading an image (or file, ofr example PDF). here i had to set

json.url = json.filelink

in the insert function of redactor and all seems to work fine now.

last problm i am having is that the changes arent saved while in “source” view mode. but this is a very small problem and i am sure i can get it solved along the way. thanks again!!

I thank you for all users!
Please publish your script edits.
Send me email = demo - My contact: IvaRo

IvaRo

hi ivaro,

i commented my changes in the documents. please, this was just a quick solution so everything works! i am pretty sure there is a more clean alternative since my solution was just duplicating variables

i will send you the zip file right now

it seems i cannot send you zip files here, so im posting the code here

  1. imagemanager.js

     (function($)
     {
     	$.Redactor.prototype.imagemanager = function()
     	{
     		return {
     			langs: {
     				en: {
     					"upload": "Upload",
     					"choose": "Choose"
     				}
     			},
     			init: function()
     			{
     				if (!this.opts.imageManagerJson)
     				{
     					return;
     				}
    
     				this.modal.addCallback('image', this.imagemanager.load);
     			},
     			load: function()
     			{
     				var $box = $('<div style="overflow: auto; height: 300px; display: none;" class="redactor-modal-tab" data-title="Choose">');
     				this.modal.getModal().append($box);
    
     				$.ajax({
     					dataType: "json",
     					cache: false,
     					url: this.opts.imageManagerJson,
     					success: $.proxy(function(data)
     					{
     						$.each(data, $.proxy(function(key, val)
     						{
     							// title
     							var thumbtitle = '';
     							if (typeof val.title !== 'undefined')
     							{
     								thumbtitle = val.title;
     							}
    
     							var img = $('<img src="' + val.thumb + '"  data-params="' + encodeURI(JSON.stringify(val)) + '" style="width: 100px; height: 75px; cursor: pointer;" />');
     							$box.append(img);
     							$(img).click($.proxy(this.imagemanager.insert, this));
    
     						}, this));
    
     					}, this)
     				});
    
    
     			},
     			insert: function(e)
     			{
     				var $el = $(e.target);
     				var json = $.parseJSON(decodeURI($el.attr('data-params')));
     				
     				/********
     						edit: squareclouds
     						date: 27. august 2017
     						solves: img was not showing right away in editor. the problem was that image.insert
     						        tries to handle json.url, which was not beeing set. 								
     					*********/
     				
     				json.url = json.image;
     				/*** end squareclouds edit ***/
     				
     				this.image.insert(json, null);
     			}
     		};
     	};
     })(jQuery);

sorry i cannot post redactor-v2.js, it is too long :confused: please send me your email

Nice work @IvaRo!

@squareclouds-design - the screenshot isn't great but just tried image upload on the demo and works fine and tags created in Redactor I:

Are the images being uploaded to your Media folder?

hi michael!

yes, with redactor 1 everything works fine :slight_smile: but the plug-in “properties” was not working, since it was for redactor 2 i think (at least the one i found). thats why i integrated redactor 2 as suggested by ivaro, but then a couple of things were not working as intended anymore.

the images in redactor 2 were uploading! but the tags were empty, because the generated json object was missing the right properties

any news on the pulse5 launch? :slight_smile: will it have redactor2? :smiley:

1 Like

Yep - Redactor II (latest version) already locked, loaded and ready to go in Pulse 5:

You can then add any of the new Imperavi plugins :slight_smile:
We've put in the best ones that are best for most cases

This topic was automatically closed after 24 hours. New replies are no longer allowed.