otetard / ownpad

Ownpad is a Nextcloud application that allows to create and open Etherpad and Ethercalc documents.
GNU Affero General Public License v3.0
58 stars 25 forks source link

Associate pads with ownpad #40

Closed geek-merlin closed 1 year ago

geek-merlin commented 7 years ago

Pads are not associated with ownpad.

There is a workaround in the readme introduced in #3. This requires editing a config file so is not feasible for managed fooCloud hosting.

Some former code did it in a way that broke other stuff. The problem is also mentioned in #5 which may or may not be ralated.

geek-merlin commented 7 years ago

I noticed that drawio has success in this so groked the code that does the job. Maybe this helps.

                $.each(OCA.DrawIO.Mimes, function (ext, attr) {
                    fileList.fileActions.registerAction({
                        name: "drawioOpen",
                        displayName: t(OCA.DrawIO.AppName, "Open in Draw.io"),
                                                        mime: attr.mime,
                                                        permissions: OC.PERMISSION_READ | OC.PERMISSION_UPDATE,
                                                        icon: function () {
                                                            return OC.imagePath(OCA.DrawIO.AppName, "btn-edit");
                                                        },
                                                        iconClass: "icon-drawio-xml",
                                                        actionHandler: function (fileName, context) {
                                                            var dir = fileList.getCurrentDirectory();
                                                            OCA.DrawIO.EditFileNewWindow(OC.joinPaths(dir, fileName));
                                                        }
                    });

                    if ((fileList.fileActions.getDefaultFileAction(attr.mime, "file", OC.PERMISSION_READ) == false) || (OCA.AppSettings.overrideXml == "yes")) {
                        fileList.fileActions.setDefault(attr.mime, "drawioOpen");
                    }
                });
geek-merlin commented 7 years ago

OTOH the markdown editor seems to kick itself in as a preview handler:

$(document).ready(function () {
    if (OCA.Files_Texteditor && OCA.Files_Texteditor.registerPreviewPlugin) {
        OCA.Files_Texteditor.registerPreviewPlugin('text/markdown', previewPlugin);
    }
});
fwolfst commented 4 years ago

Maybe someone can find and share a link to the developer documentation (or a thread in the discussion forum) about how to deal with this issue best.

otetard commented 1 year ago

This issue should now be fixed with 3620bde4ab35629551c64630a8332b1d8a0319c6 (not yet released).