integrated the Google Docs viewer
This commit is contained in:
parent
4721a48c31
commit
6c1c00c238
|
@ -31,8 +31,10 @@ import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.Float;
|
import com.google.gwt.dom.client.Style.Float;
|
||||||
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.i18n.client.DateTimeFormat;
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||||
import com.google.gwt.i18n.client.NumberFormat;
|
import com.google.gwt.i18n.client.NumberFormat;
|
||||||
|
import com.google.gwt.safehtml.shared.UriUtils;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.Command;
|
import com.google.gwt.user.client.Command;
|
||||||
|
@ -91,6 +93,9 @@ public class DialogGetInfoBootstrap extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
HTMLPanel htmlPanelImagePreview;
|
HTMLPanel htmlPanelImagePreview;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
HTMLPanel htmlPanelFilePreview;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
HTML txtName;
|
HTML txtName;
|
||||||
|
|
||||||
|
@ -320,10 +325,11 @@ public class DialogGetInfoBootstrap extends Composite {
|
||||||
if (typeEnum.equals(GXTFolderItemTypeEnum.GCUBE_ITEM)) {
|
if (typeEnum.equals(GXTFolderItemTypeEnum.GCUBE_ITEM)) {
|
||||||
loadGcubeItemProperties();
|
loadGcubeItemProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_PDF_FILE) ||
|
if(typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_PDF_FILE) ||
|
||||||
typeEnum.equals(GXTFolderItemTypeEnum.PDF_DOCUMENT)) {
|
typeEnum.equals(GXTFolderItemTypeEnum.PDF_DOCUMENT) ||
|
||||||
|
typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_FILE)) {
|
||||||
|
|
||||||
GWT.log("The file is a PDF");
|
GWT.log("The file is a PDF");
|
||||||
|
|
||||||
|
@ -339,36 +345,17 @@ public class DialogGetInfoBootstrap extends Composite {
|
||||||
GWT.log("The PublicLink link is: "+result);
|
GWT.log("The PublicLink link is: "+result);
|
||||||
|
|
||||||
if(result!=null) {
|
if(result!=null) {
|
||||||
|
|
||||||
// String pdfPreview = "<object "
|
|
||||||
// + "width=\"300\" "
|
|
||||||
// + "height=\"300\" "
|
|
||||||
// + "type=\"application/pdf\" "
|
|
||||||
// + "data=\""+result.getCompleteURL()+"?#zoom=85&scrollbar=0&toolbar=0&navpanes=0\">"
|
|
||||||
// + "<p>This browser does not support PDFs</p>"
|
|
||||||
// + "</object>";
|
|
||||||
//
|
|
||||||
// String pdfPreview = "<iframe "
|
|
||||||
// + "src=\"http://docs.google.com/gview?url="+result.getCompleteURL()+"&embedded=true\" "
|
|
||||||
// + "style=\"width:90%; max-height:400px;\" frameborder=\"0\"></iframe>";
|
|
||||||
//
|
|
||||||
|
|
||||||
String pdfPreview = "<object data=\""+result.getCompleteURL()+"\" type=\"application/pdf\" width=\"250\" height=\"300\">"
|
String pdfPreview = "<iframe frameBorder=\"0\" class=\"my-preview-doc\" "
|
||||||
+ "<iframe src=\""+result.getCompleteURL()+"\" style=\"border: none;\" width=\"100%\" height=\"100%\">"
|
+ "src=\"https://docs.google.com/viewer?url="+URL.encode(result.getCompleteURL())+"&embedded=true\">"
|
||||||
+ "This browser does not support PDFs. Please download the PDF to view it: "
|
+ "</iframe>";
|
||||||
+ "<a href=\""+result.getCompleteURL()+"\">Download PDF</a></iframe>"
|
|
||||||
+ "</object>";
|
|
||||||
//
|
|
||||||
String pdfPreview = "<object data=\""+result.getCompleteURL()+"\" type=\"application/pdf\" width=\"100%\" height=\"100%\">"</object>";
|
|
||||||
|
|
||||||
//pdfPreview = "<embed src=\""+result.getCompleteURL()+"\" type=\"application/pdf\" width=\"100%\" height=\"100%\">";
|
htmlPanelFilePreview.add(new HTML(pdfPreview));
|
||||||
|
htmlPanelFilePreview.setVisible(true);
|
||||||
htmlPanelImagePreview.add(new HTML(pdfPreview));
|
|
||||||
htmlPanelImagePreview.setVisible(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addHandlers();
|
addHandlers();
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
<g:HTMLPanel ui:field="htmlPanelImagePreview"
|
<g:HTMLPanel ui:field="htmlPanelImagePreview"
|
||||||
visible="false" addStyleNames="preview-image-style">
|
visible="false" addStyleNames="preview-image-style">
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
<g:HTMLPanel ui:field="htmlPanelFilePreview"
|
||||||
|
visible="false" addStyleNames="preview-file-style">
|
||||||
|
</g:HTMLPanel>
|
||||||
<b:Form type="HORIZONTAL">
|
<b:Form type="HORIZONTAL">
|
||||||
<b:Alert ui:field="actionAlert" close="false" type="INFO"
|
<b:Alert ui:field="actionAlert" close="false" type="INFO"
|
||||||
visible="false">
|
visible="false">
|
||||||
|
@ -53,7 +56,7 @@
|
||||||
<b:ControlGroup
|
<b:ControlGroup
|
||||||
addStyleNames="my-control-group-get-info" ui:field="cgTxtIsPublic"
|
addStyleNames="my-control-group-get-info" ui:field="cgTxtIsPublic"
|
||||||
visible="false">
|
visible="false">
|
||||||
<b:ControlLabel>Public Folder</b:ControlLabel>
|
<b:ControlLabel>Public</b:ControlLabel>
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<g:HTML ui:field="txtIsPublic">
|
<g:HTML ui:field="txtIsPublic">
|
||||||
</g:HTML>
|
</g:HTML>
|
||||||
|
@ -84,12 +87,12 @@
|
||||||
readOnly="true">
|
readOnly="true">
|
||||||
</b:TextArea>
|
</b:TextArea>
|
||||||
<b:Tooltip text="Edit the Description">
|
<b:Tooltip text="Edit the Description">
|
||||||
<b:Button icon="EDIT"
|
<b:Button icon="EDIT" ui:field="buttonUpdateDescription"
|
||||||
ui:field="buttonUpdateDescription" type="LINK">Edit</b:Button>
|
type="LINK">Edit</b:Button>
|
||||||
</b:Tooltip>
|
</b:Tooltip>
|
||||||
<b:Tooltip text="Save the Description">
|
<b:Tooltip text="Save the Description">
|
||||||
<b:Button icon="SAVE"
|
<b:Button icon="SAVE" ui:field="buttonSaveDescription"
|
||||||
ui:field="buttonSaveDescription" type="LINK" visible="false">Save</b:Button>
|
type="LINK" visible="false">Save</b:Button>
|
||||||
</b:Tooltip>
|
</b:Tooltip>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
|
|
|
@ -304,7 +304,7 @@ table.userssuggest th {
|
||||||
|
|
||||||
.my-control-group-get-info {
|
.my-control-group-get-info {
|
||||||
margin-bottom: 5px !important;
|
margin-bottom: 5px !important;
|
||||||
margin-left: 10px;
|
margin-left: 15px;
|
||||||
font-size: 14px !important;
|
font-size: 14px !important;
|
||||||
font-family: Arial, serif;
|
font-family: Arial, serif;
|
||||||
color: #222;
|
color: #222;
|
||||||
|
@ -330,7 +330,9 @@ table.userssuggest th {
|
||||||
.my-control-group-get-info .gwt-HTML {
|
.my-control-group-get-info .gwt-HTML {
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
font-family: Roboto, Arial, serif !important;
|
font-family: Roboto, Arial, serif !important;
|
||||||
overflow-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-control-group-get-info .gwt-TextBox:hover {
|
.my-control-group-get-info .gwt-TextBox:hover {
|
||||||
|
@ -410,10 +412,21 @@ IN THE 'DETAILS' PANEL*/
|
||||||
width: 95%;
|
width: 95%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-image-style img {
|
.preview-image-style img {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-file-style {
|
||||||
|
width: 95%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-preview-doc {
|
||||||
|
width: 350px;
|
||||||
|
height: 350px;
|
||||||
}
|
}
|
Loading…
Reference in New Issue