-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#12 PdfJs Viewer support for customizing the toolbar
- Toolbar config is specified in model.toolbarItems, which can be modified as needed by extensions
- Loading branch information
Showing
2 changed files
with
194 additions
and
77 deletions.
There are no files selected for viewing
111 changes: 34 additions & 77 deletions
111
config/alfresco/site-webscripts/org/sharextras/modules/preview/pdfjs.get.html.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
config/alfresco/site-webscripts/org/sharextras/modules/preview/pdfjs.get.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
function main() | ||
{ | ||
model.toolbarItems = [ | ||
{ | ||
id: "previous", | ||
type: "button", | ||
icon: "components/images/back-arrow.png", | ||
label: msg.get("button.previous"), | ||
disabled: true | ||
}, | ||
{ | ||
id: "next", | ||
type: "button", | ||
icon: "components/images/forward-arrow-16.png", | ||
label: msg.get("button.next"), | ||
disabled: true | ||
}, | ||
{ | ||
id: "pageNumber", | ||
type: "number", | ||
disabled: true | ||
}, | ||
{ | ||
type: "span", | ||
text: "/" | ||
}, | ||
{ | ||
id: "numPages", | ||
type: "span", | ||
className: "numPages", | ||
text: "--" | ||
}, | ||
{ | ||
type: "separator" | ||
}, | ||
{ | ||
id: "zoomOut", | ||
type: "button", | ||
icon: "extras/components/preview/images/zoom-out.svg", | ||
title: msg.get("button.zoomout"), | ||
disabled: true | ||
}, | ||
{ | ||
id: "zoomIn", | ||
type: "button", | ||
icon: "extras/components/preview/images/zoom-in.svg", | ||
title: msg.get("button.zoomin"), | ||
disabled: true | ||
}, | ||
{ | ||
id: "scaleSelect", | ||
type: "select", | ||
icon: "components/images/forward-arrow.png", | ||
label: msg.get("button.next"), | ||
options: [ | ||
{ | ||
label: "25%", | ||
value: "0.25" | ||
}, | ||
{ | ||
label: "50%", | ||
value: "0.5" | ||
}, | ||
{ | ||
label: "75%", | ||
value: "0.75" | ||
}, | ||
{ | ||
label: "100%", | ||
value: "1" | ||
}, | ||
{ | ||
label: "125%", | ||
value: "1.25" | ||
}, | ||
{ | ||
label: "150%", | ||
value: "1.5" | ||
}, | ||
{ | ||
label: "200%", | ||
value: "2" | ||
}, | ||
{ | ||
label: "400%", | ||
value: "4" | ||
}, | ||
{ | ||
label: msg.get("select.pagewidth"), | ||
value: "page-width" | ||
}, | ||
{ | ||
label: msg.get("select.twopagewidth"), | ||
value: "two-page-width" | ||
}, | ||
{ | ||
label: msg.get("select.pagefit"), | ||
value: "page-fit" | ||
}, | ||
{ | ||
label: msg.get("select.twopagefit"), | ||
value: "two-page-fit" | ||
}, | ||
{ | ||
label: msg.get("select.auto"), | ||
value: "auto" | ||
} | ||
], | ||
disabled: true | ||
}, | ||
{ | ||
type: "separator" | ||
}, | ||
{ | ||
id: "fullpage", | ||
title: "", | ||
type: "button", | ||
icon: "components/documentlibrary/actions/default-16.png", | ||
label: msg.get("button.maximize"), | ||
useWrapper: true, | ||
wrapperClassName: "maximizebutton" | ||
}, | ||
{ | ||
type: "separator", | ||
useWrapper: true, | ||
wrapperClassName: "maximizebutton" | ||
}, | ||
{ | ||
id: "download", | ||
type: "button", | ||
icon: "components/documentlibrary/actions/document-download-16.png", | ||
label: msg.get("button.download"), | ||
title: msg.get("button.download") | ||
}, | ||
{ | ||
id: "link", | ||
type: "button", | ||
icon: "components/images/link-16.png", | ||
title: msg.get("button.link"), | ||
useWrapper: true, | ||
wrapperClassName: "linkbutton" | ||
}, | ||
{ | ||
type: "separator", | ||
useWrapper: true, | ||
wrapperClassName: "searchBarToggle" | ||
}, | ||
{ | ||
id: "searchBarToggle", | ||
type: "button", | ||
icon: "components/images/search-16.png", | ||
label: msg.get("button.search"), | ||
useWrapper: true, | ||
wrapperClassName: "searchBarToggle", | ||
disabled: true | ||
} | ||
]; | ||
} | ||
|
||
main(); |