-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
It would be nice to support different HTML for view and edit mode. This is necessary for the svgedit webviewer has we want to use completely different code in both cases.
This code in WebViewers.Code would work:
private Map doZip(xcontext, doc, fileName, out) {
def j = new JsonSlurper().parseText(getPkg(doc, fileName, xcontext));
def actions = j.get("actions");
def main = j.get("main");
def main_view = j.get("main_view");
def main_edit = j.get("main_edit");
if (!main) { main = "index.html"; }
if (!main_view) { main_view = main; }
if (!main_edit) { main_edit = main; }
for (Object action : actions.keySet()) {
for (Object fileType : actions.get(action)) {
def hm = out.get(fileType);
if (!hm) {
hm = new HashMap();
out.put(fileType, hm);
}
def mainpath = (action=="edit") ? main_edit : main_view;
hm.put(action, URLDecoder.decode(doc.getAttachmentURL(fileName), "UTF-8") + "/" + mainpath);
}
}
return out;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels