CHANGE: Attachment in TinyMCE: Default ist Link

This commit is contained in:
HausdorffHimself
2013-08-24 17:16:55 +02:00
parent e7eabbe6aa
commit b92cbfab8a

View File

@@ -25,15 +25,11 @@
function insertAttachment(url,name) { function insertAttachment(url,name) {
var ext = url.split('.').pop(); var ext = url.split('.').pop();
var img_ext = [ "jpg", "png", "bmp" , "jpeg" ]; var img_ext = [ "jpg", "png", "bmp" , "jpeg" ];
var text_ext = [ "pdf" ];
if ( img_ext.indexOf(ext) > -1) { if ( img_ext.indexOf(ext) > -1) {
tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + "<img src=\"" + url + "\" title=\"" + name + "\">"); tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + "<img src=\"" + url + "\" title=\"" + name + "\">");
} }
else if (text_ext.indexOf(ext) > -1) { else {
tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + "<a href=\"" + url + "\">" + name +"</a>"); tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + "<a href=\"" + url + "\">" + name +"</a>");
} }
else {
alert("<a href=\"" + url + "\">" + "Link</a>");
}
} }