diff --git a/src/CKEditorForMendix/widget/CKEditorForMendix.js b/src/CKEditorForMendix/widget/CKEditorForMendix.js index 4c14883..b5b8ea1 100644 --- a/src/CKEditorForMendix/widget/CKEditorForMendix.js +++ b/src/CKEditorForMendix/widget/CKEditorForMendix.js @@ -425,6 +425,12 @@ define([ this._contextObj.addReference(this._imageReference, obj.getGuid()); } + // Normalize file name and size (sometimes doesn't work in firefox) + if (file.name === undefined && file.size === undefined) { + file.name = file.fileName; + file.size = file.fileSize; + } + var guid = obj.getGuid(); var upload = new Upload({ objectGuid: guid, @@ -592,6 +598,9 @@ define([ _getFileUrl: function (guid) { var changedDate = Math.floor(Date.now() / 1); // Right now; + if (mx.data.getDocumentUrl) { + return mx.data.getDocumentUrl(guid, changedDate, false); + } return mx.appUrl + "file?" + [ "guid=" + guid, "changedDate=" + changedDate diff --git a/src/CKEditorForMendix/widget/CKEditorViewerForMendix.js b/src/CKEditorForMendix/widget/CKEditorViewerForMendix.js index 3fffe9d..bde09b5 100644 --- a/src/CKEditorForMendix/widget/CKEditorViewerForMendix.js +++ b/src/CKEditorForMendix/widget/CKEditorViewerForMendix.js @@ -71,6 +71,9 @@ define([ _getFileUrl: function (guid) { var changedDate = Math.floor(Date.now() / 1); // Right now; + if (mx.data.getDocumentUrl) { + return mx.data.getDocumentUrl(guid, changedDate, false); + } return mx.appUrl + "file?" + [ "guid=" + guid, "changedDate=" + changedDate diff --git a/src/CKEditorForMendix/widget/lib/ckeditor.js b/src/CKEditorForMendix/widget/lib/ckeditor.js index 0ff52f4..77440af 100644 --- a/src/CKEditorForMendix/widget/lib/ckeditor.js +++ b/src/CKEditorForMendix/widget/lib/ckeditor.js @@ -378,7 +378,7 @@ var g=CKEDITOR.dom.walker.whitespaces(!0),z=CKEDITOR.dom.walker.bookmark(!1,!0), k;++r)e=D.getItem(r),a(e)?(g=e.getName(),J&&g in CKEDITOR.dtd.$list?f=f.concat(b(e,d)):(p=!!h[g],"br"!=g||!e.data("cke-eol")||r&&r!=k-1||(t=(m=r?f[r-1].node:D.getItem(r+1))&&(!a(m)||!m.is("br")),m=m&&a(m)&&B.$block[m.getName()]),-1!=G||p||(G=r),p||(n=r),f.push({isElement:1,isLineBreak:t,isBlock:e.isBlockBoundary(),hasBlockSibling:m,node:e,name:g,allowed:p}),m=t=0)):f.push({isElement:0,node:e,allowed:1});-1" + "\" onclick=\"CKEDITOR.tools.simpleimagebrowserinsertpicture('", + value.imageUrl, "','", value.guid, + "');\" style=\"position:relative;max-width:75px;max-height:75px;margin:5px;float:left;cursor:pointer;\" \\>" ].join(""); txt = txt + element; }); diff --git a/test/Test.mpr b/test/Test.mpr index 9144e29..5760966 100644 Binary files a/test/Test.mpr and b/test/Test.mpr differ diff --git a/test/widgets/CKEditorForMendix.mpk b/test/widgets/CKEditorForMendix.mpk index 1562ebf..86a53a0 100644 Binary files a/test/widgets/CKEditorForMendix.mpk and b/test/widgets/CKEditorForMendix.mpk differ