Skip to content

Commit

Permalink
Merge pull request #11 from openkm/OCM-37
Browse files Browse the repository at this point in the history
OCM-37 Preview requires license key
  • Loading branch information
monkiki committed May 3, 2017
2 parents 6cf02d2 + c475e25 commit b7a9e96
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 49 deletions.
80 changes: 36 additions & 44 deletions src/main/java/com/openkm/frontend/client/util/Util.java
Expand Up @@ -21,6 +21,9 @@


package com.openkm.frontend.client.util; package com.openkm.frontend.client.util;


import java.util.List;
import java.util.Map;

import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.http.client.URL; import com.google.gwt.http.client.URL;
Expand All @@ -33,9 +36,6 @@
import com.openkm.frontend.client.service.OKMGeneralService; import com.openkm.frontend.client.service.OKMGeneralService;
import com.openkm.frontend.client.service.OKMGeneralServiceAsync; import com.openkm.frontend.client.service.OKMGeneralServiceAsync;


import java.util.List;
import java.util.Map;

/** /**
* Util * Util
* *
Expand Down Expand Up @@ -567,47 +567,39 @@ public static native void resizeSwfViewer(String width, String height) /*-{
obj.height = height; obj.height = height;
}-*/; }-*/;


public static native void createPDFViewerFlexPaper(String pdfUrl, String width, String height, String printEnabled) /*-{ public static native void createPDFViewerFlexPaper(String pdfUrl, String width, String height) /*-{
if (printEnabled == 'true') { fpViewer = "../js/flexpaper/FlexPaperViewer.swf";
fpViewer = "../js/flexpaper/FlexPaperViewer.swf"; pdfUrl = encodeURIComponent(pdfUrl);
} else { $wnd.swfobject.embedSWF(fpViewer, "pdfviewercontainer", width, height, "10.0.0", "playerProductInstall.swf",
fpViewer = "../js/flexpaper/FlexPaperViewerRO.swf"; {
} SwfFile : pdfUrl,
Scale : 0.6,
pdfUrl = encodeURIComponent(pdfUrl); ZoomTransition : "easeOut",
$wnd.swfobject.embedSWF(fpViewer, "pdfviewercontainer", width, height, "10.0.0", "playerProductInstall.swf", ZoomTime : 0.5,
{ ZoomInterval : 0.1,
SwfFile: pdfUrl, FitPageOnLoad : false,
Scale: 0.6, FitWidthOnLoad : true,
ZoomTransition: "easeOut", FullScreenAsMaxWindow : false,
ZoomTime: 0.5, ProgressiveLoading : true,
ZoomInterval: 0.1, ViewModeToolsVisible : true,
FitPageOnLoad: false, ZoomToolsVisible : true,
FitWidthOnLoad: true, FullScreenVisible : true,
PrintEnabled: printEnabled, NavToolsVisible : true,
FullScreenAsMaxWindow: false, CursorToolsVisible : true,
ProgressiveLoading: true, SearchToolsVisible : true,
localeChain: "en_US"
// PrintToolsVisible : printEnabled, },
ViewModeToolsVisible: true, {
ZoomToolsVisible: true, quality : "high",
FullScreenVisible: true, bgcolor : "#ffffff",
NavToolsVisible: true, allowscriptaccess : "sameDomain",
CursorToolsVisible: true, allowfullscreen : "true"
SearchToolsVisible: true, },
localeChain: "en_US" {
}, id : "FlexPaperViewer",
{ name : "FlexPaperViewer"
quality: "high", });
bgcolor: "#ffffff", }-*/;
allowscriptaccess: "sameDomain",
allowfullscreen: "true"
},
{
id: "FlexPaperViewer",
name: "FlexPaperViewer"
});
}-*/;


public static native void resizePDFViewerFlexPaper(String width, String height) /*-{ public static native void resizePDFViewerFlexPaper(String width, String height) /*-{
obj = $wnd.swfobject.getObjectById('FlexPaperViewer'); obj = $wnd.swfobject.getObjectById('FlexPaperViewer');
Expand Down
Expand Up @@ -21,6 +21,9 @@


package com.openkm.frontend.client.widget.properties; package com.openkm.frontend.client.widget.properties;


import java.util.ArrayList;
import java.util.List;

import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.http.client.URL; import com.google.gwt.http.client.URL;
Expand All @@ -31,9 +34,6 @@
import com.openkm.frontend.client.extension.widget.preview.PreviewExtension; import com.openkm.frontend.client.extension.widget.preview.PreviewExtension;
import com.openkm.frontend.client.util.Util; import com.openkm.frontend.client.util.Util;


import java.util.ArrayList;
import java.util.List;

/** /**
* Notes * Notes
* *
Expand Down Expand Up @@ -171,9 +171,9 @@ public void showEmbedSWF(String uuid) {


if (Main.get().workspaceUserProperties.getWorkspace().getPreviewer().equals("flexpaper")) { if (Main.get().workspaceUserProperties.getWorkspace().getPreviewer().equals("flexpaper")) {
if (Main.get().workspaceUserProperties.getWorkspace().isPrintPreview()) { if (Main.get().workspaceUserProperties.getWorkspace().isPrintPreview()) {
Util.createPDFViewerFlexPaper(url, "" + width, "" + height, "true"); Util.createPDFViewerFlexPaper(url, "" + width, "" + height);
} else { } else {
Util.createPDFViewerFlexPaper(url, "" + width, "" + height, "false"); Util.createPDFViewerFlexPaper(url, "" + width, "" + height);
} }
} }


Expand Down
Binary file modified src/main/webapp/js/flexpaper/FlexPaperViewer.swf
Binary file not shown.
Binary file removed src/main/webapp/js/flexpaper/FlexPaperViewerRO.swf
Binary file not shown.

0 comments on commit b7a9e96

Please sign in to comment.