Buenas dias, estoy intentando integrar un filemanager el de fckeditor con slimey la aplicación de hacer presentaciones el problema es que no entiendo bien las llamadas que se hace a la clase para lanzar las acciones de importación de imagenes y me falla, aqui esta el codigo de la clase SlimeyInsertImageTool:
Código:
/**
* class SlimeyInsertImageTool - this tool inserts new images into the editor
*/
var SlimeyInsertImageTool = function(slimey) {
/* create the DOM element that represents the tool (a clickable image) */
var img = createImageButton('insertImage', lang("insert image"), this);
SlimeyTool.call(this, 'insertImage', img, slimey);
}
/**
* SlimeyInsertImageTool extends SlimeyTool
*/
SlimeyInsertImageTool.prototype = new SlimeyTool();
/**
* inserts a new image into the editor
*/
SlimeyInsertImageTool.prototype.execute = function() {
chooseImage(this.imageChosen, this, this.element);
}
SlimeyInsertImageTool.prototype.imageChosen = function(url) {
if (url) {
var action = new SlimeyInsertAction(this.slimey, 'img');
action.getElement().src = url;
this.slimey.editor.performAction(action);
}
}
Esta es la llamada que se hace en el origen y no se muy bien como volver a lanzarla.
Código:
function chooseImage(func, scope, button) {
var url = prompt(lang("enter the url of the image") + ":", "images/sample.png");
func.call(scope, url);
}
Esta es la funcion chooseImage lanza la ventana pones la url de la imagen y la inserta, yo lo que he intentado hacer es llamar a la chooseImage desde otro script, el problema es que los parametros no son los correctos me falla ese scope, si alguien me pudiera ayudar estoy un poco perdido.
Un saludo y gracias.