This doesn't seem to work for me here is the code I am using. It should work I can't see any errors with it.
WHat did I do wrong here?
- Code:
$(document).ready(function() {
$.sceditor.command.set("filepicker", {
exec: function() {
var editor = this;
filepicker.setKey('MY API KEY');
filepicker.pick({mimetypes: ['application/msword','text/*','image/*'],
services:['COMPUTER','GOOGLE_DRIVE','DROPBOX','FACEBOOK','PICASA','FLICKR','WEBCAM','URL','INSTAGRAM','IMAGE_SEARCH']
},function(FPFile) {
var docFile = FPFile.url,
textArea = $('#toolbar textarea'),
type= FPFile.mimetype;
if(/^.*text.*$/.test(type)) {
editor.insert('[url]'+FPFile.url+'+'+FPFile.filename.replace(/\s/g,"")+'[/url]');
} else if(/^.*image.*$/.test(type)) {
editor.insert('[img]'+FPFile.url+'+'+FPFile.filename.replace(/\s/g,"")+'[/img]');
}
});
},
tooltip: "Upload File"
});
WHat did I do wrong here?