Permalink
Browse files

Merge pull request #11 from openkm/OCM-37

OCM-37 Preview requires license key
  • Loading branch information...
monkiki committed May 3, 2017
2 parents 6cf02d2 + c475e25 commit b7a9e96fa3339cac2205f474a962bc7286a772df
@@ -21,6 +21,9 @@
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.event.dom.client.KeyUpEvent;
import com.google.gwt.http.client.URL;
@@ -33,9 +36,6 @@
import com.openkm.frontend.client.service.OKMGeneralService;
import com.openkm.frontend.client.service.OKMGeneralServiceAsync;
import java.util.List;
import java.util.Map;
/**
* Util
*
@@ -567,47 +567,39 @@ public static native void resizeSwfViewer(String width, String height) /*-{
obj.height = height;
}-*/;
public static native void createPDFViewerFlexPaper(String pdfUrl, String width, String height, String printEnabled) /*-{
if (printEnabled == 'true') {
fpViewer = "../js/flexpaper/FlexPaperViewer.swf";
} else {
fpViewer = "../js/flexpaper/FlexPaperViewerRO.swf";
}
pdfUrl = encodeURIComponent(pdfUrl);
$wnd.swfobject.embedSWF(fpViewer, "pdfviewercontainer", width, height, "10.0.0", "playerProductInstall.swf",
{
SwfFile: pdfUrl,
Scale: 0.6,
ZoomTransition: "easeOut",
ZoomTime: 0.5,
ZoomInterval: 0.1,
FitPageOnLoad: false,
FitWidthOnLoad: true,
PrintEnabled: printEnabled,
FullScreenAsMaxWindow: false,
ProgressiveLoading: true,
// PrintToolsVisible : printEnabled,
ViewModeToolsVisible: true,
ZoomToolsVisible: true,
FullScreenVisible: true,
NavToolsVisible: true,
CursorToolsVisible: true,
SearchToolsVisible: true,
localeChain: "en_US"
},
{
quality: "high",
bgcolor: "#ffffff",
allowscriptaccess: "sameDomain",
allowfullscreen: "true"
},
{
id: "FlexPaperViewer",
name: "FlexPaperViewer"
});
}-*/;
public static native void createPDFViewerFlexPaper(String pdfUrl, String width, String height) /*-{
fpViewer = "../js/flexpaper/FlexPaperViewer.swf";
pdfUrl = encodeURIComponent(pdfUrl);
$wnd.swfobject.embedSWF(fpViewer, "pdfviewercontainer", width, height, "10.0.0", "playerProductInstall.swf",
{
SwfFile : pdfUrl,
Scale : 0.6,
ZoomTransition : "easeOut",
ZoomTime : 0.5,
ZoomInterval : 0.1,
FitPageOnLoad : false,
FitWidthOnLoad : true,
FullScreenAsMaxWindow : false,
ProgressiveLoading : true,
ViewModeToolsVisible : true,
ZoomToolsVisible : true,
FullScreenVisible : true,
NavToolsVisible : true,
CursorToolsVisible : true,
SearchToolsVisible : true,
localeChain: "en_US"
},
{
quality : "high",
bgcolor : "#ffffff",
allowscriptaccess : "sameDomain",
allowfullscreen : "true"
},
{
id : "FlexPaperViewer",
name : "FlexPaperViewer"
});
}-*/;
public static native void resizePDFViewerFlexPaper(String width, String height) /*-{
obj = $wnd.swfobject.getObjectById('FlexPaperViewer');
@@ -21,6 +21,9 @@
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.ClickHandler;
import com.google.gwt.http.client.URL;
@@ -31,9 +34,6 @@
import com.openkm.frontend.client.extension.widget.preview.PreviewExtension;
import com.openkm.frontend.client.util.Util;
import java.util.ArrayList;
import java.util.List;
/**
* Notes
*
@@ -171,9 +171,9 @@ public void showEmbedSWF(String uuid) {
if (Main.get().workspaceUserProperties.getWorkspace().getPreviewer().equals("flexpaper")) {
if (Main.get().workspaceUserProperties.getWorkspace().isPrintPreview()) {
Util.createPDFViewerFlexPaper(url, "" + width, "" + height, "true");
Util.createPDFViewerFlexPaper(url, "" + width, "" + height);
} else {
Util.createPDFViewerFlexPaper(url, "" + width, "" + height, "false");
Util.createPDFViewerFlexPaper(url, "" + width, "" + height);
}
}
Binary file not shown.
Binary file not shown.

0 comments on commit b7a9e96

Please sign in to comment.