diff --git a/backend-source/hdfs-netdisk b/backend-source/hdfs-netdisk new file mode 160000 index 0000000..9133435 --- /dev/null +++ b/backend-source/hdfs-netdisk @@ -0,0 +1 @@ +Subproject commit 913343522bfb20f24342454a5dba3c880914d631 diff --git a/backend-source/hdfs-netdisk.zip b/backend-source/hdfs-netdisk.zip new file mode 100644 index 0000000..399e007 Binary files /dev/null and b/backend-source/hdfs-netdisk.zip differ diff --git a/frontend-source/.gitignore b/frontend-source/.gitignore new file mode 100644 index 0000000..f044205 --- /dev/null +++ b/frontend-source/.gitignore @@ -0,0 +1,21 @@ +.DS_Store +node_modules +/dist +package-lock.json +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* diff --git a/frontend-source/README.md b/frontend-source/README.md new file mode 100644 index 0000000..9812a57 --- /dev/null +++ b/frontend-source/README.md @@ -0,0 +1,31 @@ +# pearProject Mac下开发 + +基于Vue.js实现的项目管理系统 + + +2019.4.11 前端mock数据完毕 +2019.4.12 登陆接口实现完成 + + +base-vue:用户头像上传 +```js +uploadAction: 'http://localhost:9000/front/app/updateImg' +``` + +--- +seeBox: 文件查看 +``` +getUrl(fileUrl){ + return getFileUrl(fileUrl, 'local'); +} +``` + +--- +文件下载(资源库,分享,网盘) +```js +downLoad(file) { + window.location.href = "http://localhost:8888/api/fileDownload?fileId="+file.id; +}, +``` + + diff --git a/frontend-source/babel.config.js b/frontend-source/babel.config.js new file mode 100644 index 0000000..ba17966 --- /dev/null +++ b/frontend-source/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/app' + ] +} diff --git a/frontend-source/package.json b/frontend-source/package.json new file mode 100644 index 0000000..59bdc0d --- /dev/null +++ b/frontend-source/package.json @@ -0,0 +1,72 @@ +{ + "name": "pear-project", + "version": "2.0.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "ant-design-vue": "latest", + "axios": "^0.18.0", + "echarts": "^4.2.0-rc.1", + "element-ui": "^2.7.2", + "jquery": "^3.3.1", + "layui-layer": "^1.0.9", + "lodash": "^4.17.11", + "md5": "^2.2.1", + "moment": "^2.22.2", + "v-charts": "^1.17.10", + "vue": "^2.5.17", + "vue-clipboards": "^1.2.4", + "vue-cropper": "^0.4.7", + "vue-router": "^3.0.1", + "vue-simple-uploader": "^0.5.6", + "vuedraggable": "^2.17.0", + "vuescroll": "^4.6.24", + "vuex": "^3.0.1", + "wangeditor": "^3.1.1" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^3.2.0", + "@vue/cli-plugin-eslint": "^3.2.0", + "@vue/cli-service": "^3.2.0", + "babel-eslint": "^10.0.1", + "babel-plugin-import": "^1.11.0", + "eslint": "^5.8.0", + "eslint-plugin-vue": "^5.0.0-0", + "less": "^3.9.0", + "less-loader": "^4.1.0", + "mockjs": "^1.0.1-beta3", + "semver": "^6.0.0", + "vue-template-compiler": "^2.5.17" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "extends": [ + "plugin:vue/essential", + "eslint:recommended" + ], + "rules": { + "vue/no-unused-components": "off", + "vue/no-unused-vars": "off" + }, + "parserOptions": { + "parser": "babel-eslint" + } + }, + "postcss": { + "plugins": { + "autoprefixer": {} + } + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/frontend-source/public/bull.png b/frontend-source/public/bull.png new file mode 100644 index 0000000..ede95c3 Binary files /dev/null and b/frontend-source/public/bull.png differ diff --git a/frontend-source/public/favicon.ico b/frontend-source/public/favicon.ico new file mode 100644 index 0000000..8c33ea1 Binary files /dev/null and b/frontend-source/public/favicon.ico differ diff --git a/frontend-source/public/index.html b/frontend-source/public/index.html new file mode 100644 index 0000000..24851f2 --- /dev/null +++ b/frontend-source/public/index.html @@ -0,0 +1,16 @@ + + + + + + + 夜未央网盘 + + +
+ + + + diff --git a/frontend-source/src/App.vue b/frontend-source/src/App.vue new file mode 100644 index 0000000..fe753d2 --- /dev/null +++ b/frontend-source/src/App.vue @@ -0,0 +1,23 @@ + + diff --git a/frontend-source/src/api/common.js b/frontend-source/src/api/common.js new file mode 100644 index 0000000..bd31372 --- /dev/null +++ b/frontend-source/src/api/common.js @@ -0,0 +1,5 @@ +import $http from '../assets/js/http' + +export function bindClientId(client_id, uid) { + return $http.post('index/index/bindClientId', {client_id: client_id, uid: uid}); +} diff --git a/frontend-source/src/api/common/common.js b/frontend-source/src/api/common/common.js new file mode 100644 index 0000000..8654203 --- /dev/null +++ b/frontend-source/src/api/common/common.js @@ -0,0 +1,30 @@ +import $http from '../../assets/js/http' + +export function install(data) { + return $http.post('index/index/install', data); +} + +export function checkInstall() { + return $http.post('index/index/checkInstall'); +} + +export function inviteInfo(inviteCode) { + return $http.post('project/invite_link/_read', {inviteCode: inviteCode}); +} + +export function createInviteLink(data) { + return $http.post('project/invite_link/save', data); +} + + +export function notifyOverview(to) { + return $http.post('index/notify/listTypeFormat', {to: to}); +} + +export function areasData() { + return $http.post('index/index/getAreaData'); +} + +export function refreshAccessToken(refreshToken) { + return $http.post('index/index/refreshAccessToken', {refreshToken: refreshToken}); +} diff --git a/frontend-source/src/api/demo.js b/frontend-source/src/api/demo.js new file mode 100644 index 0000000..0308ab7 --- /dev/null +++ b/frontend-source/src/api/demo.js @@ -0,0 +1,16 @@ +import $http from '@/assets/js/http' + + +export function del(code) { + return $http.post('project/task_tag/delete', {tagCode: code}); +} + + +export function edit(data) { + return $http.post('project/task_tag/edit', data); +} + + +export function sort(preCode, nextCode, projectCode) { + return $http.post('project/task_stages/sort', {preCode: preCode, nextCode: nextCode, projectCode: projectCode}); +} diff --git a/frontend-source/src/api/file.js b/frontend-source/src/api/file.js new file mode 100644 index 0000000..80ff4f4 --- /dev/null +++ b/frontend-source/src/api/file.js @@ -0,0 +1,27 @@ +import $http from '@/assets/js/http' + +// +// export function list(data) { +// return $http.post('project/file', data); +// } +// +// export function read(fileCode) { +// return $http.post('project/file/read', {fileCode: fileCode}); +// } +// +// export function edit(data) { +// return $http.post('project/file/edit', data); +// } +// + +// export function recycle(fileCode) { +// return $http.post('project/file/recycle', {fileCode: fileCode}); +// } +// +// export function recovery(fileCode) { +// return $http.post('project/file/recovery', {fileCode: fileCode}); +// } +// +// export function del(fileCode) { +// return $http.post('project/file/delete', {fileCode: fileCode}); +// } diff --git a/frontend-source/src/api/menu.js b/frontend-source/src/api/menu.js new file mode 100644 index 0000000..55e0bc8 --- /dev/null +++ b/frontend-source/src/api/menu.js @@ -0,0 +1,28 @@ +// import $http from '@/assets/js/http' +// +// export function getMenuForUser() { +// return $http.post('project/index'); +// } +// +// /*export function getMenu() { +// return $http.post('project/menu/menu'); +// }*/ +// +// export function doMenu(data) { +// let url = 'project/menu/menuAdd'; +// if (data.id) { +// url = 'project/menu/menuEdit'; +// } +// return $http.post(url, data); +// } +// export function forbid(id, status) { +// return $http.post('project/menu/menuForbid', {id: id, status: status}); +// } +// +// export function resume(id, status) { +// return $http.post('project/menu/menuResume', {id: id, status: status}); +// } +// export function delMenu(id) { +// return $http.post('project/menu/menuDel', {id: id}); +// } +// diff --git a/frontend-source/src/api/mock.js b/frontend-source/src/api/mock.js new file mode 100644 index 0000000..4817015 --- /dev/null +++ b/frontend-source/src/api/mock.js @@ -0,0 +1,192 @@ +import $http from '@/assets/js/http' +import {getApiUrl} from "../assets/js/utils"; +import {getStore} from "../assets/js/storage"; + +/**---------------登陆--------------**/ +/*登陆*/ +export function Login(data) { + return $http.post('login', data); +} + +/*获取验证码*/ +export function getCaptcha(mobile) { + return $http.post('getCaptcha', {mobile: mobile}); +} + +/*获取qq授页面*/ +export function getQqLoginUrl() { + return $http.post('qq/login'); +} + +/*获取qq关联url*/ +export function getQqConnUrl() { + return $http.post('qq/conn'); +} + + +/*获取qq登陆用户信息*/ +export function qqCallback() { + return $http.post('qq/callback'); +} + +/*获取微博授页面*/ +export function getSinaLoginUrl() { + return $http.post('sina/login'); +} + +/*忘記密碼*/ +export function forget(data) { + return $http.post('forget', data); +} + + +/**---------------菜单--------------**/ +/*获取菜单*/ +export function getMenu() { + return $http.post('getMenu'); +} + +/*获取通知*/ +export function getNotice(data) { + return $http.post('getNotice', data); +} + + + + +/**---------------首页--------------**/ +/*获取操作记录*/ +export function getOperateLog(data) { + return $http.post('/getOperateLog', data); +} + + +/*获取首页数据*/ +export function getIndexData(data) { + return $http.post('/getIndexData', data); +} + + + +/**---------------网盘--------------**/ +/*获取文件上传日志*/ +export function getFileLog(data) { + return $http.post('/getFileLog', data); +} + +/*获取文件列表*/ +export function getFiles(data) { + return $http.post('/getFiles', data); +} + + +/*分享查询分享的用户*/ +export function findToShareUser(userName) { + return $http.post('findToShareUser', {userName: userName}); +} + +/*分享给用户*/ +export function shareToUser(userId, fileId) { + return $http.post('/toShare', {userId: userId, fileId: fileId}); +} + +/*创建分享链接*/ +export function createShareUrl(data) { + return $http.post('createLink', data); +} + +/*文件加入网盘*/ +export function addDisk(fileId) { + return $http.post('addDisk', {fileId: fileId}); +} + +/*我的网盘删除文件*/ +export function delFileById(fileId) { + return $http.post('delFileById', {fileId: fileId}); +} + + +/**---------分享--------**/ +/*获取分享列表*/ +export function getShares(data) { + return $http.post('getShares', data); +} + +export function delByShareId(data) { + return $http.post('delByShareId', data); +} + +export function uploadFiles() { + return "http://localhost:9000/front/app/uploadFile"; +} + +export function getUserId(userId) { + let accessToken = userId; + return {userId: `${accessToken}`}; +} + +export function getLinkInfo(data) { + return $http.post('getLinkInfo', data); +} + + + +/**--------资源库-------**/ +/*获取网盘文件类型*/ +export function getSourceType() { + return $http.post('getSourceType'); +} + +/*获取资源列表*/ +export function getSource(data) { + return $http.post('getSource', data); +} + + +/*获取资源列表*/ +export function fileDownload(data) { + return $http.post('fileDownload', data); +} + +/*文件重命名*/ +export function fileRename(data) { + return $http.post('/file/rename', data); +} + + + + +/**--------关注用户-------**/ +/*获取关注用户列表*/ +export function getFollowUser(data) { + return $http.post('getFollowUser', data); +} +export function getUserDetail(data) { + return $http.post('getUserDetail', data); +} + +export function addOrCancleUser(data) { + return $http.post('addOrCancelUser', data); +} + + + +/**--------更多-------**/ +export function editPersonal(data) { + return $http.post('updateUserInfo', data); +} + +export function _bindMail(data) { + return $http.post('bindUpdate', data); +} + +export function _bindMobile(data) { + return $http.post('bindUpdate', data); +} + +export function editPassword(data) { + return $http.post('bindUpdate', data); +} + + + diff --git a/frontend-source/src/api/notify.js b/frontend-source/src/api/notify.js new file mode 100644 index 0000000..6e5d24d --- /dev/null +++ b/frontend-source/src/api/notify.js @@ -0,0 +1,29 @@ +import $http from '@/assets/js/http' + +export function list(data) { + return $http.post('project/notify', data); +} + +export function noReads() { + return $http.post('project/notify/noReads'); +} + +export function doData(data) { + let url = 'project/notify/save'; + if (data.id) { + url = 'project/notify/edit'; + } + return $http.post(url, data); +} + +export function del(id) { + return $http.post('project/notify/delete', {id: id}); +} + +export function batchDel(ids) { + return $http.post('project/notify/batchDel', {ids: ids}); +} + +export function setReadied(ids) { + return $http.post('project/notify/setReadied', {ids: ids}); +} diff --git a/frontend-source/src/api/other.js b/frontend-source/src/api/other.js new file mode 100644 index 0000000..d3b9d1c --- /dev/null +++ b/frontend-source/src/api/other.js @@ -0,0 +1,13 @@ +import $ from 'jquery' +export function getYiYan(callback, type) { + if (type === undefined) { + type = 'f'; + } + let api = 'https://v1.hitokoto.cn/?c=' + type + '&encode=json'; + $.get({ + url: api, + success: function (data) { + callback(data); + } + }) +} \ No newline at end of file diff --git a/frontend-source/src/api/project.js b/frontend-source/src/api/project.js new file mode 100644 index 0000000..e69de29 diff --git a/frontend-source/src/api/system.js b/frontend-source/src/api/system.js new file mode 100644 index 0000000..e69de29 diff --git a/frontend-source/src/api/user.js b/frontend-source/src/api/user.js new file mode 100644 index 0000000..49adb83 --- /dev/null +++ b/frontend-source/src/api/user.js @@ -0,0 +1,82 @@ +import $http from '@/assets/js/http' + +export async function Login(data) { + return $http.post('project/login', data); +} + +export function register(data) { + return $http.post('project/login/register', data); +} + +export function forget(data) { + return $http.post('project/login/forget', data); +} + +export function getCaptcha(mobile) { + return $http.post('project/login/getCaptcha', {mobile: mobile}); +} + +export function changeCurrentOrganization(organizationCode) { + return $http.post('project/index/changeCurrentOrganization', {organizationCode: organizationCode}); +} + +export function list(data) { + return $http.post('project/account', data); +} + +export function forbid(accountCode) { + return $http.post('project/account/forbid', {accountCode: accountCode, status: 0}); +} + +export function resume(accountCode) { + return $http.post('project/account/resume', {accountCode: accountCode, status: 1}); +} + +export function doAccount(data) { + let url = 'project/account/add'; + if (data.code) { + url = 'project/account/edit'; + } + return $http.post(url, data); +} + +export function auth(id, auth) { + return $http.post('project/account/auth', {id: id, auth: auth}); +} + +export function del(accountCode) { + return $http.post('project/account/del', {accountCode: accountCode}); +} + +export function info($id) { + return $http.post('project/index/info', {id: $id}); +} + +export function read(code) { + return $http.post('project/account/read', {code: code}); +} + +export function editAccount(data) { + return $http.post('project/account/edit', data); +} + +export function editPersonal(data) { + return $http.post('project/index/editPersonal', data); +} + +export function editPassword(data) { + return $http.post('project/index/editPassword', data); +} +export function _bindMobile(data) { + return $http.post('project/login/_bindMobile', data); +} +export function _bindMail(data) { + return $http.post('project/login/_bindMail', data); +} +export function _checkBindMail(data) { + return $http.post('project/login/_checkBindMail', data); +} + +export function _joinByInviteLink(inviteCode) { + return $http.post('project/account/_joinByInviteLink', {inviteCode: inviteCode}); +} diff --git a/frontend-source/src/assets/css/components/base.less b/frontend-source/src/assets/css/components/base.less new file mode 100644 index 0000000..fbc955b --- /dev/null +++ b/frontend-source/src/assets/css/components/base.less @@ -0,0 +1,406 @@ +body { + overflow: hidden; +} + +.pull-right { + float: right; +} + +.pull-left { + float: left; +} + +//Text +.muted { + color: rgba(0, 0, 0, 0.45); + font-weight: 400; +} + +.text-grey { + color: grey; +} + +.text-default { + color: #333; +} + +.text-primary { + color: @primary-color; +} + +.text-info { + color: @info-color; +} + +.text-success { + color: @success-color; +} + +.text-processing { + color: @processing-color; +} + +.text-error { + color: @error-color; +} + +.text-highlight { + color: @highlight-color; +} + +.text-warning { + color: @warning-color; +} + +.text-normal { + color: @normal-color; +} + +.text-center { + text-align: center; +} + +.text-right { + text-align: right; +} + +.text-left { + text-align: left; +} + +//Input +.ant-input-lg { + font-size: 14px; +} + +.ant-select-lg { + font-size: 14px; +} + +//Button +.action-btn { + margin-top: 12px; + + .cancel-text { + margin-right: 12px; + } + + button { + margin-right: 4px; + } +} + +.group-btn, .submit-set { + .cancel-text { + margin-right: 12px; + } + + button { + margin-right: 4px; + } +} + +.middle-btn { + min-width: 66px; + //min-height: 42px; + //min-width: 90px; + //height: 35px !important; +} + +.ant-btn-lg { + font-size: 14px; +} + +.disabled-btn { + background-color: #d9d9d9 !important; + border-color: #d9d9d9 !important; + color: #fff !important; +} + +//Form +.ant-form-horizontal { + .ant-form-item-with-help { + margin-bottom: 12px; + } +} + +//Table +.ant-table-wrapper { + clear: both; +} + +.table-list { + .item { + display: inline-block; + + &.row-img { + img { + width: 85px; + height: 85px; + } + } + + &.row-title { + margin-left: 12px; + vertical-align: middle; + width: 75%; + + .title { + margin-bottom: 0; + + &.title-name { + padding: 5px 24px 5px 5px; + color: @primary-color; + } + } + } + } + + .edit-content { + .prefix { + position: absolute; + line-height: 2.3; + } + + .editable-cell { + width: 115px; + } + + &.price { + .editable-cell-input-wrapper, .editable-cell-text-wrapper { + padding-left: 15px; + } + } + } +} + +//Drowdown +.ant-dropdown-menu-item { + color: grey; +} + +.field-right-menu { + width: 240px; + + .ant-dropdown-menu-item { + min-height: 36px; + padding: 8px 16px; + position: relative; + + .menu-action { + position: absolute; + right: 16px; + top: 8px; + font-size: 12px; + color: @primary-color; + } + + .menu-desc { + padding-left: 22px; + font-size: 12px; + } + + .menu-item-content { + display: flex; + justify-content: space-between; + align-items: center; + } + } +} + +//Select +.ant-select { + min-width: 100px; +} + +.wangEditor-txt { + h1, h2, h3, h4, h5, h6 { + font-weight: bold; + } +} + +//Modal +.ant-modal { + top: 50px; +} + +//Badge + +.badge-blue { + .ant-badge-status-dot { + background-color: #1890ff; + } +} + +.badge-red { + .ant-badge-status-dot { + background-color: #f5222d; + } +} + +.badge-orange { + .ant-badge-status-dot { + background-color: #ff9900; + } +} + +.badge-green { + .ant-badge-status-dot { + background-color: #52c41a; + } +} + +.badge-brown { + .ant-badge-status-dot { + background-color: #2fbdb3; + } +} + +.badge-purple { + .ant-badge-status-dot { + background-color: #797ec9; + } +} + +.scroll-modal { + .ant-modal-body { + padding-bottom: 24px; + height: 70vh; + } + + .modal-content { + padding: 0 24px; + height: 100%; + } + + .modal-footer { + position: fixed; + bottom: 13vh; + background: #FFF; + margin-bottom: 0; + } +} + +.task-detail-modal { + width: 1200px; + + &.ant-modal { + padding-bottom: 0; + } + + .ant-modal-content { + .ant-modal-body { + padding: 0; + } + + } +} + +.hidden { + display: none; +} + +.project-navigation { + border-bottom: 1px solid #D9D9D9; + z-index: 1; + background-color: #F5F5F5; + transition: right 218ms ease; + position: fixed; + width: 100%; +} + +.project-navigation .ivu-breadcrumb-item-separator { + color: #383838; +} + +.project-navigation .ivu-breadcrumb > span:last-child { + font-weight: normal; +} + +.project-navigation .project-nav-header { + position: absolute; + z-index: 2; + left: 0; + height: 50px; + margin: 0; + padding: 15px; + + .nav-title { + font-size: 15px; + margin-right: 12px; + } + + .actions { + cursor: pointer; + margin-right: 12px; + } +} + +.project-navigation .nav-underscore { + position: relative; + height: 50px; + border: none; + margin-bottom: 0; +} + +.project-navigation .nav-body { + position: relative; + white-space: nowrap; + z-index: 1; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +.project-navigation .nav-body .nav-wrapper.nav > li { + z-index: 2; + padding: 0 20px; +} + +.project-navigation .nav-underscore > li { + list-style: none; + float: left; +} + +.project-navigation .nav-underscore > li a { + display: inline-block; + position: relative; + height: 50px; + margin: 0; + padding: 15px 0; + color: #383838; + font-size: 15px; + font-weight: normal; +} + +.project-navigation .nav-body .nav-wrapper.nav > li .app[data-app=tasks] { + position: relative; + float: left; + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.project-navigation .nav-underscore > li > a:hover { + background-color: inherit; +} + +.project-navigation .nav-underscore > li > a:after { + position: absolute; + left: 0; + bottom: 0; + height: 3px; + width: 100%; + border-bottom: 0 solid #3da8f5; + content: ''; + opacity: 0; +} + +.project-navigation .nav-underscore > li > a:hover:after, .project-navigation .nav-underscore > .actives > a:after { + border-width: 3px; + opacity: 1; +} diff --git a/frontend-source/src/assets/css/components/commom.less b/frontend-source/src/assets/css/components/commom.less new file mode 100644 index 0000000..24b0273 --- /dev/null +++ b/frontend-source/src/assets/css/components/commom.less @@ -0,0 +1,402 @@ +/* MARGINS & PADDINGS */ + +.p-xxs { + padding: 5px; +} + +.p-xs { + padding: 10px; +} + +.p-sm { + padding: 15px; +} + +.p-m { + padding: 20px; +} + +.p-md { + padding: 25px; +} + +.p-lg { + padding: 30px; +} + +.p-xl { + padding: 40px; +} + +.p-w-xs { + padding: 0 10px; +} + +.p-w-sm { + padding: 0 15px; + +} + +.p-w-m { + padding: 0 20px; + +} + +.p-w-md { + padding: 0 25px; + +} + +.p-w-lg { + padding: 0 30px; + +} + +.p-w-xl { + padding: 0 40px; + +} + +.p-h-xs { + padding: 10px 0; +} + +.p-h-sm { + padding: 15px 0; + +} + +.p-h-m { + padding: 20px 0; + +} + +.p-h-md { + padding: 25px 0; + +} + +.p-h-lg { + padding: 30px 0; + +} + +.p-h-xl { + padding: 40px 0; + +} + +.m-xxs { + margin: 2px 4px; +} + +.m { + margin: 15px; +} + +.m-xs { + margin: 5px; +} + +.m-sm { + margin: 10px; +} + +.m-md { + margin: 20px; +} + +.m-lg { + margin: 30px; +} + +.m-xl { + margin: 50px; +} + +.m-n { + margin: 0 !important; +} + +.m-l-none { + margin-left: 0; +} + +.m-l-xs { + margin-left: 5px; +} + +.m-l-sm { + margin-left: 10px; +} + +.m-l { + margin-left: 15px; +} + +.m-l-md { + margin-left: 20px; +} + +.m-l-lg { + margin-left: 30px; +} + +.m-l-xl { + margin-left: 40px; +} + +.m-l-n-xxs { + margin-left: -1px; +} + +.m-l-n-xs { + margin-left: -5px; +} + +.m-l-n-sm { + margin-left: -10px; +} + +.m-l-n { + margin-left: -15px; +} + +.m-l-n-md { + margin-left: -20px; +} + +.m-l-n-lg { + margin-left: -30px; +} + +.m-l-n-xl { + margin-left: -40px; +} + +.m-t-none { + margin-top: 0; +} + +.m-t-xxs { + margin-top: 1px; +} + +.m-t-xs { + margin-top: 5px; +} + +.m-t-sm { + margin-top: 10px; +} + +.m-t { + margin-top: 15px; +} + +.m-t-md { + margin-top: 20px; +} + +.m-t-lg { + margin-top: 30px; +} + +.m-t-xl { + margin-top: 40px; +} + +.m-t-n-xxs { + margin-top: -1px; +} + +.m-t-n-xs { + margin-top: -5px; +} + +.m-t-n-sm { + margin-top: -10px; +} + +.m-t-n { + margin-top: -15px; +} + +.m-t-n-md { + margin-top: -20px; +} + +.m-t-n-lg { + margin-top: -30px; +} + +.m-t-n-xl { + margin-top: -40px; +} + +.m-r-none { + margin-right: 0; +} + +.m-r-xxs { + margin-right: 1px; +} + +.m-r-xs { + margin-right: 5px; +} + +.m-r-sm { + margin-right: 10px; +} + +.m-r { + margin-right: 15px; +} + +.m-r-md { + margin-right: 20px; +} + +.m-r-lg { + margin-right: 30px; +} + +.m-r-xl { + margin-right: 40px; +} + +.m-r-n-xxs { + margin-right: -1px; +} + +.m-r-n-xs { + margin-right: -5px; +} + +.m-r-n-sm { + margin-right: -10px; +} + +.m-r-n { + margin-right: -15px; +} + +.m-r-n-md { + margin-right: -20px; +} + +.m-r-n-lg { + margin-right: -30px; +} + +.m-r-n-xl { + margin-right: -40px; +} + +.m-b-none { + margin-bottom: 0; +} + +.m-b-xxs { + margin-bottom: 1px; +} + +.m-b-xs { + margin-bottom: 5px; +} + +.m-b-sm { + margin-bottom: 10px; +} + +.m-b { + margin-bottom: 15px; +} + +.m-b-md { + margin-bottom: 20px; +} + +.m-b-lg { + margin-bottom: 30px; +} + +.m-b-xl { + margin-bottom: 40px; +} + +.m-b-n-xxs { + margin-bottom: -1px; +} + +.m-b-n-xs { + margin-bottom: -5px; +} + +.m-b-n-sm { + margin-bottom: -10px; +} + +.m-b-n { + margin-bottom: -15px; +} + +.m-b-n-md { + margin-bottom: -20px; +} + +.m-b-n-lg { + margin-bottom: -30px; +} + +.m-b-n-xl { + margin-bottom: -40px; +} + +.space-15 { + margin: 15px 0; +} + +.space-20 { + margin: 20px 0; +} + +.space-25 { + margin: 25px 0; +} + +.space-30 { + margin: 30px 0; +} + +// IMAGES SIZE + +.img-sm { + width: 32px; + height: 32px; +} + +.img-md { + width: 64px; + height: 64px; +} + +.img-lg { + width: 96px; + height: 96px; +} + +// BORDER RADIUS + +// Alignment +.text-left { text-align: left; } +.text-right { text-align: right; } +.text-center { text-align: center; } +.text-justify { text-align: justify; } +.text-nowrap { white-space: nowrap; } + +// Transformation +.text-lowercase { text-transform: lowercase; } +.text-uppercase { text-transform: uppercase; } +.text-capitalize { text-transform: capitalize; } diff --git a/frontend-source/src/assets/css/components/index.less b/frontend-source/src/assets/css/components/index.less new file mode 100644 index 0000000..a4585c6 --- /dev/null +++ b/frontend-source/src/assets/css/components/index.less @@ -0,0 +1,6 @@ +@import "commom"; +@import "base"; +@import "layout"; +@import "list"; +@import "labels"; +@import "warpperContent"; diff --git a/frontend-source/src/assets/css/components/labels.less b/frontend-source/src/assets/css/components/labels.less new file mode 100644 index 0000000..eccfcb1 --- /dev/null +++ b/frontend-source/src/assets/css/components/labels.less @@ -0,0 +1,73 @@ + +// +// Labels +// -------------------------------------------------- + + +.label { + display: inline; + padding: .3em .8em; + font-size: 75%; + //font-weight: bold; + line-height: 1; + color: #FFF; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; + background-color: #d1dade; + //font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + text-shadow: none; + + // Add hover effects, but only for links + a& { + &:hover, + &:focus { + color: #FFF; + text-decoration: none; + cursor: pointer; + } + } + + // Empty labels collapse automatically (not available in IE8) + &:empty { + display: none; + } + + // Quick fix for labels in buttons + .btn & { + position: relative; + top: -1px; + } +} + +// Colors +// Contextual variations (linked labels get darker on :hover) + +.label-default { + //background-color(@default-color); +} + +.label-primary { + background-color:(@primary-color); +} + +.label-success { + background-color:(@success-color); +} + +.label-info { + background-color:(@info-color); +} + +.label-warning { + background-color:(@warning-color); +} + +.label-danger { + background-color:(@error-color); +} +.label-normal { + color: gray; + background-color:(@normal-color); +} diff --git a/frontend-source/src/assets/css/components/layout.less b/frontend-source/src/assets/css/components/layout.less new file mode 100644 index 0000000..16af68c --- /dev/null +++ b/frontend-source/src/assets/css/components/layout.less @@ -0,0 +1,316 @@ +#layout { + height: 100vh; + + .ant-layout-header { + background: #fff; + padding: 0; + line-height: 85px; + position: fixed; + width: 100%; + top: 0; + z-index: 5; + //box-shadow: 0 1px 4px rgba(0, 21, 41, .08); + box-shadow: 0 0 8px 0 rgba(0,0,0,.1); + ul { + border-bottom: none; + } + } + + .logo { + height: 32px; + padding: 16px; + text-align: center; + box-sizing: content-box; + transition: all .2s; + width: 224px; + float: left; + line-height: 1.4; + background: initial; + color: #FFF; + cursor: pointer; + .logo-img { + width: 23px; + position: absolute; + left: 45px; + top: 15px; + transition: all .2s; + } + + .title { + color: inherit; + font-size: 20px; + position: relative; + .version { + color: inherit; + position: absolute; + right: -25px; + font-size: 14px; + } + } + } + + .right-menu { + position: absolute; + right: 12px; + top: 0; + height: 100%; + line-height: 66px; + color: #FFF; + display: flex; + + .action { + cursor: pointer; + //display: inline-block; + transition: all .2s; + padding: 0 6px; + height: 65px; + + .anticon { + font-size: 16px; + vertical-align: middle; + color: #FFF; + //color: rgba(0, 0, 0, .65); + } + + .action-item { + padding: 0 12px; + height: 100%; + position: relative; + + &.user-info { + padding-left: 52px; + + .ant-avatar { + position: absolute; + left: 12px; + top: 18px; + } + } + } + + &:hover { + background: rgba(0, 0, 0, .08); + //background: #e6f7ff; + } + + &.action-avatar { + padding: 0; + } + + &.action-organization { + //min-width: 200px; + text-align: center; + } + } + } + + .ant-layout-sider { + z-index: 2; + overflow: auto; + width: 256px !important; + max-width: 256px !important; + height: 100vh; + position: fixed; + left: 0; + box-shadow: 2px 0 8px 0 rgba(29, 35, 41, .05); + + &.ant-layout-sider-collapsed { + width: 80px !important; + max-width: 80px !important; + + .ant-layout-sider-trigger { + width: 80px !important; + } + + .logo { + .title { + display: none; + } + } + } + + .ant-layout-sider-trigger { + width: 256px !important; + } + + } + + .maint-content{ + .ant-layout-content{ + border-top: 1px solid #e8e8e8; + } + } + + .ant-layout-footer { + margin: 0 6px; + padding: 0 50px 12px 50px; + } + + .ant-layout-header.collapsed{ + .logo{ + width: 48px; + .logo-img{ + left: 27px; + } + .title{ + display: none; + } + } + } + + &.layout-light { + .ant-layout-header { + ul { + //background-color: #2b83f9; + //background-image: linear-gradient(143deg,#2945cb 20%,#2b83f9 81%,#3a9dff); + //background-image: linear-gradient(143deg, #2945cb 20%, #1890ff 81%, #3a9dff); + background-image: linear-gradient(143deg, #e12f3f 20%, #f79275 81%, #FFC107); + border-bottom: none; + + li { + border-bottom: none; + + span, i { + color: #FFF; + //opacity: .69; + } + + &:hover { + span, i { + opacity: 1; + } + } + + &.ant-menu-item-selected, &.ant-menu-item-active { + color: #1890ff; + background: rgba(0, 0, 0, 0.08); + } + } + } + } + + .ant-layout-sider { + background: #FFF; + .ant-layout-sider-children{ + .ant-menu-inline, .ant-menu-vertical, .ant-menu-vertical-left { + border-right: none; + } + } + } + + .logo { + .title { + color: inherit; + + .version { + color: inherit; + } + } + } + + .ant-layout-sider-trigger { + background: #FFF; + color: inherit; + } + } + + &.layout-dark { + .ant-layout-header { + ul { + background-color: #fff; + background-image: none; + } + } + + .logo { + background: #002140; + border-bottom: 1px solid #002140; + box-shadow: 2px 0 6px rgba(0, 21, 41, .35); + } + + .ant-layout-sider{ + box-shadow: 2px 0 6px rgba(0, 21, 41, .35); + } + + .right-menu { + color: initial; + + .action { + .anticon { + color: initial; + } + + .action-item { + &.user-info { + .ant-avatar { + } + } + } + + &:hover { + background: rgba(0,0,0,.025); + //background: #e6f7ff; + } + + &.action-avatar { + } + + &.action-organization { + } + } + } + + } + + header { + .ant-menu { + //-webkit-box-shadow: 0 1px 4px rgba(0,21,41,.08); + //box-shadow: 0 1px 4px rgba(0,21,41,.08); + } + } + + &.hide { + .ant-layout-sider { + display: none; + } + + .main-content { + padding-left: 0 !important; + } + } + + .trigger { + font-size: 18px; + line-height: 64px; + padding: 0 24px; + cursor: pointer; + transition: color .2s; + + &:hover { + color: #1890ff; + } + + } +} + +.middle-menu { + padding: 4px 0; + + .ant-dropdown-menu-item-divider, .ant-dropdown-menu-submenu-title-divider { + margin: 4px 0; + } + + .ant-dropdown-menu-item { + width: 160px; + } + + &.organization-menu { + .ant-dropdown-menu-item { + width: 100%; + } + } +} + +.__vuescroll .__rail-is-vertical { + z-index: 3; +} diff --git a/frontend-source/src/assets/css/components/list.less b/frontend-source/src/assets/css/components/list.less new file mode 100644 index 0000000..51511bd --- /dev/null +++ b/frontend-source/src/assets/css/components/list.less @@ -0,0 +1,29 @@ +.default-list { + .ant-list-item-meta-avatar { + .ant-avatar { + width: 50px; + height: 50px; + border-radius: 3px; + } + } + + .ant-list-item-content { + .other-info { + display: flex; + + .info-item { + display: flex; + flex-direction: column; + padding-left: 48px; + } + } + } + + .ant-list-item-action { + .anticon:hover { + svg { + color: @primary-color; + } + } + } +} diff --git a/frontend-source/src/assets/css/components/task.less b/frontend-source/src/assets/css/components/task.less new file mode 100644 index 0000000..0912297 --- /dev/null +++ b/frontend-source/src/assets/css/components/task.less @@ -0,0 +1,1509 @@ +.project-space-task { +} + +.project-space-task .wrapper-main { + margin: 0; + padding: 0; + background: inherit; +} + +.project-space-task .wrapper-content { + background: #f1f1f1; + position: fixed; + height: 100%; + padding: 0 0 63px; +} + +.project-space-task .layout-content { + padding: 60px 10px 0 0; + height: 100%; + margin-left: 0; + margin-right: 0; + background: #fff; +} + +.project-space-task .manage-contents { + padding-left: 32px; + padding-right: 32px; +} + +.project-space-task .manage-contents h4 { + display: block; + border-bottom: 1px solid #e5e5e5; + padding-bottom: 12px; +} + + +.project-space-task .board-scrum-stages { + position: relative; + padding: 0 10px 10px 10px; + white-space: nowrap; + overflow-x: auto; + overflow-y: hidden; + -webkit-overflow-scrolling: touch; + height: 100%; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} + +.scrum-stage { + position: relative; + height: 100%; + width: 295px; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + margin-right: 10px; + vertical-align: top; + background-color: #EEEEEE; + border-radius: 3px; + + .sortable-chosen { + cursor: pointer; + //display: none + } + + &.stage-ghost { + background: #e5e5e5; + + div { + display: none; + } + + } +} + +.scrum-stage .scrum-stage-header, .scrum-stage .sort-header-placeholder { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + padding: 14px 18px; + font-size: 15px; + font-weight: bold; + z-index: 1; + transition: box-shadow 100ms ease; +} + +.scrum-stage-header.ui-sortable-handle { + cursor: pointer; +} + +.scrum-stage .stage-menu-toggler { + position: absolute; + right: 15px; +} + +.stage-menu-toggler .menu-toggler-title:hover { + color: #57a3f3; +} + + +.scrum-stage .stage-menu-toggler .ivu-select-dropdown { + border-radius: 3px; +} + +.stage-menu-toggler li { + line-height: 30px; + padding: 5px 15px; +} + +.task-popover-content .ivu-select-dropdown { + margin-top: 0; + padding-top: 0; +} + +.task-popover-content .popover-header { + text-align: center; + padding: 5px 10px; + background: #fff; + border-bottom: 1px solid rgba(0, 0, 0, .07); +} + +.task-popover-content .popover-title { + padding: 0; + font-size: 15px; + font-weight: 700; + line-height: 30px; + text-align: center; + background: none; + border: 0 none; + border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; +} + +.scrum-stage .scrum-stage-wrap { + position: relative; + height: 100%; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.scrum-stage .scrum-stage-content { + -webkit-flex: 1 1 0; + -ms-flex: 1 1 0; + flex: 1 1 0; + overflow: auto; + overflow-x: visible; + -webkit-overflow-scrolling: touch; +} + +.scrum-stage .scrum-stage-content > ul { + /*margin-bottom: 8px;*/ +} + +.scrum-stage .scrum-stage-tasks,.scrum-stage .scrum-stage-tasks-done { + transition: opacity 0.08s ease-out; + opacity: 1; + min-height: 5px; + padding: 0 5px; + position: relative; +} + +.scrum-stage .task.task-card { + margin: 0 8px 8px; +} + +.task.task-card { + padding: 0; + background-color: white; + border-radius: 3px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); + cursor: pointer; + min-height: 52px; + + &.task-ghost { + border-left: 3px solid #e5e5e5 !important; + background: #e5e5e5; + + * { + visibility: hidden; + //display: none; + } + } +} + +.task-drag { + //transform:rotate(7deg); + //top: 0px !important; + cursor: pointer; + background: red; +} + +.sortable-fallback { + background: red; + cursor: pointer; + +} + +.task { + position: relative; + white-space: normal; +} + +.task { + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; +} + +.task.task-card .task-priority { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} + +.task .task-priority.bg-priority-0 { + opacity: 0; +} + +.task .task-priority { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 6px; + cursor: pointer; + transition: width 218ms ease-in, opacity 218ms ease-in; +} + +.bg-priority-0 { + background-color: #A6A6A6; +} + +.task.task-card .task-content-set { + padding: 12px 0; + margin-left: 0; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.task .task-content-set { + overflow: hidden; + margin: 0 0 0 12px; + line-height: 20px; + cursor: pointer; +} + +.task-content-input { + width: 100%; +} + +.task .task-content-set { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; +} + +.task.task-card .task-content-wrapper { + overflow: visible; +} + +.task .task-content-set .task-content-wrapper { + overflow: hidden; + min-height: 24px; +} + +.task .task-content-set .task-content-wrapper { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; +} + +.task .task-content-set .task-content-wrapper .task-content { + margin: 2px 12px 0 0; + padding: 0; + border: none; + background: none; + cursor: pointer; + word-wrap: break-word; + overflow: hidden; + transition: color 218ms ease; +} + +.task .task-content-set .task-content-wrapper .task-content { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; +} + +.scrum-stage .task.task-card .avatar { + opacity: 1; + margin: 0 14px 0 0; + transition: -webkit-transform 218ms ease-in-out, opacity 100ms; +} + +.task .avatar { + margin-right: 12px; +} + +.task .avatar { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} + +.task.task-card .task-info-wrapper { + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + /*-webkit-flex-direction: column;*/ + /*-ms-flex-direction: column;*/ + /*flex-direction: column;*/ + padding-right: 14px; +} + +.task.task-card .task-info-wrapper .task-infos { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: hidden; +} + +.task.task-card .task-infos { + margin-top: 4px; + line-height: 20px; + font-size: 0; +} + +.task.task-card .task-infos .label, .task.task-card .task-infos .icon-wrapper, .task.task-card .task-infos .tag { + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + height: 20px; + font-size: 12px; + vertical-align: middle; + margin: 2px 6px 0 0; + //padding: 0 4px; + max-width: 100%; +} + +.task.task-card .task-infos .icon-wrapper { + font-size: 14px; + //width: 20px; + margin: 2px 10px 0 0; + + span { + margin-left: 3px; + } +} + +.task.task-card .task-infos .label { + padding-left: 6px; +} + +.label-important, .badge-important { + color: #FFFFFF; + background-color: #FF4F3E; +} + +.task.task-card .task-infos .label > span, .task.task-card .task-infos .icon-wrapper, .task.task-card .task-infos .tag { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.task.task-card .task-infos .tag { + position: relative; + padding-right: 6px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.task.task-card .task-infos .text { + width: 50px; + font-size: 12px; + //color: #19be6b; +} + +.tag-color-disc-blue { + background-color: #2d8cf0; +} + +.tag.tag-color-blue:before { + content: ' '; + position: absolute; + top: 7px; + left: 4px; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #2d8cf0; +} + +.tag-color-disc-orange { + background-color: #ff9900; +} + +.tag.tag-color-orange:before { + content: ' '; + position: absolute; + top: 7px; + left: 4px; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #ff9900; +} + +.tag-color-disc-red { + background-color: #ed3f14; +} + +.tag.tag-color-red:before { + content: ' '; + position: absolute; + top: 7px; + left: 4px; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #ed3f14; +} + +.tag-color-disc-green { + background-color: #19be6b; +} + +.tag.tag-color-green:before { + content: ' '; + position: absolute; + top: 7px; + left: 4px; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #19be6b; +} + +.tag-color-disc-brown { + background-color: #2fbdb3; +} + +.tag.tag-color-brown:before { + content: ' '; + position: absolute; + top: 7px; + left: 4px; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #2fbdb3; +} + +.tag-color-disc-purple { + background-color: #797ec9; +} + +.tag.tag-color-purple:before { + content: ' '; + position: absolute; + top: 7px; + left: 4px; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #797ec9; +} + +.task-info-footer { + display: flex; + flex-direction: row-reverse; + margin-bottom: -12px; + + .task-id-number { + display: inline-block; + padding: 0 4px; + color: gray; + font-size: 12px; + line-height: 20px; + background-color: #f5f5f5; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-top: 4px; + border-radius: 4px 0 4px 0; + } +} + +.scrum-stage .task-creator-handler-wrap .task-creator-handler { + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + padding: 14px 15px; + //border-radius: 3px; + font-size: 15px; +} + +.scrum-stage .task-creator-handler-wrap .task-creator-handler:hover { + background-color: #E5E5E5; +} + +.link-add-handler { + color: #2d8cf0 !important; + transition: color 218ms ease; +} + +.link-add-handler { + //margin-right: 10px; +} + +.img-24 { + display: inline-block; + width: 24px; + height: 24px; + background-color: #eee; + background-size: 24px 24px; +} + +.img-32 { + display: inline-block; + width: 32px; + height: 32px; + background-color: #eee; + background-size: 32px 32px; +} + +.img-circle { + border-radius: 50%; +} + +.disabled { + cursor: not-allowed; + color: rgba(0, 0, 0, 0.45); +} + +.task.task-card.done .check-box, .task.task-card.done .task-content-set { + opacity: 0.64; + filter: alpha(opacity=64); +} + +.task.task-card .check-box { + margin: 14px 12px 0 8px; +} + +.task .check-box { + width: 20px; + height: 20px; + margin-top: 2px; + border: solid 2px #A6A6A6; + cursor: pointer; + border-radius: 3px; +} + +.task .check-box.disabled { + border-color: #ccc !important; + background-color: #f5f5f5; + cursor: not-allowed; +} + +.children-task-list .task .check-box { + width: 15px; + height: 15px; + margin-top: 6px; +} + +.task .check-box { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} + +.task .check-box:hover { + border-color: #808080; +} + +.task.done { + background-color: #F7F7F7; +} + +.children-task-list .task.done { + background-color: inherit; +} + +.task.done .task-content { + color: #A6A6A6; + text-decoration: line-through; +} + +.task.done .check-box .anticon-check { + //font-weight: bold; + visibility: visible; +} + +.task .check-box .anticon-check { + visibility: hidden; + color: #A6A6A6; + font-size: 12px; + -webkit-transform: translate(2px, 0); + transform: translate(2px, 0); + top: 18px; + left: 10px; + position: absolute; +} + +.ivu-modal .task .check-box .anticon-check { + top: 10px; + left: 5.8px; +} + +.children-task-list .task .check-box .anticon-check { + font-size: 12px; + -webkit-transform: translate(1px, -4px); + transform: translate(1px, -4px); + top: 17px; +} + +.scrum-stage .task-creator-wrap { + margin: 0 8px 8px; + box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.1); +} + +.scrum-stage .task-creator-wrap .submit-set .middle-btn { + width: 50%; +} + +.project-space-task .card { + border: 0 none; + background-color: #FFFFFF; + border-radius: 2px; + box-shadow: rgba(0, 0, 0, 0.0470588) 0 2px 3px 0; +} + +.project-space-task .card { + background-color: #fff; + border: 0 none; + border-radius: 2px; + -webkit-box-shadow: rgba(0, 0, 0, .0470588) 0 2px 3px 0; + box-shadow: rgba(0, 0, 0, .0470588) 0 2px 3px 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; +} + +.fade.in { + opacity: 1; +} + +.task-creator { + position: relative; + padding: 10px; +} + +.task-creator-wrap .executor-handler { + display: flex; + align-items: center; +} + +.task-creator-wrap .executor-handler .avatar { + margin-right: 8px; +} + +.executor-handler-menu { + .ant-dropdown-menu-item { + position: relative; + line-height: 32px; + + .anticon-check { + position: absolute; + float: right; + top: 16px; + right: 12px; + font-size: 12px; + } + + } + + //padding-top: 15px; +} + +.task-creator-wrap .ivu-select-dropdown { + position: absolute !important; + width: 238px; + left: 0 !important; +} + +.fade { + opacity: 0; + -webkit-transition: opacity .15s linear; + -o-transition: opacity .15s linear; + transition: opacity .15s linear; +} + +input.form-control, textarea.form-control { + background-color: #FFFFFF; + border: 1px solid #D9D9D9; + border-radius: 3px; + line-height: 20px; +} + +.task-creator .handler-wrap { + position: relative; + height: 54px; + border-bottom: 1px solid #EEEEEE; +} + +.task-creator .handler-wrap > a { + width: 100%; + display: inline-block; + //padding: 15px 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.task-creator .handler-wrap .creator-handler-text.name { + font-weight: bold; + margin-right: 4px; +} + +.task-creator .handler-wrap .creator-handler-text { + line-height: 24px; +} + +.task-creator .handler-wrap > a > .icon, .task-creator .handler-wrap > a > .avatar { + display: inline-block; + line-height: 24px; + float: left; + margin-right: 8px; +} + +.involve-view { + padding: 12px 0 5px; + position: relative; +} + +.involve-view .involve-header { + margin-bottom: -3px; + color: #808080; + font-size: 13px; + font-weight: bold; +} + +.involve-view .involve-members { + margin: 10px 0 -5px -10px; +} + +.involve-view .involve-members > li { + position: relative; + float: left; + margin: 0 0 10px 10px; + cursor: pointer; +} + +.involve-view .involve-members > li > .avatar { + display: block; + width: 24px; + height: 24px; + transition: -webkit-transform 2110ms ease-in-out; +} + +.avatar { + background-size: cover !important; + background-repeat: no-repeat !important; + background-position: center !important; +} + +.involve-view .involve-members > li { + position: relative; + float: left; + margin: 0 0 10px 10px; + cursor: pointer; +} + +.involve-view .add-involvement-handler { + display: block; + font-size: 24px; + color: #A6A6A6; +} + +.add-member { + color: #3da8f5; + display: block; + width: 24px; + height: 24px; + line-height: 26px; + text-align: center; +} + +.task-creator .handler-wrap > a { + width: 100%; + display: inline-block; + padding: 6px 0; + margin: 6px 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.task-creator .handler-wrap .creator-handler-text { + line-height: 24px; +} + +.project-space-task .menu-toggler-title, .project-space-task .footer-item { + color: #808080; + text-decoration: none; + cursor: pointer; +} + +.task-creator .tags-wrap, .task-creator .involve-wrap { + border-bottom: 1px solid #EEEEEE; +} + +.task-creator .submit-set { + position: relative; + margin-top: 10px; +} + +.scrum-stage.fixed-creator .task-creator-handler-wrap { + position: fixed; + bottom: 10px; + height: 50px; + width: 295px; +} + +.task-creator-handler-wrap { + /*box-shadow: 0 -3px 2px -2px rgba(0, 0, 0, 0.1);*/ +} + +.task-creator-handler-wrap { + width: 100%; + background-color: #EEEEEE; + transition: box-shadow 218ms ease; + /*bottom: 0;*/ + /*position: absolute;*/ +} + +.scrum-stage-wrap.ui-sortable { + padding-bottom: 50px; +} + +.hidden-creator-bottom { + padding-bottom: 0 !important; +} + +.create-stage { + height: auto; + cursor: default; + + .create-stage-footer { + text-align: right; + padding-top: 10px; + + .cancel-text { + margin-right: 24px; + font-size: 14px; + } + } + + .ant-input { + padding-top: 12px; + padding-bottom: 12px; + height: 40px; + line-height: 40px; + } +} + +/*.task-datepicker .ivu-select-dropdown{*/ +/*left: 18px !important;*/ +/*top: 360px !important;*/ +/*}*/ +.detail-content .wangEditor-container { + min-height: 200px; +} + +.activities-timeline .activities-list-wrap { + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; +} + +.activities-timeline > div, .activities-timeline > ul { + margin-right: -1px; + margin-left: -1px; + overflow: hidden; + background-color: #FFFFFF; +} + +.activities-list { + padding-bottom: 0; +} + +.activities-timeline .activities-list { + position: relative; +} + +.activity:first-child { + margin-top: 12px; +} + +.activity { + position: relative; + overflow: hidden; + margin: 15px; + padding-left: 15px; +} + +.activity .activity-body-coyness { + font-size: 12px; + margin: 0 0 0 25px; + padding-left: 10px; +} + +.activity .activity-body-coyness .activity-content { + cursor: pointer; +} + +.activity .activity-content { + color: #383838; +} + +.readable > *:last-child { + margin-bottom: 0; +} + +.activity .activity-body-coyness .activity-content.overflow .activity-description { + display: block; +} + +.activity .activity-body-coyness .activity-content .activity-description { + display: none; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 12px; + border-left: 5px solid #EEEEEE; +} + +.activity .activity-content > blockquote { + margin: 5px 0 0 0; + padding: 0 0 0 10px; +} + +.readable blockquote { + font-size: 14px; + border-left: 6px solid #ddd; + padding: 5px 0 5px 10px; +} + +blockquote { + font-size: 12px; +} + +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eee; +} + +.activity .activity-body-coyness .activity-content.overflow .activity-content-detail { + display: none; +} + +li.activity.creator i { + margin-top: 0; +} + +.activities-timeline.early-hidden .activity-early-wrap, .activities-timeline.early-shown .activity-early-wrap, .activities-timeline.early-loading .activity-early-wrap { + display: block; +} + +.activities-timeline .activity-early-wrap { + display: none; +} + +.activities-timeline .activity-early-handler { + display: block; + padding: 0 35px 0; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.link-add-handler { + color: #3da8f5 !important; + transition: color 218ms ease; +} + +.task.task-card.ui-sortable-handle.dragging, .scrum-stage-tasks-done .task.task-card.ui-sortable-handle.dragging { + cursor: move; +} + +/*紧急程度一般*/ +.task.task-card.ui-sortable-handle:hover, .scrum-stage-tasks-done .task.task-card.ui-sortable-handle:hover { + border-left: 3px solid #a6a6a6; +} + +.task.task-card.ui-sortable-handle.warning { + border-left: 3px solid #ff9900; +} + +.task.task-card.ui-sortable-handle.error { + border-left: 3px solid #ed3f14; +} + +.task.task-card.ui-sortable-handle.warning:hover { + border-left: 3px solid #ff9900; +} + +.task.task-card.ui-sortable-handle.error:hover { + border-left: 3px solid #ed3f14; +} + +.task.task-card.ui-sortable-handle { + border-left: 3px solid #fff; + -webkit-transition-property: border-left; + -webkit-transition-duration: 0.5s; + -webkit-transition-timing-function: ease; +} + +.scrum-stage-tasks-done .task.task-card.ui-sortable-handle { + border-left: 3px solid #f7f7f7; +} + +.scrum-stage-tasks-done .task.task-card.ui-sortable-handle.warning { + border-left: 3px solid #ff9900; +} + +.scrum-stage-tasks-done .task.task-card.ui-sortable-handle.error { + border-left: 3px solid #ed3f14; +} + +.scrum-stage-tasks-done .task.task-card.ui-sortable-handle.warning:hover { + border-left: 3px solid #ff9900; +} + +.scrum-stage-tasks-done .task.task-card.ui-sortable-handle.error:hover { + border-left: 3px solid #ed3f14; +} + +.activities-list { + font-size: 18px; + padding-left: 3px; +} + +.detail-content .ivu-upload-list { + clear: both; +} + +.project-nav-footer { + position: absolute; + right: 0; + top: 0; + display: flex; + height: 50px; + align-items: center; + z-index: 998; +} + +.project-nav-footer .footer-item { + font-size: 15px; + position: relative; + padding: 15px 10px; + margin: 0 5px; + float: right; + display: inline-block; + text-align: center; +} + +.project-nav-footer .footer-item.active { + color: #2D8cF0; +} + +.project-nav-footer .footer-item:hover { + color: #2D8cF0; +} + +.project-nav-footer :not(:first-child):after { + position: absolute; + content: ''; + right: -5px; + top: 16px; + bottom: 16px; + width: 1px; + background-color: #A6A6A6; +} + + +.menu-modal .ivu-modal-mask { + overflow: hidden; + background-color: inherit; + width: 0; +} + +.menu-modal .ivu-modal-wrap { + //width:0; + z-index: 1; +} + +.menu-modal .ivu-modal { + position: fixed; + top: 111px; + right: 0; + height: 100%; + box-shadow: -3px 0 3px rgba(0, 0, 0, 0.1); +} + +.menu-modal .ivu-modal-header { + text-align: center; +} + +.menu-modal .ivu-modal-content { + height: 100%; + background-color: #F7F7F7; +} + +.menu-modal .ivu-modal-body { + padding: 0; +} + +.menu-modal .ivu-modal-footer { + display: none; +} + +.menu-modal .ivu-modal-content .project-menus { + position: relative; + padding-bottom: 1px; +} + +.menu-modal .ivu-modal-content .project-menus:after { + position: absolute; + left: 14px; + right: 16px; + bottom: 0; + content: ' '; + height: 1px; + background-color: rgba(0, 0, 0, 0.06); +} + +.project-menus .list > li { + position: relative; + line-height: 30px; +} + +.project-menus .list > li:first-child > a { + margin-top: 5px; +} + +.project-menus .list > li:first-child > a { + margin-top: 5px; +} + +.project-menus .list > li > a { + display: flex; + align-items: center; + cursor: pointer; + padding: 5px 15px; + text-decoration: none; + color: #808080; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.project-menus .list > li > a { + color: #808080; + font-size: 16px; + width: 35px; + text-align: center; +} + +.project-menus .activities-panel-menu-list > li > a { + color: #383838; + font-weight: 600; +} + +.project-menus .activities-panel-menu-list > li:hover a { + background-color: #EEEEEE; +} + +.activity-card-datas.activity-card:first-child { + margin-top: 5px; +} + +.activity-card:first-child { + margin-top: 0; +} + +.activity-card-datas { + margin-top: 5px; + margin-bottom: 15px; + padding: 0 15px; +} + +.activity-card { + position: relative; + line-height: 20px; + padding: 10px 15px 0; + margin: 9px auto 0; +} + +.activity-card .activity-card-header { + position: relative; + margin-bottom: 10px; + display: inline-block; + vertical-align: middle; + float: left; + margin-right: 10px; +} + +.activity-card-datas .activity-card-header { + display: block; + float: none; + margin-bottom: 0; + font-weight: 600; + line-height: 35px; +} + +.activity-card .activity-card-header { + color: #808080; + font-size: 16px; + width: 35px; + text-align: center; +} + +.activity-card .activity-card-title { + margin-right: 6px; +} + +.activity-card .activity-card-header .activity-card-title { + z-index: 1; + display: inline-block; + margin-bottom: 8px; +} + +.activity-card-datas .activity-card-header .activity-card-title { + line-height: 24px; + margin-bottom: 0; +} + +.activity-card-datas .data-statistics { + padding-bottom: 10px; +} + +.activity-card-datas .data-statistics > div { + display: inline-block; + vertical-align: middle; + cursor: pointer; + width: 130px; + margin-left: 29px; + padding-left: 5px; + padding-top: 5px; + padding-bottom: 13px; + border-radius: 2px; + font-size: 14px; +} + +.activity-card-datas .data-statistics > div:hover { + background-color: #EEEEEE; +} + +.activity-card-datas .data-statistics .activity-link-today { + margin-left: 0; +} + +.activity-card-datas .data-statistics .unassignedtasks-number { + color: #19be6b; + font-size: 24px; + display: inline-block; + margin-top: 5px; +} + +.activity-card-datas .data-statistics .todayDatas-number { + color: #ff9900; + font-size: 24px; + display: inline-block; + margin-top: 5px; +} + +.activity-card-datas .data-statistics::after { + position: absolute; + left: 49px; + right: 15px; + bottom: 1px; + content: ' '; + height: 1px; + background-color: rgba(0, 0, 0, 0.06); +} + +.activity-panel-card-table { + position: relative; + display: flex; +} + +.activity-card-table.activity-card { + width: 100%; + margin: 10px 15px; + padding: 0 0 15px; +} + +.activity-panel-card-table .activity-card-table .activity-card-header { + width: 100%; +} + +.activity-card-table .activity-card-title { + padding-left: 34px; +} + +.activity-card-table .activity-card-body { + display: block; + margin-left: 34px; + margin-right: 0; + min-height: 100px; + background-color: #FFFFFF; +} + +.activity-card-table::after { + position: absolute; + left: 34px; + right: 1px; + bottom: 0; + content: ' '; + height: 1px; + background-color: rgba(0, 0, 0, 0.06); +} + +.activity-panel-activities-list .activity-panel-activities-title { + position: relative; + line-height: 30px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-top: 5px; +} + +.activity-panel-activities-list .activity-panel-activities-title .project-activies-title { + color: #383838; + padding: 5px 15px; + font-weight: 600; +} + +.project-activies-title { + color: #808080; + font-size: 16px; + width: 35px; + text-align: center; +} + +.activity-panel-activities-wrap { + margin-top: -5px; +} + +.activity-card.activity-task { + padding-top: 25px; + padding-left: 20px; +} + +.work { + position: relative; +} + +.activity-card .activity-content { + overflow: hidden; + padding-bottom: 5px; + color: #383838; +} + +.activity-card .activity-content .activity-card-title { + display: inline-block; + vertical-align: middle; + margin-bottom: 5px; +} + +.activity-card.activity-task .activity-card-title { + width: 100%; +} + +.activity-card .activity-card-title { + margin-right: 6px; +} + +.activity-card .activity-card-body:empty { + display: none; +} + +.activity-card .activity-card-footer { + margin-bottom: 5px; + display: inline-block; + vertical-align: bottom; +} + +.react-time-stamp { + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} + +.activity-card .activity-card-footer time { + color: #808080; + font-size: 12px; +} + +.activity-card .activity-card-footer:after { + clear: both; +} + +.activity-panel-activities .activity-panel-activities-body .activity-content::after { + position: absolute; + left: 48px; + right: 16px; + bottom: -5px; + content: ' '; + height: 1px; + background-color: rgba(0, 0, 0, 0.06); +} + +.menu-modal .user-content { + padding: 15px; +} + +.user-menu-modal .menu-user-list img { + width: 36px; + height: 36px; +} + +.user-menu-modal .project-menus .list > li { + line-height: 10px; +} + +.user-menu-modal .user-info { + width: 100%; + padding-left: 10px; + padding-bottom: 10px; +} + +.user-menu-modal .user-item { + line-height: 30px; +} + +.user-menu-modal .ivu-modal-content .project-menus:after { + background-color: inherit; +} + +.task-type-move { + cursor: move; + //border: 1px solid rgb(61, 168, 245); + box-shadow: 0 1px 5px 1px #c0c0c0; + //background: red; + //transform: rotate(2deg) !important; +} + +.task-move { + //transform: rotate(2deg); + +} diff --git a/frontend-source/src/assets/css/components/warpperContent.less b/frontend-source/src/assets/css/components/warpperContent.less new file mode 100644 index 0000000..f15cf5e --- /dev/null +++ b/frontend-source/src/assets/css/components/warpperContent.less @@ -0,0 +1,146 @@ +.page-title { + font-size: 18px; + color: #464c5b; + line-height: 35px; + padding-bottom: 5px; + font-weight: 400; + //border-bottom: 1px solid #e5e5e5; +} +.content-title { + font-size: 18px; + color: #464c5b; + line-height: 35px; + padding-bottom: 12px; + margin-bottom: 12px; + min-height: 52px; + font-weight: 400; + border-bottom: 1px solid #e5e5e5; +} + +.content-action { + float: right; +} + +.content-action + .page-title { + //padding-top: 55px; +} +.page-header{ + //margin-top: 65px; + background: #fff; + padding: 16px 32px 0; + border-bottom: 1px solid #e8e8e8; + .breadcrumb{ + margin-bottom: 16px; + } + .detail{ + display: flex; + .row { + display: flex; + width: 100%; + } + .main{ + width: 100%; + flex: 0 1 auto; + .title{ + flex: auto; + font-size: 20px; + font-weight: 500; + color: rgba(0,0,0,.85); + margin-bottom: 16px; + } + .logo{ + width: 28px; + height: 28px; + border-radius: 4px; + margin-right: 16px; + } + .content{ + margin-bottom: 16px; + flex: auto; + } + .extra{ + flex: 0 1 auto; + margin-left: 88px; + min-width: 242px; + text-align: right; + } + .action{ + margin-left: 56px; + min-width: 266px; + flex: 0 1 auto; + text-align: right; + } + } + } +} +.page-header-none{ + padding: 0; + border-bottom: none; +} + +.wrapper-main { + margin: 24px; + padding: 24px 0 12px 24px; + background: rgb(255, 255, 255); +} + +.wrapper-content { + width: 100%; + padding-right: 24px; + transition: all 368ms; + .action{ + padding-bottom: 12px; + line-height: 3; + } +} + +.layout-content { +} + +.page-search { + margin-bottom: 16px; +} + +.has-header-content .wrapper-content { + padding: 80px 20px 0 276px; + margin-top: 0; + height: 100%; +} + +.has-header-content .layout-content { + box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .047); + padding: 5px 30px 15px 30px; +} + +.wrapper-content .data-content { + margin-top: 30px; +} + +.layout-content .content-header { + height: 56px; + z-index: 5; + width: 100%; + line-height: 56px; + overflow: hidden; + border-bottom: 1px solid #e5e5e5; + margin-bottom: 35px; +} + +.layout-content .content-header h1:first-child { + cursor: pointer; + color: @primary-color; +} + +.layout-content .content-header h1 { + font-size: 14px; + float: left; + line-height: 56px; + font-weight: 400; +} + +.layout-copy { + text-align: center; + padding: 10px 0 20px; + color: #9ea7b4; +} + diff --git a/frontend-source/src/assets/css/project/memberMenu.less b/frontend-source/src/assets/css/project/memberMenu.less new file mode 100644 index 0000000..cc8c66d --- /dev/null +++ b/frontend-source/src/assets/css/project/memberMenu.less @@ -0,0 +1,66 @@ +.member-menu { + background: #fff; + box-shadow: 0 2px 20px rgba(0, 0, 0, .1); + padding: 12px 0; + width: 250px; + height: 375px; + border-radius: 4px; + + .header { + display: flex; + flex-direction: row; + justify-content: space-between; + padding: 12px 0; + } + + .search-content { + padding: 12px; + + .ant-input { + font-size: 14px; + } + } + + .member-list { + height: 235px; + position: relative; + + .list-group { + .title { + display: block; + margin: 6px 12px; + } + + .member-list-item { + padding: 12px; + cursor: pointer; + border-bottom: none; + + .ant-list-item-meta { + align-items: center; + } + + &.owner { + cursor: not-allowed; + } + + &:hover { + background-color: #f5f5f5; + } + } + } + + .ant-list-empty-text { + text-align: left; + } + } + + .footer { + border-top: 1px solid #e5e5e5; + padding: 12px 12px 0 12px; + position: fixed; + width: 250px; + height: 75px; + } + +} diff --git a/frontend-source/src/assets/css/theme.less b/frontend-source/src/assets/css/theme.less new file mode 100644 index 0000000..5abe1ae --- /dev/null +++ b/frontend-source/src/assets/css/theme.less @@ -0,0 +1,4 @@ +@import "~ant-design-vue/dist/antd.less"; +@import "components/index"; +@import "project/memberMenu"; + diff --git a/frontend-source/src/assets/css/wangEditor.css b/frontend-source/src/assets/css/wangEditor.css new file mode 100644 index 0000000..ffc9aa3 --- /dev/null +++ b/frontend-source/src/assets/css/wangEditor.css @@ -0,0 +1,831 @@ +/* 编辑器边框颜色 */ +/* 菜单颜色、上边框颜色 */ +/* 菜单选中状态的颜色 */ +/* input focus 时的颜色 */ +/* 按钮颜色 */ +/* tab selected 状态下的颜色 */ +.wangEditor-container { + position: relative; + background-color: #fff; + border: 1px solid #ccc; + z-index: 1; + width: 100%; +} +.wangEditor-container a:focus, +.wangEditor-container button:focus { + outline: none; +} +.wangEditor-container, +.wangEditor-container * { + margin: 0; + padding: 0; + box-sizing: border-box; + line-height: 1; +} +.wangEditor-container img { + border: none; +} +.wangEditor-container .clearfix:after { + content: ''; + display: table; + clear: both; +} +.wangEditor-container .clearfix { + *zoom: 1; +} +.wangEditor-container textarea { + border: none; +} +.wangEditor-container textarea:focus { + outline: none; +} +.wangEditor-container .height-tip { + position: absolute; + width: 3px; + background-color: #ccc; + left: 0; + transition: top .2s; +} +.wangEditor-container .txt-toolbar { + position: absolute; + background-color: #fff; + padding: 3px 5px; + border-top: 2px solid #666; + box-shadow: 1px 3px 3px #999; + border-left: 1px\9 solid\9 #ccc\9; + border-bottom: 1px\9 solid\9 #999\9; + border-right: 1px\9 solid\9 #999\9; +} +.wangEditor-container .txt-toolbar .tip-triangle { + display: block; + position: absolute; + width: 0; + height: 0; + border: 5px solid; + border-color: transparent transparent #666 transparent; + top: -12px; + left: 50%; + margin-left: -5px; +} +.wangEditor-container .txt-toolbar a { + color: #666; + display: inline-block; + margin: 0 3px; + padding: 5px; + text-decoration: none; + border-radius: 3px; +} +.wangEditor-container .txt-toolbar a:hover { + background-color: #f1f1f1; +} +.wangEditor-container .img-drag-point { + display: block; + position: absolute; + width: 12px; + height: 12px; + border-radius: 50%; + cursor: se-resize; + background-color: #666; + margin-left: -6px; + margin-top: -6px; + box-shadow: 1px 1px 5px #999; +} +.wangEditor-container .wangEditor-upload-progress { + position: absolute; + height: 1px; + background: #1e88e5; + width: 0; + display: none; + -webkit-transition: width .5s; + -o-transition: width .5s; + transition: width .5s; +} +.wangEditor-fullscreen { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} +.wangEditor-container .code-textarea { + resize: none; + width: 100%; + font-size: 14px; + line-height: 1.5; + font-family: 'Verdana'; + color: #333; + padding: 0 15px 0 15px; +} +.wangEditor-menu-container { + width: 100%; + border-bottom: 1px solid #f1f1f1; + background-color: #fff; +} +.wangEditor-menu-container a { + text-decoration: none; +} +.wangEditor-menu-container .menu-group { + float: left; + padding: 0 8px; + border-right: 1px solid #f1f1f1; +} +.wangEditor-menu-container .menu-item { + float: left; + position: relative; + text-align: center; + height: 31px; + width: 35px; +} +.wangEditor-menu-container .menu-item:hover { + background-color: #f1f1f1; +} +.wangEditor-menu-container .menu-item a { + display: block; + text-align: center; + color: #666; + width: 100%; + padding: 8px 0; + font-size: 0.9em; +} +.wangEditor-menu-container .menu-item .selected { + color: #1e88e5; +} +.wangEditor-menu-container .menu-item .active { + background-color: #f1f1f1; +} +.wangEditor-menu-container .menu-item .disable { + opacity: 0.5; + filter: alpha(opacity=50); +} +.wangEditor-menu-container .menu-tip { + display: block; + position: absolute; + z-index: 20; + width: 60px; + text-align: center; + background-color: #666; + color: #fff; + padding: 7px 0; + font-size: 12px; + top: 100%; + left: 50%; + margin-left: -30px; + border-radius: 2px; + box-shadow: 1px 1px 5px #999; + display: none; + /*// 小三角 + .tip-triangle { + display: block; + position: absolute; + width: 0; + height: 0; + border:5px solid; + border-color: transparent transparent @fore-color transparent; + top: -10px; + left: 50%; + margin-left: -5px; + }*/ +} +.wangEditor-menu-container .menu-tip-40 { + width: 40px; + margin-left: -20px; +} +.wangEditor-menu-container .menu-tip-50 { + width: 50px; + margin-left: -25px; +} +.wangEditor-menu-shadow { + /*border-bottom-width: 0;*/ + border-bottom: 1px\9 solid\9 #f1f1f1\9; + box-shadow: 0 1px 3px #999; +} +.wangEditor-container .wangEditor-txt { + width: 100%; + text-align: left; + padding: 15px; + padding-top: 0; + margin-top: 5px; + overflow-y: auto; +} +.wangEditor-container .wangEditor-txt p, +.wangEditor-container .wangEditor-txt h1, +.wangEditor-container .wangEditor-txt h2, +.wangEditor-container .wangEditor-txt h3, +.wangEditor-container .wangEditor-txt h4, +.wangEditor-container .wangEditor-txt h5 { + margin: 10px 0; + line-height: 1.8; +} +.wangEditor-container .wangEditor-txt p *, +.wangEditor-container .wangEditor-txt h1 *, +.wangEditor-container .wangEditor-txt h2 *, +.wangEditor-container .wangEditor-txt h3 *, +.wangEditor-container .wangEditor-txt h4 *, +.wangEditor-container .wangEditor-txt h5 * { + line-height: 1.8; +} +.wangEditor-container .wangEditor-txt ul, +.wangEditor-container .wangEditor-txt ol { + padding-left: 20px; +} +.wangEditor-container .wangEditor-txt img { + cursor: pointer; +} +.wangEditor-container .wangEditor-txt img.clicked { + box-shadow: 1px 1px 10px #999; +} +.wangEditor-container .wangEditor-txt table.clicked { + box-shadow: 1px 1px 10px #999; +} +.wangEditor-container .wangEditor-txt pre code { + line-height: 1.5; +} +.wangEditor-container .wangEditor-txt:focus { + outline: none; +} +.wangEditor-container .wangEditor-txt blockquote { + display: block; + border-left: 8px solid #d0e5f2; + padding: 5px 10px; + margin: 10px 0; + line-height: 1.4; + font-size: 100%; + background-color: #f1f1f1; +} +.wangEditor-container .wangEditor-txt table { + border: none; + border-collapse: collapse; +} +.wangEditor-container .wangEditor-txt table td, +.wangEditor-container .wangEditor-txt table th { + border: 1px solid #999; + padding: 3px 5px; + min-width: 50px; + height: 20px; +} +.wangEditor-container .wangEditor-txt pre { + border: 1px solid #ccc; + background-color: #f8f8f8; + padding: 10px; + margin: 5px 0px; + font-size: 0.8em; + border-radius: 3px; +} +.wangEditor-drop-list { + display: none; + position: absolute; + background-color: #fff; + overflow: hidden; + z-index: 10; + transition: height .7s; + border-top: 1px solid #f1f1f1; + box-shadow: 1px 3px 3px #999; + border-left: 1px\9 solid\9 #ccc\9; + border-bottom: 1px\9 solid\9 #999\9; + border-right: 1px\9 solid\9 #999\9; +} +.wangEditor-drop-list a { + text-decoration: none; + display: block; + color: #666; + padding: 3px 5px; +} +.wangEditor-drop-list a:hover { + background-color: #f1f1f1; +} +.wangEditor-drop-panel, +.txt-toolbar { + display: none; + position: absolute; + padding: 10px; + font-size: 14px; + /*border: 1px\9 solid\9 #cccccc\9;*/ + background-color: #fff; + z-index: 10; + border-top: 2px solid #666; + box-shadow: 1px 3px 3px #999; + border-left: 1px\9 solid\9 #ccc\9; + border-bottom: 1px\9 solid\9 #999\9; + border-right: 1px\9 solid\9 #999\9; +} +.wangEditor-drop-panel .tip-triangle, +.txt-toolbar .tip-triangle { + display: block; + position: absolute; + width: 0; + height: 0; + border: 5px solid; + border-color: transparent transparent #666 transparent; + top: -12px; + left: 50%; + margin-left: -5px; +} +.wangEditor-drop-panel a, +.txt-toolbar a { + text-decoration: none; +} +.wangEditor-drop-panel input[type=text], +.txt-toolbar input[type=text] { + border: none; + border-bottom: 1px solid #ccc; + font-size: 14px; + height: 20px; + color: #333; + padding: 3px 0; +} +.wangEditor-drop-panel input[type=text]:focus, +.txt-toolbar input[type=text]:focus { + outline: none; + border-bottom: 2px solid #1e88e5; +} +.wangEditor-drop-panel input[type=text].block, +.txt-toolbar input[type=text].block { + display: block; + width: 100%; +} +.wangEditor-drop-panel textarea, +.txt-toolbar textarea { + border: 1px solid #ccc; +} +.wangEditor-drop-panel textarea:focus, +.txt-toolbar textarea:focus { + outline: none; + border-color: #1e88e5; +} +.wangEditor-drop-panel button, +.txt-toolbar button { + font-size: 14px; + color: #1e88e5; + border: none; + padding: 10px; + background-color: #fff; + cursor: pointer; + border-radius: 3px; +} +.wangEditor-drop-panel button:hover, +.txt-toolbar button:hover { + background-color: #f1f1f1; +} +.wangEditor-drop-panel button:focus, +.txt-toolbar button:focus { + outline: none; +} +.wangEditor-drop-panel button.right, +.txt-toolbar button.right { + float: right; + margin-left: 10px; +} +.wangEditor-drop-panel button.gray, +.txt-toolbar button.gray { + color: #999; +} +.wangEditor-drop-panel button.link, +.txt-toolbar button.link { + padding: 5px 10px; +} +.wangEditor-drop-panel button.link:hover, +.txt-toolbar button.link:hover { + background-color: #fff; + text-decoration: underline; +} +.wangEditor-drop-panel .color-item, +.txt-toolbar .color-item { + display: block; + float: left; + width: 25px; + height: 25px; + text-align: center; + padding: 2px; + border-radius: 2px; + text-decoration: underline; +} +.wangEditor-drop-panel .color-item:hover, +.txt-toolbar .color-item:hover { + background-color: #f1f1f1; +} +.wangEditor-drop-panel .list-menu-item, +.txt-toolbar .list-menu-item { + display: block; + float: left; + color: #333; + padding: 5px 5px; + border-radius: 2px; +} +.wangEditor-drop-panel .list-menu-item:hover, +.txt-toolbar .list-menu-item:hover { + background-color: #f1f1f1; +} +.wangEditor-drop-panel table.choose-table, +.txt-toolbar table.choose-table { + border: none; + border-collapse: collapse; +} +.wangEditor-drop-panel table.choose-table td, +.txt-toolbar table.choose-table td { + border: 1px solid #ccc; + width: 16px; + height: 12px; +} +.wangEditor-drop-panel table.choose-table td.active, +.txt-toolbar table.choose-table td.active { + background-color: #ccc; + opacity: .5; + filter: alpha(opacity=50); +} +.wangEditor-drop-panel .panel-tab .tab-container, +.txt-toolbar .panel-tab .tab-container { + margin-bottom: 5px; +} +.wangEditor-drop-panel .panel-tab .tab-container a, +.txt-toolbar .panel-tab .tab-container a { + display: inline-block; + color: #999; + text-align: center; + margin: 0 5px; + padding: 5px 5px; +} +.wangEditor-drop-panel .panel-tab .tab-container a.selected, +.txt-toolbar .panel-tab .tab-container a.selected { + color: #1e88e5; + border-bottom: 2px solid #1e88e5; +} +.wangEditor-drop-panel .panel-tab .content-container .content, +.txt-toolbar .panel-tab .content-container .content { + display: none; +} +.wangEditor-drop-panel .panel-tab .content-container .content a, +.txt-toolbar .panel-tab .content-container .content a { + display: inline-block; + margin: 2px; + padding: 2px; + border-radius: 2px; +} +.wangEditor-drop-panel .panel-tab .content-container .content a:hover, +.txt-toolbar .panel-tab .content-container .content a:hover { + background-color: #f1f1f1; +} +.wangEditor-drop-panel .panel-tab .content-container .selected, +.txt-toolbar .panel-tab .content-container .selected { + display: block; +} +.wangEditor-drop-panel .panel-tab .emotion-content-container, +.txt-toolbar .panel-tab .emotion-content-container { + height: 200px; + overflow-y: auto; +} +.wangEditor-drop-panel .upload-icon-container, +.txt-toolbar .upload-icon-container { + color: #ccc; + text-align: center; + margin: 20px 20px 15px 20px !important; + padding: 5px !important; + font-size: 65px; + cursor: pointer; + border: 2px dotted #f1f1f1; + display: block !important; +} +.wangEditor-drop-panel .upload-icon-container:hover, +.txt-toolbar .upload-icon-container:hover { + color: #666; + border-color: #ccc; +} +.wangEditor-modal { + position: absolute; + top: 50%; + left: 50%; + background-color: #fff; + border-top: 1px solid #f1f1f1; + box-shadow: 1px 3px 3px #999; + border-top: 1px\9 solid\9 #ccc\9; + border-left: 1px\9 solid\9 #ccc\9; + border-bottom: 1px\9 solid\9 #999\9; + border-right: 1px\9 solid\9 #999\9; +} +.wangEditor-modal .wangEditor-modal-close { + position: absolute; + top: 0; + right: 0; + margin-top: -25px; + margin-right: -25px; + font-size: 1.5em; + color: #666; + cursor: pointer; +} +/*@font-face {*/ + /*font-family: 'icomoon';*/ + /*src: url('../fonts/icomoon.eot?-qdfu1s');*/ + /*src: url('../fonts/icomoon.eot?#iefix-qdfu1s') format('embedded-opentype'), url('../fonts/icomoon.ttf?-qdfu1s') format('truetype'), url('../fonts/icomoon.woff?-qdfu1s') format('woff'), url('../fonts/icomoon.svg?-qdfu1s#icomoon') format('svg');*/ + /*font-weight: normal;*/ + /*font-style: normal;*/ +/*}*/ +[class^="wangeditor-menu-img-"], +[class*=" wangeditor-menu-img-"] { + font-family: 'icomoon'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.wangeditor-menu-img-link:before { + content: "\e800"; +} +.wangeditor-menu-img-unlink:before { + content: "\e801"; +} +.wangeditor-menu-img-code:before { + content: "\e802"; +} +.wangeditor-menu-img-cancel:before { + content: "\e803"; +} +.wangeditor-menu-img-terminal:before { + content: "\e804"; +} +.wangeditor-menu-img-angle-down:before { + content: "\e805"; +} +.wangeditor-menu-img-font:before { + content: "\e806"; +} +.wangeditor-menu-img-bold:before { + content: "\e807"; +} +.wangeditor-menu-img-italic:before { + content: "\e808"; +} +.wangeditor-menu-img-header:before { + content: "\e809"; +} +.wangeditor-menu-img-align-left:before { + content: "\e80a"; +} +.wangeditor-menu-img-align-center:before { + content: "\e80b"; +} +.wangeditor-menu-img-align-right:before { + content: "\e80c"; +} +.wangeditor-menu-img-list-bullet:before { + content: "\e80d"; +} +.wangeditor-menu-img-indent-left:before { + content: "\e80e"; +} +.wangeditor-menu-img-indent-right:before { + content: "\e80f"; +} +.wangeditor-menu-img-list-numbered:before { + content: "\e810"; +} +.wangeditor-menu-img-underline:before { + content: "\e811"; +} +.wangeditor-menu-img-table:before { + content: "\e812"; +} +.wangeditor-menu-img-eraser:before { + content: "\e813"; +} +.wangeditor-menu-img-text-height:before { + content: "\e814"; +} +.wangeditor-menu-img-brush:before { + content: "\e815"; +} +.wangeditor-menu-img-pencil:before { + content: "\e816"; +} +.wangeditor-menu-img-minus:before { + content: "\e817"; +} +.wangeditor-menu-img-picture:before { + content: "\e818"; +} +.wangeditor-menu-img-file-image:before { + content: "\e819"; +} +.wangeditor-menu-img-cw:before { + content: "\e81a"; +} +.wangeditor-menu-img-ccw:before { + content: "\e81b"; +} +.wangeditor-menu-img-music:before { + content: "\e911"; +} +.wangeditor-menu-img-play:before { + content: "\e912"; +} +.wangeditor-menu-img-location:before { + content: "\e947"; +} +.wangeditor-menu-img-happy:before { + content: "\e9df"; +} +.wangeditor-menu-img-sigma:before { + content: "\ea67"; +} +.wangeditor-menu-img-enlarge2:before { + content: "\e98b"; +} +.wangeditor-menu-img-shrink2:before { + content: "\e98c"; +} +.wangeditor-menu-img-newspaper:before { + content: "\e904"; +} +.wangeditor-menu-img-camera:before { + content: "\e90f"; +} +.wangeditor-menu-img-video-camera:before { + content: "\e914"; +} +.wangeditor-menu-img-file-zip:before { + content: "\e92b"; +} +.wangeditor-menu-img-stack:before { + content: "\e92e"; +} +.wangeditor-menu-img-credit-card:before { + content: "\e93f"; +} +.wangeditor-menu-img-address-book:before { + content: "\e944"; +} +.wangeditor-menu-img-envelop:before { + content: "\e945"; +} +.wangeditor-menu-img-drawer:before { + content: "\e95c"; +} +.wangeditor-menu-img-download:before { + content: "\e960"; +} +.wangeditor-menu-img-upload:before { + content: "\e961"; +} +.wangeditor-menu-img-lock:before { + content: "\e98f"; +} +.wangeditor-menu-img-unlocked:before { + content: "\e990"; +} +.wangeditor-menu-img-wrench:before { + content: "\e991"; +} +.wangeditor-menu-img-eye:before { + content: "\e9ce"; +} +.wangeditor-menu-img-eye-blocked:before { + content: "\e9d1"; +} +.wangeditor-menu-img-command:before { + content: "\ea4e"; +} +.wangeditor-menu-img-font2:before { + content: "\ea5c"; +} +.wangeditor-menu-img-libreoffice:before { + content: "\eade"; +} +.wangeditor-menu-img-quotes-left:before { + content: "\e977"; +} +.wangeditor-menu-img-strikethrough:before { + content: "\ea65"; +} +.wangeditor-menu-img-desktop:before { + content: "\f108"; +} +.wangeditor-menu-img-tablet:before { + content: "\f10a"; +} +.wangeditor-menu-img-search-plus:before { + content: "\f00e"; +} +.wangeditor-menu-img-search-minus:before { + content: "\f010"; +} +.wangeditor-menu-img-trash-o:before { + content: "\f014"; +} +.wangeditor-menu-img-align-justify:before { + content: "\f039"; +} +.wangeditor-menu-img-arrows-v:before { + content: "\f07d"; +} +.wangeditor-menu-img-sigma2:before { + content: "\ea68"; +} +.wangeditor-menu-img-omega:before { + content: "\e900"; +} +.wangeditor-menu-img-cancel-circle:before { + content: "\e901"; +} +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #f8f8f8; + -webkit-text-size-adjust: none; +} +.hljs-comment, +.diff .hljs-header { + color: #998; + font-style: italic; +} +.hljs-keyword, +.css .rule .hljs-keyword, +.hljs-winutils, +.nginx .hljs-title, +.hljs-subst, +.hljs-request, +.hljs-status { + color: #333; + font-weight: bold; +} +.hljs-number, +.hljs-hexcolor, +.ruby .hljs-constant { + color: #008080; +} +.hljs-string, +.hljs-tag .hljs-value, +.hljs-doctag, +.tex .hljs-formula { + color: #d14; +} +.hljs-title, +.hljs-id, +.scss .hljs-preprocessor { + color: #900; + font-weight: bold; +} +.hljs-list .hljs-keyword, +.hljs-subst { + font-weight: normal; +} +.hljs-class .hljs-title, +.hljs-type, +.vhdl .hljs-literal, +.tex .hljs-command { + color: #458; + font-weight: bold; +} +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rule .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal; +} +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body, +.hljs-name { + color: #008080; +} +.hljs-regexp { + color: #009926; +} +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.lisp .hljs-keyword, +.clojure .hljs-keyword, +.scheme .hljs-keyword, +.tex .hljs-special, +.hljs-prompt { + color: #990073; +} +.hljs-built_in { + color: #0086b3; +} +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold; +} +.hljs-deletion { + background: #fdd; +} +.hljs-addition { + background: #dfd; +} +.diff .hljs-change { + background: #0086b3; +} +.hljs-chunk { + color: #aaa; +} diff --git a/frontend-source/src/assets/css/wangEditorTxt.css b/frontend-source/src/assets/css/wangEditorTxt.css new file mode 100644 index 0000000..da59627 --- /dev/null +++ b/frontend-source/src/assets/css/wangEditorTxt.css @@ -0,0 +1,72 @@ +.wangEditor-txt { + width: 100%; + text-align: left; + padding: 15px; + padding-top: 0; + margin-top: 5px; + overflow-y: auto; +} +.wangEditor-txt p, +.wangEditor-txt h1, +.wangEditor-txt h2, +.wangEditor-txt h3, +.wangEditor-txt h4, +.wangEditor-txt h5 { + margin: 10px 0; + line-height: 1.8; +} +.wangEditor-txt p *, +.wangEditor-txt h1 *, +.wangEditor-txt h2 *, +.wangEditor-txt h3 *, +.wangEditor-txt h4 *, +.wangEditor-txt h5 * { + line-height: 1.8; +} +.wangEditor-txt ul, +.wangEditor-txt ol { + padding-left: 20px; +} +.wangEditor-txt img { + cursor: pointer; +} +.wangEditor-txt img.clicked { + box-shadow: 1px 1px 10px #999; +} +.wangEditor-txt table.clicked { + box-shadow: 1px 1px 10px #999; +} +.wangEditor-txt pre code { + line-height: 1.5; +} +.wangEditor-txt:focus { + outline: none; +} +.wangEditor-txt blockquote { + display: block; + border-left: 8px solid #d0e5f2; + padding: 5px 10px; + margin: 10px 0; + line-height: 1.4; + font-size: 100%; + background-color: #f1f1f1; +} +.wangEditor-txt table { + border: none; + border-collapse: collapse; +} +.wangEditor-txt table td, +.wangEditor-txt table th { + border: 1px solid #999; + padding: 3px 5px; + min-width: 50px; + height: 20px; +} +.wangEditor-txt pre { + border: 1px solid #ccc; + background-color: #f8f8f8; + padding: 10px; + margin: 5px 0px; + font-size: 0.8em; + border-radius: 3px; +} diff --git a/frontend-source/src/assets/icon/iconfont.css b/frontend-source/src/assets/icon/iconfont.css new file mode 100644 index 0000000..4085f6c --- /dev/null +++ b/frontend-source/src/assets/icon/iconfont.css @@ -0,0 +1,47 @@ + +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1496642611968'); /* IE9*/ + src: url('iconfont.eot?t=1496642611968#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('iconfont.woff?t=1496642611968') format('woff'), /* chrome, firefox */ + url('iconfont.ttf?t=1496642611968') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('iconfont.svg?t=1496642611968#iconfont') format('svg'); /* iOS 4.1- */ +} + +.iconfont { + font-family:"iconfont" !important; + font-size:16px; + font-style:normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-img:before { content: "\e657"; } + +.icon-excel:before { content: "\e61c"; } + +.icon-word:before { content: "\e61f"; } + +.icon-file:before { content: "\e689"; } + +.icon-js:before { content: "\e6b2"; } + +.icon-MP:before { content: "\e670"; } + +.icon-txt:before { content: "\e668"; } + +.icon-file_csv:before { content: "\e724"; } + +.icon-file_ppt:before { content: "\e726"; } + +.icon-file_word:before { content: "\e729"; } + +.icon-pdf:before { content: "\e72c"; } + +.icon-zip:before { content: "\e661"; } + +.icon-rar:before { content: "\e662"; } + +.icon-file_css:before { content: "\e6bd"; } + +.icon-file_video:before { content: "\e6bf"; } + diff --git a/frontend-source/src/assets/icon/iconfont.eot b/frontend-source/src/assets/icon/iconfont.eot new file mode 100644 index 0000000..90eabed Binary files /dev/null and b/frontend-source/src/assets/icon/iconfont.eot differ diff --git a/frontend-source/src/assets/icon/iconfont.js b/frontend-source/src/assets/icon/iconfont.js new file mode 100644 index 0000000..d96f716 --- /dev/null +++ b/frontend-source/src/assets/icon/iconfont.js @@ -0,0 +1 @@ +(function(window){var svgSprite=""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+"";var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file diff --git a/frontend-source/src/assets/icon/iconfont.svg b/frontend-source/src/assets/icon/iconfont.svg new file mode 100644 index 0000000..d465688 --- /dev/null +++ b/frontend-source/src/assets/icon/iconfont.svg @@ -0,0 +1,99 @@ + + + + +Created by FontForge 20120731 at Mon Jun 5 14:03:31 2017 + By admin + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend-source/src/assets/icon/iconfont.ttf b/frontend-source/src/assets/icon/iconfont.ttf new file mode 100644 index 0000000..ef00377 Binary files /dev/null and b/frontend-source/src/assets/icon/iconfont.ttf differ diff --git a/frontend-source/src/assets/icon/iconfont.woff b/frontend-source/src/assets/icon/iconfont.woff new file mode 100644 index 0000000..4eee42f Binary files /dev/null and b/frontend-source/src/assets/icon/iconfont.woff differ diff --git a/frontend-source/src/assets/image/common/background.svg b/frontend-source/src/assets/image/common/background.svg new file mode 100644 index 0000000..89c2597 --- /dev/null +++ b/frontend-source/src/assets/image/common/background.svg @@ -0,0 +1,69 @@ + + + + Group 21 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/image/common/bull.png b/frontend-source/src/assets/image/common/bull.png new file mode 100644 index 0000000..ede95c3 Binary files /dev/null and b/frontend-source/src/assets/image/common/bull.png differ diff --git a/frontend-source/src/assets/image/common/login.svg b/frontend-source/src/assets/image/common/login.svg new file mode 100644 index 0000000..89c2597 --- /dev/null +++ b/frontend-source/src/assets/image/common/login.svg @@ -0,0 +1,69 @@ + + + + Group 21 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/image/common/logo.png b/frontend-source/src/assets/image/common/logo.png new file mode 100644 index 0000000..257b35f Binary files /dev/null and b/frontend-source/src/assets/image/common/logo.png differ diff --git a/frontend-source/src/assets/image/common/logo3.png b/frontend-source/src/assets/image/common/logo3.png new file mode 100644 index 0000000..f11f81e Binary files /dev/null and b/frontend-source/src/assets/image/common/logo3.png differ diff --git a/frontend-source/src/assets/image/common/nullContent.png b/frontend-source/src/assets/image/common/nullContent.png new file mode 100644 index 0000000..63284e9 Binary files /dev/null and b/frontend-source/src/assets/image/common/nullContent.png differ diff --git a/frontend-source/src/assets/image/error/403.svg b/frontend-source/src/assets/image/error/403.svg new file mode 100644 index 0000000..610f136 --- /dev/null +++ b/frontend-source/src/assets/image/error/403.svg @@ -0,0 +1,508 @@ + + + + Group 9 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/image/error/404.svg b/frontend-source/src/assets/image/error/404.svg new file mode 100644 index 0000000..5531d05 --- /dev/null +++ b/frontend-source/src/assets/image/error/404.svg @@ -0,0 +1,314 @@ + + + + Group 4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/image/error/500.svg b/frontend-source/src/assets/image/error/500.svg new file mode 100644 index 0000000..de723b1 --- /dev/null +++ b/frontend-source/src/assets/image/error/500.svg @@ -0,0 +1,208 @@ + + + + Group 4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/image/notify/bell.svg b/frontend-source/src/assets/image/notify/bell.svg new file mode 100644 index 0000000..74768dc --- /dev/null +++ b/frontend-source/src/assets/image/notify/bell.svg @@ -0,0 +1,21 @@ + + + + bells (1) + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/image/notify/laba.svg b/frontend-source/src/assets/image/notify/laba.svg new file mode 100644 index 0000000..56372b6 --- /dev/null +++ b/frontend-source/src/assets/image/notify/laba.svg @@ -0,0 +1,21 @@ + + + + Group 6 + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/image/notify/mail.png b/frontend-source/src/assets/image/notify/mail.png new file mode 100644 index 0000000..b713953 Binary files /dev/null and b/frontend-source/src/assets/image/notify/mail.png differ diff --git a/frontend-source/src/assets/image/notify/system.png b/frontend-source/src/assets/image/notify/system.png new file mode 100644 index 0000000..c6c8dbd Binary files /dev/null and b/frontend-source/src/assets/image/notify/system.png differ diff --git a/frontend-source/src/assets/image/notify/ticket.svg b/frontend-source/src/assets/image/notify/ticket.svg new file mode 100644 index 0000000..53cfdc3 --- /dev/null +++ b/frontend-source/src/assets/image/notify/ticket.svg @@ -0,0 +1,21 @@ + + + + Group 6 + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend-source/src/assets/js/dateTime.js b/frontend-source/src/assets/js/dateTime.js new file mode 100644 index 0000000..2445341 --- /dev/null +++ b/frontend-source/src/assets/js/dateTime.js @@ -0,0 +1,300 @@ +/** + * 获取本周一时间 + * @returns {number} + */ +import moment from "moment"; + +export const getWeekDay = () => { + //起止日期数组 + var startStop = []; + //获取当前时间 + var currentDate = new Date(); + //返回date是一周中的某一天 + var week = currentDate.getDay(); + //返回date是一个月中的某一天 + var month = currentDate.getDate(); + + //一天的毫秒数 + var millisecond = 1000 * 60 * 60 * 24; + //减去的天数 + var minusDay = week != 0 ? week - 1 : 6; + //alert(minusDay) + //本周 周一 + var monday = new Date(currentDate.getTime() - (minusDay * millisecond)); + //本周 周日 + var sunday = new Date(monday.getTime() + (6 * millisecond)); + monday = monday.getFullYear() + "-" + (monday.getMonth() + 1) + "-" + monday.getDate(); + sunday = sunday.getFullYear() + "-" + (sunday.getMonth() + 1) + "-" + sunday.getDate(); + var week_day = { + monday: monday, + sunday: sunday, + }; + return week_day +}; +/** + * 格式化相对时间 + * @returns {string} + * @param value + * @param now + */ +export const relativelyTime = (value, now) => { + if (!now) { + now = moment(); + } + const diff = moment(now).diff(moment(value), 'hours'); + if (diff <= 1) { + return moment(value).fromNow(); + } + const today = moment(now).get('date'); + const current = moment(value).get('date'); + if (current < today - 1) { + // return moment(value).format('M月D日 H:mm'); + } + let detailTime = moment(value).format('H:mm'); + const currentDate = moment(value).format('YYYY-MM-DD'); + const currentMonday = moment().weekday(0).format('YYYY-MM-DD'); + const currentSunday = moment().weekday(6).format('YYYY-MM-DD'); + let weekDate = ''; + if (currentDate < currentMonday) { + weekDate = '[上周]dd ' + detailTime; + }else if (currentDate > currentSunday) { + weekDate = '[下周]dd ' + detailTime; + }else{ + weekDate = '[周]dd ' + detailTime; + } + return moment(value).calendar(null, { + sameDay: '[今天 ]' + moment(value).format('H:mm'), + nextDay: '[明天 ]' + detailTime, + nextWeek: weekDate, + lastDay: '[昨天 ]' + detailTime, + lastWeek: weekDate, + sameElse: 'M月D日 H:mm' + }); +}; +/** + * + * @param value 日期 + * @param showDetailTime 是否显示具体时间 + * @returns {string} + */ +export const relativelyTaskTime = (value, showDetailTime = false) => { + let detailTime = moment(value).format('H:mm'); + if (!showDetailTime) { + detailTime = ''; + } + const currentDate = moment(value).format('YYYY-MM-DD'); + const currentMonday = moment().weekday(0).format('YYYY-MM-DD'); + const currentSunday = moment().weekday(6).format('YYYY-MM-DD'); + let weekDate = ''; + if (currentDate < currentMonday) { + weekDate = '[上周]dd ' + detailTime; + }else if (currentDate > currentSunday) { + weekDate = '[下周]dd ' + detailTime; + }else{ + weekDate = '[周]dd ' + detailTime; + } + return moment(value).calendar(null, { + sameDay: '[今天 ]' + moment(value).format('H:mm'), + nextDay: '[明天 ]' + detailTime, + nextWeek: weekDate, + lastDay: '[昨天 ]' + detailTime, + lastWeek: weekDate, + sameElse: 'M月D日 H:mm' + }); +}; +export const formatTaskTime = (begin, end) => { + //如果不是今天则不显示具体时间 + if (!end && begin) { + return relativelyTaskTime(begin) + ' 开始'; + } + if (!begin) { + return relativelyTaskTime(end) + ' 截止'; + } +}; +/** + * 格式化时间 + * @param data + * @param show + * @returns {string} + */ +export const format_date = (data, show) => { + if (show == undefined) { + show = true + } + //格式化时间 + let now = new Date(data * 1000); + let year = now.getFullYear(); + let month = now.getMonth() + 1; + let date = now.getDate(); + let hour = now.getHours(); + let minute = now.getMinutes(); + // let second = now.getSeconds(); + if (month < 10) { + month = '0' + month; + } + if (date < 10) { + date = '0' + date; + } + if (hour < 10) { + hour = '0' + hour; + } + if (minute < 10) { + minute = '0' + minute; + } + const finally_date = { + year: year, + month: month, + day: date, + hour: hour, + minute: minute + }; + if (show) { + return year + "-" + month + "-" + date + " " + hour + ":" + minute; + } else { + return finally_date + } +}; + +export const formatDateNow = (day) => { + //格式化时间 + if (day == undefined) { + day = 0; + } + let now = new Date(); + let year = now.getFullYear(); + let month = now.getMonth() + 1; + let date = now.getDate() + day; + if (month < 10) { + month = '0' + month; + } + if (date < 10) { + date = '0' + date; + } + return year + "-" + month + "-" + date; +}; + +/** + * 格式化项目任务时间 + * @param begin_time + * @param end_time + * @returns {string} + */ +export const showTaskTime = (begin_time, end_time) => { + let task_time = ''; + let begin_time_format = ''; + let end_time_format = ''; + begin_time = Date.parse(new Date(begin_time)) / 1000; + end_time = Date.parse(new Date(end_time)) / 1000; + if (begin_time > 0) { + let begin = format_date(begin_time, false); + begin_time_format = begin.month + '月' + begin.day + '日' + ' - ' + } + if (end_time > 0) { + let end = format_date(end_time, false); + end_time_format = end.month + '月' + end.day + '日'; + if (end.hour > 12 && end.hour <= 18) { + end_time_format += ' 下午下班前' + } + if (end.hour > 18) { + end_time_format += ' 加班' + } + if (end.hour <= 12 && end.hour >= 8) { + end_time_format += ' 上午下班前' + } + if (end.hour < 8 && end.hour > 0) { + end_time_format += ' 通宵' + } + } + if (begin_time_format == '') { + end_time_format += '完成' + } + task_time += begin_time_format + end_time_format; + return task_time +}; +/** + * + * @returns {string} + * @param time + */ +export const showHelloTime = (time) => { + let time_format = ''; + if (time == undefined) { + time = new Date(); + } + let hr = time.getHours(); + if ((hr >= 0) && (hr <= 4)) + time_format = "深夜了,注意身体,"; + if ((hr >= 4) && (hr < 7)) + time_format = "清晨好, "; + if ((hr >= 7) && (hr < 12)) + time_format = "早安,"; + if ((hr >= 12) && (hr <= 13)) + time_format = "午饭时间到了,"; + if ((hr >= 13) && (hr <= 17)) + time_format = "下午好,"; + if ((hr >= 17) && (hr <= 18)) + time_format = "进入傍晚了,"; + if ((hr >= 18) && (hr <= 20)) + time_format = "吃过晚饭了吗,"; + if ((hr >= 20) && (hr <= 24)) + time_format = "在加班吗?辛苦了,"; + return time_format +}; + +/** + * 格式化日期对象 + * @returns {string} + * @param date + * @param format + */ +export const dateFormat = (date, format) => { + let o = { + "M+": date.getMonth() + 1, //month + "d+": date.getDate(), //day + "h+": date.getHours(), //hour + "m+": date.getMinutes(), //minute + "s+": date.getSeconds(), //second + "q+": Math.floor((date.getMonth() + 3) / 3), //quarter + "S": date.getMilliseconds() //millisecond + }; + if (/(y+)/.test(format)) { + format = format.replace(RegExp.$1, + (date.getFullYear() + "").substr(4 - RegExp.$1.length)); + } + for (let k in o) if (new RegExp("(" + k + ")").test(format)) + format = format.replace(RegExp.$1, + RegExp.$1.length == 1 ? o[k] : + ("00" + o[k]).substr(("" + o[k]).length)); + return format; +}; + +/** + * 数字转英文字母 + * 如:1->A + * @param num + * @returns {string} + */ +export const convert = (num) => { + let result = ""; + while (num) { + result = String.fromCharCode(--num % 26 + 65) + result; + num = Math.floor(num / 26) + } + return result +}; + +export const formatDateTime = (inputTime) => { + var date = new Date(inputTime); + var y = date.getFullYear(); + var m = date.getMonth() + 1; + m = m < 10 ? ('0' + m) : m; + var d = date.getDate(); + d = d < 10 ? ('0' + d) : d; + var h = date.getHours(); + h = h < 10 ? ('0' + h) : h; + var minute = date.getMinutes(); + var second = date.getSeconds(); + minute = minute < 10 ? ('0' + minute) : minute; + second = second < 10 ? ('0' + second) : second; + return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second; +} diff --git a/frontend-source/src/assets/js/http.js b/frontend-source/src/assets/js/http.js new file mode 100644 index 0000000..915473b --- /dev/null +++ b/frontend-source/src/assets/js/http.js @@ -0,0 +1,105 @@ +import {message,} from 'ant-design-vue' +import Axios from "axios" +import * as utils from './utils' +import {getStore} from './storage' +import $store from '../../store/index'; +import $router from '../../router/index'; +import {notice} from './notice'; +import config from "../../config/config"; + +const HOME_PAGE = config.HOME_PAGE; +const crossDomain = config.crossDomain; + +let axiosConfig = {}; +if (crossDomain) { + axiosConfig.withCredentials = true; + axiosConfig.crossDomain = true; +} +const $http = Axios.create(axiosConfig); + +// Before request +$http.interceptors.request.use( + config => { + //正在请求更新token时,其他接口等待 + config.url = utils.getApiUrl(config.url); + if (config.method === 'post') { + const querystring = require('querystring'); + config.data = querystring.stringify(config.data); + } + /*如果是mock数据,就用get方法*/ + if (config.url.indexOf("mock") >=0){ + config.method = 'get'; + } + let token = getStore('token'); + if (token){ + config.headers.Authorization = `${token}`; + config.headers.token = `${token}`; + } + return config; + }, + error => { + return Promise.reject(error); + } +); +// After request +$http.interceptors.response.use( + response => { + response = response.data; + response.code = Number(response.code); + switch (response.code) { + case 200: + response.msg !== '' && notice(response.msg, 'message', 'success'); + return Promise.resolve(response); + case 401: + $router.replace('/member/login?redirect=' + $router.currentRoute.fullPath); + $store.dispatch('SET_LOGOUT'); + return Promise.resolve(response); + case 403: + notice({ + title: response.msg !== '' ? response.msg : '无权限操作资源,访问被拒绝', + }, 'notice', 'error', 5); + return Promise.resolve(response); + case 4031: + //无权限操作资源 + notice({ + title: response.msg !== '' ? response.msg : '无权限操作资源,访问被拒绝', + }, 'notice', 'error', 5); + $router.replace(HOME_PAGE); + return Promise.resolve(response); + case 404: + //资源不存在 + notice({ + title: response.msg !== '' ? response.msg : '资源不存在', + }, 'notice', 'warning', 5); + $router.replace(HOME_PAGE); + return Promise.resolve(response); + } + if (response.code === 200) { + notice({ + title: '请求错误 ' + response.code, + desc: response.msg + }, 'notice', 'warning', 5); + return Promise.resolve(response); + } else { + response.msg !== '' && notice({ + title: response.msg, + }, 'notice', 'error', 5); + return Promise.resolve(response); + } + }, + error => { + const response = error.response.data; + console.log(response); + response.code = Number(response.code); + message.destroy(); + switch (response.code) { + default: + response.msg !== '' && notice({ + title: response.msg, + }, 'notice', 'error', 5); + return Promise.reject(error); + } + } +); + +export default $http; diff --git a/frontend-source/src/assets/js/notice.js b/frontend-source/src/assets/js/notice.js new file mode 100644 index 0000000..c4b52ee --- /dev/null +++ b/frontend-source/src/assets/js/notice.js @@ -0,0 +1,45 @@ +import {message,notification} from 'ant-design-vue' + +export const notice = (content, type = 'message', action = 'warning', duration = 3, placement = 'bottomLeft') => { + destroyNotice(); + let config = {}; + config.duration = duration; + if (type === 'message') { + switch (action) { + case 'info': + return message.info(content, duration); + case 'success': + return message.success(content, duration); + case 'error': + return message.error(content, duration); + case 'loading': + return message.loading(content, duration); + default: + return message.warning(content, duration); + } + } else { + config.message = content.title; + config.description = content.msg || ''; + config.placement = placement; + switch (action) { + case 'open': + return notification.open(config); + case 'info': + return notification.info(config); + case 'success': + return notification.success(config); + case 'error': + return notification.error(config); + default: + return notification.warning(config); + } + } +}; +export const destroyNotice = (type = '') => { + if (!type) { + message.destroy(); + notification.destroy(); + }else{ + type === 'message' ? message.destroy() : notification.destroy(); + } +}; diff --git a/frontend-source/src/assets/js/notify.js b/frontend-source/src/assets/js/notify.js new file mode 100644 index 0000000..171bc2c --- /dev/null +++ b/frontend-source/src/assets/js/notify.js @@ -0,0 +1,88 @@ +/** + * Created by vilson on 17/6/4. + */ +export const showMsgNotification = (title, msg, $opt = {}) => { + let options = { + body: msg, + icon: $opt.icon || "http://static.vilson.xyz/preview.jpg", + showTime: $opt.showTime || 15000, + onclick: $opt.onclick, + onshow: $opt.onshow, + onerror: $opt.onerror, + onclose: $opt.onclose, + }; + let Notification = window.Notification || window.mozNotification || window.webkitNotification; + console.log(Notification.permission); + if (Notification && Notification.permission === "granted") { + let instance = new Notification(title, options); + instance.onclick = function () { + // Something to do + if (typeof options.onclick === 'function') { + options.onclick(instance) + } + // window.location.href = instance.icon + }; + instance.onerror = function () { + // Something to do + if (typeof options.onerror === 'function') { + options.onerror(instance) + } + }; + instance.onshow = function () { + // Something to do + if (typeof options.onshow === 'function') { + options.onshow(instance) + } + setTimeout(function () { + instance.close(); + }, options.showTime) + }; + instance.onclose = function () { + // Something to do + if (typeof options.onclose === 'function') { + options.onclose(instance) + } + }; + } else if (Notification && Notification.permission !== "denied") { + Notification.requestPermission(function (status) { + if (Notification.permission !== status) { + Notification.permission = status; + } + // If the user said okay + if (status === "granted") { + let instance = new Notification(title, options); + instance.onclick = function () { + // Something to do + if (typeof options.onclick === 'function') { + options.onclick(instance) + } + }; + instance.onerror = function () { + // Something to do + if (typeof options.onerror === 'function') { + options.onerror(instance) + } + }; + instance.onshow = function () { + // Something to do + if (typeof options.onshow === 'function') { + options.onshow(instance) + } + setTimeout(function () { + instance.close(); + }, options.showTime) + }; + instance.onclose = function () { + // Something to do + if (typeof options.onclose === 'function') { + options.onclose(instance) + } + }; + } else { + return false + } + }); + } else { + return false; + } +}; diff --git a/frontend-source/src/assets/js/print.js b/frontend-source/src/assets/js/print.js new file mode 100644 index 0000000..3b0a1ac --- /dev/null +++ b/frontend-source/src/assets/js/print.js @@ -0,0 +1,133 @@ +// 打印类属性、方法定义 +/* eslint-disable */ +const Print = function (dom, options) { + if (!(this instanceof Print)) return new Print(dom, options); + + this.options = this.extend({ + 'noPrint': '.no-print' + }, options); + + if ((typeof dom) === "string") { + this.dom = document.querySelector(dom); + } else { + this.isDOM(dom) + this.dom = this.isDOM(dom) ? dom : dom.$el; + } + + this.init(); +}; +Print.prototype = { + init: function () { + var content = this.getStyle() + this.getHtml(); + this.writeIframe(content); + }, + extend: function (obj, obj2) { + for (var k in obj2) { + obj[k] = obj2[k]; + } + return obj; + }, + + getStyle: function () { + var str = "", + styles = document.querySelectorAll('style,link'); + for (var i = 0; i < styles.length; i++) { + str += styles[i].outerHTML; + } + str += ""; + + return str; + }, + + getHtml: function () { + var inputs = document.querySelectorAll('input'); + var textareas = document.querySelectorAll('textarea'); + var selects = document.querySelectorAll('select'); + + for (var k = 0; k < inputs.length; k++) { + if (inputs[k].type == "checkbox" || inputs[k].type == "radio") { + if (inputs[k].checked == true) { + inputs[k].setAttribute('checked', "checked") + } else { + inputs[k].removeAttribute('checked') + } + } else if (inputs[k].type == "text") { + inputs[k].setAttribute('value', inputs[k].value) + } else { + inputs[k].setAttribute('value', inputs[k].value) + } + } + + for (var k2 = 0; k2 < textareas.length; k2++) { + if (textareas[k2].type == 'textarea') { + textareas[k2].innerHTML = textareas[k2].value + } + } + + for (var k3 = 0; k3 < selects.length; k3++) { + if (selects[k3].type == 'select-one') { + var child = selects[k3].children; + for (var i in child) { + if (child[i].tagName == 'OPTION') { + if (child[i].selected == true) { + child[i].setAttribute('selected', "selected") + } else { + child[i].removeAttribute('selected') + } + } + } + } + } + + return this.dom.outerHTML; + }, + + writeIframe: function (content) { + var w, doc, iframe = document.createElement('iframe'), + f = document.body.appendChild(iframe); + iframe.id = "myIframe"; + //iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;"; + iframe.setAttribute('style', 'position:absolute;width:0;height:0;top:-10px;left:-10px;'); + w = f.contentWindow || f.contentDocument; + doc = f.contentDocument || f.contentWindow.document; + doc.open(); + doc.write(content); + doc.close(); + this.toPrint(w); + + setTimeout(function () { + document.body.removeChild(iframe) + }, 100) + }, + + toPrint: function (frameWindow) { + try { + setTimeout(function () { + frameWindow.focus(); + try { + if (!frameWindow.document.execCommand('print', false, null)) { + frameWindow.print(); + } + } catch (e) { + frameWindow.print(); + } + frameWindow.close(); + }, 10); + } catch (err) { + console.log('err', err); + } + }, + isDOM: (typeof HTMLElement === 'object') ? + function (obj) { + return obj instanceof HTMLElement; + } : + function (obj) { + return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string'; + } +}; +const MyPlugin = {} +MyPlugin.install = function (Vue, options) { + // 4. 添加实例方法 + Vue.prototype.$print = Print +} +export default MyPlugin diff --git a/frontend-source/src/assets/js/storage.js b/frontend-source/src/assets/js/storage.js new file mode 100644 index 0000000..5445113 --- /dev/null +++ b/frontend-source/src/assets/js/storage.js @@ -0,0 +1,97 @@ +export const PREFIX = 'ep_'; +/** + * 存储localStorage + * @param name + * @param content + * @param duration Storage有效时间,单位:小时 + * @param set_time 是否设置时间 + * @returns {boolean} + */ +export const setStore = (name, content, set_time = false, duration = 0) => { + if (!name) return false; + name = PREFIX + name; + if (typeof content !== 'string') { + content = JSON.stringify(content) + } + if (set_time) { + let date = new Date; + if (duration > 0) { + content += '&' + (date.getTime() + duration * 3600 * 1e3) + } else { + content += '&0' + } + content += '&' + (date.getTime()) + } + window.localStorage.setItem(name, content) +}; + +/** + * 获取localStorage + * @param name + * @param parse // 是否json格式化 + * @returns {boolean} + */ +export const getStore = (name, parse = false) => { + if (!name) return false; + name = PREFIX + name; + if (parse) { + return JSON.parse(window.localStorage.getItem(name)) + } + return window.localStorage.getItem(name) +}; + +/** + * 删除localStorage + */ +export const removeStore = name => { + if (!name) return false; + name = PREFIX + name; + window.localStorage.removeItem(name) +}; + +/** + * 生成cookie + * @param name cookie名称 + * @param value cookie值 + * @param duration cookie有效时间,单位:小时 + */ +export const addCookie = (name, value, duration) => { + name = PREFIX + name; + let n = name + '=' + escape(value) + '; path=/'; + if (duration > 0) { + let date = new Date; + date.setTime(date.getTime() + duration * 3600 * 1e3); + n = n + ';expires=' + date.toGMTString() + } + document.cookie = n +}; + +/** + * 获取cookie + * @param name cookie名称 + * @returns {null} + */ +export const getCookie = (name) => { + name = PREFIX + name; + let t = document.cookie; + let a = t.split('; '); + for (let n = 0; n < a.length; n++) { + let r = a[n].split('='); + if (r[0] === name) { + return unescape(r[1]) + } + } + return null +}; + +/** + * 移除cookie + * @param name cookie名称 + */ +export const delCookie = (name) => { + name = PREFIX + name; + let t = new Date; + t.setTime(t.getTime() - 1); + let a = getCookie(name); + if (a !== null) document.cookie = name + '=' + a + '; path=/;expires=' + t.toGMTString() +}; diff --git a/frontend-source/src/assets/js/utils.js b/frontend-source/src/assets/js/utils.js new file mode 100644 index 0000000..cec81e5 --- /dev/null +++ b/frontend-source/src/assets/js/utils.js @@ -0,0 +1,366 @@ +import {notice} from './notice'; +import config from '../../config/config' +import {getStore} from "./storage"; + +const PROD_URL = config.PROD_URL; +const crossDomain = config.crossDomain; +const MOCK_URL = config.MOCK_URL; + +const local_file_url = config.VIEW_FILE_SERVER_LOCAL; +const remote_file_url = config.VIEW_FILE_SERVER_SERVER; + + +/** + * 判断客户端返回状态 + * @param res + * @param show_msg + * @returns {boolean} + */ +export const checkResponse = (res, show_msg = false) => { + const code = res.code; + const msg = res.msg; + if (code !== 200) { + if (show_msg) { + notice(msg); + } + return false + } else { + return true + } +}; +/** + * 创建路由对象 + * @returns {boolean} + * @param data + */ +export const createRoute = (data) => { + let path = data.url; + if (data.params) { + path += '/' + data.params; + } + let filePath = data.url; + if (data.file_path) { + filePath = data.file_path; + } + return { + name: data.id, + path: path, + component: resolve => require(['@/views/' + filePath], resolve), + meta: {model: data.pid, info: data}, + }; +}; + +export const getBase64 = (img, callback) => { + const reader = new FileReader(); + reader.addEventListener('load', () => callback(reader.result)); + reader.readAsDataURL(img); +}; + +/** + * 操作确认 + * @param options + * @param callback + */ +export const showWarConfirm = (options = {}, callback = function () { +}) => { + Modal.confirm({ + title: options.title || '操作提示', + content: '

' + options.content + '

', + loading: true, + onOk: () => { + callback() + } + }); +}; + + +/** + * 获取文件查看url + * + * @param fileUrl + * @param type + * @returns {string} + */ +export const getFileUrl = (fileUrl, type) => { + if (type === 'local'){ + return local_file_url + fileUrl; + } else { + return remote_file_url + fileUrl; + } +}; + + +/** + * 获取请求的全部url + * + * @param api + * @returns {string} + */ +export const getApiUrl = (api) => { + /*判断是否为mock数据*/ + if (api.indexOf("mock") >=0){ + return MOCK_URL; + }else{ + return PROD_URL + '/' + api; + } + /* if (crossDomain) { + return PROD_URL + '/' + api; //开启跨域直接返回 + } + if (process.env.NODE_ENV === 'production') { + return PROD_URL + '/' + api; + } else { + return '/api/' + api; + }*/ +}; + +/** + * 获取上传文件地址 + * @param api + * @returns {string} + */ +export const getUploadUrl = (api) => { + let baseUrl = ''; + // if (process.env.NODE_ENV === 'production') { + // baseUrl = PROD_URL + // } + return baseUrl + getApiUrl(api) +}; + + +export const format_date = (data, show = true) => { + //格式化时间 + let now = null; + if (isNaN(data)) { + now = new Date(data * 1000); + + } else { + now = new Date(data); + } + let year = now.getFullYear(); + let month = now.getMonth() + 1; + let date = now.getDate(); + let hour = now.getHours(); + let minute = now.getMinutes(); + // let second = now.getSeconds(); + if (month < 10) { + month = '0' + month; + } + if (date < 10) { + date = '0' + date; + } + if (hour < 10) { + hour = '0' + hour; + } + if (minute < 10) { + minute = '0' + minute; + } + const finally_date = { + year: year, + month: month, + day: date, + hour: hour, + minute: minute + }; + if (show) { + return year + "-" + month + "-" + date + " " + hour + ":" + minute; + } else { + return finally_date + } +}; +/** + * 转换时间为可阅读格式,传入date的time值 + * @param time + * @returns {*} + */ +export const prettyTime2Chinese = (time) => { + if (!time) { + return ''; + } + if (isNaN(time)) { + return '格式不正确'; + } + var minute = 60 * 1000, //1分钟 + hour = 60 * minute, //1小时 + day = 24 * hour, //1天 + month = 12 * day,//月 + year = 12 * month;//年 + + var diff = new Date().getTime() - time; + var r = 0; + if (diff > year) { + r = parseInt(diff / year); + return r + "年前"; + } + if (diff > month) { + r = parseInt(diff / month); + return r + "个月前"; + } + if (diff > day) { + r = parseInt(diff / day); + if (r == 1) { + return "昨天"; + } + return r + "天前"; + } + if (diff > hour) { + r = parseInt(diff / hour); + return r + "个小时前"; + } + if (diff > minute) { + r = parseInt(diff / minute); + return r + "分钟前"; + } + return "刚刚"; +}; + +/** + * 数字转英文字母 + * 如:1->A + * @param num + * @returns {string} + */ +export const convert = (num) => { + let result = ""; + while (num) { + result = String.fromCharCode(--num % 26 + 65) + result; + num = Math.floor(num / 26) + } + return result +}; + +export function timeFix() { + const time = new Date(); + const hour = time.getHours(); + return hour < 9 ? '早上好' : (hour <= 11 ? '上午好' : (hour <= 13 ? '中午好' : (hour < 20 ? '下午好' : '晚上好'))) +} +export function getAuthorization() { + let tokenList = getStore('tokenList', true); + if (tokenList) { + let accessToken = tokenList.accessToken; + let tokenType = tokenList.tokenType; + return {Authorization: `${tokenType} ${accessToken}`}; + } + return {}; +} + +/** + * 获取推送消息 + * 如:1->A + * @param num + * @returns {string} + */ +export const getPushData = (data) => { + return JSON.parse(data) +}; +// export const snail = (array) => { +// let arrs = []; +// for(var i=0,l=array.length;i { + for (var a in obj) { + if (typeof (obj[a]) == "object") { + return snail(obj[a], value); //递归遍历 + } else { + if (a === 'path') { + if (obj[a] === value) { + console.log(a + "=" + obj[a]); + return true; + } + } + } + } +}; + +// 判断参数是否是其中之一 +export function oneOf(value, validList) { + for (let i = 0; i < validList.length; i++) { + if (value === validList[i]) { + return true; + } + } + return false; +} + +/** + * 根据class获取节点 + * @param className + * @param tag + * @returns {NodeList} + */ +export const getClassObj = (className, tag) => { + tag = tag || document; + className = className || '*'; + let findarr = []; + if (document.getElementsByClassName) { + return document.getElementsByClassName(className) + } + let el = document.getElementsByTagName(tag); + let pattern = new RegExp('(^|\\s)' + className + '(\\s|$)'); + for (let i = 0; i < el.length; i++) { + if (pattern.test(el[i].className)) { + findarr.push(el[i]) + } + } +}; + +/** + * 判断某dom是否有滚动条 + * @param el dom对象 + * @param direction 垂直滚动或水平滚动 + * @returns {boolean} + */ +export const hasScrolled = (el, direction = "vertical") => { + if (!el) { + return false; + } + let overflow = el.currentStyle ? el.currentStyle.overflow : + window.getComputedStyle(el).getPropertyValue("overflow"); + if (overflow === "hidden") return false; + + if (direction === "vertical") { + return el.scrollHeight > el.clientHeight; + } else if (direction === "horizontal") { + return el.scrollWidth > el.clientWidth; + } +}; +/*判断token是否过期*/ +export const isTokenExpired = (timeStamp) => { + let expiredTime = timeStamp; + /*获取本地时间*/ + let nowTime = new Date().getTime() / 1000; + /*如果 < 10分钟,则说明即将过期*/ + return (expiredTime - nowTime) < 60 * 10 +}; + +//实现一个能遍历多维数组的方法 那么就在原型里面添加方法 +// 原型的一个作用就是留给我们扩展对象的属性和方法的 +//我们为数组添加一个each方法能遍历多维数组 传入一个回掉函数 +Array.prototype.each = function (fn) { + try { //核心业务逻辑 + this.i || (this.i = 0); //定义一个计数器,如果存在就是原来 如果不存在初始化成0 + //当数组有长度并且传过来的是一个函数的时候我们就对数组执行回调 + if (this.length > 0 && fn.constructor === Function) { + while (this.i < this.length) { //进行遍历 + var e = this[this.i]; //取到当前元素 + //如果取到的e元素是个数组,那就递归 一直到是一个元素的时候再执行回调 + if (e && e.constructor === Array) { + e.each(fn); + } else { + //进入这里说明 e元素是单个元素 + //我们为e元素绑定方法,相当于e调用了fn方法 + //fn.apply(e,[e]); 或者 + fn.call(e, e); + } + this.i++; + } + } + this.i = null; //进行垃圾回收 删除引用标记 + } catch (ex) { + console.log(ex); + //do something + } +}; diff --git a/frontend-source/src/components/Trend/Trend.vue b/frontend-source/src/components/Trend/Trend.vue new file mode 100644 index 0000000..1be8e91 --- /dev/null +++ b/frontend-source/src/components/Trend/Trend.vue @@ -0,0 +1,41 @@ + + + + + \ No newline at end of file diff --git a/frontend-source/src/components/Trend/index.js b/frontend-source/src/components/Trend/index.js new file mode 100644 index 0000000..761366d --- /dev/null +++ b/frontend-source/src/components/Trend/index.js @@ -0,0 +1,3 @@ +import Trend from './Trend.vue' + +export default Trend \ No newline at end of file diff --git a/frontend-source/src/components/Trend/index.less b/frontend-source/src/components/Trend/index.less new file mode 100644 index 0000000..d020c06 --- /dev/null +++ b/frontend-source/src/components/Trend/index.less @@ -0,0 +1,42 @@ +@import "../index"; + +@trend-prefix-cls: ~"@{ant-pro-prefix}-trend"; + +.@{trend-prefix-cls} { + display: inline-block; + font-size: @font-size-base; + line-height: 22px; + + .up, + .down { + margin-left: 4px; + position: relative; + top: 1px; + + i { + font-size: 12px; + transform: scale(0.83); + } + } + + .item-text { + display: inline-block; + margin-left: 8px; + color: rgba(0,0,0,.85); + } + + .up { + color: @red-6; + } + .down { + color: @green-6; + top: -1px; + } + + &.reverse-color .up { + color: @green-6; + } + &.reverse-color .down { + color: @red-6; + } +} diff --git a/frontend-source/src/components/Trend/index.md b/frontend-source/src/components/Trend/index.md new file mode 100644 index 0000000..8881f0e --- /dev/null +++ b/frontend-source/src/components/Trend/index.md @@ -0,0 +1,45 @@ +# Trend 趋势标记 + +趋势符号,标记上升和下降趋势。通常用绿色代表“好”,红色代表“不好”,股票涨跌场景除外。 + + + +引用方式: + +```javascript +import Trend from '@/components/Trend' + +export default { + components: { + Trend + } +} +``` + + + +## 代码演示 [demo](https://pro.loacg.com/test/home) + +```html +5% +``` +或 +```html + + 工资 + 5% + +``` +或 +```html +5% +``` + + +## API + +| 参数 | 说明 | 类型 | 默认值 | +|----------|------------------------------------------|-------------|-------| +| flag | 上升下降标识:`up|down` | string | - | +| reverseColor | 颜色反转 | Boolean | false | + diff --git a/frontend-source/src/components/chart/ChartCard.vue b/frontend-source/src/components/chart/ChartCard.vue new file mode 100644 index 0000000..0d83f98 --- /dev/null +++ b/frontend-source/src/components/chart/ChartCard.vue @@ -0,0 +1,111 @@ + + + + + \ No newline at end of file diff --git a/frontend-source/src/components/chart/MiniProgress.vue b/frontend-source/src/components/chart/MiniProgress.vue new file mode 100644 index 0000000..3e548bb --- /dev/null +++ b/frontend-source/src/components/chart/MiniProgress.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/frontend-source/src/components/chart/RankList.vue b/frontend-source/src/components/chart/RankList.vue new file mode 100644 index 0000000..e62adb6 --- /dev/null +++ b/frontend-source/src/components/chart/RankList.vue @@ -0,0 +1,77 @@ + + + + + \ No newline at end of file diff --git a/frontend-source/src/components/editor.vue b/frontend-source/src/components/editor.vue new file mode 100644 index 0000000..aac98ce --- /dev/null +++ b/frontend-source/src/components/editor.vue @@ -0,0 +1,181 @@ + + + diff --git a/frontend-source/src/components/error/errorPage.vue b/frontend-source/src/components/error/errorPage.vue new file mode 100644 index 0000000..9cfaaef --- /dev/null +++ b/frontend-source/src/components/error/errorPage.vue @@ -0,0 +1,100 @@ + + + diff --git a/frontend-source/src/components/file/box.vue b/frontend-source/src/components/file/box.vue new file mode 100644 index 0000000..27ba583 --- /dev/null +++ b/frontend-source/src/components/file/box.vue @@ -0,0 +1,200 @@ + + + + + diff --git a/frontend-source/src/components/file/boxDemo.vue b/frontend-source/src/components/file/boxDemo.vue new file mode 100644 index 0000000..3c223ad --- /dev/null +++ b/frontend-source/src/components/file/boxDemo.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/frontend-source/src/components/file/share.vue b/frontend-source/src/components/file/share.vue new file mode 100644 index 0000000..b07c01e --- /dev/null +++ b/frontend-source/src/components/file/share.vue @@ -0,0 +1,184 @@ + + + + + diff --git a/frontend-source/src/components/index.less b/frontend-source/src/components/index.less new file mode 100644 index 0000000..df1feb4 --- /dev/null +++ b/frontend-source/src/components/index.less @@ -0,0 +1,4 @@ +@import "~ant-design-vue/lib/style/index"; + +// The prefix to use on all css classes from ant-pro. +@ant-pro-prefix : ant-pro; diff --git a/frontend-source/src/components/layout/UserLayout.vue b/frontend-source/src/components/layout/UserLayout.vue new file mode 100644 index 0000000..abb9a73 --- /dev/null +++ b/frontend-source/src/components/layout/UserLayout.vue @@ -0,0 +1,157 @@ + + + + + + diff --git a/frontend-source/src/components/layout/WrapperContent.vue b/frontend-source/src/components/layout/WrapperContent.vue new file mode 100644 index 0000000..b391a43 --- /dev/null +++ b/frontend-source/src/components/layout/WrapperContent.vue @@ -0,0 +1,144 @@ + + diff --git a/frontend-source/src/components/layout/account/setting.vue b/frontend-source/src/components/layout/account/setting.vue new file mode 100644 index 0000000..c8c32b6 --- /dev/null +++ b/frontend-source/src/components/layout/account/setting.vue @@ -0,0 +1,61 @@ + + + + + + diff --git a/frontend-source/src/components/layout/header/HeaderAvatar.vue b/frontend-source/src/components/layout/header/HeaderAvatar.vue new file mode 100644 index 0000000..12863b6 --- /dev/null +++ b/frontend-source/src/components/layout/header/HeaderAvatar.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/frontend-source/src/components/layout/header/HeaderNotice.vue b/frontend-source/src/components/layout/header/HeaderNotice.vue new file mode 100644 index 0000000..626545e --- /dev/null +++ b/frontend-source/src/components/layout/header/HeaderNotice.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/frontend-source/src/components/layout/header/HeaderSelect.vue b/frontend-source/src/components/layout/header/HeaderSelect.vue new file mode 100644 index 0000000..13ef157 --- /dev/null +++ b/frontend-source/src/components/layout/header/HeaderSelect.vue @@ -0,0 +1,75 @@ + + + + + + diff --git a/frontend-source/src/components/table/EditableCell.vue b/frontend-source/src/components/table/EditableCell.vue new file mode 100644 index 0000000..399e11a --- /dev/null +++ b/frontend-source/src/components/table/EditableCell.vue @@ -0,0 +1,108 @@ + + + diff --git a/frontend-source/src/components/tools/VUploader.vue b/frontend-source/src/components/tools/VUploader.vue new file mode 100644 index 0000000..2bcc815 --- /dev/null +++ b/frontend-source/src/components/tools/VUploader.vue @@ -0,0 +1,375 @@ + + + + + diff --git a/frontend-source/src/components/websocket/socket.vue b/frontend-source/src/components/websocket/socket.vue new file mode 100644 index 0000000..593f26e --- /dev/null +++ b/frontend-source/src/components/websocket/socket.vue @@ -0,0 +1,98 @@ + + + diff --git a/frontend-source/src/config/config.js b/frontend-source/src/config/config.js new file mode 100644 index 0000000..227f052 --- /dev/null +++ b/frontend-source/src/config/config.js @@ -0,0 +1,11 @@ +export default { + crossDomain: false, //是否开启跨域支持 + //PROD_URL: 'https://beta.vilson.xyz/index.php/', //生产环境接口地址 + PROD_URL: 'http://localhost:8888/api', //生产环境接口地址(网关)服务器url + MOCK_URL: 'https://result.eolinker.com/1DVzyqbab364c82aaead42f24de532c4c046e6805221c90?uri=/mock/', //mock数据url + WS_URI: 'ws://localhost:8888/websocket', //WebSocket地址 + HOME_PAGE: '/home',//主页路由 + ERROR_PAGE_URL: 'http://ppkn5nh6t.bkt.clouddn.com/upload/20190410/dbf66652effa4b309d98b00946043690.jpeg',//404页面图片 + VIEW_FILE_SERVER_LOCAL: 'http://localhost:8012/onlinePreview?url=', //本地查看文件服务器 + VIEW_FILE_SERVER_SERVER: 'http://193.112.27.123:8012/onlinePreview?url=', //远程查看文件服务器 +}; diff --git a/frontend-source/src/config/version.js b/frontend-source/src/config/version.js new file mode 100644 index 0000000..8ed7df7 --- /dev/null +++ b/frontend-source/src/config/version.js @@ -0,0 +1,3 @@ +export default { + VERSION: '2.2.10', +}; diff --git a/frontend-source/src/const/common.js b/frontend-source/src/const/common.js new file mode 100644 index 0000000..539c447 --- /dev/null +++ b/frontend-source/src/const/common.js @@ -0,0 +1,5 @@ +export const COMMON = { + PAGE_SIZE: 20, + PAGE_NUM: 1, +}; + diff --git a/frontend-source/src/main.js b/frontend-source/src/main.js new file mode 100644 index 0000000..176e315 --- /dev/null +++ b/frontend-source/src/main.js @@ -0,0 +1,76 @@ +/* eslint-disable no-console,no-unused-vars */ +import Vue from 'vue' +import VueRouter from 'vue-router' +import Antd from "ant-design-vue"; +import App from './App' +import store from './store/index' +import router from './router/index' +import 'ant-design-vue/dist/antd.css' +import vuescroll from 'vuescroll'; +import 'vuescroll/dist/vuescroll.css'; +import '@/assets/css/theme.less' +import '@/assets/icon/iconfont' +import WrapperContent from '@/components/layout/WrapperContent' +import {message, notification} from 'ant-design-vue' +import {notice, destroyNotice} from './assets/js/notice' + +import moment from 'moment'; +import 'moment/locale/zh-cn'; + +import common from "./mixins/common"; + +import '@/utils/filter' // global filter + + +moment.locale('zh-cn'); + +Vue.use(VueRouter); +Vue.use(store); + +Vue.config.productionTip = false; +Vue.use(Antd); +Vue.component('WrapperContent', WrapperContent); + +import VueClipboards from 'vue-clipboards'; +Vue.use(VueClipboards); + +import uploader from 'vue-simple-uploader' +Vue.use(uploader); + + +//引入element ui +import ElementUI from 'element-ui'; +import 'element-ui/lib/theme-chalk/index.css'; +Vue.use(ElementUI); + +Vue.prototype.$message = message; +Vue.prototype.$notification = notification; +Vue.prototype.$notice = notice; +Vue.prototype.$destroyNotice = destroyNotice; + +Vue.use(vuescroll); +Vue.prototype.$vuescrollConfig = { + vuescroll: { + mode: 'native' + }, + scrollPanel: { + scrollingX: true, + }, + bar: { + delayTime: 500, + onlyShowBarOnScroll: false, + background: "#cecece", + keepShow: false + } +}; + +Vue.mixin(common); + + +new Vue({ + el: '#app', + store, + router, + template: '', + components: {App} +}); diff --git a/frontend-source/src/mixins/common.js b/frontend-source/src/mixins/common.js new file mode 100644 index 0000000..c5a898b --- /dev/null +++ b/frontend-source/src/mixins/common.js @@ -0,0 +1,15 @@ +// common-mixin.vue +export default { + data() { + return {} + }, + methods: { + routerLink(page, replace = false) { + if (replace) { + this.$router.replace(page); + } else { + this.$router.push(page); + } + }, + } +} diff --git a/frontend-source/src/mixins/pagination.js b/frontend-source/src/mixins/pagination.js new file mode 100644 index 0000000..e3788c3 --- /dev/null +++ b/frontend-source/src/mixins/pagination.js @@ -0,0 +1,34 @@ +// pagination-mixin.vue +export default { + data() { + return { + pagination: { + page: 1, + pageSize: 10, + total: 0, + showTotal: (total, range) => `共 ${total} 条` + }, + // requestData: { + // page: this.pagination.page, + // pageSize: this.pagination.pageSize, + // }, + } + }, + computed:{ + requestData(){ + return { + page: this.pagination.page, + pageSize: this.pagination.pageSize, + }; + } + }, + methods: { + init() { + }, + pageChange(page) { + this.pagination.page = page; + this.requestData.page = page.current; + this.init(); + }, + } +} diff --git a/frontend-source/src/router/home.js b/frontend-source/src/router/home.js new file mode 100644 index 0000000..1ac202c --- /dev/null +++ b/frontend-source/src/router/home.js @@ -0,0 +1,58 @@ +/** + * Home 自定义路由 + */ +export default [ + /* { + //任务看板 + name: 'files', + path: '/project/space/files', + component: resolve => require(['@/views/project/space/files'], resolve), + meta: {model: 'Project', info: {show_slider: true, is_inner: false, pid: 122, id: 152, innerText: '导航'}}, + children: [ + { + //任务详情 + name: 'taskdetail', + path: 'detail/:taskCode', + component: resolve => require(['@/views/project/space/taskdetail'], resolve), + meta: {model: 'Project', info: {show_slider: false}}, + }, + ] + },*/ + { + //任务看板 + name: 'inviteFromLink', + path: '/invite_from_link/:code', + component: resolve => require(['@/views/common/inviteFromLink'], resolve), + meta: {model: 'Common', info: {show_slider: false}}, + }, + { + name: 'demo', + path: '/demo', + component: resolve => require(['@/views/member/demo'], resolve), + meta: {model: 'diskdemo', info:{show_slider: false}}, + }, + { + name: 'detail', + path: '/followuser/detail', + component: resolve => require(['@/views/followuser/detail'], resolve), + meta: {model: 'followuser', info:{show_slider: false}}, + }, + { + name: 'link', + path: '/share/link', + component: resolve => require(['@/views/share/link'], resolve), + meta: {model: 'share', info:{show_slider: false}}, + }, + /* { + name: 'files', + path: '/disk/files', + component: resolve => require(['@/views/disk/files'], resolve), + meta: {model: 'diskdemo', info:{show_slider: false}}, + },*/ + /*{ + name: 'overview', + path: '/disk/overview', + component: resolve => require(['@/views/disk/overview'], resolve), + meta: {model: 'diskdemo', info:{show_slider: false}}, + }*/ +]; diff --git a/frontend-source/src/router/index.js b/frontend-source/src/router/index.js new file mode 100644 index 0000000..3603711 --- /dev/null +++ b/frontend-source/src/router/index.js @@ -0,0 +1,140 @@ +import Vue from 'vue' +import store from '@/store' +import Router from 'vue-router' +import Index from '@/views/index' +import Home from './home'; +import {getStore, setStore} from "../assets/js/storage"; +import {createRoute, isTokenExpired} from "../assets/js/utils"; +import config from "../config/config"; +import {refreshAccessToken} from "../api/common/common"; + +Vue.use(Router); +const routes = [].concat( + Home +); +// const router = new Router({ +// routes: routers +// }); +const menu = getStore('menu', true); +//后台查询出来的菜单注册到路由里面 +if (menu) { + menu.forEach(function (v) { + routes.push(createRoute(v)); + if (v.children) { + v.children.forEach(function (v2) { + routes.push(createRoute(v2)); + if (v2.children) { + v2.children.forEach(function (v3) { + routes.push(createRoute(v3)); + }); + } + }); + } + }); +} +const router = new Router({ + routes: [ + { + path: '/', + name: 'index', + component: Index, + children: routes + }, + { + name: 'member', + path: '/member', + component: resolve => require(['@/components/layout/UserLayout'], resolve), + meta: {model: 'Login'}, + children: [ + { + path: 'login', + name: 'login', + component: () => import(/* webpackChunkName: "user" */ '@/views/member/login'), + meta: {model: 'Login'}, + }, + { + path: 'register', + name: 'register', + component: () => import(/* webpackChunkName: "user" */ '@/views/member/Register'), + meta: {model: 'Login'}, + }, + { + path: 'forget', + name: 'forget', + component: () => import(/* webpackChunkName: "user" */ '@/views/member/forget'), + meta: {model: 'Login'}, + } + ] + }, + { + name: 'install', + path: '/install', + component: resolve => require(['@/views/error/install'], resolve), + meta: {model: 'error'}, + }, + { + name: 'resetEmail', + path: '/reset/email', + component: resolve => require(['@/views/reset/email'], resolve), + meta: {model: 'error'}, + }, + { + name: '404', + path: '/404', + component: resolve => require(['@/views/error/404'], resolve), + meta: {model: 'error'}, + }, + { + name: '403', + path: '/403', + component: resolve => require(['@/views/error/403'], resolve), + meta: {model: 'error'}, + } + ] +}); + +router.beforeEach((to, from, next) => { + console.log(to); + let tokenList = getStore('tokenList', true); + if (tokenList) { + let refreshToken = tokenList.refreshToken; + let accessTokenExp = tokenList.accessTokenExp; + //判断accessToken即将到期后刷新token + if (accessTokenExp && isTokenExpired(accessTokenExp)) { + refreshAccessToken(refreshToken).then(res => { + tokenList.accessToken = res.data.accessToken; + tokenList.accessTokenExp = res.data.accessTokenExp; + setStore('tokenList', tokenList); + }); + } + } + const HOME_PAGE = config.HOME_PAGE; + //页面中转 + if (to.name === 'index' || to.path === '/index' || to.path === '/') { + next({path: HOME_PAGE}); + return false; + } + //无效页面跳转至首页 + if (!to.name && from.meta.model !== 'Login' && to.path !== HOME_PAGE) { + next({path: '/404'}); + return false; + } + if (to.meta.model === 'Login' && store.state.logged) { + next({path: HOME_PAGE}); + return false; + } + if (!store.state.logged && to.meta.model !== 'Login' && to.meta.model !== 'error') { + next({ + name: 'login', + query: {redirect: to.fullPath} + }); + return false; + } + next(); +}); +router.afterEach(route => { + //预留 + // window.scrollTo(0,0) +}); + +export default router diff --git a/frontend-source/src/store/actions.js b/frontend-source/src/store/actions.js new file mode 100644 index 0000000..e1c0714 --- /dev/null +++ b/frontend-source/src/store/actions.js @@ -0,0 +1,44 @@ +import {setStore, removeStore} from '@/assets/js/storage' + +export default { + SET_LOGGED({commit}, data) { + setStore('tokenList', data.tokenList); + setStore('userInfo', data.userInfo); + commit('SET_LOGGED', data); + }, + SET_USER({commit}, data) { + setStore('userInfo', data); + commit('SET_USER', data); + }, + SET_LOGOUT({commit}) { + removeStore('tokenList'); + removeStore('token'); + removeStore('userInfo'); + commit('SET_LOGOUT'); + }, + setTheme({commit}, theme) { + setStore('theme', theme); + commit('setTheme', theme); + }, + pageLoading({commit}, status) { + commit('pageLoading', status); + }, + windowLoading({commit}, status) { + commit('windowLoading', status); + }, + setOrganizationList({commit}, data) { + setStore('organizationList', data); + commit('setOrganizationList', data); + }, + setCurrentOrganization({commit}, data) { + setStore('currentOrganization', data); + commit('setCurrentOrganization', data); + }, + setSystem({commit}, data) { + setStore('system', data); + commit('setSystem', data); + }, + setBoundClient({commit}, data) { + commit('setBoundClient', data); + }, +} diff --git a/frontend-source/src/store/index.js b/frontend-source/src/store/index.js new file mode 100644 index 0000000..92820d3 --- /dev/null +++ b/frontend-source/src/store/index.js @@ -0,0 +1,21 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import state from './state' +import mutations from './mutations' +import actions from './actions' +import common from './modules/common' +import menu from './modules/menu' +import {getStore, setStore} from '@/assets/js/storage' + +Vue.use(Vuex); + +const store = new Vuex.Store({ + modules: { + common, + menu, + }, + state, + mutations, + actions +}); +export default store diff --git a/frontend-source/src/store/modules/common.js b/frontend-source/src/store/modules/common.js new file mode 100644 index 0000000..bf643c6 --- /dev/null +++ b/frontend-source/src/store/modules/common.js @@ -0,0 +1,26 @@ +import {getStore, setStore} from '@/assets/js/storage'; + +const common = { + state: { + uploader: null, + tempData: getStore('tempData', true) + }, + mutations: { + setUploader(state, data) { + state.uploader = data; + }, + setTempData(state, data) { + state.tempData = data; + }, + }, + actions: { + setUploader({commit}, data) { + commit('setUploader', data); + }, + setTempData({commit}, data) { + setStore('tempData', data); + commit('setTempData', data); + } + } +}; +export default common diff --git a/frontend-source/src/store/modules/menu.js b/frontend-source/src/store/modules/menu.js new file mode 100644 index 0000000..cf54716 --- /dev/null +++ b/frontend-source/src/store/modules/menu.js @@ -0,0 +1,35 @@ +import {getMenuForUser} from "@/api/menu"; +import {getMenu} from "@/api/mock"; +import {getStore, setStore} from '@/assets/js/storage'; + +const common = { + state: { + menu: getStore('menu', true), + breadCrumbInfo: [] + }, + mutations: { + SET_MENU(state, data) { + state.menu = data; + }, + setBreadCrumbInfo(state, data) { + state.breadCrumbInfo = data; + } + }, + actions: { + GET_MENU({commit}) { + getMenu().then(res => { + setStore('menu', res.data); + commit('SET_MENU', res.data); + }); + }, + SET_MENU({commit},data) { + setStore('menu', data); + commit('SET_MENU', data); + }, + setBreadCrumbInfo({commit}, data) { + commit('setBreadCrumbInfo', data); + } + } + +}; +export default common diff --git a/frontend-source/src/store/mutations.js b/frontend-source/src/store/mutations.js new file mode 100644 index 0000000..482d1a2 --- /dev/null +++ b/frontend-source/src/store/mutations.js @@ -0,0 +1,37 @@ +export default { + SET_LOGGED(state, {tokenList, userInfo}) { + state.logged = true; + state.userInfo = userInfo; + }, + SET_USER(state, data) { + state.userInfo = data; + }, + SET_LOGOUT(state) { + state.logged = false; + state.userInfo = null; + }, + setTheme(state, theme) { + state.theme = theme + }, + pageLoading(state, status) { + state.pageLoading = status + }, + windowLoading(state, status) { + state.windowLoading = status + }, + setSystem(state, data) { + state.system = data; + }, + setOrganizationList(state, data) { + state.organizationList = data; + }, + setCurrentOrganization(state, data) { + state.currentOrganization = data; + }, + catchSocketAction(state, data) { + state.socketAction = data; + }, + setBoundClient(state, data) { + state.boundClient = data; + } +}; diff --git a/frontend-source/src/store/state.js b/frontend-source/src/store/state.js new file mode 100644 index 0000000..dcaa98d --- /dev/null +++ b/frontend-source/src/store/state.js @@ -0,0 +1,17 @@ +import {getStore} from "../assets/js/storage"; + +const userInfo = getStore('userInfo', true); +const theme = getStore('theme'); +export default { + theme: theme ? theme : 'dark', + logged: !!userInfo,//登录状态 + userInfo: userInfo,//用户信息 + organizationList: getStore('organizationList', true),//能查看的组织列表 + currentOrganization: getStore('currentOrganization', true),//当前组织 + system: getStore('system', true),//系统配置 + windowLoading: false, // 窗口loading + pageLoading: false, // 页面加载loading + socketAction: '', + boundClient: false,//是否绑定client + +} diff --git a/frontend-source/src/utils/filter.js b/frontend-source/src/utils/filter.js new file mode 100644 index 0000000..95df2e8 --- /dev/null +++ b/frontend-source/src/utils/filter.js @@ -0,0 +1,22 @@ +import Vue from 'vue' + +Vue.filter('NumberFormat', function (value) { + if (!value) { + return '0' + } + const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); //将整数部分逢三一断 + return intPartFormat +}); + +//文件预览 +Vue.filter('showPreviewUrl', function (file) { + let url = file.file_url; + const docUrl = 'https://view.officeapps.live.com/op/view.aspx?src=https://beta.vilson.xyz/static/upload/file/default/6v7be19pwman2fird04gqu53/6v7be19pwman2fird04gqu53/20190408/20190408124525-qq%E9%9F%B3%E4%B9%90%20copy%2055.png'; + let docArr = ['doc', 'docx', 'docm', 'dotm', 'dotx', 'xlsx', 'xlsb', 'xls', 'xlsm', 'pptx', 'ppsx', 'ppt', 'pps', 'pptm', 'potm', 'ppam', 'potx', 'ppsm']; + const extension = file.extension; + const index = docArr.findIndex(item => item == extension); + if (index !== -1) { + url = docUrl + url; + } + return url; +}); diff --git a/frontend-source/src/views/account/setting/base.vue b/frontend-source/src/views/account/setting/base.vue new file mode 100644 index 0000000..2986342 --- /dev/null +++ b/frontend-source/src/views/account/setting/base.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/frontend-source/src/views/account/setting/security.vue b/frontend-source/src/views/account/setting/security.vue new file mode 100644 index 0000000..0be56b3 --- /dev/null +++ b/frontend-source/src/views/account/setting/security.vue @@ -0,0 +1,492 @@ + + + + + diff --git a/frontend-source/src/views/common/inviteFromLink.vue b/frontend-source/src/views/common/inviteFromLink.vue new file mode 100644 index 0000000..7bef855 --- /dev/null +++ b/frontend-source/src/views/common/inviteFromLink.vue @@ -0,0 +1,93 @@ + + + diff --git a/frontend-source/src/views/demo/fileList.vue b/frontend-source/src/views/demo/fileList.vue new file mode 100644 index 0000000..255e40b --- /dev/null +++ b/frontend-source/src/views/demo/fileList.vue @@ -0,0 +1,389 @@ + + + + + diff --git a/frontend-source/src/views/demo/fileview.vue b/frontend-source/src/views/demo/fileview.vue new file mode 100644 index 0000000..39aedf7 --- /dev/null +++ b/frontend-source/src/views/demo/fileview.vue @@ -0,0 +1,156 @@ + + + + + + diff --git a/frontend-source/src/views/disk/files.vue b/frontend-source/src/views/disk/files.vue new file mode 100644 index 0000000..1f467bd --- /dev/null +++ b/frontend-source/src/views/disk/files.vue @@ -0,0 +1,501 @@ + + + + + diff --git a/frontend-source/src/views/disk/index.vue b/frontend-source/src/views/disk/index.vue new file mode 100644 index 0000000..de6c6a8 --- /dev/null +++ b/frontend-source/src/views/disk/index.vue @@ -0,0 +1,488 @@ + + + + + + diff --git a/frontend-source/src/views/disk/overview.vue b/frontend-source/src/views/disk/overview.vue new file mode 100644 index 0000000..fed7f53 --- /dev/null +++ b/frontend-source/src/views/disk/overview.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/frontend-source/src/views/error/403.vue b/frontend-source/src/views/error/403.vue new file mode 100644 index 0000000..2611105 --- /dev/null +++ b/frontend-source/src/views/error/403.vue @@ -0,0 +1,18 @@ + + diff --git a/frontend-source/src/views/error/404.vue b/frontend-source/src/views/error/404.vue new file mode 100644 index 0000000..c4febaf --- /dev/null +++ b/frontend-source/src/views/error/404.vue @@ -0,0 +1,18 @@ + + diff --git a/frontend-source/src/views/error/500.vue b/frontend-source/src/views/error/500.vue new file mode 100644 index 0000000..74d26ed --- /dev/null +++ b/frontend-source/src/views/error/500.vue @@ -0,0 +1,16 @@ + + diff --git a/frontend-source/src/views/error/install.vue b/frontend-source/src/views/error/install.vue new file mode 100644 index 0000000..17858c3 --- /dev/null +++ b/frontend-source/src/views/error/install.vue @@ -0,0 +1,196 @@ + + diff --git a/frontend-source/src/views/followuser/detail.vue b/frontend-source/src/views/followuser/detail.vue new file mode 100644 index 0000000..a9517bf --- /dev/null +++ b/frontend-source/src/views/followuser/detail.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/frontend-source/src/views/followuser/index.vue b/frontend-source/src/views/followuser/index.vue new file mode 100644 index 0000000..304d5c7 --- /dev/null +++ b/frontend-source/src/views/followuser/index.vue @@ -0,0 +1,316 @@ + + + + + + diff --git a/frontend-source/src/views/home/index.vue b/frontend-source/src/views/home/index.vue new file mode 100644 index 0000000..658a751 --- /dev/null +++ b/frontend-source/src/views/home/index.vue @@ -0,0 +1,401 @@ + + + diff --git a/frontend-source/src/views/index.vue b/frontend-source/src/views/index.vue new file mode 100644 index 0000000..62bd5ff --- /dev/null +++ b/frontend-source/src/views/index.vue @@ -0,0 +1,336 @@ + + + + diff --git a/frontend-source/src/views/member/Register.vue b/frontend-source/src/views/member/Register.vue new file mode 100644 index 0000000..d0092fa --- /dev/null +++ b/frontend-source/src/views/member/Register.vue @@ -0,0 +1,330 @@ + + + + + diff --git a/frontend-source/src/views/member/demo.vue b/frontend-source/src/views/member/demo.vue new file mode 100644 index 0000000..5ddbb9e --- /dev/null +++ b/frontend-source/src/views/member/demo.vue @@ -0,0 +1,94 @@ + + + diff --git a/frontend-source/src/views/member/forget.vue b/frontend-source/src/views/member/forget.vue new file mode 100644 index 0000000..40a6738 --- /dev/null +++ b/frontend-source/src/views/member/forget.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/frontend-source/src/views/member/login.vue b/frontend-source/src/views/member/login.vue new file mode 100644 index 0000000..2976250 --- /dev/null +++ b/frontend-source/src/views/member/login.vue @@ -0,0 +1,389 @@ + + + + + diff --git a/frontend-source/src/views/notify/notice.vue b/frontend-source/src/views/notify/notice.vue new file mode 100644 index 0000000..a7543da --- /dev/null +++ b/frontend-source/src/views/notify/notice.vue @@ -0,0 +1,97 @@ + + diff --git a/frontend-source/src/views/project/recycle/index.vue b/frontend-source/src/views/project/recycle/index.vue new file mode 100644 index 0000000..c87f3e8 --- /dev/null +++ b/frontend-source/src/views/project/recycle/index.vue @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend-source/src/views/project/space/files.vue b/frontend-source/src/views/project/space/files.vue new file mode 100644 index 0000000..a99da8d --- /dev/null +++ b/frontend-source/src/views/project/space/files.vue @@ -0,0 +1,453 @@ + diff --git a/frontend-source/src/views/project/space/index.vue b/frontend-source/src/views/project/space/index.vue new file mode 100644 index 0000000..f987562 --- /dev/null +++ b/frontend-source/src/views/project/space/index.vue @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/frontend-source/src/views/project/space/overview.vue b/frontend-source/src/views/project/space/overview.vue new file mode 100644 index 0000000..65fc417 --- /dev/null +++ b/frontend-source/src/views/project/space/overview.vue @@ -0,0 +1,362 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend-source/src/views/project/space/task.vue b/frontend-source/src/views/project/space/task.vue new file mode 100644 index 0000000..e69de29 diff --git a/frontend-source/src/views/reset/email.vue b/frontend-source/src/views/reset/email.vue new file mode 100644 index 0000000..f0165dd --- /dev/null +++ b/frontend-source/src/views/reset/email.vue @@ -0,0 +1,96 @@ + + + diff --git a/frontend-source/src/views/share/index.vue b/frontend-source/src/views/share/index.vue new file mode 100644 index 0000000..09bf861 --- /dev/null +++ b/frontend-source/src/views/share/index.vue @@ -0,0 +1,318 @@ + + + + + + diff --git a/frontend-source/src/views/share/link.vue b/frontend-source/src/views/share/link.vue new file mode 100644 index 0000000..d688033 --- /dev/null +++ b/frontend-source/src/views/share/link.vue @@ -0,0 +1,114 @@ + + + diff --git a/frontend-source/vue.config.js b/frontend-source/vue.config.js new file mode 100644 index 0000000..4dbe5c7 --- /dev/null +++ b/frontend-source/vue.config.js @@ -0,0 +1,54 @@ +const path = require('path'); + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const HOST = '127.0.0.1'; +const PORT = '8045'; +const DEV_URL = 'http://localhost:8888'; + +module.exports = { + publicPath: process.env.NODE_ENV === 'production' ? './' : '/', + productionSourceMap: false, + css: { + loaderOptions: { + less: { + modifyVars: { + blue: '#3a82f8', + 'text-color': '#333' + }, + javascriptEnabled: true + } + } + }, + devServer: { + host: HOST, + port: PORT, + https: false, + hotOnly: false, + proxy: { // 配置跨域 + '/api': { + //要访问的跨域的api的域名 + target: `${DEV_URL}/`, + ws: true, + changOrigin: true, + pathRewrite: { + '^/api': '' + } + } + }, + }, + configureWebpack: config => { + config.resolve = { + extensions: ['.js', '.vue', '.json', ".css"], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + 'assets': resolve('src/assets'), + 'components': resolve('src/components') + } + } + }, + lintOnSave: undefined +}; diff --git a/release/README.md b/release/README.md new file mode 100644 index 0000000..8a68035 --- /dev/null +++ b/release/README.md @@ -0,0 +1,15 @@ +# 基于 HDFS 的分布式网盘系统部署说明 + +## 文件说明 + +## 部署步骤 + +### 部署文件在线预览服务 + +运行 start-file-preview-service.bat(Linux 下为 .sh)即可。 + +需满足以下条件: + +1. redis,本地和远程皆可,默认本地。 +2. OpenOffice 4 + diff --git a/release/environments/Apache_OpenOffice_4.1.11_Linux_x86-64_install-deb_zh-CN.tar.gz b/release/environments/Apache_OpenOffice_4.1.11_Linux_x86-64_install-deb_zh-CN.tar.gz new file mode 100644 index 0000000..3c2f1cc Binary files /dev/null and b/release/environments/Apache_OpenOffice_4.1.11_Linux_x86-64_install-deb_zh-CN.tar.gz differ diff --git a/release/file-preview-service/META-INF/MANIFEST.MF b/release/file-preview-service/META-INF/MANIFEST.MF new file mode 100644 index 0000000..ee72612 --- /dev/null +++ b/release/file-preview-service/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Implementation-Title: jodconverter-web +Implementation-Version: 1.5.8.RELEASE +Archiver-Version: Plexus Archiver +Built-By: cxx +Implementation-Vendor-Id: org.springframework.boot +Spring-Boot-Version: 1.5.8.RELEASE +Implementation-Vendor: Pivotal Software, Inc. +Main-Class: org.springframework.boot.loader.WarLauncher +Start-Class: cn.keking.FilePreviewApplication +Spring-Boot-Classes: WEB-INF/classes/ +Spring-Boot-Lib: WEB-INF/lib/ +Created-By: Apache Maven 3.3.9 +Build-Jdk: 1.8.0_181 +Implementation-URL: http://projects.spring.io/spring-boot/jodconverter + -web/ + diff --git a/release/file-preview-service/META-INF/maven/org.springframework.boot/jodconverter-web/pom.properties b/release/file-preview-service/META-INF/maven/org.springframework.boot/jodconverter-web/pom.properties new file mode 100644 index 0000000..253ff6b --- /dev/null +++ b/release/file-preview-service/META-INF/maven/org.springframework.boot/jodconverter-web/pom.properties @@ -0,0 +1,5 @@ +#Generated by Apache Maven +#Wed Apr 24 02:32:46 CST 2019 +version=1.5.8.RELEASE +groupId=org.springframework.boot +artifactId=jodconverter-web diff --git a/release/file-preview-service/META-INF/maven/org.springframework.boot/jodconverter-web/pom.xml b/release/file-preview-service/META-INF/maven/org.springframework.boot/jodconverter-web/pom.xml new file mode 100644 index 0000000..65dad2e --- /dev/null +++ b/release/file-preview-service/META-INF/maven/org.springframework.boot/jodconverter-web/pom.xml @@ -0,0 +1,172 @@ + + + + org.springframework.boot + spring-boot-starter-parent + 1.5.8.RELEASE + + + 4.0.0 + + jodconverter-web + war + + + + UTF-8 + UTF-8 + 1.8 + 1.0-SNAPSHOT + ${basedir}/target/classes/logs + file-preview + + + + + jboss-public-repository-group + https://repository.jboss.org/nexus/content/groups/public-jboss/ + + + + + org.springframework.boot + spring-boot-starter-freemarker + + + org.springframework.boot + spring-boot-starter-web + + + net.logstash.logback + logstash-logback-encoder + 4.11 + + + org.springframework.boot + spring-boot-starter-test + test + + + cn.keking + jodconverter-core + 1.0.0 + + + commons-io + commons-io + + + + + + org.redisson + redisson + 3.2.0 + + + org.apache.poi + poi + 3.12 + + + org.apache.poi + poi-scratchpad + 3.12 + + + fr.opensagres.xdocreport + org.apache.poi.xwpf.converter.core + 1.0.5 + + + poi + org.apache.poi + + + + + fr.opensagres.xdocreport + org.apache.poi.xwpf.converter.xhtml + 1.0.5 + + + fr.opensagres.xdocreport + fr.opensagres.xdocreport.document + 1.0.5 + + + commons-io + commons-io + 2.4 + + + + org.apache.commons + commons-compress + 1.9 + + + + com.github.junrar + junrar + 0.7 + + + net.sourceforge.jchardet + jchardet + 1.0 + + + antlr + antlr + 2.7.7 + + + commons-httpclient + commons-httpclient + 3.1 + test + + + commons-logging + commons-logging + + + + + commons-cli + commons-cli + 1.2 + + + com.thoughtworks.xstream + xstream + 1.3.1 + + + com.google.guava + guava + 19.0 + + + + + + src/main/resources + + **/* + + true + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/release/file-preview-service/WEB-INF/classes/META-INF/app.properties b/release/file-preview-service/WEB-INF/classes/META-INF/app.properties new file mode 100644 index 0000000..ca9d3a6 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/META-INF/app.properties @@ -0,0 +1 @@ +app.id=file-preview diff --git a/release/file-preview-service/WEB-INF/classes/application-linux.properties b/release/file-preview-service/WEB-INF/classes/application-linux.properties new file mode 100644 index 0000000..006766b --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application-linux.properties @@ -0,0 +1,15 @@ +#=============================================#spring Redisson\u914D\u7F6E#===================================# +spring.redisson.address = 60.205.212.196:6379 +##\u8D44\u6E90\u6620\u5C04\u8DEF\u5F84(\u56E0\u4E3Ajar\u65B9\u5F0F\u8FD0\u884C\u7684\u539F\u56E0) +file.dir = /home/file/ +spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir} +## openoffice\u76F8\u5173\u914D\u7F6E +office.home = /opt/openoffice4/ +server.tomcat.uri-encoding = UTF-8 +converted.file.charset = GBK + +spring.http.multipart.max-file-size=100MB +spring.http.multipart.max-request-size=100MB +## \u05A7\u6587\u4EF6\u7C7B\u578B +simText = txt,html,xml,java,properties,sql +media=mp3,mp4,flv,rmvb diff --git a/release/file-preview-service/WEB-INF/classes/application-linux.yml b/release/file-preview-service/WEB-INF/classes/application-linux.yml new file mode 100644 index 0000000..cca6dda --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application-linux.yml @@ -0,0 +1,21 @@ +converted: + file: + charset: GBK +file: + dir: /home/file/ +media: mp3,mp4,flv,rmvb +office: + home: /opt/openoffice4/ +server: + tomcat: + uri-encoding: UTF-8 +simText: txt,html,xml,java,properties,sql +spring: + http: + multipart: + max-file-size: 100MB + max-request-size: 100MB + redisson: + address: localhost:6379 + resources: + static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir} diff --git a/release/file-preview-service/WEB-INF/classes/application-mac.properties b/release/file-preview-service/WEB-INF/classes/application-mac.properties new file mode 100644 index 0000000..f0b9bfc --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application-mac.properties @@ -0,0 +1,15 @@ +#=============================================#spring Redisson\u914D\u7F6E#===================================# +spring.redisson.address = 60.205.212.196:6379 +##\u8D44\u6E90\u6620\u5C04\u8DEF\u5F84(\u56E0\u4E3Ajar\u65B9\u5F0F\u8FD0\u884C\u7684\u539F\u56E0) +file.dir = /Users/cxx/openoffice/ +spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir} +## openoffice\u76F8\u5173\u914D\u7F6E +office.home = /Applications/OpenOffice.app/Contents/ +server.tomcat.uri-encoding = UTF-8 +converted.file.charset = GBK + +spring.http.multipart.max-file-size=100MB +spring.http.multipart.max-request-size=100MB +## \u05A7\u6587\u4EF6\u7C7B\u578B +simText = txt,html,xml,java,properties,sql +media=mp3,mp4,flv,rmvb diff --git a/release/file-preview-service/WEB-INF/classes/application-mac.yml b/release/file-preview-service/WEB-INF/classes/application-mac.yml new file mode 100644 index 0000000..4f001cd --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application-mac.yml @@ -0,0 +1,21 @@ +converted: + file: + charset: GBK +file: + dir: /Temp/openoffice/ +media: mp3,mp4,flv,rmvb +office: + home: /Applications/OpenOffice.app/Contents/ +server: + tomcat: + uri-encoding: UTF-8 +simText: txt,html,xml,java,properties,sql +spring: + http: + multipart: + max-file-size: 100MB + max-request-size: 100MB + redisson: + address: localhost:6379 + resources: + static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir} diff --git a/release/file-preview-service/WEB-INF/classes/application-window.properties b/release/file-preview-service/WEB-INF/classes/application-window.properties new file mode 100644 index 0000000..88a976b --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application-window.properties @@ -0,0 +1,15 @@ +#=============================================#spring Redisson\u914D\u7F6E#===================================# +spring.redisson.address = localhost:6379 +##\u8D44\u6E90\u6620\u5C04\u8DEF\u5F84(\u56E0\u4E3Ajar\u65B9\u5F0F\u8FD0\u884C\u7684\u539F\u56E0) +file.dir = E:\\disk\\ +spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir} +## openoffice\u76F8\u5173\u914D\u7F6E +office.home = C:\\Program Files (x86)\\OpenOffice 4 +server.tomcat.uri-encoding = UTF-8 +converted.file.charset = GBK + +spring.http.multipart.max-file-size=100MB +spring.http.multipart.max-request-size=100MB +## \u05A7\u6587\u4EF6\u7C7B\u578B +simText = txt,html,xml,java,properties,sql +media=mp3,mp4,flv,rmvb diff --git a/release/file-preview-service/WEB-INF/classes/application-window.yml b/release/file-preview-service/WEB-INF/classes/application-window.yml new file mode 100644 index 0000000..d12071f --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application-window.yml @@ -0,0 +1,21 @@ +converted: + file: + charset: GBK +file: + dir: E:\\disk\\ +media: mp3,mp4,flv,rmvb +office: + home: C:\Program Files (x86)\OpenOffice 4 +server: + tomcat: + uri-encoding: UTF-8 +simText: txt,html,xml,java,properties,sql +spring: + http: + multipart: + max-file-size: 100MB + max-request-size: 100MB + redisson: + address: localhost:6379 + resources: + static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir} diff --git a/release/file-preview-service/WEB-INF/classes/application.properties b/release/file-preview-service/WEB-INF/classes/application.properties new file mode 100644 index 0000000..618fbe8 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application.properties @@ -0,0 +1,15 @@ +server.port = 8012 +spring.http.encoding.charset = utf8 +## Freemarker \u914D\u7F6E +spring.freemarker.template-loader-path = classpath:/web/ +spring.freemarker.cache = false +spring.freemarker.charset = UTF-8 +spring.freemarker.check-template-location = true +spring.freemarker.content-type = text/html +spring.freemarker.expose-request-attributes = true +spring.freemarker.expose-session-attributes = true +spring.freemarker.request-context-attribute = request +spring.freemarker.suffix = .ftl + +#\u9ED8\u8BA4\u73AF\u5883 +spring.profiles.active=window diff --git a/release/file-preview-service/WEB-INF/classes/application.yml b/release/file-preview-service/WEB-INF/classes/application.yml new file mode 100644 index 0000000..5c23c06 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/application.yml @@ -0,0 +1,18 @@ +server: + port: 8012 +spring: + freemarker: + cache: false + charset: UTF-8 + check-template-location: true + content-type: text/html + expose-request-attributes: true + expose-session-attributes: true + request-context-attribute: request + suffix: .ftl + template-loader-path: classpath:/web/ + http: + encoding: + charset: utf8 + profiles: + active: window diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/FilePreviewApplication.class b/release/file-preview-service/WEB-INF/classes/cn/keking/FilePreviewApplication.class new file mode 100644 index 0000000..38691c4 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/FilePreviewApplication.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/config/RedissonConfig.class b/release/file-preview-service/WEB-INF/classes/cn/keking/config/RedissonConfig.class new file mode 100644 index 0000000..4c24487 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/config/RedissonConfig.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/extend/ControlDocumentFormatRegistry.class b/release/file-preview-service/WEB-INF/classes/cn/keking/extend/ControlDocumentFormatRegistry.class new file mode 100644 index 0000000..0a67be6 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/extend/ControlDocumentFormatRegistry.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/filters/ChinesePathFilter.class b/release/file-preview-service/WEB-INF/classes/cn/keking/filters/ChinesePathFilter.class new file mode 100644 index 0000000..399a9c6 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/filters/ChinesePathFilter.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/filters/FilterConfiguration.class b/release/file-preview-service/WEB-INF/classes/cn/keking/filters/FilterConfiguration.class new file mode 100644 index 0000000..b3bb42f Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/filters/FilterConfiguration.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/model/FileAttribute.class b/release/file-preview-service/WEB-INF/classes/cn/keking/model/FileAttribute.class new file mode 100644 index 0000000..9c6fbb2 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/model/FileAttribute.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/model/FileType.class b/release/file-preview-service/WEB-INF/classes/cn/keking/model/FileType.class new file mode 100644 index 0000000..0ec77db Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/model/FileType.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/model/ReturnResponse.class b/release/file-preview-service/WEB-INF/classes/cn/keking/model/ReturnResponse.class new file mode 100644 index 0000000..d79cd6d Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/model/ReturnResponse.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/FileConverQueueTask$ConverTask.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FileConverQueueTask$ConverTask.class new file mode 100644 index 0000000..6fb7b2c Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FileConverQueueTask$ConverTask.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/FileConverQueueTask.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FileConverQueueTask.class new file mode 100644 index 0000000..835d915 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FileConverQueueTask.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/FilePreview.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FilePreview.class new file mode 100644 index 0000000..409100a Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FilePreview.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/FilePreviewFactory.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FilePreviewFactory.class new file mode 100644 index 0000000..e246d6e Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/FilePreviewFactory.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/CompressFilePreviewImpl.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/CompressFilePreviewImpl.class new file mode 100644 index 0000000..f7e4adb Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/CompressFilePreviewImpl.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/MediaFilePreviewImpl.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/MediaFilePreviewImpl.class new file mode 100644 index 0000000..13938a2 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/MediaFilePreviewImpl.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/OfficeFilePreviewImpl.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/OfficeFilePreviewImpl.class new file mode 100644 index 0000000..93e5de5 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/OfficeFilePreviewImpl.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/OtherFilePreviewImpl.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/OtherFilePreviewImpl.class new file mode 100644 index 0000000..7a8737a Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/OtherFilePreviewImpl.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/PdfFilePreviewImpl.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/PdfFilePreviewImpl.class new file mode 100644 index 0000000..0bb59cc Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/PdfFilePreviewImpl.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/PictureFilePreviewImpl.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/PictureFilePreviewImpl.class new file mode 100644 index 0000000..69e94c4 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/PictureFilePreviewImpl.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/SimTextFilePreviewImpl.class b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/SimTextFilePreviewImpl.class new file mode 100644 index 0000000..d1c86b6 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/service/impl/SimTextFilePreviewImpl.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ConverterUtils.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ConverterUtils.class new file mode 100644 index 0000000..accbab6 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ConverterUtils.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/DeleteFileUtil.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/DeleteFileUtil.class new file mode 100644 index 0000000..e16e887 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/DeleteFileUtil.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/DownloadUtils.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/DownloadUtils.class new file mode 100644 index 0000000..7a25a0d Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/DownloadUtils.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileCharsetDetector$Observer.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileCharsetDetector$Observer.class new file mode 100644 index 0000000..3513a79 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileCharsetDetector$Observer.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileCharsetDetector.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileCharsetDetector.class new file mode 100644 index 0000000..28b034b Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileCharsetDetector.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileUtils.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileUtils.class new file mode 100644 index 0000000..9c23698 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/FileUtils.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/OfficeToPdf.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/OfficeToPdf.class new file mode 100644 index 0000000..818d88e Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/OfficeToPdf.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ShedulerClean.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ShedulerClean.class new file mode 100644 index 0000000..f787a1e Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ShedulerClean.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/SimTextUtil.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/SimTextUtil.class new file mode 100644 index 0000000..63b176d Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/SimTextUtil.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$1.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$1.class new file mode 100644 index 0000000..d16a5d9 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$1.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$FileNode.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$FileNode.class new file mode 100644 index 0000000..7bede8d Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$FileNode.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$RarExtractorWorker.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$RarExtractorWorker.class new file mode 100644 index 0000000..f112976 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$RarExtractorWorker.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$ZipExtractorWorker.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$ZipExtractorWorker.class new file mode 100644 index 0000000..a14dcaf Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader$ZipExtractorWorker.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader.class b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader.class new file mode 100644 index 0000000..82e1ddc Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/utils/ZipReader.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/FileController.class b/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/FileController.class new file mode 100644 index 0000000..73fd3c1 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/FileController.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/IndexController.class b/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/IndexController.class new file mode 100644 index 0000000..6ef0019 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/IndexController.class differ diff --git a/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/OnlinePreviewController.class b/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/OnlinePreviewController.class new file mode 100644 index 0000000..a34b7c9 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/cn/keking/web/controller/OnlinePreviewController.class differ diff --git a/release/file-preview-service/WEB-INF/classes/logs/app.log b/release/file-preview-service/WEB-INF/classes/logs/app.log new file mode 100644 index 0000000..74b8e83 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/logs/app.log @@ -0,0 +1,47 @@ +2019-04-24 02:32:02.665 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.keking.FilePreviewApplicationTests], using SpringBootContextLoader +2019-04-24 02:32:02.884 INFO --- [main] o.s.t.c.support.AbstractContextLoader : Could not detect default resource locations for test class [cn.keking.FilePreviewApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}. +2019-04-24 02:32:02.971 INFO --- [main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [cn.keking.FilePreviewApplicationTests]: FilePreviewApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration. +2019-04-24 02:32:04.582 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration cn.keking.FilePreviewApplication for test class cn.keking.FilePreviewApplicationTests +2019-04-24 02:32:07.904 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2019-04-24 02:32:08.204 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Could not instantiate TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/transaction/interceptor/TransactionAttributeSource] +2019-04-24 02:32:08.618 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Could not instantiate TestExecutionListener [org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/transaction/interceptor/TransactionAttribute] +2019-04-24 02:32:09.001 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@5562c41e, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@32ee6fee, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@4d0f2471, org.springframework.test.context.support.DirtiesContextTestExecutionListener@7133da86, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@3232a28a, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@73e22a3d, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@47faa49c, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@28f2a10f, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@f736069, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@6da21078] +2019-04-24 02:32:10.436 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.keking.FilePreviewApplicationTests], using SpringBootContextLoader +2019-04-24 02:32:10.508 INFO --- [main] o.s.t.c.support.AbstractContextLoader : Could not detect default resource locations for test class [cn.keking.FilePreviewApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}. +2019-04-24 02:32:10.812 INFO --- [main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [cn.keking.FilePreviewApplicationTests]: FilePreviewApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration. +2019-04-24 02:32:11.967 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration cn.keking.FilePreviewApplication for test class cn.keking.FilePreviewApplicationTests +2019-04-24 02:32:12.214 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] +2019-04-24 02:32:12.838 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Could not instantiate TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/transaction/interceptor/TransactionAttributeSource] +2019-04-24 02:32:13.420 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Could not instantiate TestExecutionListener [org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/transaction/interceptor/TransactionAttribute] +2019-04-24 02:32:13.426 INFO --- [main] .b.t.c.SpringBootTestContextBootstrapper : Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@4803b726, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@ffaa6af, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@53ce1329, org.springframework.test.context.support.DirtiesContextTestExecutionListener@316bcf94, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@6404f418, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@3e11f9e9, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@1de5f259, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@729d991e, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@31fa1761, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@957e06] +2019-04-24 02:32:17.515 INFO 10960 --- [main] cn.keking.FilePreviewApplicationTests : Starting FilePreviewApplicationTests on cxx with PID 10960 (started by cxx in C:\Users\cxx\Desktop\file-online-preview\jodconverter-web) +2019-04-24 02:32:17.518 INFO 10960 --- [main] cn.keking.FilePreviewApplicationTests : The following profiles are active: window +2019-04-24 02:32:17.627 INFO 10960 --- [main] o.s.w.c.s.GenericWebApplicationContext : Refreshing org.springframework.web.context.support.GenericWebApplicationContext@4b7dc788: startup date [Wed Apr 24 02:32:17 CST 2019]; root of context hierarchy +2019-04-24 02:32:25.636 INFO 10960 --- [main] org.redisson.Version : Redisson 3.2.0 +2019-04-24 02:32:26.013 INFO 10960 --- [nioEventLoopGroup-2-5] o.r.c.pool.MasterConnectionPool : 10 connections initialized for /60.205.212.196:6379 +2019-04-24 02:32:26.015 INFO 10960 --- [nioEventLoopGroup-2-7] o.r.c.pool.SinglePubSubConnectionPool : 1 connections initialized for /60.205.212.196:6379 +2019-04-24 02:32:26.092 INFO 10960 --- [main] cn.keking.service.FileConverQueueTask : дļת +2019-04-24 02:32:26.255 INFO 10960 --- [main] o.a.j.office.ProcessPoolOfficeManager : ProcessManager implementation is PureJavaProcessManager +2019-04-24 02:32:26.300 WARN 10960 --- [OfficeProcessThread-0] o.a.jodconverter.office.OfficeProcess : profile dir 'C:\Users\cxx\AppData\Local\Temp\.jodconverter_socket_host-127.0.0.1_port-8100' already exists; deleting +2019-04-24 02:32:27.527 INFO 10960 --- [OfficeProcessThread-0] o.a.jodconverter.office.OfficeProcess : starting process with acceptString 'socket,host=127.0.0.1,port=8100,tcpNoDelay=1' and profileDir 'C:\Users\cxx\AppData\Local\Temp\.jodconverter_socket_host-127.0.0.1_port-8100' +2019-04-24 02:32:27.635 INFO 10960 --- [OfficeProcessThread-0] o.a.jodconverter.office.OfficeProcess : started process +2019-04-24 02:32:31.902 INFO 10960 --- [OfficeProcessThread-0] o.a.j.office.OfficeConnection : connected: 'socket,host=127.0.0.1,port=8100,tcpNoDelay=1' +2019-04-24 02:32:33.620 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@4b7dc788: startup date [Wed Apr 24 02:32:17 CST 2019]; root of context hierarchy +2019-04-24 02:32:33.851 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/listFiles],methods=[GET]}" onto public java.lang.String cn.keking.web.controller.FileController.getFiles() throws com.fasterxml.jackson.core.JsonProcessingException +2019-04-24 02:32:33.856 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/deleteFile],methods=[GET]}" onto public java.lang.String cn.keking.web.controller.FileController.deleteFile(java.lang.String) throws com.fasterxml.jackson.core.JsonProcessingException +2019-04-24 02:32:33.898 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/fileUpload],methods=[POST]}" onto public java.lang.String cn.keking.web.controller.FileController.fileUpload(org.springframework.web.multipart.MultipartFile,javax.servlet.http.HttpServletRequest) throws com.fasterxml.jackson.core.JsonProcessingException +2019-04-24 02:32:33.906 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public java.lang.String cn.keking.web.controller.IndexController.root() +2019-04-24 02:32:33.908 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/index],methods=[GET]}" onto public java.lang.String cn.keking.web.controller.IndexController.go2Index() +2019-04-24 02:32:33.916 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/onlinePreview],methods=[GET]}" onto public java.lang.String cn.keking.web.controller.OnlinePreviewController.onlinePreview(java.lang.String,org.springframework.ui.Model,javax.servlet.http.HttpServletRequest) +2019-04-24 02:32:33.920 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/picturesPreview],methods=[POST]}" onto public java.lang.String cn.keking.web.controller.OnlinePreviewController.picturesPreview(org.springframework.ui.Model,javax.servlet.http.HttpServletRequest) throws java.io.UnsupportedEncodingException +2019-04-24 02:32:33.927 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/picturesPreview],methods=[GET]}" onto public java.lang.String cn.keking.web.controller.OnlinePreviewController.picturesPreview(java.lang.String,java.lang.String,org.springframework.ui.Model,javax.servlet.http.HttpServletRequest) throws java.io.UnsupportedEncodingException +2019-04-24 02:32:33.931 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/addTask],methods=[GET]}" onto public java.lang.String cn.keking.web.controller.OnlinePreviewController.addQueueTask(java.lang.String) +2019-04-24 02:32:33.933 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/getCorsFile],methods=[GET]}" onto public void cn.keking.web.controller.OnlinePreviewController.getCorsFile(java.lang.String,javax.servlet.http.HttpServletResponse) +2019-04-24 02:32:33.940 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) +2019-04-24 02:32:33.944 INFO 10960 --- [main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) +2019-04-24 02:32:34.013 INFO 10960 --- [main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2019-04-24 02:32:34.015 INFO 10960 --- [main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2019-04-24 02:32:34.169 INFO 10960 --- [main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] +2019-04-24 02:32:35.906 INFO 10960 --- [main] o.s.w.s.v.f.FreeMarkerConfigurer : ClassTemplateLoader for Spring macros added to FreeMarker configuration +2019-04-24 02:32:36.289 INFO 10960 --- [main] cn.keking.FilePreviewApplicationTests : Started FilePreviewApplicationTests in 21.439 seconds (JVM running for 37.176) +2019-04-24 02:32:36.400 INFO 10960 --- [Thread-3] o.s.w.c.s.GenericWebApplicationContext : Closing org.springframework.web.context.support.GenericWebApplicationContext@4b7dc788: startup date [Wed Apr 24 02:32:17 CST 2019]; root of context hierarchy diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/1_close.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/1_close.png new file mode 100644 index 0000000..68ccb3c Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/1_close.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/1_open.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/1_open.png new file mode 100644 index 0000000..d6ff36d Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/1_open.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/2.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/2.png new file mode 100644 index 0000000..9eff506 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/2.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/3.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/3.png new file mode 100644 index 0000000..d7ba6d0 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/3.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/4.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/4.png new file mode 100644 index 0000000..753e2bf Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/4.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/5.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/5.png new file mode 100644 index 0000000..0c5eccd Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/5.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/6.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/6.png new file mode 100644 index 0000000..070b835 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/6.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/7.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/7.png new file mode 100644 index 0000000..532b037 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/7.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/8.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/8.png new file mode 100644 index 0000000..a8f3a86 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/8.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/diy/9.png b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/9.png new file mode 100644 index 0000000..4db73cd Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/diy/9.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/line_conn.gif b/release/file-preview-service/WEB-INF/classes/static/css/img/line_conn.gif new file mode 100644 index 0000000..d561d36 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/line_conn.gif differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/loading.gif b/release/file-preview-service/WEB-INF/classes/static/css/img/loading.gif new file mode 100644 index 0000000..e8c2892 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/loading.gif differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/zTreeStandard.gif b/release/file-preview-service/WEB-INF/classes/static/css/img/zTreeStandard.gif new file mode 100644 index 0000000..50c94fd Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/zTreeStandard.gif differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/img/zTreeStandard.png b/release/file-preview-service/WEB-INF/classes/static/css/img/zTreeStandard.png new file mode 100644 index 0000000..ffda01e Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/css/img/zTreeStandard.png differ diff --git a/release/file-preview-service/WEB-INF/classes/static/css/loading.css b/release/file-preview-service/WEB-INF/classes/static/css/loading.css new file mode 100644 index 0000000..771a6d8 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/css/loading.css @@ -0,0 +1,121 @@ +.loading_container{ + margin:0; + padding:0; + position: absolute; + left:0; + top:0; + width:100%; + display: none; + opacity: 0.5; + background-color: black; +} +.spinner { + margin: 245px auto; + width: 60px; + height: 60px; + position: relative; +} + +.container1 > div, .container2 > div, .container3 > div { + width: 16px; + height: 16px; + background-color: #67CF22; + + border-radius: 100%; + position: absolute; + -webkit-animation: bouncedelay 1.2s infinite ease-in-out; + animation: bouncedelay 1.2s infinite ease-in-out; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +.spinner .spinner-container { + position: absolute; + width: 100%; + height: 100%; +} + +.container2 { + -webkit-transform: rotateZ(45deg); + transform: rotateZ(45deg); +} + +.container3 { + -webkit-transform: rotateZ(90deg); + transform: rotateZ(90deg); +} + +.circle1 { top: 0; left: 0; } +.circle2 { top: 0; right: 0; } +.circle3 { right: 0; bottom: 0; } +.circle4 { left: 0; bottom: 0; } + +.container2 .circle1 { + -webkit-animation-delay: -1.1s; + animation-delay: -1.1s; +} + +.container3 .circle1 { + -webkit-animation-delay: -1.0s; + animation-delay: -1.0s; +} + +.container1 .circle2 { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} + +.container2 .circle2 { + -webkit-animation-delay: -0.8s; + animation-delay: -0.8s; +} + +.container3 .circle2 { + -webkit-animation-delay: -0.7s; + animation-delay: -0.7s; +} + +.container1 .circle3 { + -webkit-animation-delay: -0.6s; + animation-delay: -0.6s; +} + +.container2 .circle3 { + -webkit-animation-delay: -0.5s; + animation-delay: -0.5s; +} + +.container3 .circle3 { + -webkit-animation-delay: -0.4s; + animation-delay: -0.4s; +} + +.container1 .circle4 { + -webkit-animation-delay: -0.3s; + animation-delay: -0.3s; +} + +.container2 .circle4 { + -webkit-animation-delay: -0.2s; + animation-delay: -0.2s; +} + +.container3 .circle4 { + -webkit-animation-delay: -0.1s; + animation-delay: -0.1s; +} + +@-webkit-keyframes bouncedelay { + 0%, 80%, 100% { -webkit-transform: scale(0.0) } + 40% { -webkit-transform: scale(1.0) } +} + +@keyframes bouncedelay { + 0%, 80%, 100% { + transform: scale(0.0); + -webkit-transform: scale(0.0); + } 40% { + transform: scale(1.0); + -webkit-transform: scale(1.0); + } +} \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/static/css/viewer.min.css b/release/file-preview-service/WEB-INF/classes/static/css/viewer.min.css new file mode 100644 index 0000000..10f7a63 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/css/viewer.min.css @@ -0,0 +1,9 @@ +/*! + * Viewer.js v0.3.1 + * https://github.com/fengyuanchen/viewerjs + * + * Copyright (c) 2015-2016 Fengyuan Chen + * Released under the MIT license + * + * Date: 2016-02-02T11:35:36.273Z + */.viewer-container,.viewer-navbar{background-color:#000;overflow:hidden}.viewer-canvas,.viewer-container,.viewer-footer,.viewer-player{right:0;bottom:0;left:0}.viewer-button,.viewer-canvas,.viewer-container,.viewer-footer,.viewer-list,.viewer-navbar,.viewer-open,.viewer-title,.viewer-toolbar,.viewer-toolbar>li{overflow:hidden}.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{font-size:0;line-height:0;display:block;width:20px;height:20px;color:transparent;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X0au/3HgN9P4LFCjIANOJdrLr0zzZ+BEpNYDwKbpnQMeAw4m8HjQtM6Z9qa917zPQwFr3M5KgA6J5rTJCdFZJj9/lyvGhsDvwFNVuV2MhhjrK6b9bFiE+j1r87eBl4HDwCF7/U/k+ofAX5b/EXBv5JoLMuILzf3Ap6Z3EzgdqHMCuF7hcQf4HDgeoHnccncqdK/TvSDWffFXI/exICY/xZyqc6XLWF1UFZna4gJ7q8BsRvgd2/xXpo6P+D9dfT7PpECtA3cnWPM0GXGFZh/wgWltA+cDNC7X+AP4GzjZQe+k5dRxuYPeiuXU7e1qwLpDz7dFjXKRaSwuMLvAlG8zZlG+YmiK1HoFqT7wP2z+4Q45TfEGcMt01xLoNZEBTwRqD4BLpnMLeC1A41UmVxsXgXeBayV/Wx20rpTyrpnWRft7p6O/FdqzGrDukPNtkaMoMo3FBdBSQMOnYBCReyf05s126fU9ytfX98+mY54Kxnp7S9K3kj6U9KYdG0h6UdLbkh7poFXMfUnSOyVvL0h6VtIXHbS6nOP+s/Zm9mvyXW1uuC9ohZ72E9uDmXWLJOB1GxsH+DxPftsB8B6wlGDN02TAkxG6+4D3TWsbeC5CS8CDFce+AW500LhhOW2020TRjK3b21HEmgti9m0RonxbdMZeVzV+/4tF3cBpP7E9mKHNL5q8h5g0eYsCMQz0epq8gQrwMXAgcs0FGXGFRcB9wCemF9PkbYqM/Bas7fxLwNeJPdTdpo4itQti8lPMqTpXuozVRVXPpbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC);background-repeat:no-repeat}.viewer-zoom-in:before{content:'Zoom In';background-position:0 0}.viewer-zoom-out:before{content:'Zoom Out';background-position:-20px 0}.viewer-one-to-one:before{content:'One to One';background-position:-40px 0}.viewer-reset:before{content:'Reset';background-position:-60px 0}.viewer-prev:before{content:'Previous';background-position:-80px 0}.viewer-play:before{content:'Play';background-position:-100px 0}.viewer-next:before{content:'Next';background-position:-120px 0}.viewer-rotate-left:before{content:'Rotate Left';background-position:-140px 0}.viewer-rotate-right:before{content:'Rotate Right';background-position:-160px 0}.viewer-flip-horizontal:before{content:'Flip Horizontal';background-position:-180px 0}.viewer-flip-vertical:before{content:'Flip Vertical';background-position:-200px 0}.viewer-fullscreen:before{content:'Enter Full Screen';background-position:-220px 0}.viewer-fullscreen-exit:before{content:'Exit Full Screen';background-position:-240px 0}.viewer-close:before{content:'Close';background-position:-260px 0}.viewer-container{font-size:0;line-height:0;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:rgba(0,0,0,.5);direction:ltr!important;-ms-touch-action:none;touch-action:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.viewer-container ::-moz-selection,.viewer-container::-moz-selection{background-color:transparent}.viewer-container ::selection,.viewer-container::selection{background-color:transparent}.viewer-container img{display:block;width:100%;min-width:0!important;max-width:none!important;height:auto;min-height:0!important;max-height:none!important}.viewer-player,.viewer-tooltip{display:none;position:absolute}.viewer-canvas{position:absolute;top:0}.viewer-canvas>img{width:auto;max-width:90%!important;height:auto;margin:15px auto}.viewer-footer{position:absolute;text-align:center}.viewer-navbar{background-color:rgba(0,0,0,.5)}.viewer-list{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:50px;margin:0;padding:1px 0}.viewer-list>li{font-size:0;line-height:0;float:left;overflow:hidden;width:30px;height:50px;cursor:pointer;opacity:.5;color:transparent;filter:alpha(opacity=50)}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-active{opacity:1;filter:alpha(opacity=100)}.viewer-player{top:0;cursor:none;background-color:#000}.viewer-player>img{position:absolute;top:0;left:0}.viewer-toolbar{width:280px;margin:0 auto 5px;padding:3px 0}.viewer-toolbar>li{float:left;width:24px;height:24px;cursor:pointer;border-radius:50%;background-color:#000;background-color:rgba(0,0,0,.5)}.viewer-toolbar>li:hover{background-color:#000;background-color:rgba(0,0,0,.8)}.viewer-toolbar>li:before{margin:2px}.viewer-toolbar>li+li{margin-left:1px}.viewer-toolbar>.viewer-play{width:30px;height:30px;margin-top:-3px;margin-bottom:-3px}.viewer-toolbar>.viewer-play:before{margin:5px}.viewer-tooltip{font-size:12px;line-height:20px;top:50%;left:50%;width:50px;height:20px;margin-top:-10px;margin-left:-25px;text-align:center;color:#fff;border-radius:10px;background-color:#000;background-color:rgba(0,0,0,.8)}.viewer-title{font-size:12px;line-height:1;display:inline-block;max-width:90%;margin:0 5% 5px;white-space:nowrap;text-overflow:ellipsis;opacity:.8;color:#ccc;filter:alpha(opacity=80)}.viewer-title:hover{opacity:1;filter:alpha(opacity=100)}.viewer-button{position:absolute;top:-40px;right:-40px;width:80px;height:80px;cursor:pointer;border-radius:50%;background-color:#000;background-color:rgba(0,0,0,.5)}.viewer-button:before{position:absolute;bottom:15px;left:15px}.viewer-fixed{position:fixed}.viewer-show{display:block}.viewer-hide{display:none}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.viewer-fade{opacity:0;filter:alpha(opacity=0)}.viewer-in{opacity:1;filter:alpha(opacity=100)}.viewer-transition{-webkit-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}} \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/static/css/zTreeStyle.css b/release/file-preview-service/WEB-INF/classes/static/css/zTreeStyle.css new file mode 100644 index 0000000..4a1705b --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/css/zTreeStyle.css @@ -0,0 +1,97 @@ +/*------------------------------------- +zTree Style + +version: 3.5.19 +author: Hunter.z +email: hunter.z@263.net +website: http://code.google.com/p/jquerytree/ + +-------------------------------------*/ + +.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} +.ztree {margin:0; padding:5px; color:#333} +.ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} +.ztree li ul{ margin:0; padding:0 0 0 18px} +.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;} + +.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; + text-decoration:none; vertical-align:top; display: inline-block} +.ztree li a:hover {text-decoration:underline} +.ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} +.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} +.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; + opacity:0.8; filter:alpha(opacity=80)} +.ztree li a.tmpTargetNode_prev {} +.ztree li a.tmpTargetNode_next {} +.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; + font-size:12px; border:1px #7EC4CC solid; *border:0px} +.ztree li span {line-height:16px; margin-right:2px} +.ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; + border:0 none; cursor: pointer;outline:none; + background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; + background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} + +.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} +.ztree li span.button.chk.checkbox_false_full {background-position:0 0} +.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} +.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} +.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} +.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} +.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} +.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} +.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} +.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} +.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} +.ztree li span.button.chk.radio_false_full {background-position:-28px 0} +.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} +.ztree li span.button.chk.radio_false_part {background-position:-28px -28px} +.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} +.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} +.ztree li span.button.chk.radio_true_full {background-position:-42px 0} +.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} +.ztree li span.button.chk.radio_true_part {background-position:-42px -28px} +.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} +.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} + +.ztree li span.button.switch {width:18px; height:18px} +.ztree li span.button.root_open{background-position:-92px -54px} +.ztree li span.button.root_close{background-position:-74px -54px} +.ztree li span.button.roots_open{background-position:-92px 0} +.ztree li span.button.roots_close{background-position:-74px 0} +.ztree li span.button.center_open{background-position:-92px -18px} +.ztree li span.button.center_close{background-position:-74px -18px} +.ztree li span.button.bottom_open{background-position:-92px -36px} +.ztree li span.button.bottom_close{background-position:-74px -36px} +.ztree li span.button.noline_open{background-position:-92px -72px} +.ztree li span.button.noline_close{background-position:-74px -72px} +.ztree li span.button.root_docu{ background:none;} +.ztree li span.button.roots_docu{background-position:-56px 0} +.ztree li span.button.center_docu{background-position:-56px -18px} +.ztree li span.button.bottom_docu{background-position:-56px -36px} +.ztree li span.button.noline_docu{ background:none;} + +.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} +.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} +.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} +.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} +.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} + +.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} + +ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} + +span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; + background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; + background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} + +ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} +.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} + +/* level style*/ +/*.ztree li span.button.level0 { + display:none; +} +.ztree li ul.level0 { + padding:0; + background:none; +}*/ \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/static/images/sorry.jpg b/release/file-preview-service/WEB-INF/classes/static/images/sorry.jpg new file mode 100644 index 0000000..03c9dd3 Binary files /dev/null and b/release/file-preview-service/WEB-INF/classes/static/images/sorry.jpg differ diff --git a/release/file-preview-service/WEB-INF/classes/static/js/excel.header.js b/release/file-preview-service/WEB-INF/classes/static/js/excel.header.js new file mode 100644 index 0000000..8852d1f --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/js/excel.header.js @@ -0,0 +1,19 @@ +/**创建一个div并固定在底部,将center中的所有a标签放在改div中**/ +$("body").append($("
").css({"width":"100%","height":"30px","position":"fixed","top":"0","left":"0" + ,"background-color":"rgba(53, 53, 53, 1)","line-height":"30px","font-size":"13px"}).attr("id","excel-header-nav")); +$("center").css("display", "none"); +var centerChildrenA = $("center").children("a"); +if (centerChildrenA.length === 0) { + $("#excel-header-nav").hide(); +} +$(centerChildrenA).each(function (a, b) { + // 获取a标签对应的target的name值,并设置name对应标签的样式以避免锚点标签标题被覆盖 + var href = $(b).attr("href"); + var name = href.substr(1); + console.log(href + ":" + name); + $("[name=" + name + "]").css({"display":"block","padding-top":"14.01px"}); + $(b).css({"padding":"5px","border-right":"1px solid white","color":"#f9f9f9"}); + $("#excel-header-nav").append(b); +}); +/**给所有的table添加class=table table-striped样式**/ +$("table").addClass("table table-striped"); \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/static/js/jquery-3.0.0.min.js b/release/file-preview-service/WEB-INF/classes/static/js/jquery-3.0.0.min.js new file mode 100644 index 0000000..62d410d --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/js/jquery-3.0.0.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.0.0 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.0.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return a&&"[object Object]"===k.call(a)?(b=e(a))?(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n):!0:!1},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;d>f;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;return"string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a)?(d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e):void 0},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"===c||r.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\x00-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\x00"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[0>c?c+b:c]}),even:pa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,e>i&&ya(a.slice(i,e)),f>e&&ya(a=a.slice(e)),f>e&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;d>b;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;d>b;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(f>b)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(1>=b&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){ +return j.call(r(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthf;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;g>f;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;d>c;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;o>n;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;cc;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;m>l;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;i>l;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;e>d;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;e>d;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),0>=d||null==d){if(d=Ma(a,b,f),(0>d||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){return c?!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)}):void 0},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){return b?(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;e>g;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);g>f;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;e>d;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c); +}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){return r.isArray(b)?a.checked=r.inArray(r(a).val(),b)>-1:void 0}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?r.event.trigger(a,b,c,!0):void 0}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",0>b&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;return o.cors||Pb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + + + + + + + +
+ +
+
+
+ + + +
+
+
+
+
+ + +
+
+ +
+ + + + +
+
+
+
+ +
+ +
+ +
+ +
+ + +
+
+ + + + + + + + + Current View + + +
+ + +
+
+
+ +
+ +
+ + + +
+
+
+
+
+
+
+
+
+
+ + + + + + + + +
+
+
+ + +
+ + + +
+
+ + + diff --git a/release/file-preview-service/WEB-INF/classes/static/pdfjs/web/viewer.js b/release/file-preview-service/WEB-INF/classes/static/pdfjs/web/viewer.js new file mode 100644 index 0000000..10a91c7 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/pdfjs/web/viewer.js @@ -0,0 +1,10486 @@ +/* Copyright 2017 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 8); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.waitOnEventOrTimeout = exports.WaitOnType = exports.localized = exports.animationStarted = exports.normalizeWheelEventDelta = exports.binarySearchFirstItem = exports.watchScroll = exports.scrollIntoView = exports.getOutputScale = exports.approximateFraction = exports.roundToDivide = exports.getVisibleElements = exports.parseQueryString = exports.noContextMenuHandler = exports.getPDFFileNameFromURL = exports.ProgressBar = exports.EventBus = exports.NullL10n = exports.mozL10n = exports.RendererType = exports.PresentationModeState = exports.cloneObj = exports.isValidRotation = exports.VERTICAL_PADDING = exports.SCROLLBAR_PADDING = exports.MAX_AUTO_SCALE = exports.UNKNOWN_SCALE = exports.MAX_SCALE = exports.MIN_SCALE = exports.DEFAULT_SCALE = exports.DEFAULT_SCALE_VALUE = exports.CSS_UNITS = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var CSS_UNITS = 96.0 / 72.0; +var DEFAULT_SCALE_VALUE = 'auto'; +var DEFAULT_SCALE = 1.0; +var MIN_SCALE = 0.25; +var MAX_SCALE = 10.0; +var UNKNOWN_SCALE = 0; +var MAX_AUTO_SCALE = 1.25; +var SCROLLBAR_PADDING = 40; +var VERTICAL_PADDING = 5; +var PresentationModeState = { + UNKNOWN: 0, + NORMAL: 1, + CHANGING: 2, + FULLSCREEN: 3 +}; +var RendererType = { + CANVAS: 'canvas', + SVG: 'svg' +}; +function formatL10nValue(text, args) { + if (!args) { + return text; + } + return text.replace(/\{\{\s*(\w+)\s*\}\}/g, function (all, name) { + return name in args ? args[name] : '{{' + name + '}}'; + }); +} +var NullL10n = { + get: function get(property, args, fallback) { + return Promise.resolve(formatL10nValue(fallback, args)); + }, + translate: function translate(element) { + return Promise.resolve(); + } +}; +_pdfjsLib.PDFJS.disableFullscreen = _pdfjsLib.PDFJS.disableFullscreen === undefined ? false : _pdfjsLib.PDFJS.disableFullscreen; +_pdfjsLib.PDFJS.useOnlyCssZoom = _pdfjsLib.PDFJS.useOnlyCssZoom === undefined ? false : _pdfjsLib.PDFJS.useOnlyCssZoom; +_pdfjsLib.PDFJS.maxCanvasPixels = _pdfjsLib.PDFJS.maxCanvasPixels === undefined ? 16777216 : _pdfjsLib.PDFJS.maxCanvasPixels; +_pdfjsLib.PDFJS.disableHistory = _pdfjsLib.PDFJS.disableHistory === undefined ? false : _pdfjsLib.PDFJS.disableHistory; +_pdfjsLib.PDFJS.disableTextLayer = _pdfjsLib.PDFJS.disableTextLayer === undefined ? false : _pdfjsLib.PDFJS.disableTextLayer; +_pdfjsLib.PDFJS.ignoreCurrentPositionOnZoom = _pdfjsLib.PDFJS.ignoreCurrentPositionOnZoom === undefined ? false : _pdfjsLib.PDFJS.ignoreCurrentPositionOnZoom; +{ + _pdfjsLib.PDFJS.locale = _pdfjsLib.PDFJS.locale === undefined && typeof navigator !== 'undefined' ? navigator.language : _pdfjsLib.PDFJS.locale; +} +function getOutputScale(ctx) { + var devicePixelRatio = window.devicePixelRatio || 1; + var backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; + var pixelRatio = devicePixelRatio / backingStoreRatio; + return { + sx: pixelRatio, + sy: pixelRatio, + scaled: pixelRatio !== 1 + }; +} +function scrollIntoView(element, spot) { + var skipOverflowHiddenElements = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var parent = element.offsetParent; + if (!parent) { + console.error('offsetParent is not set -- cannot scroll'); + return; + } + var offsetY = element.offsetTop + element.clientTop; + var offsetX = element.offsetLeft + element.clientLeft; + while (parent.clientHeight === parent.scrollHeight || skipOverflowHiddenElements && getComputedStyle(parent).overflow === 'hidden') { + if (parent.dataset._scaleY) { + offsetY /= parent.dataset._scaleY; + offsetX /= parent.dataset._scaleX; + } + offsetY += parent.offsetTop; + offsetX += parent.offsetLeft; + parent = parent.offsetParent; + if (!parent) { + return; + } + } + if (spot) { + if (spot.top !== undefined) { + offsetY += spot.top; + } + if (spot.left !== undefined) { + offsetX += spot.left; + parent.scrollLeft = offsetX; + } + } + parent.scrollTop = offsetY; +} +function watchScroll(viewAreaElement, callback) { + var debounceScroll = function debounceScroll(evt) { + if (rAF) { + return; + } + rAF = window.requestAnimationFrame(function viewAreaElementScrolled() { + rAF = null; + var currentY = viewAreaElement.scrollTop; + var lastY = state.lastY; + if (currentY !== lastY) { + state.down = currentY > lastY; + } + state.lastY = currentY; + callback(state); + }); + }; + var state = { + down: true, + lastY: viewAreaElement.scrollTop, + _eventHandler: debounceScroll + }; + var rAF = null; + viewAreaElement.addEventListener('scroll', debounceScroll, true); + return state; +} +function parseQueryString(query) { + var parts = query.split('&'); + var params = Object.create(null); + for (var i = 0, ii = parts.length; i < ii; ++i) { + var param = parts[i].split('='); + var key = param[0].toLowerCase(); + var value = param.length > 1 ? param[1] : null; + params[decodeURIComponent(key)] = decodeURIComponent(value); + } + return params; +} +function binarySearchFirstItem(items, condition) { + var minIndex = 0; + var maxIndex = items.length - 1; + if (items.length === 0 || !condition(items[maxIndex])) { + return items.length; + } + if (condition(items[minIndex])) { + return minIndex; + } + while (minIndex < maxIndex) { + var currentIndex = minIndex + maxIndex >> 1; + var currentItem = items[currentIndex]; + if (condition(currentItem)) { + maxIndex = currentIndex; + } else { + minIndex = currentIndex + 1; + } + } + return minIndex; +} +function approximateFraction(x) { + if (Math.floor(x) === x) { + return [x, 1]; + } + var xinv = 1 / x; + var limit = 8; + if (xinv > limit) { + return [1, limit]; + } else if (Math.floor(xinv) === xinv) { + return [1, xinv]; + } + var x_ = x > 1 ? xinv : x; + var a = 0, + b = 1, + c = 1, + d = 1; + while (true) { + var p = a + c, + q = b + d; + if (q > limit) { + break; + } + if (x_ <= p / q) { + c = p; + d = q; + } else { + a = p; + b = q; + } + } + var result = void 0; + if (x_ - a / b < c / d - x_) { + result = x_ === x ? [a, b] : [b, a]; + } else { + result = x_ === x ? [c, d] : [d, c]; + } + return result; +} +function roundToDivide(x, div) { + var r = x % div; + return r === 0 ? x : Math.round(x - r + div); +} +function getVisibleElements(scrollEl, views) { + var sortByVisibility = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var top = scrollEl.scrollTop, + bottom = top + scrollEl.clientHeight; + var left = scrollEl.scrollLeft, + right = left + scrollEl.clientWidth; + function isElementBottomBelowViewTop(view) { + var element = view.div; + var elementBottom = element.offsetTop + element.clientTop + element.clientHeight; + return elementBottom > top; + } + var visible = [], + view = void 0, + element = void 0; + var currentHeight = void 0, + viewHeight = void 0, + hiddenHeight = void 0, + percentHeight = void 0; + var currentWidth = void 0, + viewWidth = void 0; + var firstVisibleElementInd = views.length === 0 ? 0 : binarySearchFirstItem(views, isElementBottomBelowViewTop); + for (var i = firstVisibleElementInd, ii = views.length; i < ii; i++) { + view = views[i]; + element = view.div; + currentHeight = element.offsetTop + element.clientTop; + viewHeight = element.clientHeight; + if (currentHeight > bottom) { + break; + } + currentWidth = element.offsetLeft + element.clientLeft; + viewWidth = element.clientWidth; + if (currentWidth + viewWidth < left || currentWidth > right) { + continue; + } + hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, currentHeight + viewHeight - bottom); + percentHeight = (viewHeight - hiddenHeight) * 100 / viewHeight | 0; + visible.push({ + id: view.id, + x: currentWidth, + y: currentHeight, + view: view, + percent: percentHeight + }); + } + var first = visible[0]; + var last = visible[visible.length - 1]; + if (sortByVisibility) { + visible.sort(function (a, b) { + var pc = a.percent - b.percent; + if (Math.abs(pc) > 0.001) { + return -pc; + } + return a.id - b.id; + }); + } + return { + first: first, + last: last, + views: visible + }; +} +function noContextMenuHandler(evt) { + evt.preventDefault(); +} +function isDataSchema(url) { + var i = 0, + ii = url.length; + while (i < ii && url[i].trim() === '') { + i++; + } + return url.substr(i, 5).toLowerCase() === 'data:'; +} +function getPDFFileNameFromURL(url) { + var defaultFilename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'document.pdf'; + + if (isDataSchema(url)) { + console.warn('getPDFFileNameFromURL: ' + 'ignoring "data:" URL for performance reasons.'); + return defaultFilename; + } + var reURI = /^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; + var reFilename = /[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i; + var splitURI = reURI.exec(url); + var suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]); + if (suggestedFilename) { + suggestedFilename = suggestedFilename[0]; + if (suggestedFilename.indexOf('%') !== -1) { + try { + suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0]; + } catch (ex) {} + } + } + return suggestedFilename || defaultFilename; +} +function normalizeWheelEventDelta(evt) { + var delta = Math.sqrt(evt.deltaX * evt.deltaX + evt.deltaY * evt.deltaY); + var angle = Math.atan2(evt.deltaY, evt.deltaX); + if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) { + delta = -delta; + } + var MOUSE_DOM_DELTA_PIXEL_MODE = 0; + var MOUSE_DOM_DELTA_LINE_MODE = 1; + var MOUSE_PIXELS_PER_LINE = 30; + var MOUSE_LINES_PER_PAGE = 30; + if (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) { + delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE; + } else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) { + delta /= MOUSE_LINES_PER_PAGE; + } + return delta; +} +function isValidRotation(angle) { + return Number.isInteger(angle) && angle % 90 === 0; +} +function cloneObj(obj) { + var result = Object.create(null); + for (var i in obj) { + if (Object.prototype.hasOwnProperty.call(obj, i)) { + result[i] = obj[i]; + } + } + return result; +} +var WaitOnType = { + EVENT: 'event', + TIMEOUT: 'timeout' +}; +function waitOnEventOrTimeout(_ref) { + var target = _ref.target, + name = _ref.name, + _ref$delay = _ref.delay, + delay = _ref$delay === undefined ? 0 : _ref$delay; + + if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) !== 'object' || !(name && typeof name === 'string') || !(Number.isInteger(delay) && delay >= 0)) { + return Promise.reject(new Error('waitOnEventOrTimeout - invalid paramaters.')); + } + var capability = (0, _pdfjsLib.createPromiseCapability)(); + function handler(type) { + if (target instanceof EventBus) { + target.off(name, eventHandler); + } else { + target.removeEventListener(name, eventHandler); + } + if (timeout) { + clearTimeout(timeout); + } + capability.resolve(type); + } + var eventHandler = handler.bind(null, WaitOnType.EVENT); + if (target instanceof EventBus) { + target.on(name, eventHandler); + } else { + target.addEventListener(name, eventHandler); + } + var timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT); + var timeout = setTimeout(timeoutHandler, delay); + return capability.promise; +} +var animationStarted = new Promise(function (resolve) { + window.requestAnimationFrame(resolve); +}); +var mozL10n = void 0; +var localized = Promise.resolve(); + +var EventBus = function () { + function EventBus() { + _classCallCheck(this, EventBus); + + this._listeners = Object.create(null); + } + + _createClass(EventBus, [{ + key: 'on', + value: function on(eventName, listener) { + var eventListeners = this._listeners[eventName]; + if (!eventListeners) { + eventListeners = []; + this._listeners[eventName] = eventListeners; + } + eventListeners.push(listener); + } + }, { + key: 'off', + value: function off(eventName, listener) { + var eventListeners = this._listeners[eventName]; + var i = void 0; + if (!eventListeners || (i = eventListeners.indexOf(listener)) < 0) { + return; + } + eventListeners.splice(i, 1); + } + }, { + key: 'dispatch', + value: function dispatch(eventName) { + var eventListeners = this._listeners[eventName]; + if (!eventListeners || eventListeners.length === 0) { + return; + } + var args = Array.prototype.slice.call(arguments, 1); + eventListeners.slice(0).forEach(function (listener) { + listener.apply(null, args); + }); + } + }]); + + return EventBus; +}(); + +function clamp(v, min, max) { + return Math.min(Math.max(v, min), max); +} + +var ProgressBar = function () { + function ProgressBar(id) { + var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + height = _ref2.height, + width = _ref2.width, + units = _ref2.units; + + _classCallCheck(this, ProgressBar); + + this.visible = true; + this.div = document.querySelector(id + ' .progress'); + this.bar = this.div.parentNode; + this.height = height || 100; + this.width = width || 100; + this.units = units || '%'; + this.div.style.height = this.height + this.units; + this.percent = 0; + } + + _createClass(ProgressBar, [{ + key: '_updateBar', + value: function _updateBar() { + if (this._indeterminate) { + this.div.classList.add('indeterminate'); + this.div.style.width = this.width + this.units; + return; + } + this.div.classList.remove('indeterminate'); + var progressSize = this.width * this._percent / 100; + this.div.style.width = progressSize + this.units; + } + }, { + key: 'setWidth', + value: function setWidth(viewer) { + if (!viewer) { + return; + } + var container = viewer.parentNode; + var scrollbarWidth = container.offsetWidth - viewer.offsetWidth; + if (scrollbarWidth > 0) { + this.bar.setAttribute('style', 'width: calc(100% - ' + scrollbarWidth + 'px);'); + } + } + }, { + key: 'hide', + value: function hide() { + if (!this.visible) { + return; + } + this.visible = false; + this.bar.classList.add('hidden'); + document.body.classList.remove('loadingInProgress'); + } + }, { + key: 'show', + value: function show() { + if (this.visible) { + return; + } + this.visible = true; + document.body.classList.add('loadingInProgress'); + this.bar.classList.remove('hidden'); + } + }, { + key: 'percent', + get: function get() { + return this._percent; + }, + set: function set(val) { + this._indeterminate = isNaN(val); + this._percent = clamp(val, 0, 100); + this._updateBar(); + } + }]); + + return ProgressBar; +}(); + +exports.CSS_UNITS = CSS_UNITS; +exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE; +exports.DEFAULT_SCALE = DEFAULT_SCALE; +exports.MIN_SCALE = MIN_SCALE; +exports.MAX_SCALE = MAX_SCALE; +exports.UNKNOWN_SCALE = UNKNOWN_SCALE; +exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE; +exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING; +exports.VERTICAL_PADDING = VERTICAL_PADDING; +exports.isValidRotation = isValidRotation; +exports.cloneObj = cloneObj; +exports.PresentationModeState = PresentationModeState; +exports.RendererType = RendererType; +exports.mozL10n = mozL10n; +exports.NullL10n = NullL10n; +exports.EventBus = EventBus; +exports.ProgressBar = ProgressBar; +exports.getPDFFileNameFromURL = getPDFFileNameFromURL; +exports.noContextMenuHandler = noContextMenuHandler; +exports.parseQueryString = parseQueryString; +exports.getVisibleElements = getVisibleElements; +exports.roundToDivide = roundToDivide; +exports.approximateFraction = approximateFraction; +exports.getOutputScale = getOutputScale; +exports.scrollIntoView = scrollIntoView; +exports.watchScroll = watchScroll; +exports.binarySearchFirstItem = binarySearchFirstItem; +exports.normalizeWheelEventDelta = normalizeWheelEventDelta; +exports.animationStarted = animationStarted; +exports.localized = localized; +exports.WaitOnType = WaitOnType; +exports.waitOnEventOrTimeout = waitOnEventOrTimeout; + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var pdfjsLib; +if (typeof window !== 'undefined' && window['pdfjs-dist/build/pdf']) { + pdfjsLib = window['pdfjs-dist/build/pdf']; +} else { + pdfjsLib = require('../build/pdf.js'); +} +module.exports = pdfjsLib; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getGlobalEventBus = exports.attachDOMEventsToEventBus = undefined; + +var _ui_utils = __webpack_require__(0); + +function attachDOMEventsToEventBus(eventBus) { + eventBus.on('documentload', function () { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('documentload', true, true, {}); + window.dispatchEvent(event); + }); + eventBus.on('pagerendered', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('pagerendered', true, true, { + pageNumber: evt.pageNumber, + cssTransform: evt.cssTransform + }); + evt.source.div.dispatchEvent(event); + }); + eventBus.on('textlayerrendered', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('textlayerrendered', true, true, { pageNumber: evt.pageNumber }); + evt.source.textLayerDiv.dispatchEvent(event); + }); + eventBus.on('pagechange', function (evt) { + var event = document.createEvent('UIEvents'); + event.initUIEvent('pagechange', true, true, window, 0); + event.pageNumber = evt.pageNumber; + evt.source.container.dispatchEvent(event); + }); + eventBus.on('pagesinit', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('pagesinit', true, true, null); + evt.source.container.dispatchEvent(event); + }); + eventBus.on('pagesloaded', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('pagesloaded', true, true, { pagesCount: evt.pagesCount }); + evt.source.container.dispatchEvent(event); + }); + eventBus.on('scalechange', function (evt) { + var event = document.createEvent('UIEvents'); + event.initUIEvent('scalechange', true, true, window, 0); + event.scale = evt.scale; + event.presetValue = evt.presetValue; + evt.source.container.dispatchEvent(event); + }); + eventBus.on('updateviewarea', function (evt) { + var event = document.createEvent('UIEvents'); + event.initUIEvent('updateviewarea', true, true, window, 0); + event.location = evt.location; + evt.source.container.dispatchEvent(event); + }); + eventBus.on('find', function (evt) { + if (evt.source === window) { + return; + } + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('find' + evt.type, true, true, { + query: evt.query, + phraseSearch: evt.phraseSearch, + caseSensitive: evt.caseSensitive, + highlightAll: evt.highlightAll, + findPrevious: evt.findPrevious + }); + window.dispatchEvent(event); + }); + eventBus.on('attachmentsloaded', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('attachmentsloaded', true, true, { attachmentsCount: evt.attachmentsCount }); + evt.source.container.dispatchEvent(event); + }); + eventBus.on('sidebarviewchanged', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('sidebarviewchanged', true, true, { view: evt.view }); + evt.source.outerContainer.dispatchEvent(event); + }); + eventBus.on('pagemode', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('pagemode', true, true, { mode: evt.mode }); + evt.source.pdfViewer.container.dispatchEvent(event); + }); + eventBus.on('namedaction', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('namedaction', true, true, { action: evt.action }); + evt.source.pdfViewer.container.dispatchEvent(event); + }); + eventBus.on('presentationmodechanged', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('presentationmodechanged', true, true, { + active: evt.active, + switchInProgress: evt.switchInProgress + }); + window.dispatchEvent(event); + }); + eventBus.on('outlineloaded', function (evt) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('outlineloaded', true, true, { outlineCount: evt.outlineCount }); + evt.source.container.dispatchEvent(event); + }); +} +var globalEventBus = null; +function getGlobalEventBus() { + if (globalEventBus) { + return globalEventBus; + } + globalEventBus = new _ui_utils.EventBus(); + attachDOMEventsToEventBus(globalEventBus); + return globalEventBus; +} +exports.attachDOMEventsToEventBus = attachDOMEventsToEventBus; +exports.getGlobalEventBus = getGlobalEventBus; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var CLEANUP_TIMEOUT = 30000; +var RenderingStates = { + INITIAL: 0, + RUNNING: 1, + PAUSED: 2, + FINISHED: 3 +}; + +var PDFRenderingQueue = function () { + function PDFRenderingQueue() { + _classCallCheck(this, PDFRenderingQueue); + + this.pdfViewer = null; + this.pdfThumbnailViewer = null; + this.onIdle = null; + this.highestPriorityPage = null; + this.idleTimeout = null; + this.printing = false; + this.isThumbnailViewEnabled = false; + } + + _createClass(PDFRenderingQueue, [{ + key: "setViewer", + value: function setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + }, { + key: "setThumbnailViewer", + value: function setThumbnailViewer(pdfThumbnailViewer) { + this.pdfThumbnailViewer = pdfThumbnailViewer; + } + }, { + key: "isHighestPriority", + value: function isHighestPriority(view) { + return this.highestPriorityPage === view.renderingId; + } + }, { + key: "renderHighestPriority", + value: function renderHighestPriority(currentlyVisiblePages) { + if (this.idleTimeout) { + clearTimeout(this.idleTimeout); + this.idleTimeout = null; + } + if (this.pdfViewer.forceRendering(currentlyVisiblePages)) { + return; + } + if (this.pdfThumbnailViewer && this.isThumbnailViewEnabled) { + if (this.pdfThumbnailViewer.forceRendering()) { + return; + } + } + if (this.printing) { + return; + } + if (this.onIdle) { + this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT); + } + } + }, { + key: "getHighestPriority", + value: function getHighestPriority(visible, views, scrolledDown) { + var visibleViews = visible.views; + var numVisible = visibleViews.length; + if (numVisible === 0) { + return false; + } + for (var i = 0; i < numVisible; ++i) { + var view = visibleViews[i].view; + if (!this.isViewFinished(view)) { + return view; + } + } + if (scrolledDown) { + var nextPageIndex = visible.last.id; + if (views[nextPageIndex] && !this.isViewFinished(views[nextPageIndex])) { + return views[nextPageIndex]; + } + } else { + var previousPageIndex = visible.first.id - 2; + if (views[previousPageIndex] && !this.isViewFinished(views[previousPageIndex])) { + return views[previousPageIndex]; + } + } + return null; + } + }, { + key: "isViewFinished", + value: function isViewFinished(view) { + return view.renderingState === RenderingStates.FINISHED; + } + }, { + key: "renderView", + value: function renderView(view) { + var _this = this; + + switch (view.renderingState) { + case RenderingStates.FINISHED: + return false; + case RenderingStates.PAUSED: + this.highestPriorityPage = view.renderingId; + view.resume(); + break; + case RenderingStates.RUNNING: + this.highestPriorityPage = view.renderingId; + break; + case RenderingStates.INITIAL: + this.highestPriorityPage = view.renderingId; + var continueRendering = function continueRendering() { + _this.renderHighestPriority(); + }; + view.draw().then(continueRendering, continueRendering); + break; + } + return true; + } + }]); + + return PDFRenderingQueue; +}(); + +exports.RenderingStates = RenderingStates; +exports.PDFRenderingQueue = PDFRenderingQueue; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFPrintServiceFactory = exports.DefaultExternalServices = exports.PDFViewerApplication = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _ui_utils = __webpack_require__(0); + +var _pdfjsLib = __webpack_require__(1); + +var _pdf_cursor_tools = __webpack_require__(6); + +var _pdf_rendering_queue = __webpack_require__(3); + +var _pdf_sidebar = __webpack_require__(10); + +var _dom_events = __webpack_require__(2); + +var _overlay_manager = __webpack_require__(11); + +var _password_prompt = __webpack_require__(12); + +var _pdf_attachment_viewer = __webpack_require__(13); + +var _pdf_document_properties = __webpack_require__(14); + +var _pdf_find_bar = __webpack_require__(15); + +var _pdf_find_controller = __webpack_require__(7); + +var _pdf_history = __webpack_require__(16); + +var _pdf_link_service = __webpack_require__(5); + +var _pdf_outline_viewer = __webpack_require__(17); + +var _pdf_presentation_mode = __webpack_require__(18); + +var _pdf_thumbnail_viewer = __webpack_require__(19); + +var _pdf_viewer = __webpack_require__(21); + +var _secondary_toolbar = __webpack_require__(26); + +var _toolbar = __webpack_require__(27); + +var _view_history = __webpack_require__(28); + +var DEFAULT_SCALE_DELTA = 1.1; +var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; +function configure(PDFJS) { + PDFJS.imageResourcesPath = './images/'; + PDFJS.workerSrc = '../build/pdf.worker.js'; + PDFJS.cMapUrl = '../web/cmaps/'; + PDFJS.cMapPacked = true; +} +var DefaultExternalServices = { + updateFindControlState: function updateFindControlState(data) {}, + initPassiveLoading: function initPassiveLoading(callbacks) {}, + fallback: function fallback(data, callback) {}, + reportTelemetry: function reportTelemetry(data) {}, + createDownloadManager: function createDownloadManager() { + throw new Error('Not implemented: createDownloadManager'); + }, + createPreferences: function createPreferences() { + throw new Error('Not implemented: createPreferences'); + }, + createL10n: function createL10n() { + throw new Error('Not implemented: createL10n'); + }, + + supportsIntegratedFind: false, + supportsDocumentFonts: true, + supportsDocumentColors: true, + supportedMouseWheelZoomModifierKeys: { + ctrlKey: true, + metaKey: true + } +}; +var PDFViewerApplication = { + initialBookmark: document.location.hash.substring(1), + initialized: false, + fellback: false, + appConfig: null, + pdfDocument: null, + pdfLoadingTask: null, + printService: null, + pdfViewer: null, + pdfThumbnailViewer: null, + pdfRenderingQueue: null, + pdfPresentationMode: null, + pdfDocumentProperties: null, + pdfLinkService: null, + pdfHistory: null, + pdfSidebar: null, + pdfOutlineViewer: null, + pdfAttachmentViewer: null, + pdfCursorTools: null, + store: null, + downloadManager: null, + overlayManager: null, + preferences: null, + toolbar: null, + secondaryToolbar: null, + eventBus: null, + l10n: null, + isInitialViewSet: false, + downloadComplete: false, + viewerPrefs: { + sidebarViewOnLoad: _pdf_sidebar.SidebarView.NONE, + pdfBugEnabled: false, + showPreviousViewOnLoad: true, + defaultZoomValue: '', + disablePageMode: false, + disablePageLabels: false, + renderer: 'canvas', + enhanceTextSelection: false, + renderInteractiveForms: false, + enablePrintAutoRotate: false + }, + isViewerEmbedded: window.parent !== window, + url: '', + baseUrl: '', + externalServices: DefaultExternalServices, + _boundEvents: {}, + initialize: function initialize(appConfig) { + var _this = this; + + this.preferences = this.externalServices.createPreferences(); + configure(_pdfjsLib.PDFJS); + this.appConfig = appConfig; + return this._readPreferences().then(function () { + return _this._initializeL10n(); + }).then(function () { + return _this._initializeViewerComponents(); + }).then(function () { + _this.bindEvents(); + _this.bindWindowEvents(); + var appContainer = appConfig.appContainer || document.documentElement; + _this.l10n.translate(appContainer).then(function () { + _this.eventBus.dispatch('localized'); + }); + if (_this.isViewerEmbedded && !_pdfjsLib.PDFJS.isExternalLinkTargetSet()) { + _pdfjsLib.PDFJS.externalLinkTarget = _pdfjsLib.PDFJS.LinkTarget.TOP; + } + _this.initialized = true; + }); + }, + _readPreferences: function _readPreferences() { + var preferences = this.preferences, + viewerPrefs = this.viewerPrefs; + + return Promise.all([preferences.get('enableWebGL').then(function resolved(value) { + _pdfjsLib.PDFJS.disableWebGL = !value; + }), preferences.get('sidebarViewOnLoad').then(function resolved(value) { + viewerPrefs['sidebarViewOnLoad'] = value; + }), preferences.get('pdfBugEnabled').then(function resolved(value) { + viewerPrefs['pdfBugEnabled'] = value; + }), preferences.get('showPreviousViewOnLoad').then(function resolved(value) { + viewerPrefs['showPreviousViewOnLoad'] = value; + }), preferences.get('defaultZoomValue').then(function resolved(value) { + viewerPrefs['defaultZoomValue'] = value; + }), preferences.get('enhanceTextSelection').then(function resolved(value) { + viewerPrefs['enhanceTextSelection'] = value; + }), preferences.get('disableTextLayer').then(function resolved(value) { + if (_pdfjsLib.PDFJS.disableTextLayer === true) { + return; + } + _pdfjsLib.PDFJS.disableTextLayer = value; + }), preferences.get('disableRange').then(function resolved(value) { + if (_pdfjsLib.PDFJS.disableRange === true) { + return; + } + _pdfjsLib.PDFJS.disableRange = value; + }), preferences.get('disableStream').then(function resolved(value) { + if (_pdfjsLib.PDFJS.disableStream === true) { + return; + } + _pdfjsLib.PDFJS.disableStream = value; + }), preferences.get('disableAutoFetch').then(function resolved(value) { + _pdfjsLib.PDFJS.disableAutoFetch = value; + }), preferences.get('disableFontFace').then(function resolved(value) { + if (_pdfjsLib.PDFJS.disableFontFace === true) { + return; + } + _pdfjsLib.PDFJS.disableFontFace = value; + }), preferences.get('useOnlyCssZoom').then(function resolved(value) { + _pdfjsLib.PDFJS.useOnlyCssZoom = value; + }), preferences.get('externalLinkTarget').then(function resolved(value) { + if (_pdfjsLib.PDFJS.isExternalLinkTargetSet()) { + return; + } + _pdfjsLib.PDFJS.externalLinkTarget = value; + }), preferences.get('renderer').then(function resolved(value) { + viewerPrefs['renderer'] = value; + }), preferences.get('renderInteractiveForms').then(function resolved(value) { + viewerPrefs['renderInteractiveForms'] = value; + }), preferences.get('disablePageMode').then(function resolved(value) { + viewerPrefs['disablePageMode'] = value; + }), preferences.get('disablePageLabels').then(function resolved(value) { + viewerPrefs['disablePageLabels'] = value; + }), preferences.get('enablePrintAutoRotate').then(function resolved(value) { + viewerPrefs['enablePrintAutoRotate'] = value; + })]).catch(function (reason) {}); + }, + _initializeL10n: function _initializeL10n() { + if (this.viewerPrefs['pdfBugEnabled']) { + var hash = document.location.hash.substring(1); + var hashParams = (0, _ui_utils.parseQueryString)(hash); + if ('locale' in hashParams) { + _pdfjsLib.PDFJS.locale = hashParams['locale']; + } + } + this.l10n = this.externalServices.createL10n(); + return this.l10n.getDirection().then(function (dir) { + document.getElementsByTagName('html')[0].dir = dir; + }); + }, + _initializeViewerComponents: function _initializeViewerComponents() { + var _this2 = this; + + var appConfig = this.appConfig; + return new Promise(function (resolve, reject) { + _this2.overlayManager = new _overlay_manager.OverlayManager(); + var eventBus = appConfig.eventBus || (0, _dom_events.getGlobalEventBus)(); + _this2.eventBus = eventBus; + var pdfRenderingQueue = new _pdf_rendering_queue.PDFRenderingQueue(); + pdfRenderingQueue.onIdle = _this2.cleanup.bind(_this2); + _this2.pdfRenderingQueue = pdfRenderingQueue; + var pdfLinkService = new _pdf_link_service.PDFLinkService({ eventBus: eventBus }); + _this2.pdfLinkService = pdfLinkService; + var downloadManager = _this2.externalServices.createDownloadManager(); + _this2.downloadManager = downloadManager; + var container = appConfig.mainContainer; + var viewer = appConfig.viewerContainer; + _this2.pdfViewer = new _pdf_viewer.PDFViewer({ + container: container, + viewer: viewer, + eventBus: eventBus, + renderingQueue: pdfRenderingQueue, + linkService: pdfLinkService, + downloadManager: downloadManager, + renderer: _this2.viewerPrefs['renderer'], + l10n: _this2.l10n, + enhanceTextSelection: _this2.viewerPrefs['enhanceTextSelection'], + renderInteractiveForms: _this2.viewerPrefs['renderInteractiveForms'], + enablePrintAutoRotate: _this2.viewerPrefs['enablePrintAutoRotate'] + }); + pdfRenderingQueue.setViewer(_this2.pdfViewer); + pdfLinkService.setViewer(_this2.pdfViewer); + var thumbnailContainer = appConfig.sidebar.thumbnailView; + _this2.pdfThumbnailViewer = new _pdf_thumbnail_viewer.PDFThumbnailViewer({ + container: thumbnailContainer, + renderingQueue: pdfRenderingQueue, + linkService: pdfLinkService, + l10n: _this2.l10n + }); + pdfRenderingQueue.setThumbnailViewer(_this2.pdfThumbnailViewer); + _this2.pdfHistory = new _pdf_history.PDFHistory({ + linkService: pdfLinkService, + eventBus: eventBus + }); + pdfLinkService.setHistory(_this2.pdfHistory); + _this2.findController = new _pdf_find_controller.PDFFindController({ pdfViewer: _this2.pdfViewer }); + _this2.findController.onUpdateResultsCount = function (matchCount) { + if (_this2.supportsIntegratedFind) { + return; + } + _this2.findBar.updateResultsCount(matchCount); + }; + _this2.findController.onUpdateState = function (state, previous, matchCount) { + if (_this2.supportsIntegratedFind) { + _this2.externalServices.updateFindControlState({ + result: state, + findPrevious: previous + }); + } else { + _this2.findBar.updateUIState(state, previous, matchCount); + } + }; + _this2.pdfViewer.setFindController(_this2.findController); + var findBarConfig = Object.create(appConfig.findBar); + findBarConfig.findController = _this2.findController; + findBarConfig.eventBus = eventBus; + _this2.findBar = new _pdf_find_bar.PDFFindBar(findBarConfig, _this2.l10n); + _this2.pdfDocumentProperties = new _pdf_document_properties.PDFDocumentProperties(appConfig.documentProperties, _this2.overlayManager, _this2.l10n); + _this2.pdfCursorTools = new _pdf_cursor_tools.PDFCursorTools({ + container: container, + eventBus: eventBus, + preferences: _this2.preferences + }); + _this2.toolbar = new _toolbar.Toolbar(appConfig.toolbar, container, eventBus, _this2.l10n); + _this2.secondaryToolbar = new _secondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, container, eventBus); + if (_this2.supportsFullscreen) { + _this2.pdfPresentationMode = new _pdf_presentation_mode.PDFPresentationMode({ + container: container, + viewer: viewer, + pdfViewer: _this2.pdfViewer, + eventBus: eventBus, + contextMenuItems: appConfig.fullscreen + }); + } + _this2.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay, _this2.overlayManager, _this2.l10n); + _this2.pdfOutlineViewer = new _pdf_outline_viewer.PDFOutlineViewer({ + container: appConfig.sidebar.outlineView, + eventBus: eventBus, + linkService: pdfLinkService + }); + _this2.pdfAttachmentViewer = new _pdf_attachment_viewer.PDFAttachmentViewer({ + container: appConfig.sidebar.attachmentsView, + eventBus: eventBus, + downloadManager: downloadManager + }); + var sidebarConfig = Object.create(appConfig.sidebar); + sidebarConfig.pdfViewer = _this2.pdfViewer; + sidebarConfig.pdfThumbnailViewer = _this2.pdfThumbnailViewer; + sidebarConfig.pdfOutlineViewer = _this2.pdfOutlineViewer; + sidebarConfig.eventBus = eventBus; + _this2.pdfSidebar = new _pdf_sidebar.PDFSidebar(sidebarConfig, _this2.l10n); + _this2.pdfSidebar.onToggled = _this2.forceRendering.bind(_this2); + resolve(undefined); + }); + }, + run: function run(config) { + this.initialize(config).then(webViewerInitialized); + }, + zoomIn: function zoomIn(ticks) { + var newScale = this.pdfViewer.currentScale; + do { + newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2); + newScale = Math.ceil(newScale * 10) / 10; + newScale = Math.min(_ui_utils.MAX_SCALE, newScale); + } while (--ticks > 0 && newScale < _ui_utils.MAX_SCALE); + this.pdfViewer.currentScaleValue = newScale; + }, + zoomOut: function zoomOut(ticks) { + var newScale = this.pdfViewer.currentScale; + do { + newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2); + newScale = Math.floor(newScale * 10) / 10; + newScale = Math.max(_ui_utils.MIN_SCALE, newScale); + } while (--ticks > 0 && newScale > _ui_utils.MIN_SCALE); + this.pdfViewer.currentScaleValue = newScale; + }, + + get pagesCount() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + }, + get pageRotation() { + return this.pdfViewer.pagesRotation; + }, + set page(val) { + this.pdfViewer.currentPageNumber = val; + }, + get page() { + return this.pdfViewer.currentPageNumber; + }, + get printing() { + return !!this.printService; + }, + get supportsPrinting() { + return PDFPrintServiceFactory.instance.supportsPrinting; + }, + get supportsFullscreen() { + var support = void 0; + var doc = document.documentElement; + support = !!(doc.requestFullscreen || doc.mozRequestFullScreen || doc.webkitRequestFullScreen || doc.msRequestFullscreen); + if (document.fullscreenEnabled === false || document.mozFullScreenEnabled === false || document.webkitFullscreenEnabled === false || document.msFullscreenEnabled === false) { + support = false; + } + if (support && _pdfjsLib.PDFJS.disableFullscreen === true) { + support = false; + } + return (0, _pdfjsLib.shadow)(this, 'supportsFullscreen', support); + }, + get supportsIntegratedFind() { + return this.externalServices.supportsIntegratedFind; + }, + get supportsDocumentFonts() { + return this.externalServices.supportsDocumentFonts; + }, + get supportsDocumentColors() { + return this.externalServices.supportsDocumentColors; + }, + get loadingBar() { + var bar = new _ui_utils.ProgressBar('#loadingBar'); + return (0, _pdfjsLib.shadow)(this, 'loadingBar', bar); + }, + get supportedMouseWheelZoomModifierKeys() { + return this.externalServices.supportedMouseWheelZoomModifierKeys; + }, + initPassiveLoading: function initPassiveLoading() { + throw new Error('Not implemented: initPassiveLoading'); + }, + setTitleUsingUrl: function setTitleUsingUrl(url) { + this.url = url; + this.baseUrl = url.split('#')[0]; + var title = (0, _ui_utils.getPDFFileNameFromURL)(url, ''); + if (!title) { + try { + title = decodeURIComponent((0, _pdfjsLib.getFilenameFromUrl)(url)) || url; + } catch (ex) { + title = url; + } + } + this.setTitle(title); + }, + setTitle: function setTitle(title) { + if (this.isViewerEmbedded) { + return; + } + document.title = title; + }, + close: function close() { + var errorWrapper = this.appConfig.errorWrapper.container; + errorWrapper.setAttribute('hidden', 'true'); + if (!this.pdfLoadingTask) { + return Promise.resolve(); + } + var promise = this.pdfLoadingTask.destroy(); + this.pdfLoadingTask = null; + if (this.pdfDocument) { + this.pdfDocument = null; + this.pdfThumbnailViewer.setDocument(null); + this.pdfViewer.setDocument(null); + this.pdfLinkService.setDocument(null, null); + this.pdfDocumentProperties.setDocument(null, null); + } + this.store = null; + this.isInitialViewSet = false; + this.downloadComplete = false; + this.pdfSidebar.reset(); + this.pdfOutlineViewer.reset(); + this.pdfAttachmentViewer.reset(); + this.findController.reset(); + this.findBar.reset(); + this.toolbar.reset(); + this.secondaryToolbar.reset(); + if (typeof PDFBug !== 'undefined') { + PDFBug.cleanup(); + } + return promise; + }, + open: function open(file, args) { + var _this3 = this; + + if (arguments.length > 2 || typeof args === 'number') { + return Promise.reject(new Error('Call of open() with obsolete signature.')); + } + if (this.pdfLoadingTask) { + return this.close().then(function () { + _this3.preferences.reload(); + return _this3.open(file, args); + }); + } + var parameters = Object.create(null); + if (typeof file === 'string') { + this.setTitleUsingUrl(file); + parameters.url = file; + } else if (file && 'byteLength' in file) { + parameters.data = file; + } else if (file.url && file.originalUrl) { + this.setTitleUsingUrl(file.originalUrl); + parameters.url = file.url; + } + if (args) { + for (var prop in args) { + if (!_pdfjsLib.PDFJS.pdfjsNext && prop === 'scale') { + console.error('Call of open() with obsolete "scale" argument, ' + 'please use the "defaultZoomValue" preference instead.'); + continue; + } else if (prop === 'length') { + this.pdfDocumentProperties.setFileSize(args[prop]); + } + parameters[prop] = args[prop]; + } + } + var loadingTask = (0, _pdfjsLib.getDocument)(parameters); + this.pdfLoadingTask = loadingTask; + loadingTask.onPassword = function (updateCallback, reason) { + _this3.passwordPrompt.setUpdateCallback(updateCallback, reason); + _this3.passwordPrompt.open(); + }; + loadingTask.onProgress = function (_ref) { + var loaded = _ref.loaded, + total = _ref.total; + + _this3.progress(loaded / total); + }; + loadingTask.onUnsupportedFeature = this.fallback.bind(this); + return loadingTask.promise.then(function (pdfDocument) { + _this3.load(pdfDocument); + }, function (exception) { + var message = exception && exception.message; + var loadingErrorMessage = void 0; + if (exception instanceof _pdfjsLib.InvalidPDFException) { + loadingErrorMessage = _this3.l10n.get('invalid_file_error', null, 'Invalid or corrupted PDF file.'); + } else if (exception instanceof _pdfjsLib.MissingPDFException) { + loadingErrorMessage = _this3.l10n.get('missing_file_error', null, 'Missing PDF file.'); + } else if (exception instanceof _pdfjsLib.UnexpectedResponseException) { + loadingErrorMessage = _this3.l10n.get('unexpected_response_error', null, 'Unexpected server response.'); + } else { + loadingErrorMessage = _this3.l10n.get('loading_error', null, 'An error occurred while loading the PDF.'); + } + return loadingErrorMessage.then(function (msg) { + _this3.error(msg, { message: message }); + throw new Error(msg); + }); + }); + }, + download: function download() { + var _this4 = this; + + function downloadByUrl() { + downloadManager.downloadUrl(url, filename); + } + var url = this.baseUrl; + var filename = (0, _ui_utils.getPDFFileNameFromURL)(this.url); + var downloadManager = this.downloadManager; + downloadManager.onerror = function (err) { + _this4.error('PDF failed to download: ' + err); + }; + if (!this.pdfDocument || !this.downloadComplete) { + downloadByUrl(); + return; + } + this.pdfDocument.getData().then(function (data) { + var blob = (0, _pdfjsLib.createBlob)(data, 'application/pdf'); + downloadManager.download(blob, url, filename); + }).catch(downloadByUrl); + }, + fallback: function fallback(featureId) {}, + error: function error(message, moreInfo) { + var moreInfoText = [this.l10n.get('error_version_info', { + version: _pdfjsLib.version || '?', + build: _pdfjsLib.build || '?' + }, 'PDF.js v{{version}} (build: {{build}})')]; + if (moreInfo) { + moreInfoText.push(this.l10n.get('error_message', { message: moreInfo.message }, 'Message: {{message}}')); + if (moreInfo.stack) { + moreInfoText.push(this.l10n.get('error_stack', { stack: moreInfo.stack }, 'Stack: {{stack}}')); + } else { + if (moreInfo.filename) { + moreInfoText.push(this.l10n.get('error_file', { file: moreInfo.filename }, 'File: {{file}}')); + } + if (moreInfo.lineNumber) { + moreInfoText.push(this.l10n.get('error_line', { line: moreInfo.lineNumber }, 'Line: {{line}}')); + } + } + } + var errorWrapperConfig = this.appConfig.errorWrapper; + var errorWrapper = errorWrapperConfig.container; + errorWrapper.removeAttribute('hidden'); + var errorMessage = errorWrapperConfig.errorMessage; + errorMessage.textContent = message; + var closeButton = errorWrapperConfig.closeButton; + closeButton.onclick = function () { + errorWrapper.setAttribute('hidden', 'true'); + }; + var errorMoreInfo = errorWrapperConfig.errorMoreInfo; + var moreInfoButton = errorWrapperConfig.moreInfoButton; + var lessInfoButton = errorWrapperConfig.lessInfoButton; + moreInfoButton.onclick = function () { + errorMoreInfo.removeAttribute('hidden'); + moreInfoButton.setAttribute('hidden', 'true'); + lessInfoButton.removeAttribute('hidden'); + errorMoreInfo.style.height = errorMoreInfo.scrollHeight + 'px'; + }; + lessInfoButton.onclick = function () { + errorMoreInfo.setAttribute('hidden', 'true'); + moreInfoButton.removeAttribute('hidden'); + lessInfoButton.setAttribute('hidden', 'true'); + }; + moreInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler; + lessInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler; + closeButton.oncontextmenu = _ui_utils.noContextMenuHandler; + moreInfoButton.removeAttribute('hidden'); + lessInfoButton.setAttribute('hidden', 'true'); + Promise.all(moreInfoText).then(function (parts) { + errorMoreInfo.value = parts.join('\n'); + }); + }, + progress: function progress(level) { + var _this5 = this; + + if (this.downloadComplete) { + return; + } + var percent = Math.round(level * 100); + if (percent > this.loadingBar.percent || isNaN(percent)) { + this.loadingBar.percent = percent; + if (_pdfjsLib.PDFJS.disableAutoFetch && percent) { + if (this.disableAutoFetchLoadingBarTimeout) { + clearTimeout(this.disableAutoFetchLoadingBarTimeout); + this.disableAutoFetchLoadingBarTimeout = null; + } + this.loadingBar.show(); + this.disableAutoFetchLoadingBarTimeout = setTimeout(function () { + _this5.loadingBar.hide(); + _this5.disableAutoFetchLoadingBarTimeout = null; + }, DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT); + } + } + }, + load: function load(pdfDocument) { + var _this6 = this; + + this.pdfDocument = pdfDocument; + pdfDocument.getDownloadInfo().then(function () { + _this6.downloadComplete = true; + _this6.loadingBar.hide(); + firstPagePromise.then(function () { + _this6.eventBus.dispatch('documentload', { source: _this6 }); + }); + }); + var pageModePromise = pdfDocument.getPageMode().catch(function () {}); + this.toolbar.setPagesCount(pdfDocument.numPages, false); + this.secondaryToolbar.setPagesCount(pdfDocument.numPages); + var id = this.documentFingerprint = pdfDocument.fingerprint; + var store = this.store = new _view_history.ViewHistory(id); + var baseDocumentUrl = void 0; + baseDocumentUrl = null; + this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl); + this.pdfDocumentProperties.setDocument(pdfDocument, this.url); + var pdfViewer = this.pdfViewer; + pdfViewer.setDocument(pdfDocument); + var firstPagePromise = pdfViewer.firstPagePromise; + var pagesPromise = pdfViewer.pagesPromise; + var onePageRendered = pdfViewer.onePageRendered; + var pdfThumbnailViewer = this.pdfThumbnailViewer; + pdfThumbnailViewer.setDocument(pdfDocument); + firstPagePromise.then(function (pdfPage) { + _this6.loadingBar.setWidth(_this6.appConfig.viewerContainer); + if (!_pdfjsLib.PDFJS.disableHistory && !_this6.isViewerEmbedded) { + var resetHistory = !_this6.viewerPrefs['showPreviousViewOnLoad']; + _this6.pdfHistory.initialize(id, resetHistory); + if (_this6.pdfHistory.initialBookmark) { + _this6.initialBookmark = _this6.pdfHistory.initialBookmark; + _this6.initialRotation = _this6.pdfHistory.initialRotation; + } + } + var initialParams = { + bookmark: null, + hash: null + }; + var storePromise = store.getMultiple({ + exists: false, + page: '1', + zoom: _ui_utils.DEFAULT_SCALE_VALUE, + scrollLeft: '0', + scrollTop: '0', + rotation: null, + sidebarView: _pdf_sidebar.SidebarView.NONE + }).catch(function () {}); + Promise.all([storePromise, pageModePromise]).then(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + _ref3$ = _ref3[0], + values = _ref3$ === undefined ? {} : _ref3$, + pageMode = _ref3[1]; + + var hash = _this6.viewerPrefs['defaultZoomValue'] ? 'zoom=' + _this6.viewerPrefs['defaultZoomValue'] : null; + var rotation = null; + var sidebarView = _this6.viewerPrefs['sidebarViewOnLoad']; + if (values.exists && _this6.viewerPrefs['showPreviousViewOnLoad']) { + hash = 'page=' + values.page + '&zoom=' + (_this6.viewerPrefs['defaultZoomValue'] || values.zoom) + ',' + values.scrollLeft + ',' + values.scrollTop; + rotation = parseInt(values.rotation, 10); + sidebarView = sidebarView || values.sidebarView | 0; + } + if (pageMode && !_this6.viewerPrefs['disablePageMode']) { + sidebarView = sidebarView || apiPageModeToSidebarView(pageMode); + } + return { + hash: hash, + rotation: rotation, + sidebarView: sidebarView + }; + }).then(function (_ref4) { + var hash = _ref4.hash, + rotation = _ref4.rotation, + sidebarView = _ref4.sidebarView; + + initialParams.bookmark = _this6.initialBookmark; + initialParams.hash = hash; + _this6.setInitialView(hash, { + rotation: rotation, + sidebarView: sidebarView + }); + if (!_this6.isViewerEmbedded) { + pdfViewer.focus(); + } + return pagesPromise; + }).then(function () { + if (!initialParams.bookmark && !initialParams.hash) { + return; + } + if (pdfViewer.hasEqualPageSizes) { + return; + } + _this6.initialBookmark = initialParams.bookmark; + pdfViewer.currentScaleValue = pdfViewer.currentScaleValue; + _this6.setInitialView(initialParams.hash); + }).then(function () { + pdfViewer.update(); + }); + }); + pdfDocument.getPageLabels().then(function (labels) { + if (!labels || _this6.viewerPrefs['disablePageLabels']) { + return; + } + var i = 0, + numLabels = labels.length; + if (numLabels !== _this6.pagesCount) { + console.error('The number of Page Labels does not match ' + 'the number of pages in the document.'); + return; + } + while (i < numLabels && labels[i] === (i + 1).toString()) { + i++; + } + if (i === numLabels) { + return; + } + pdfViewer.setPageLabels(labels); + pdfThumbnailViewer.setPageLabels(labels); + _this6.toolbar.setPagesCount(pdfDocument.numPages, true); + _this6.toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + }); + pagesPromise.then(function () { + if (!_this6.supportsPrinting) { + return; + } + pdfDocument.getJavaScript().then(function (javaScript) { + if (javaScript.length === 0) { + return; + } + javaScript.some(function (js) { + if (!js) { + return false; + } + console.warn('Warning: JavaScript is not supported'); + _this6.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript); + return true; + }); + var regex = /\bprint\s*\(/; + for (var i = 0, ii = javaScript.length; i < ii; i++) { + var js = javaScript[i]; + if (js && regex.test(js)) { + setTimeout(function () { + window.print(); + }); + return; + } + } + }); + }); + Promise.all([onePageRendered, _ui_utils.animationStarted]).then(function () { + pdfDocument.getOutline().then(function (outline) { + _this6.pdfOutlineViewer.render({ outline: outline }); + }); + pdfDocument.getAttachments().then(function (attachments) { + _this6.pdfAttachmentViewer.render({ attachments: attachments }); + }); + }); + pdfDocument.getMetadata().then(function (_ref5) { + var info = _ref5.info, + metadata = _ref5.metadata; + + _this6.documentInfo = info; + _this6.metadata = metadata; + console.log('PDF ' + pdfDocument.fingerprint + ' [' + info.PDFFormatVersion + ' ' + (info.Producer || '-').trim() + ' / ' + (info.Creator || '-').trim() + ']' + ' (PDF.js: ' + (_pdfjsLib.version || '-') + (!_pdfjsLib.PDFJS.disableWebGL ? ' [WebGL]' : '') + ')'); + var pdfTitle = void 0; + if (metadata && metadata.has('dc:title')) { + var title = metadata.get('dc:title'); + if (title !== 'Untitled') { + pdfTitle = title; + } + } + if (!pdfTitle && info && info['Title']) { + pdfTitle = info['Title']; + } + if (pdfTitle) { + _this6.setTitle(pdfTitle + ' - ' + document.title); + } + if (info.IsAcroFormPresent) { + console.warn('Warning: AcroForm/XFA is not supported'); + _this6.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms); + } + }); + }, + setInitialView: function setInitialView(storedHash) { + var _this7 = this; + + var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + rotation = _ref6.rotation, + sidebarView = _ref6.sidebarView; + + var setRotation = function setRotation(angle) { + if ((0, _ui_utils.isValidRotation)(angle)) { + _this7.pdfViewer.pagesRotation = angle; + } + }; + this.isInitialViewSet = true; + this.pdfSidebar.setInitialView(sidebarView); + if (this.initialBookmark) { + setRotation(this.initialRotation); + delete this.initialRotation; + this.pdfLinkService.setHash(this.initialBookmark); + this.initialBookmark = null; + } else if (storedHash) { + setRotation(rotation); + this.pdfLinkService.setHash(storedHash); + } + this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel); + this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber); + if (!this.pdfViewer.currentScaleValue) { + this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + } + }, + cleanup: function cleanup() { + if (!this.pdfDocument) { + return; + } + this.pdfViewer.cleanup(); + this.pdfThumbnailViewer.cleanup(); + if (this.pdfViewer.renderer !== _ui_utils.RendererType.SVG) { + this.pdfDocument.cleanup(); + } + }, + forceRendering: function forceRendering() { + this.pdfRenderingQueue.printing = this.printing; + this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar.isThumbnailViewVisible; + this.pdfRenderingQueue.renderHighestPriority(); + }, + beforePrint: function beforePrint() { + var _this8 = this; + + if (this.printService) { + return; + } + if (!this.supportsPrinting) { + this.l10n.get('printing_not_supported', null, 'Warning: Printing is not fully supported by ' + 'this browser.').then(function (printMessage) { + _this8.error(printMessage); + }); + return; + } + if (!this.pdfViewer.pageViewsReady) { + this.l10n.get('printing_not_ready', null, 'Warning: The PDF is not fully loaded for printing.').then(function (notReadyMessage) { + window.alert(notReadyMessage); + }); + return; + } + var pagesOverview = this.pdfViewer.getPagesOverview(); + var printContainer = this.appConfig.printContainer; + var printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, this.l10n); + this.printService = printService; + this.forceRendering(); + printService.layout(); + }, + + afterPrint: function pdfViewSetupAfterPrint() { + if (this.printService) { + this.printService.destroy(); + this.printService = null; + } + this.forceRendering(); + }, + rotatePages: function rotatePages(delta) { + if (!this.pdfDocument) { + return; + } + var newRotation = (this.pdfViewer.pagesRotation + 360 + delta) % 360; + this.pdfViewer.pagesRotation = newRotation; + }, + requestPresentationMode: function requestPresentationMode() { + if (!this.pdfPresentationMode) { + return; + } + this.pdfPresentationMode.request(); + }, + bindEvents: function bindEvents() { + var eventBus = this.eventBus, + _boundEvents = this._boundEvents; + + _boundEvents.beforePrint = this.beforePrint.bind(this); + _boundEvents.afterPrint = this.afterPrint.bind(this); + eventBus.on('resize', webViewerResize); + eventBus.on('hashchange', webViewerHashchange); + eventBus.on('beforeprint', _boundEvents.beforePrint); + eventBus.on('afterprint', _boundEvents.afterPrint); + eventBus.on('pagerendered', webViewerPageRendered); + eventBus.on('textlayerrendered', webViewerTextLayerRendered); + eventBus.on('updateviewarea', webViewerUpdateViewarea); + eventBus.on('pagechanging', webViewerPageChanging); + eventBus.on('scalechanging', webViewerScaleChanging); + eventBus.on('rotationchanging', webViewerRotationChanging); + eventBus.on('sidebarviewchanged', webViewerSidebarViewChanged); + eventBus.on('pagemode', webViewerPageMode); + eventBus.on('namedaction', webViewerNamedAction); + eventBus.on('presentationmodechanged', webViewerPresentationModeChanged); + eventBus.on('presentationmode', webViewerPresentationMode); + eventBus.on('openfile', webViewerOpenFile); + eventBus.on('print', webViewerPrint); + eventBus.on('download', webViewerDownload); + eventBus.on('firstpage', webViewerFirstPage); + eventBus.on('lastpage', webViewerLastPage); + eventBus.on('nextpage', webViewerNextPage); + eventBus.on('previouspage', webViewerPreviousPage); + eventBus.on('zoomin', webViewerZoomIn); + eventBus.on('zoomout', webViewerZoomOut); + eventBus.on('pagenumberchanged', webViewerPageNumberChanged); + eventBus.on('scalechanged', webViewerScaleChanged); + eventBus.on('rotatecw', webViewerRotateCw); + eventBus.on('rotateccw', webViewerRotateCcw); + eventBus.on('documentproperties', webViewerDocumentProperties); + eventBus.on('find', webViewerFind); + eventBus.on('findfromurlhash', webViewerFindFromUrlHash); + eventBus.on('fileinputchange', webViewerFileInputChange); + }, + bindWindowEvents: function bindWindowEvents() { + var eventBus = this.eventBus, + _boundEvents = this._boundEvents; + + _boundEvents.windowResize = function () { + eventBus.dispatch('resize'); + }; + _boundEvents.windowHashChange = function () { + eventBus.dispatch('hashchange', { hash: document.location.hash.substring(1) }); + }; + _boundEvents.windowBeforePrint = function () { + eventBus.dispatch('beforeprint'); + }; + _boundEvents.windowAfterPrint = function () { + eventBus.dispatch('afterprint'); + }; + window.addEventListener('wheel', webViewerWheel); + window.addEventListener('click', webViewerClick); + window.addEventListener('keydown', webViewerKeyDown); + window.addEventListener('resize', _boundEvents.windowResize); + window.addEventListener('hashchange', _boundEvents.windowHashChange); + window.addEventListener('beforeprint', _boundEvents.windowBeforePrint); + window.addEventListener('afterprint', _boundEvents.windowAfterPrint); + }, + unbindEvents: function unbindEvents() { + var eventBus = this.eventBus, + _boundEvents = this._boundEvents; + + eventBus.off('resize', webViewerResize); + eventBus.off('hashchange', webViewerHashchange); + eventBus.off('beforeprint', _boundEvents.beforePrint); + eventBus.off('afterprint', _boundEvents.afterPrint); + eventBus.off('pagerendered', webViewerPageRendered); + eventBus.off('textlayerrendered', webViewerTextLayerRendered); + eventBus.off('updateviewarea', webViewerUpdateViewarea); + eventBus.off('pagechanging', webViewerPageChanging); + eventBus.off('scalechanging', webViewerScaleChanging); + eventBus.off('rotationchanging', webViewerRotationChanging); + eventBus.off('sidebarviewchanged', webViewerSidebarViewChanged); + eventBus.off('pagemode', webViewerPageMode); + eventBus.off('namedaction', webViewerNamedAction); + eventBus.off('presentationmodechanged', webViewerPresentationModeChanged); + eventBus.off('presentationmode', webViewerPresentationMode); + eventBus.off('openfile', webViewerOpenFile); + eventBus.off('print', webViewerPrint); + eventBus.off('download', webViewerDownload); + eventBus.off('firstpage', webViewerFirstPage); + eventBus.off('lastpage', webViewerLastPage); + eventBus.off('nextpage', webViewerNextPage); + eventBus.off('previouspage', webViewerPreviousPage); + eventBus.off('zoomin', webViewerZoomIn); + eventBus.off('zoomout', webViewerZoomOut); + eventBus.off('pagenumberchanged', webViewerPageNumberChanged); + eventBus.off('scalechanged', webViewerScaleChanged); + eventBus.off('rotatecw', webViewerRotateCw); + eventBus.off('rotateccw', webViewerRotateCcw); + eventBus.off('documentproperties', webViewerDocumentProperties); + eventBus.off('find', webViewerFind); + eventBus.off('findfromurlhash', webViewerFindFromUrlHash); + eventBus.off('fileinputchange', webViewerFileInputChange); + _boundEvents.beforePrint = null; + _boundEvents.afterPrint = null; + }, + unbindWindowEvents: function unbindWindowEvents() { + var _boundEvents = this._boundEvents; + + window.removeEventListener('wheel', webViewerWheel); + window.removeEventListener('click', webViewerClick); + window.removeEventListener('keydown', webViewerKeyDown); + window.removeEventListener('resize', _boundEvents.windowResize); + window.removeEventListener('hashchange', _boundEvents.windowHashChange); + window.removeEventListener('beforeprint', _boundEvents.windowBeforePrint); + window.removeEventListener('afterprint', _boundEvents.windowAfterPrint); + _boundEvents.windowResize = null; + _boundEvents.windowHashChange = null; + _boundEvents.windowBeforePrint = null; + _boundEvents.windowAfterPrint = null; + } +}; +var validateFileURL = void 0; +{ + var HOSTED_VIEWER_ORIGINS = ['null', 'http://mozilla.github.io', 'https://mozilla.github.io']; + validateFileURL = function validateFileURL(file) { + if (file === undefined) { + return file; + } + try { + var viewerOrigin = new URL(window.location.href).origin || 'null'; + if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) { + return file; + } + var fileOrigin = new URL(file, window.location.href).origin; + if (fileOrigin !== viewerOrigin) { + return '/getCorsFile?urlPath=' + file; + } + } catch (ex) { + var message = ex && ex.message; + PDFViewerApplication.l10n.get('loading_error', null, 'An error occurred while loading the PDF.').then(function (loadingErrorMessage) { + PDFViewerApplication.error(loadingErrorMessage, { message: message }); + }); + throw ex; + } + return file; + }; +} +function loadAndEnablePDFBug(enabledTabs) { + return new Promise(function (resolve, reject) { + var appConfig = PDFViewerApplication.appConfig; + var script = document.createElement('script'); + script.src = appConfig.debuggerScriptPath; + script.onload = function () { + PDFBug.enable(enabledTabs); + PDFBug.init({ + PDFJS: _pdfjsLib.PDFJS, + OPS: _pdfjsLib.OPS + }, appConfig.mainContainer); + resolve(); + }; + script.onerror = function () { + reject(new Error('Cannot load debugger at ' + script.src)); + }; + (document.getElementsByTagName('head')[0] || document.body).appendChild(script); + }); +} +function webViewerInitialized() { + var appConfig = PDFViewerApplication.appConfig; + var file = void 0; + var queryString = document.location.search.substring(1); + var params = (0, _ui_utils.parseQueryString)(queryString); + file = 'file' in params ? params.file : appConfig.defaultUrl; + file = validateFileURL(file); + var waitForBeforeOpening = []; + var fileInput = document.createElement('input'); + fileInput.id = appConfig.openFileInputName; + fileInput.className = 'fileInput'; + fileInput.setAttribute('type', 'file'); + fileInput.oncontextmenu = _ui_utils.noContextMenuHandler; + document.body.appendChild(fileInput); + if (!window.File || !window.FileReader || !window.FileList || !window.Blob) { + appConfig.toolbar.openFile.setAttribute('hidden', 'true'); + appConfig.secondaryToolbar.openFileButton.setAttribute('hidden', 'true'); + } else { + fileInput.value = null; + } + fileInput.addEventListener('change', function (evt) { + var files = evt.target.files; + if (!files || files.length === 0) { + return; + } + PDFViewerApplication.eventBus.dispatch('fileinputchange', { fileInput: evt.target }); + }); + if (PDFViewerApplication.viewerPrefs['pdfBugEnabled']) { + var hash = document.location.hash.substring(1); + var hashParams = (0, _ui_utils.parseQueryString)(hash); + if ('disableworker' in hashParams) { + _pdfjsLib.PDFJS.disableWorker = hashParams['disableworker'] === 'true'; + } + if ('disablerange' in hashParams) { + _pdfjsLib.PDFJS.disableRange = hashParams['disablerange'] === 'true'; + } + if ('disablestream' in hashParams) { + _pdfjsLib.PDFJS.disableStream = hashParams['disablestream'] === 'true'; + } + if ('disableautofetch' in hashParams) { + _pdfjsLib.PDFJS.disableAutoFetch = hashParams['disableautofetch'] === 'true'; + } + if ('disablefontface' in hashParams) { + _pdfjsLib.PDFJS.disableFontFace = hashParams['disablefontface'] === 'true'; + } + if ('disablehistory' in hashParams) { + _pdfjsLib.PDFJS.disableHistory = hashParams['disablehistory'] === 'true'; + } + if ('webgl' in hashParams) { + _pdfjsLib.PDFJS.disableWebGL = hashParams['webgl'] !== 'true'; + } + if ('useonlycsszoom' in hashParams) { + _pdfjsLib.PDFJS.useOnlyCssZoom = hashParams['useonlycsszoom'] === 'true'; + } + if ('verbosity' in hashParams) { + _pdfjsLib.PDFJS.verbosity = hashParams['verbosity'] | 0; + } + if ('ignorecurrentpositiononzoom' in hashParams) { + _pdfjsLib.PDFJS.ignoreCurrentPositionOnZoom = hashParams['ignorecurrentpositiononzoom'] === 'true'; + } + if ('textlayer' in hashParams) { + switch (hashParams['textlayer']) { + case 'off': + _pdfjsLib.PDFJS.disableTextLayer = true; + break; + case 'visible': + case 'shadow': + case 'hover': + var viewer = appConfig.viewerContainer; + viewer.classList.add('textLayer-' + hashParams['textlayer']); + break; + } + } + if ('pdfbug' in hashParams) { + _pdfjsLib.PDFJS.pdfBug = true; + var pdfBug = hashParams['pdfbug']; + var enabled = pdfBug.split(','); + waitForBeforeOpening.push(loadAndEnablePDFBug(enabled)); + } + } + if (!PDFViewerApplication.supportsPrinting) { + appConfig.toolbar.print.classList.add('hidden'); + appConfig.secondaryToolbar.printButton.classList.add('hidden'); + } + if (!PDFViewerApplication.supportsFullscreen) { + appConfig.toolbar.presentationModeButton.classList.add('hidden'); + appConfig.secondaryToolbar.presentationModeButton.classList.add('hidden'); + } + if (PDFViewerApplication.supportsIntegratedFind) { + appConfig.toolbar.viewFind.classList.add('hidden'); + } + appConfig.sidebar.mainContainer.addEventListener('transitionend', function (evt) { + if (evt.target === this) { + PDFViewerApplication.eventBus.dispatch('resize'); + } + }, true); + appConfig.sidebar.toggleButton.addEventListener('click', function () { + PDFViewerApplication.pdfSidebar.toggle(); + }); + Promise.all(waitForBeforeOpening).then(function () { + webViewerOpenFileViaURL(file); + }).catch(function (reason) { + PDFViewerApplication.l10n.get('loading_error', null, 'An error occurred while opening.').then(function (msg) { + PDFViewerApplication.error(msg, reason); + }); + }); +} +var webViewerOpenFileViaURL = void 0; +{ + webViewerOpenFileViaURL = function webViewerOpenFileViaURL(file) { + if (file && file.lastIndexOf('file:', 0) === 0) { + PDFViewerApplication.setTitleUsingUrl(file); + var xhr = new XMLHttpRequest(); + xhr.onload = function () { + PDFViewerApplication.open(new Uint8Array(xhr.response)); + }; + try { + xhr.open('GET', file); + xhr.responseType = 'arraybuffer'; + xhr.send(); + } catch (ex) { + PDFViewerApplication.l10n.get('loading_error', null, 'An error occurred while loading the PDF.').then(function (msg) { + PDFViewerApplication.error(msg, ex); + }); + } + return; + } + if (file) { + PDFViewerApplication.open(file); + } + }; +} +function webViewerPageRendered(evt) { + var pageNumber = evt.pageNumber; + var pageIndex = pageNumber - 1; + var pageView = PDFViewerApplication.pdfViewer.getPageView(pageIndex); + if (pageNumber === PDFViewerApplication.page) { + PDFViewerApplication.toolbar.updateLoadingIndicatorState(false); + } + if (!pageView) { + return; + } + if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) { + var thumbnailView = PDFViewerApplication.pdfThumbnailViewer.getThumbnail(pageIndex); + thumbnailView.setImage(pageView); + } + if (_pdfjsLib.PDFJS.pdfBug && Stats.enabled && pageView.stats) { + Stats.add(pageNumber, pageView.stats); + } + if (pageView.error) { + PDFViewerApplication.l10n.get('rendering_error', null, 'An error occurred while rendering the page.').then(function (msg) { + PDFViewerApplication.error(msg, pageView.error); + }); + } +} +function webViewerTextLayerRendered(evt) {} +function webViewerPageMode(evt) { + var mode = evt.mode, + view = void 0; + switch (mode) { + case 'thumbs': + view = _pdf_sidebar.SidebarView.THUMBS; + break; + case 'bookmarks': + case 'outline': + view = _pdf_sidebar.SidebarView.OUTLINE; + break; + case 'attachments': + view = _pdf_sidebar.SidebarView.ATTACHMENTS; + break; + case 'none': + view = _pdf_sidebar.SidebarView.NONE; + break; + default: + console.error('Invalid "pagemode" hash parameter: ' + mode); + return; + } + PDFViewerApplication.pdfSidebar.switchView(view, true); +} +function webViewerNamedAction(evt) { + var action = evt.action; + switch (action) { + case 'GoToPage': + PDFViewerApplication.appConfig.toolbar.pageNumber.select(); + break; + case 'Find': + if (!PDFViewerApplication.supportsIntegratedFind) { + PDFViewerApplication.findBar.toggle(); + } + break; + } +} +function webViewerPresentationModeChanged(evt) { + var active = evt.active, + switchInProgress = evt.switchInProgress; + + PDFViewerApplication.pdfViewer.presentationModeState = switchInProgress ? _ui_utils.PresentationModeState.CHANGING : active ? _ui_utils.PresentationModeState.FULLSCREEN : _ui_utils.PresentationModeState.NORMAL; +} +function webViewerSidebarViewChanged(evt) { + PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled = PDFViewerApplication.pdfSidebar.isThumbnailViewVisible; + var store = PDFViewerApplication.store; + if (store && PDFViewerApplication.isInitialViewSet) { + store.set('sidebarView', evt.view).catch(function () {}); + } +} +function webViewerUpdateViewarea(evt) { + var location = evt.location, + store = PDFViewerApplication.store; + if (store && PDFViewerApplication.isInitialViewSet) { + store.setMultiple({ + 'exists': true, + 'page': location.pageNumber, + 'zoom': location.scale, + 'scrollLeft': location.left, + 'scrollTop': location.top, + 'rotation': location.rotation + }).catch(function () {}); + } + var href = PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams); + PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href; + PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = href; + var currentPage = PDFViewerApplication.pdfViewer.getPageView(PDFViewerApplication.page - 1); + var loading = currentPage.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED; + PDFViewerApplication.toolbar.updateLoadingIndicatorState(loading); +} +function webViewerResize() { + var pdfDocument = PDFViewerApplication.pdfDocument, + pdfViewer = PDFViewerApplication.pdfViewer; + + if (!pdfDocument) { + return; + } + var currentScaleValue = pdfViewer.currentScaleValue; + if (currentScaleValue === 'auto' || currentScaleValue === 'page-fit' || currentScaleValue === 'page-width') { + pdfViewer.currentScaleValue = currentScaleValue; + } + pdfViewer.update(); +} +function webViewerHashchange(evt) { + var hash = evt.hash; + if (!hash) { + return; + } + if (!PDFViewerApplication.isInitialViewSet) { + PDFViewerApplication.initialBookmark = hash; + } else if (!PDFViewerApplication.pdfHistory.popStateInProgress) { + PDFViewerApplication.pdfLinkService.setHash(hash); + } +} +var webViewerFileInputChange = void 0; +{ + webViewerFileInputChange = function webViewerFileInputChange(evt) { + var file = evt.fileInput.files[0]; + if (!_pdfjsLib.PDFJS.disableCreateObjectURL && URL.createObjectURL) { + PDFViewerApplication.open(URL.createObjectURL(file)); + } else { + var fileReader = new FileReader(); + fileReader.onload = function webViewerChangeFileReaderOnload(evt) { + var buffer = evt.target.result; + PDFViewerApplication.open(new Uint8Array(buffer)); + }; + fileReader.readAsArrayBuffer(file); + } + PDFViewerApplication.setTitleUsingUrl(file.name); + var appConfig = PDFViewerApplication.appConfig; + appConfig.toolbar.viewBookmark.setAttribute('hidden', 'true'); + appConfig.secondaryToolbar.viewBookmarkButton.setAttribute('hidden', 'true'); + appConfig.toolbar.download.setAttribute('hidden', 'true'); + appConfig.secondaryToolbar.downloadButton.setAttribute('hidden', 'true'); + }; +} +function webViewerPresentationMode() { + PDFViewerApplication.requestPresentationMode(); +} +function webViewerOpenFile() { + var openFileInputName = PDFViewerApplication.appConfig.openFileInputName; + document.getElementById(openFileInputName).click(); +} +function webViewerPrint() { + window.print(); +} +function webViewerDownload() { + PDFViewerApplication.download(); +} +function webViewerFirstPage() { + if (PDFViewerApplication.pdfDocument) { + PDFViewerApplication.page = 1; + } +} +function webViewerLastPage() { + if (PDFViewerApplication.pdfDocument) { + PDFViewerApplication.page = PDFViewerApplication.pagesCount; + } +} +function webViewerNextPage() { + PDFViewerApplication.page++; +} +function webViewerPreviousPage() { + PDFViewerApplication.page--; +} +function webViewerZoomIn() { + PDFViewerApplication.zoomIn(); +} +function webViewerZoomOut() { + PDFViewerApplication.zoomOut(); +} +function webViewerPageNumberChanged(evt) { + var pdfViewer = PDFViewerApplication.pdfViewer; + pdfViewer.currentPageLabel = evt.value; + if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) { + PDFViewerApplication.toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + } +} +function webViewerScaleChanged(evt) { + PDFViewerApplication.pdfViewer.currentScaleValue = evt.value; +} +function webViewerRotateCw() { + PDFViewerApplication.rotatePages(90); +} +function webViewerRotateCcw() { + PDFViewerApplication.rotatePages(-90); +} +function webViewerDocumentProperties() { + PDFViewerApplication.pdfDocumentProperties.open(); +} +function webViewerFind(evt) { + PDFViewerApplication.findController.executeCommand('find' + evt.type, { + query: evt.query, + phraseSearch: evt.phraseSearch, + caseSensitive: evt.caseSensitive, + highlightAll: evt.highlightAll, + findPrevious: evt.findPrevious + }); +} +function webViewerFindFromUrlHash(evt) { + PDFViewerApplication.findController.executeCommand('find', { + query: evt.query, + phraseSearch: evt.phraseSearch, + caseSensitive: false, + highlightAll: true, + findPrevious: false + }); +} +function webViewerScaleChanging(evt) { + PDFViewerApplication.toolbar.setPageScale(evt.presetValue, evt.scale); + PDFViewerApplication.pdfViewer.update(); +} +function webViewerRotationChanging(evt) { + PDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation; + PDFViewerApplication.forceRendering(); + PDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber; +} +function webViewerPageChanging(evt) { + var page = evt.pageNumber; + PDFViewerApplication.toolbar.setPageNumber(page, evt.pageLabel || null); + PDFViewerApplication.secondaryToolbar.setPageNumber(page); + if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) { + PDFViewerApplication.pdfThumbnailViewer.scrollThumbnailIntoView(page); + } + if (_pdfjsLib.PDFJS.pdfBug && Stats.enabled) { + var pageView = PDFViewerApplication.pdfViewer.getPageView(page - 1); + if (pageView.stats) { + Stats.add(page, pageView.stats); + } + } +} +var zoomDisabled = false, + zoomDisabledTimeout = void 0; +function webViewerWheel(evt) { + var pdfViewer = PDFViewerApplication.pdfViewer; + if (pdfViewer.isInPresentationMode) { + return; + } + if (evt.ctrlKey || evt.metaKey) { + var support = PDFViewerApplication.supportedMouseWheelZoomModifierKeys; + if (evt.ctrlKey && !support.ctrlKey || evt.metaKey && !support.metaKey) { + return; + } + evt.preventDefault(); + if (zoomDisabled) { + return; + } + var previousScale = pdfViewer.currentScale; + var delta = (0, _ui_utils.normalizeWheelEventDelta)(evt); + var MOUSE_WHEEL_DELTA_PER_PAGE_SCALE = 3.0; + var ticks = delta * MOUSE_WHEEL_DELTA_PER_PAGE_SCALE; + if (ticks < 0) { + PDFViewerApplication.zoomOut(-ticks); + } else { + PDFViewerApplication.zoomIn(ticks); + } + var currentScale = pdfViewer.currentScale; + if (previousScale !== currentScale) { + var scaleCorrectionFactor = currentScale / previousScale - 1; + var rect = pdfViewer.container.getBoundingClientRect(); + var dx = evt.clientX - rect.left; + var dy = evt.clientY - rect.top; + pdfViewer.container.scrollLeft += dx * scaleCorrectionFactor; + pdfViewer.container.scrollTop += dy * scaleCorrectionFactor; + } + } else { + zoomDisabled = true; + clearTimeout(zoomDisabledTimeout); + zoomDisabledTimeout = setTimeout(function () { + zoomDisabled = false; + }, 1000); + } +} +function webViewerClick(evt) { + if (!PDFViewerApplication.secondaryToolbar.isOpen) { + return; + } + var appConfig = PDFViewerApplication.appConfig; + if (PDFViewerApplication.pdfViewer.containsElement(evt.target) || appConfig.toolbar.container.contains(evt.target) && evt.target !== appConfig.secondaryToolbar.toggleButton) { + PDFViewerApplication.secondaryToolbar.close(); + } +} +function webViewerKeyDown(evt) { + if (PDFViewerApplication.overlayManager.active) { + return; + } + var handled = false, + ensureViewerFocused = false; + var cmd = (evt.ctrlKey ? 1 : 0) | (evt.altKey ? 2 : 0) | (evt.shiftKey ? 4 : 0) | (evt.metaKey ? 8 : 0); + var pdfViewer = PDFViewerApplication.pdfViewer; + var isViewerInPresentationMode = pdfViewer && pdfViewer.isInPresentationMode; + if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) { + switch (evt.keyCode) { + case 70: + if (!PDFViewerApplication.supportsIntegratedFind) { + PDFViewerApplication.findBar.open(); + handled = true; + } + break; + case 71: + if (!PDFViewerApplication.supportsIntegratedFind) { + var findState = PDFViewerApplication.findController.state; + if (findState) { + PDFViewerApplication.findController.executeCommand('findagain', { + query: findState.query, + phraseSearch: findState.phraseSearch, + caseSensitive: findState.caseSensitive, + highlightAll: findState.highlightAll, + findPrevious: cmd === 5 || cmd === 12 + }); + } + handled = true; + } + break; + case 61: + case 107: + case 187: + case 171: + if (!isViewerInPresentationMode) { + PDFViewerApplication.zoomIn(); + } + handled = true; + break; + case 173: + case 109: + case 189: + if (!isViewerInPresentationMode) { + PDFViewerApplication.zoomOut(); + } + handled = true; + break; + case 48: + case 96: + if (!isViewerInPresentationMode) { + setTimeout(function () { + pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + }); + handled = false; + } + break; + case 38: + if (isViewerInPresentationMode || PDFViewerApplication.page > 1) { + PDFViewerApplication.page = 1; + handled = true; + ensureViewerFocused = true; + } + break; + case 40: + if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) { + PDFViewerApplication.page = PDFViewerApplication.pagesCount; + handled = true; + ensureViewerFocused = true; + } + break; + } + } + if (cmd === 1 || cmd === 8) { + switch (evt.keyCode) { + case 83: + PDFViewerApplication.download(); + handled = true; + break; + } + } + if (cmd === 3 || cmd === 10) { + switch (evt.keyCode) { + case 80: + PDFViewerApplication.requestPresentationMode(); + handled = true; + break; + case 71: + PDFViewerApplication.appConfig.toolbar.pageNumber.select(); + handled = true; + break; + } + } + if (handled) { + if (ensureViewerFocused && !isViewerInPresentationMode) { + pdfViewer.focus(); + } + evt.preventDefault(); + return; + } + var curElement = document.activeElement || document.querySelector(':focus'); + var curElementTagName = curElement && curElement.tagName.toUpperCase(); + if (curElementTagName === 'INPUT' || curElementTagName === 'TEXTAREA' || curElementTagName === 'SELECT') { + if (evt.keyCode !== 27) { + return; + } + } + if (cmd === 0) { + switch (evt.keyCode) { + case 38: + case 33: + case 8: + if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== 'page-fit') { + break; + } + case 37: + if (pdfViewer.isHorizontalScrollbarEnabled) { + break; + } + case 75: + case 80: + if (PDFViewerApplication.page > 1) { + PDFViewerApplication.page--; + } + handled = true; + break; + case 27: + if (PDFViewerApplication.secondaryToolbar.isOpen) { + PDFViewerApplication.secondaryToolbar.close(); + handled = true; + } + if (!PDFViewerApplication.supportsIntegratedFind && PDFViewerApplication.findBar.opened) { + PDFViewerApplication.findBar.close(); + handled = true; + } + break; + case 40: + case 34: + case 32: + if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== 'page-fit') { + break; + } + case 39: + if (pdfViewer.isHorizontalScrollbarEnabled) { + break; + } + case 74: + case 78: + if (PDFViewerApplication.page < PDFViewerApplication.pagesCount) { + PDFViewerApplication.page++; + } + handled = true; + break; + case 36: + if (isViewerInPresentationMode || PDFViewerApplication.page > 1) { + PDFViewerApplication.page = 1; + handled = true; + ensureViewerFocused = true; + } + break; + case 35: + if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) { + PDFViewerApplication.page = PDFViewerApplication.pagesCount; + handled = true; + ensureViewerFocused = true; + } + break; + case 83: + PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.SELECT); + break; + case 72: + PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.HAND); + break; + case 82: + PDFViewerApplication.rotatePages(90); + break; + } + } + if (cmd === 4) { + switch (evt.keyCode) { + case 32: + if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== 'page-fit') { + break; + } + if (PDFViewerApplication.page > 1) { + PDFViewerApplication.page--; + } + handled = true; + break; + case 82: + PDFViewerApplication.rotatePages(-90); + break; + } + } + if (!handled && !isViewerInPresentationMode) { + if (evt.keyCode >= 33 && evt.keyCode <= 40 || evt.keyCode === 32 && curElementTagName !== 'BUTTON') { + ensureViewerFocused = true; + } + } + if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) { + pdfViewer.focus(); + } + if (handled) { + evt.preventDefault(); + } +} +function apiPageModeToSidebarView(mode) { + switch (mode) { + case 'UseNone': + return _pdf_sidebar.SidebarView.NONE; + case 'UseThumbs': + return _pdf_sidebar.SidebarView.THUMBS; + case 'UseOutlines': + return _pdf_sidebar.SidebarView.OUTLINE; + case 'UseAttachments': + return _pdf_sidebar.SidebarView.ATTACHMENTS; + case 'UseOC': + } + return _pdf_sidebar.SidebarView.NONE; +} +var PDFPrintServiceFactory = { + instance: { + supportsPrinting: false, + createPrintService: function createPrintService() { + throw new Error('Not implemented: createPrintService'); + } + } +}; +exports.PDFViewerApplication = PDFViewerApplication; +exports.DefaultExternalServices = DefaultExternalServices; +exports.PDFPrintServiceFactory = PDFPrintServiceFactory; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SimpleLinkService = exports.PDFLinkService = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _dom_events = __webpack_require__(2); + +var _ui_utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var PDFLinkService = function () { + function PDFLinkService() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + eventBus = _ref.eventBus; + + _classCallCheck(this, PDFLinkService); + + this.eventBus = eventBus || (0, _dom_events.getGlobalEventBus)(); + this.baseUrl = null; + this.pdfDocument = null; + this.pdfViewer = null; + this.pdfHistory = null; + this._pagesRefCache = null; + } + + _createClass(PDFLinkService, [{ + key: 'setDocument', + value: function setDocument(pdfDocument, baseUrl) { + this.baseUrl = baseUrl; + this.pdfDocument = pdfDocument; + this._pagesRefCache = Object.create(null); + } + }, { + key: 'setViewer', + value: function setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + }, { + key: 'setHistory', + value: function setHistory(pdfHistory) { + this.pdfHistory = pdfHistory; + } + }, { + key: 'navigateTo', + value: function navigateTo(dest) { + var _this = this; + + var goToDestination = function goToDestination(_ref2) { + var namedDest = _ref2.namedDest, + explicitDest = _ref2.explicitDest; + + var destRef = explicitDest[0], + pageNumber = void 0; + if (destRef instanceof Object) { + pageNumber = _this._cachedPageNumber(destRef); + if (pageNumber === null) { + _this.pdfDocument.getPageIndex(destRef).then(function (pageIndex) { + _this.cachePageRef(pageIndex + 1, destRef); + goToDestination({ + namedDest: namedDest, + explicitDest: explicitDest + }); + }).catch(function () { + console.error('PDFLinkService.navigateTo: "' + destRef + '" is not ' + ('a valid page reference, for dest="' + dest + '".')); + }); + return; + } + } else if (Number.isInteger(destRef)) { + pageNumber = destRef + 1; + } else { + console.error('PDFLinkService.navigateTo: "' + destRef + '" is not ' + ('a valid destination reference, for dest="' + dest + '".')); + return; + } + if (!pageNumber || pageNumber < 1 || pageNumber > _this.pagesCount) { + console.error('PDFLinkService.navigateTo: "' + pageNumber + '" is not ' + ('a valid page number, for dest="' + dest + '".')); + return; + } + if (_this.pdfHistory) { + _this.pdfHistory.pushCurrentPosition(); + _this.pdfHistory.push({ + namedDest: namedDest, + explicitDest: explicitDest, + pageNumber: pageNumber + }); + } + _this.pdfViewer.scrollPageIntoView({ + pageNumber: pageNumber, + destArray: explicitDest + }); + }; + new Promise(function (resolve, reject) { + if (typeof dest === 'string') { + _this.pdfDocument.getDestination(dest).then(function (destArray) { + resolve({ + namedDest: dest, + explicitDest: destArray + }); + }); + return; + } + resolve({ + namedDest: '', + explicitDest: dest + }); + }).then(function (data) { + if (!(data.explicitDest instanceof Array)) { + console.error('PDFLinkService.navigateTo: "' + data.explicitDest + '" is' + (' not a valid destination array, for dest="' + dest + '".')); + return; + } + goToDestination(data); + }); + } + }, { + key: 'getDestinationHash', + value: function getDestinationHash(dest) { + if (typeof dest === 'string') { + return this.getAnchorUrl('#' + escape(dest)); + } + if (dest instanceof Array) { + var str = JSON.stringify(dest); + return this.getAnchorUrl('#' + escape(str)); + } + return this.getAnchorUrl(''); + } + }, { + key: 'getAnchorUrl', + value: function getAnchorUrl(anchor) { + return (this.baseUrl || '') + anchor; + } + }, { + key: 'setHash', + value: function setHash(hash) { + var pageNumber = void 0, + dest = void 0; + if (hash.indexOf('=') >= 0) { + var params = (0, _ui_utils.parseQueryString)(hash); + if ('search' in params) { + this.eventBus.dispatch('findfromurlhash', { + source: this, + query: params['search'].replace(/"/g, ''), + phraseSearch: params['phrase'] === 'true' + }); + } + if ('nameddest' in params) { + this.navigateTo(params.nameddest); + return; + } + if ('page' in params) { + pageNumber = params.page | 0 || 1; + } + if ('zoom' in params) { + var zoomArgs = params.zoom.split(','); + var zoomArg = zoomArgs[0]; + var zoomArgNumber = parseFloat(zoomArg); + if (zoomArg.indexOf('Fit') === -1) { + dest = [null, { name: 'XYZ' }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg]; + } else { + if (zoomArg === 'Fit' || zoomArg === 'FitB') { + dest = [null, { name: zoomArg }]; + } else if (zoomArg === 'FitH' || zoomArg === 'FitBH' || zoomArg === 'FitV' || zoomArg === 'FitBV') { + dest = [null, { name: zoomArg }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null]; + } else if (zoomArg === 'FitR') { + if (zoomArgs.length !== 5) { + console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'); + } else { + dest = [null, { name: zoomArg }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0]; + } + } else { + console.error('PDFLinkService.setHash: "' + zoomArg + '" is not ' + 'a valid zoom value.'); + } + } + } + if (dest) { + this.pdfViewer.scrollPageIntoView({ + pageNumber: pageNumber || this.page, + destArray: dest, + allowNegativeOffset: true + }); + } else if (pageNumber) { + this.page = pageNumber; + } + if ('pagemode' in params) { + this.eventBus.dispatch('pagemode', { + source: this, + mode: params.pagemode + }); + } + } else { + if (/^\d+$/.test(hash) && hash <= this.pagesCount) { + console.warn('PDFLinkService_setHash: specifying a page number ' + 'directly after the hash symbol (#) is deprecated, ' + ('please use the "#page=' + hash + '" form instead.')); + this.page = hash | 0; + } + dest = unescape(hash); + try { + dest = JSON.parse(dest); + if (!(dest instanceof Array)) { + dest = dest.toString(); + } + } catch (ex) {} + if (typeof dest === 'string' || isValidExplicitDestination(dest)) { + this.navigateTo(dest); + return; + } + console.error('PDFLinkService.setHash: "' + unescape(hash) + '" is not ' + 'a valid destination.'); + } + } + }, { + key: 'executeNamedAction', + value: function executeNamedAction(action) { + switch (action) { + case 'GoBack': + if (this.pdfHistory) { + this.pdfHistory.back(); + } + break; + case 'GoForward': + if (this.pdfHistory) { + this.pdfHistory.forward(); + } + break; + case 'NextPage': + if (this.page < this.pagesCount) { + this.page++; + } + break; + case 'PrevPage': + if (this.page > 1) { + this.page--; + } + break; + case 'LastPage': + this.page = this.pagesCount; + break; + case 'FirstPage': + this.page = 1; + break; + default: + break; + } + this.eventBus.dispatch('namedaction', { + source: this, + action: action + }); + } + }, { + key: 'onFileAttachmentAnnotation', + value: function onFileAttachmentAnnotation(_ref3) { + var id = _ref3.id, + filename = _ref3.filename, + content = _ref3.content; + + this.eventBus.dispatch('fileattachmentannotation', { + source: this, + id: id, + filename: filename, + content: content + }); + } + }, { + key: 'cachePageRef', + value: function cachePageRef(pageNum, pageRef) { + var refStr = pageRef.num + ' ' + pageRef.gen + ' R'; + this._pagesRefCache[refStr] = pageNum; + } + }, { + key: '_cachedPageNumber', + value: function _cachedPageNumber(pageRef) { + var refStr = pageRef.num + ' ' + pageRef.gen + ' R'; + return this._pagesRefCache && this._pagesRefCache[refStr] || null; + } + }, { + key: 'pagesCount', + get: function get() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + } + }, { + key: 'page', + get: function get() { + return this.pdfViewer.currentPageNumber; + }, + set: function set(value) { + this.pdfViewer.currentPageNumber = value; + } + }, { + key: 'rotation', + get: function get() { + return this.pdfViewer.pagesRotation; + }, + set: function set(value) { + this.pdfViewer.pagesRotation = value; + } + }]); + + return PDFLinkService; +}(); + +function isValidExplicitDestination(dest) { + if (!(dest instanceof Array)) { + return false; + } + var destLength = dest.length, + allowNull = true; + if (destLength < 2) { + return false; + } + var page = dest[0]; + if (!((typeof page === 'undefined' ? 'undefined' : _typeof(page)) === 'object' && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) { + return false; + } + var zoom = dest[1]; + if (!((typeof zoom === 'undefined' ? 'undefined' : _typeof(zoom)) === 'object' && typeof zoom.name === 'string')) { + return false; + } + switch (zoom.name) { + case 'XYZ': + if (destLength !== 5) { + return false; + } + break; + case 'Fit': + case 'FitB': + return destLength === 2; + case 'FitH': + case 'FitBH': + case 'FitV': + case 'FitBV': + if (destLength !== 3) { + return false; + } + break; + case 'FitR': + if (destLength !== 6) { + return false; + } + allowNull = false; + break; + default: + return false; + } + for (var i = 2; i < destLength; i++) { + var param = dest[i]; + if (!(typeof param === 'number' || allowNull && param === null)) { + return false; + } + } + return true; +} + +var SimpleLinkService = function () { + function SimpleLinkService() { + _classCallCheck(this, SimpleLinkService); + } + + _createClass(SimpleLinkService, [{ + key: 'navigateTo', + value: function navigateTo(dest) {} + }, { + key: 'getDestinationHash', + value: function getDestinationHash(dest) { + return '#'; + } + }, { + key: 'getAnchorUrl', + value: function getAnchorUrl(hash) { + return '#'; + } + }, { + key: 'setHash', + value: function setHash(hash) {} + }, { + key: 'executeNamedAction', + value: function executeNamedAction(action) {} + }, { + key: 'onFileAttachmentAnnotation', + value: function onFileAttachmentAnnotation(_ref4) { + var id = _ref4.id, + filename = _ref4.filename, + content = _ref4.content; + } + }, { + key: 'cachePageRef', + value: function cachePageRef(pageNum, pageRef) {} + }, { + key: 'page', + get: function get() { + return 0; + }, + set: function set(value) {} + }, { + key: 'rotation', + get: function get() { + return 0; + }, + set: function set(value) {} + }]); + + return SimpleLinkService; +}(); + +exports.PDFLinkService = PDFLinkService; +exports.SimpleLinkService = SimpleLinkService; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFCursorTools = exports.CursorTool = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _grab_to_pan = __webpack_require__(9); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var CursorTool = { + SELECT: 0, + HAND: 1, + ZOOM: 2 +}; + +var PDFCursorTools = function () { + function PDFCursorTools(_ref) { + var _this = this; + + var container = _ref.container, + eventBus = _ref.eventBus, + preferences = _ref.preferences; + + _classCallCheck(this, PDFCursorTools); + + this.container = container; + this.eventBus = eventBus; + this.active = CursorTool.SELECT; + this.activeBeforePresentationMode = null; + this.handTool = new _grab_to_pan.GrabToPan({ element: this.container }); + this._addEventListeners(); + Promise.all([preferences.get('cursorToolOnLoad'), preferences.get('enableHandToolOnLoad')]).then(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + cursorToolPref = _ref3[0], + handToolPref = _ref3[1]; + + if (handToolPref === true) { + preferences.set('enableHandToolOnLoad', false); + if (cursorToolPref === CursorTool.SELECT) { + cursorToolPref = CursorTool.HAND; + preferences.set('cursorToolOnLoad', cursorToolPref).catch(function () {}); + } + } + _this.switchTool(cursorToolPref); + }).catch(function () {}); + } + + _createClass(PDFCursorTools, [{ + key: 'switchTool', + value: function switchTool(tool) { + var _this2 = this; + + if (this.activeBeforePresentationMode !== null) { + return; + } + if (tool === this.active) { + return; + } + var disableActiveTool = function disableActiveTool() { + switch (_this2.active) { + case CursorTool.SELECT: + break; + case CursorTool.HAND: + _this2.handTool.deactivate(); + break; + case CursorTool.ZOOM: + } + }; + switch (tool) { + case CursorTool.SELECT: + disableActiveTool(); + break; + case CursorTool.HAND: + disableActiveTool(); + this.handTool.activate(); + break; + case CursorTool.ZOOM: + default: + console.error('switchTool: "' + tool + '" is an unsupported value.'); + return; + } + this.active = tool; + this._dispatchEvent(); + } + }, { + key: '_dispatchEvent', + value: function _dispatchEvent() { + this.eventBus.dispatch('cursortoolchanged', { + source: this, + tool: this.active + }); + } + }, { + key: '_addEventListeners', + value: function _addEventListeners() { + var _this3 = this; + + this.eventBus.on('switchcursortool', function (evt) { + _this3.switchTool(evt.tool); + }); + this.eventBus.on('presentationmodechanged', function (evt) { + if (evt.switchInProgress) { + return; + } + var previouslyActive = void 0; + if (evt.active) { + previouslyActive = _this3.active; + _this3.switchTool(CursorTool.SELECT); + _this3.activeBeforePresentationMode = previouslyActive; + } else { + previouslyActive = _this3.activeBeforePresentationMode; + _this3.activeBeforePresentationMode = null; + _this3.switchTool(previouslyActive); + } + }); + } + }, { + key: 'activeTool', + get: function get() { + return this.active; + } + }]); + + return PDFCursorTools; +}(); + +exports.CursorTool = CursorTool; +exports.PDFCursorTools = PDFCursorTools; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFFindController = exports.FindState = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdfjsLib = __webpack_require__(1); + +var _ui_utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var FindState = { + FOUND: 0, + NOT_FOUND: 1, + WRAPPED: 2, + PENDING: 3 +}; +var FIND_SCROLL_OFFSET_TOP = -50; +var FIND_SCROLL_OFFSET_LEFT = -400; +var FIND_TIMEOUT = 250; +var CHARACTERS_TO_NORMALIZE = { + '\u2018': '\'', + '\u2019': '\'', + '\u201A': '\'', + '\u201B': '\'', + '\u201C': '"', + '\u201D': '"', + '\u201E': '"', + '\u201F': '"', + '\xBC': '1/4', + '\xBD': '1/2', + '\xBE': '3/4' +}; + +var PDFFindController = function () { + function PDFFindController(_ref) { + var pdfViewer = _ref.pdfViewer; + + _classCallCheck(this, PDFFindController); + + this.pdfViewer = pdfViewer; + this.onUpdateResultsCount = null; + this.onUpdateState = null; + this.reset(); + var replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(''); + this.normalizationRegex = new RegExp('[' + replace + ']', 'g'); + } + + _createClass(PDFFindController, [{ + key: 'reset', + value: function reset() { + var _this = this; + + this.startedTextExtraction = false; + this.extractTextPromises = []; + this.pendingFindMatches = Object.create(null); + this.active = false; + this.pageContents = []; + this.pageMatches = []; + this.pageMatchesLength = null; + this.matchCount = 0; + this.selected = { + pageIdx: -1, + matchIdx: -1 + }; + this.offset = { + pageIdx: null, + matchIdx: null + }; + this.pagesToSearch = null; + this.resumePageIdx = null; + this.state = null; + this.dirtyMatch = false; + this.findTimeout = null; + this._firstPagePromise = new Promise(function (resolve) { + _this.resolveFirstPage = resolve; + }); + } + }, { + key: 'normalize', + value: function normalize(text) { + return text.replace(this.normalizationRegex, function (ch) { + return CHARACTERS_TO_NORMALIZE[ch]; + }); + } + }, { + key: '_prepareMatches', + value: function _prepareMatches(matchesWithLength, matches, matchesLength) { + function isSubTerm(matchesWithLength, currentIndex) { + var currentElem = matchesWithLength[currentIndex]; + var nextElem = matchesWithLength[currentIndex + 1]; + if (currentIndex < matchesWithLength.length - 1 && currentElem.match === nextElem.match) { + currentElem.skipped = true; + return true; + } + for (var i = currentIndex - 1; i >= 0; i--) { + var prevElem = matchesWithLength[i]; + if (prevElem.skipped) { + continue; + } + if (prevElem.match + prevElem.matchLength < currentElem.match) { + break; + } + if (prevElem.match + prevElem.matchLength >= currentElem.match + currentElem.matchLength) { + currentElem.skipped = true; + return true; + } + } + return false; + } + matchesWithLength.sort(function (a, b) { + return a.match === b.match ? a.matchLength - b.matchLength : a.match - b.match; + }); + for (var i = 0, len = matchesWithLength.length; i < len; i++) { + if (isSubTerm(matchesWithLength, i)) { + continue; + } + matches.push(matchesWithLength[i].match); + matchesLength.push(matchesWithLength[i].matchLength); + } + } + }, { + key: 'calcFindPhraseMatch', + value: function calcFindPhraseMatch(query, pageIndex, pageContent) { + var matches = []; + var queryLen = query.length; + var matchIdx = -queryLen; + while (true) { + matchIdx = pageContent.indexOf(query, matchIdx + queryLen); + if (matchIdx === -1) { + break; + } + matches.push(matchIdx); + } + this.pageMatches[pageIndex] = matches; + } + }, { + key: 'calcFindWordMatch', + value: function calcFindWordMatch(query, pageIndex, pageContent) { + var matchesWithLength = []; + var queryArray = query.match(/\S+/g); + for (var i = 0, len = queryArray.length; i < len; i++) { + var subquery = queryArray[i]; + var subqueryLen = subquery.length; + var matchIdx = -subqueryLen; + while (true) { + matchIdx = pageContent.indexOf(subquery, matchIdx + subqueryLen); + if (matchIdx === -1) { + break; + } + matchesWithLength.push({ + match: matchIdx, + matchLength: subqueryLen, + skipped: false + }); + } + } + if (!this.pageMatchesLength) { + this.pageMatchesLength = []; + } + this.pageMatchesLength[pageIndex] = []; + this.pageMatches[pageIndex] = []; + this._prepareMatches(matchesWithLength, this.pageMatches[pageIndex], this.pageMatchesLength[pageIndex]); + } + }, { + key: 'calcFindMatch', + value: function calcFindMatch(pageIndex) { + var pageContent = this.normalize(this.pageContents[pageIndex]); + var query = this.normalize(this.state.query); + var caseSensitive = this.state.caseSensitive; + var phraseSearch = this.state.phraseSearch; + var queryLen = query.length; + if (queryLen === 0) { + return; + } + if (!caseSensitive) { + pageContent = pageContent.toLowerCase(); + query = query.toLowerCase(); + } + if (phraseSearch) { + this.calcFindPhraseMatch(query, pageIndex, pageContent); + } else { + this.calcFindWordMatch(query, pageIndex, pageContent); + } + this.updatePage(pageIndex); + if (this.resumePageIdx === pageIndex) { + this.resumePageIdx = null; + this.nextPageMatch(); + } + if (this.pageMatches[pageIndex].length > 0) { + this.matchCount += this.pageMatches[pageIndex].length; + this.updateUIResultsCount(); + } + } + }, { + key: 'extractText', + value: function extractText() { + var _this2 = this; + + if (this.startedTextExtraction) { + return; + } + this.startedTextExtraction = true; + this.pageContents.length = 0; + var promise = Promise.resolve(); + + var _loop = function _loop(i, ii) { + var extractTextCapability = (0, _pdfjsLib.createPromiseCapability)(); + _this2.extractTextPromises[i] = extractTextCapability.promise; + promise = promise.then(function () { + return _this2.pdfViewer.getPageTextContent(i).then(function (textContent) { + var textItems = textContent.items; + var strBuf = []; + for (var j = 0, jj = textItems.length; j < jj; j++) { + strBuf.push(textItems[j].str); + } + _this2.pageContents[i] = strBuf.join(''); + extractTextCapability.resolve(i); + }, function (reason) { + console.error('Unable to get page ' + (i + 1) + ' text content', reason); + _this2.pageContents[i] = ''; + extractTextCapability.resolve(i); + }); + }); + }; + + for (var i = 0, ii = this.pdfViewer.pagesCount; i < ii; i++) { + _loop(i, ii); + } + } + }, { + key: 'executeCommand', + value: function executeCommand(cmd, state) { + var _this3 = this; + + if (this.state === null || cmd !== 'findagain') { + this.dirtyMatch = true; + } + this.state = state; + this.updateUIState(FindState.PENDING); + this._firstPagePromise.then(function () { + _this3.extractText(); + clearTimeout(_this3.findTimeout); + if (cmd === 'find') { + _this3.findTimeout = setTimeout(_this3.nextMatch.bind(_this3), FIND_TIMEOUT); + } else { + _this3.nextMatch(); + } + }); + } + }, { + key: 'updatePage', + value: function updatePage(index) { + if (this.selected.pageIdx === index) { + this.pdfViewer.currentPageNumber = index + 1; + } + var page = this.pdfViewer.getPageView(index); + if (page.textLayer) { + page.textLayer.updateMatches(); + } + } + }, { + key: 'nextMatch', + value: function nextMatch() { + var _this4 = this; + + var previous = this.state.findPrevious; + var currentPageIndex = this.pdfViewer.currentPageNumber - 1; + var numPages = this.pdfViewer.pagesCount; + this.active = true; + if (this.dirtyMatch) { + this.dirtyMatch = false; + this.selected.pageIdx = this.selected.matchIdx = -1; + this.offset.pageIdx = currentPageIndex; + this.offset.matchIdx = null; + this.hadMatch = false; + this.resumePageIdx = null; + this.pageMatches = []; + this.matchCount = 0; + this.pageMatchesLength = null; + for (var i = 0; i < numPages; i++) { + this.updatePage(i); + if (!(i in this.pendingFindMatches)) { + this.pendingFindMatches[i] = true; + this.extractTextPromises[i].then(function (pageIdx) { + delete _this4.pendingFindMatches[pageIdx]; + _this4.calcFindMatch(pageIdx); + }); + } + } + } + if (this.state.query === '') { + this.updateUIState(FindState.FOUND); + return; + } + if (this.resumePageIdx) { + return; + } + var offset = this.offset; + this.pagesToSearch = numPages; + if (offset.matchIdx !== null) { + var numPageMatches = this.pageMatches[offset.pageIdx].length; + if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) { + this.hadMatch = true; + offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1; + this.updateMatch(true); + return; + } + this.advanceOffsetPage(previous); + } + this.nextPageMatch(); + } + }, { + key: 'matchesReady', + value: function matchesReady(matches) { + var offset = this.offset; + var numMatches = matches.length; + var previous = this.state.findPrevious; + if (numMatches) { + this.hadMatch = true; + offset.matchIdx = previous ? numMatches - 1 : 0; + this.updateMatch(true); + return true; + } + this.advanceOffsetPage(previous); + if (offset.wrapped) { + offset.matchIdx = null; + if (this.pagesToSearch < 0) { + this.updateMatch(false); + return true; + } + } + return false; + } + }, { + key: 'updateMatchPosition', + value: function updateMatchPosition(pageIndex, matchIndex, elements, beginIdx) { + if (this.selected.matchIdx === matchIndex && this.selected.pageIdx === pageIndex) { + var spot = { + top: FIND_SCROLL_OFFSET_TOP, + left: FIND_SCROLL_OFFSET_LEFT + }; + (0, _ui_utils.scrollIntoView)(elements[beginIdx], spot, true); + } + } + }, { + key: 'nextPageMatch', + value: function nextPageMatch() { + if (this.resumePageIdx !== null) { + console.error('There can only be one pending page.'); + } + var matches = null; + do { + var pageIdx = this.offset.pageIdx; + matches = this.pageMatches[pageIdx]; + if (!matches) { + this.resumePageIdx = pageIdx; + break; + } + } while (!this.matchesReady(matches)); + } + }, { + key: 'advanceOffsetPage', + value: function advanceOffsetPage(previous) { + var offset = this.offset; + var numPages = this.extractTextPromises.length; + offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1; + offset.matchIdx = null; + this.pagesToSearch--; + if (offset.pageIdx >= numPages || offset.pageIdx < 0) { + offset.pageIdx = previous ? numPages - 1 : 0; + offset.wrapped = true; + } + } + }, { + key: 'updateMatch', + value: function updateMatch() { + var found = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var state = FindState.NOT_FOUND; + var wrapped = this.offset.wrapped; + this.offset.wrapped = false; + if (found) { + var previousPage = this.selected.pageIdx; + this.selected.pageIdx = this.offset.pageIdx; + this.selected.matchIdx = this.offset.matchIdx; + state = wrapped ? FindState.WRAPPED : FindState.FOUND; + if (previousPage !== -1 && previousPage !== this.selected.pageIdx) { + this.updatePage(previousPage); + } + } + this.updateUIState(state, this.state.findPrevious); + if (this.selected.pageIdx !== -1) { + this.updatePage(this.selected.pageIdx); + } + } + }, { + key: 'updateUIResultsCount', + value: function updateUIResultsCount() { + if (this.onUpdateResultsCount) { + this.onUpdateResultsCount(this.matchCount); + } + } + }, { + key: 'updateUIState', + value: function updateUIState(state, previous) { + if (this.onUpdateState) { + this.onUpdateState(state, previous, this.matchCount); + } + } + }]); + + return PDFFindController; +}(); + +exports.FindState = FindState; +exports.PDFFindController = PDFFindController; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var DEFAULT_URL = ''; +; +var pdfjsWebApp = void 0; +{ + pdfjsWebApp = __webpack_require__(4); +} +; +{ + __webpack_require__(29); +} +; +{ + __webpack_require__(34); +} +function getViewerConfiguration() { + return { + appContainer: document.body, + mainContainer: document.getElementById('viewerContainer'), + viewerContainer: document.getElementById('viewer'), + eventBus: null, + toolbar: { + container: document.getElementById('toolbarViewer'), + numPages: document.getElementById('numPages'), + pageNumber: document.getElementById('pageNumber'), + scaleSelectContainer: document.getElementById('scaleSelectContainer'), + scaleSelect: document.getElementById('scaleSelect'), + customScaleOption: document.getElementById('customScaleOption'), + previous: document.getElementById('previous'), + next: document.getElementById('next'), + zoomIn: document.getElementById('zoomIn'), + zoomOut: document.getElementById('zoomOut'), + viewFind: document.getElementById('viewFind'), + openFile: document.getElementById('openFile'), + print: document.getElementById('print'), + presentationModeButton: document.getElementById('presentationMode'), + download: document.getElementById('download'), + viewBookmark: document.getElementById('viewBookmark') + }, + secondaryToolbar: { + toolbar: document.getElementById('secondaryToolbar'), + toggleButton: document.getElementById('secondaryToolbarToggle'), + toolbarButtonContainer: document.getElementById('secondaryToolbarButtonContainer'), + presentationModeButton: document.getElementById('secondaryPresentationMode'), + openFileButton: document.getElementById('secondaryOpenFile'), + printButton: document.getElementById('secondaryPrint'), + downloadButton: document.getElementById('secondaryDownload'), + viewBookmarkButton: document.getElementById('secondaryViewBookmark'), + firstPageButton: document.getElementById('firstPage'), + lastPageButton: document.getElementById('lastPage'), + pageRotateCwButton: document.getElementById('pageRotateCw'), + pageRotateCcwButton: document.getElementById('pageRotateCcw'), + cursorSelectToolButton: document.getElementById('cursorSelectTool'), + cursorHandToolButton: document.getElementById('cursorHandTool'), + documentPropertiesButton: document.getElementById('documentProperties') + }, + fullscreen: { + contextFirstPage: document.getElementById('contextFirstPage'), + contextLastPage: document.getElementById('contextLastPage'), + contextPageRotateCw: document.getElementById('contextPageRotateCw'), + contextPageRotateCcw: document.getElementById('contextPageRotateCcw') + }, + sidebar: { + mainContainer: document.getElementById('mainContainer'), + outerContainer: document.getElementById('outerContainer'), + toggleButton: document.getElementById('sidebarToggle'), + thumbnailButton: document.getElementById('viewThumbnail'), + outlineButton: document.getElementById('viewOutline'), + attachmentsButton: document.getElementById('viewAttachments'), + thumbnailView: document.getElementById('thumbnailView'), + outlineView: document.getElementById('outlineView'), + attachmentsView: document.getElementById('attachmentsView') + }, + findBar: { + bar: document.getElementById('findbar'), + toggleButton: document.getElementById('viewFind'), + findField: document.getElementById('findInput'), + highlightAllCheckbox: document.getElementById('findHighlightAll'), + caseSensitiveCheckbox: document.getElementById('findMatchCase'), + findMsg: document.getElementById('findMsg'), + findResultsCount: document.getElementById('findResultsCount'), + findStatusIcon: document.getElementById('findStatusIcon'), + findPreviousButton: document.getElementById('findPrevious'), + findNextButton: document.getElementById('findNext') + }, + passwordOverlay: { + overlayName: 'passwordOverlay', + container: document.getElementById('passwordOverlay'), + label: document.getElementById('passwordText'), + input: document.getElementById('password'), + submitButton: document.getElementById('passwordSubmit'), + cancelButton: document.getElementById('passwordCancel') + }, + documentProperties: { + overlayName: 'documentPropertiesOverlay', + container: document.getElementById('documentPropertiesOverlay'), + closeButton: document.getElementById('documentPropertiesClose'), + fields: { + 'fileName': document.getElementById('fileNameField'), + 'fileSize': document.getElementById('fileSizeField'), + 'title': document.getElementById('titleField'), + 'author': document.getElementById('authorField'), + 'subject': document.getElementById('subjectField'), + 'keywords': document.getElementById('keywordsField'), + 'creationDate': document.getElementById('creationDateField'), + 'modificationDate': document.getElementById('modificationDateField'), + 'creator': document.getElementById('creatorField'), + 'producer': document.getElementById('producerField'), + 'version': document.getElementById('versionField'), + 'pageCount': document.getElementById('pageCountField') + } + }, + errorWrapper: { + container: document.getElementById('errorWrapper'), + errorMessage: document.getElementById('errorMessage'), + closeButton: document.getElementById('errorClose'), + errorMoreInfo: document.getElementById('errorMoreInfo'), + moreInfoButton: document.getElementById('errorShowMore'), + lessInfoButton: document.getElementById('errorShowLess') + }, + printContainer: document.getElementById('printContainer'), + openFileInputName: 'fileInput', + debuggerScriptPath: './debugger.js', + defaultUrl: DEFAULT_URL + }; +} +function webViewerLoad() { + var config = getViewerConfiguration(); + window.PDFViewerApplication = pdfjsWebApp.PDFViewerApplication; + pdfjsWebApp.PDFViewerApplication.run(config); +} +if (document.readyState === 'interactive' || document.readyState === 'complete') { + webViewerLoad(); +} else { + document.addEventListener('DOMContentLoaded', webViewerLoad, true); +} + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +function GrabToPan(options) { + this.element = options.element; + this.document = options.element.ownerDocument; + if (typeof options.ignoreTarget === 'function') { + this.ignoreTarget = options.ignoreTarget; + } + this.onActiveChanged = options.onActiveChanged; + this.activate = this.activate.bind(this); + this.deactivate = this.deactivate.bind(this); + this.toggle = this.toggle.bind(this); + this._onmousedown = this._onmousedown.bind(this); + this._onmousemove = this._onmousemove.bind(this); + this._endPan = this._endPan.bind(this); + var overlay = this.overlay = document.createElement('div'); + overlay.className = 'grab-to-pan-grabbing'; +} +GrabToPan.prototype = { + CSS_CLASS_GRAB: 'grab-to-pan-grab', + activate: function GrabToPan_activate() { + if (!this.active) { + this.active = true; + this.element.addEventListener('mousedown', this._onmousedown, true); + this.element.classList.add(this.CSS_CLASS_GRAB); + if (this.onActiveChanged) { + this.onActiveChanged(true); + } + } + }, + deactivate: function GrabToPan_deactivate() { + if (this.active) { + this.active = false; + this.element.removeEventListener('mousedown', this._onmousedown, true); + this._endPan(); + this.element.classList.remove(this.CSS_CLASS_GRAB); + if (this.onActiveChanged) { + this.onActiveChanged(false); + } + } + }, + toggle: function GrabToPan_toggle() { + if (this.active) { + this.deactivate(); + } else { + this.activate(); + } + }, + ignoreTarget: function GrabToPan_ignoreTarget(node) { + return node[matchesSelector]('a[href], a[href] *, input, textarea, button, button *, select, option'); + }, + _onmousedown: function GrabToPan__onmousedown(event) { + if (event.button !== 0 || this.ignoreTarget(event.target)) { + return; + } + if (event.originalTarget) { + try { + event.originalTarget.tagName; + } catch (e) { + return; + } + } + this.scrollLeftStart = this.element.scrollLeft; + this.scrollTopStart = this.element.scrollTop; + this.clientXStart = event.clientX; + this.clientYStart = event.clientY; + this.document.addEventListener('mousemove', this._onmousemove, true); + this.document.addEventListener('mouseup', this._endPan, true); + this.element.addEventListener('scroll', this._endPan, true); + event.preventDefault(); + event.stopPropagation(); + var focusedElement = document.activeElement; + if (focusedElement && !focusedElement.contains(event.target)) { + focusedElement.blur(); + } + }, + _onmousemove: function GrabToPan__onmousemove(event) { + this.element.removeEventListener('scroll', this._endPan, true); + if (isLeftMouseReleased(event)) { + this._endPan(); + return; + } + var xDiff = event.clientX - this.clientXStart; + var yDiff = event.clientY - this.clientYStart; + var scrollTop = this.scrollTopStart - yDiff; + var scrollLeft = this.scrollLeftStart - xDiff; + if (this.element.scrollTo) { + this.element.scrollTo({ + top: scrollTop, + left: scrollLeft, + behavior: 'instant' + }); + } else { + this.element.scrollTop = scrollTop; + this.element.scrollLeft = scrollLeft; + } + if (!this.overlay.parentNode) { + document.body.appendChild(this.overlay); + } + }, + _endPan: function GrabToPan__endPan() { + this.element.removeEventListener('scroll', this._endPan, true); + this.document.removeEventListener('mousemove', this._onmousemove, true); + this.document.removeEventListener('mouseup', this._endPan, true); + this.overlay.remove(); + } +}; +var matchesSelector; +['webkitM', 'mozM', 'msM', 'oM', 'm'].some(function (prefix) { + var name = prefix + 'atches'; + if (name in document.documentElement) { + matchesSelector = name; + } + name += 'Selector'; + if (name in document.documentElement) { + matchesSelector = name; + } + return matchesSelector; +}); +var isNotIEorIsIE10plus = !document.documentMode || document.documentMode > 9; +var chrome = window.chrome; +var isChrome15OrOpera15plus = chrome && (chrome.webstore || chrome.app); +var isSafari6plus = /Apple/.test(navigator.vendor) && /Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent); +function isLeftMouseReleased(event) { + if ('buttons' in event && isNotIEorIsIE10plus) { + return !(event.buttons & 1); + } + if (isChrome15OrOpera15plus || isSafari6plus) { + return event.which === 0; + } +} +exports.GrabToPan = GrabToPan; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFSidebar = exports.SidebarView = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +var _pdf_rendering_queue = __webpack_require__(3); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var UI_NOTIFICATION_CLASS = 'pdfSidebarNotification'; +var SidebarView = { + NONE: 0, + THUMBS: 1, + OUTLINE: 2, + ATTACHMENTS: 3 +}; + +var PDFSidebar = function () { + function PDFSidebar(options) { + var l10n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _ui_utils.NullL10n; + + _classCallCheck(this, PDFSidebar); + + this.isOpen = false; + this.active = SidebarView.THUMBS; + this.isInitialViewSet = false; + this.onToggled = null; + this.pdfViewer = options.pdfViewer; + this.pdfThumbnailViewer = options.pdfThumbnailViewer; + this.pdfOutlineViewer = options.pdfOutlineViewer; + this.mainContainer = options.mainContainer; + this.outerContainer = options.outerContainer; + this.eventBus = options.eventBus; + this.toggleButton = options.toggleButton; + this.thumbnailButton = options.thumbnailButton; + this.outlineButton = options.outlineButton; + this.attachmentsButton = options.attachmentsButton; + this.thumbnailView = options.thumbnailView; + this.outlineView = options.outlineView; + this.attachmentsView = options.attachmentsView; + this.disableNotification = options.disableNotification || false; + this.l10n = l10n; + this._addEventListeners(); + } + + _createClass(PDFSidebar, [{ + key: 'reset', + value: function reset() { + this.isInitialViewSet = false; + this._hideUINotification(null); + this.switchView(SidebarView.THUMBS); + this.outlineButton.disabled = false; + this.attachmentsButton.disabled = false; + } + }, { + key: 'setInitialView', + value: function setInitialView() { + var view = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SidebarView.NONE; + + if (this.isInitialViewSet) { + return; + } + this.isInitialViewSet = true; + if (this.isOpen && view === SidebarView.NONE) { + this._dispatchEvent(); + return; + } + var isViewPreserved = view === this.visibleView; + this.switchView(view, true); + if (isViewPreserved) { + this._dispatchEvent(); + } + } + }, { + key: 'switchView', + value: function switchView(view) { + var forceOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (view === SidebarView.NONE) { + this.close(); + return; + } + var isViewChanged = view !== this.active; + var shouldForceRendering = false; + switch (view) { + case SidebarView.THUMBS: + this.thumbnailButton.classList.add('toggled'); + this.outlineButton.classList.remove('toggled'); + this.attachmentsButton.classList.remove('toggled'); + this.thumbnailView.classList.remove('hidden'); + this.outlineView.classList.add('hidden'); + this.attachmentsView.classList.add('hidden'); + if (this.isOpen && isViewChanged) { + this._updateThumbnailViewer(); + shouldForceRendering = true; + } + break; + case SidebarView.OUTLINE: + if (this.outlineButton.disabled) { + return; + } + this.thumbnailButton.classList.remove('toggled'); + this.outlineButton.classList.add('toggled'); + this.attachmentsButton.classList.remove('toggled'); + this.thumbnailView.classList.add('hidden'); + this.outlineView.classList.remove('hidden'); + this.attachmentsView.classList.add('hidden'); + break; + case SidebarView.ATTACHMENTS: + if (this.attachmentsButton.disabled) { + return; + } + this.thumbnailButton.classList.remove('toggled'); + this.outlineButton.classList.remove('toggled'); + this.attachmentsButton.classList.add('toggled'); + this.thumbnailView.classList.add('hidden'); + this.outlineView.classList.add('hidden'); + this.attachmentsView.classList.remove('hidden'); + break; + default: + console.error('PDFSidebar_switchView: "' + view + '" is an unsupported value.'); + return; + } + this.active = view | 0; + if (forceOpen && !this.isOpen) { + this.open(); + return; + } + if (shouldForceRendering) { + this._forceRendering(); + } + if (isViewChanged) { + this._dispatchEvent(); + } + this._hideUINotification(this.active); + } + }, { + key: 'open', + value: function open() { + if (this.isOpen) { + return; + } + this.isOpen = true; + this.toggleButton.classList.add('toggled'); + this.outerContainer.classList.add('sidebarMoving'); + this.outerContainer.classList.add('sidebarOpen'); + if (this.active === SidebarView.THUMBS) { + this._updateThumbnailViewer(); + } + this._forceRendering(); + this._dispatchEvent(); + this._hideUINotification(this.active); + } + }, { + key: 'close', + value: function close() { + if (!this.isOpen) { + return; + } + this.isOpen = false; + this.toggleButton.classList.remove('toggled'); + this.outerContainer.classList.add('sidebarMoving'); + this.outerContainer.classList.remove('sidebarOpen'); + this._forceRendering(); + this._dispatchEvent(); + } + }, { + key: 'toggle', + value: function toggle() { + if (this.isOpen) { + this.close(); + } else { + this.open(); + } + } + }, { + key: '_dispatchEvent', + value: function _dispatchEvent() { + this.eventBus.dispatch('sidebarviewchanged', { + source: this, + view: this.visibleView + }); + } + }, { + key: '_forceRendering', + value: function _forceRendering() { + if (this.onToggled) { + this.onToggled(); + } else { + this.pdfViewer.forceRendering(); + this.pdfThumbnailViewer.forceRendering(); + } + } + }, { + key: '_updateThumbnailViewer', + value: function _updateThumbnailViewer() { + var pdfViewer = this.pdfViewer, + pdfThumbnailViewer = this.pdfThumbnailViewer; + + var pagesCount = pdfViewer.pagesCount; + for (var pageIndex = 0; pageIndex < pagesCount; pageIndex++) { + var pageView = pdfViewer.getPageView(pageIndex); + if (pageView && pageView.renderingState === _pdf_rendering_queue.RenderingStates.FINISHED) { + var thumbnailView = pdfThumbnailViewer.getThumbnail(pageIndex); + thumbnailView.setImage(pageView); + } + } + pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber); + } + }, { + key: '_showUINotification', + value: function _showUINotification(view) { + var _this = this; + + if (this.disableNotification) { + return; + } + this.l10n.get('toggle_sidebar_notification.title', null, 'Toggle Sidebar (document contains outline/attachments)').then(function (msg) { + _this.toggleButton.title = msg; + }); + if (!this.isOpen) { + this.toggleButton.classList.add(UI_NOTIFICATION_CLASS); + } else if (view === this.active) { + return; + } + switch (view) { + case SidebarView.OUTLINE: + this.outlineButton.classList.add(UI_NOTIFICATION_CLASS); + break; + case SidebarView.ATTACHMENTS: + this.attachmentsButton.classList.add(UI_NOTIFICATION_CLASS); + break; + } + } + }, { + key: '_hideUINotification', + value: function _hideUINotification(view) { + var _this2 = this; + + if (this.disableNotification) { + return; + } + var removeNotification = function removeNotification(view) { + switch (view) { + case SidebarView.OUTLINE: + _this2.outlineButton.classList.remove(UI_NOTIFICATION_CLASS); + break; + case SidebarView.ATTACHMENTS: + _this2.attachmentsButton.classList.remove(UI_NOTIFICATION_CLASS); + break; + } + }; + if (!this.isOpen && view !== null) { + return; + } + this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS); + if (view !== null) { + removeNotification(view); + return; + } + for (view in SidebarView) { + removeNotification(SidebarView[view]); + } + this.l10n.get('toggle_sidebar.title', null, 'Toggle Sidebar').then(function (msg) { + _this2.toggleButton.title = msg; + }); + } + }, { + key: '_addEventListeners', + value: function _addEventListeners() { + var _this3 = this; + + this.mainContainer.addEventListener('transitionend', function (evt) { + if (evt.target === _this3.mainContainer) { + _this3.outerContainer.classList.remove('sidebarMoving'); + } + }); + this.thumbnailButton.addEventListener('click', function () { + _this3.switchView(SidebarView.THUMBS); + }); + this.outlineButton.addEventListener('click', function () { + _this3.switchView(SidebarView.OUTLINE); + }); + this.outlineButton.addEventListener('dblclick', function () { + _this3.pdfOutlineViewer.toggleOutlineTree(); + }); + this.attachmentsButton.addEventListener('click', function () { + _this3.switchView(SidebarView.ATTACHMENTS); + }); + this.eventBus.on('outlineloaded', function (evt) { + var outlineCount = evt.outlineCount; + _this3.outlineButton.disabled = !outlineCount; + if (outlineCount) { + _this3._showUINotification(SidebarView.OUTLINE); + } else if (_this3.active === SidebarView.OUTLINE) { + _this3.switchView(SidebarView.THUMBS); + } + }); + this.eventBus.on('attachmentsloaded', function (evt) { + if (evt.attachmentsCount) { + _this3.attachmentsButton.disabled = false; + _this3._showUINotification(SidebarView.ATTACHMENTS); + return; + } + Promise.resolve().then(function () { + if (_this3.attachmentsView.hasChildNodes()) { + return; + } + _this3.attachmentsButton.disabled = true; + if (_this3.active === SidebarView.ATTACHMENTS) { + _this3.switchView(SidebarView.THUMBS); + } + }); + }); + this.eventBus.on('presentationmodechanged', function (evt) { + if (!evt.active && !evt.switchInProgress && _this3.isThumbnailViewVisible) { + _this3._updateThumbnailViewer(); + } + }); + } + }, { + key: 'visibleView', + get: function get() { + return this.isOpen ? this.active : SidebarView.NONE; + } + }, { + key: 'isThumbnailViewVisible', + get: function get() { + return this.isOpen && this.active === SidebarView.THUMBS; + } + }, { + key: 'isOutlineViewVisible', + get: function get() { + return this.isOpen && this.active === SidebarView.OUTLINE; + } + }, { + key: 'isAttachmentsViewVisible', + get: function get() { + return this.isOpen && this.active === SidebarView.ATTACHMENTS; + } + }]); + + return PDFSidebar; +}(); + +exports.SidebarView = SidebarView; +exports.PDFSidebar = PDFSidebar; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var OverlayManager = function () { + function OverlayManager() { + _classCallCheck(this, OverlayManager); + + this._overlays = {}; + this._active = null; + this._keyDownBound = this._keyDown.bind(this); + } + + _createClass(OverlayManager, [{ + key: 'register', + value: function register(name, element) { + var _this = this; + + var callerCloseMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var canForceClose = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + return new Promise(function (resolve) { + var container = void 0; + if (!name || !element || !(container = element.parentNode)) { + throw new Error('Not enough parameters.'); + } else if (_this._overlays[name]) { + throw new Error('The overlay is already registered.'); + } + _this._overlays[name] = { + element: element, + container: container, + callerCloseMethod: callerCloseMethod, + canForceClose: canForceClose + }; + resolve(); + }); + } + }, { + key: 'unregister', + value: function unregister(name) { + var _this2 = this; + + return new Promise(function (resolve) { + if (!_this2._overlays[name]) { + throw new Error('The overlay does not exist.'); + } else if (_this2._active === name) { + throw new Error('The overlay cannot be removed while it is active.'); + } + delete _this2._overlays[name]; + resolve(); + }); + } + }, { + key: 'open', + value: function open(name) { + var _this3 = this; + + return new Promise(function (resolve) { + if (!_this3._overlays[name]) { + throw new Error('The overlay does not exist.'); + } else if (_this3._active) { + if (_this3._overlays[name].canForceClose) { + _this3._closeThroughCaller(); + } else if (_this3._active === name) { + throw new Error('The overlay is already active.'); + } else { + throw new Error('Another overlay is currently active.'); + } + } + _this3._active = name; + _this3._overlays[_this3._active].element.classList.remove('hidden'); + _this3._overlays[_this3._active].container.classList.remove('hidden'); + window.addEventListener('keydown', _this3._keyDownBound); + resolve(); + }); + } + }, { + key: 'close', + value: function close(name) { + var _this4 = this; + + return new Promise(function (resolve) { + if (!_this4._overlays[name]) { + throw new Error('The overlay does not exist.'); + } else if (!_this4._active) { + throw new Error('The overlay is currently not active.'); + } else if (_this4._active !== name) { + throw new Error('Another overlay is currently active.'); + } + _this4._overlays[_this4._active].container.classList.add('hidden'); + _this4._overlays[_this4._active].element.classList.add('hidden'); + _this4._active = null; + window.removeEventListener('keydown', _this4._keyDownBound); + resolve(); + }); + } + }, { + key: '_keyDown', + value: function _keyDown(evt) { + if (this._active && evt.keyCode === 27) { + this._closeThroughCaller(); + evt.preventDefault(); + } + } + }, { + key: '_closeThroughCaller', + value: function _closeThroughCaller() { + if (this._overlays[this._active].callerCloseMethod) { + this._overlays[this._active].callerCloseMethod(); + } + if (this._active) { + this.close(this._active); + } + } + }, { + key: 'active', + get: function get() { + return this._active; + } + }]); + + return OverlayManager; +}(); + +exports.OverlayManager = OverlayManager; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PasswordPrompt = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var PasswordPrompt = function () { + function PasswordPrompt(options, overlayManager) { + var _this = this; + + var l10n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _ui_utils.NullL10n; + + _classCallCheck(this, PasswordPrompt); + + this.overlayName = options.overlayName; + this.container = options.container; + this.label = options.label; + this.input = options.input; + this.submitButton = options.submitButton; + this.cancelButton = options.cancelButton; + this.overlayManager = overlayManager; + this.l10n = l10n; + this.updateCallback = null; + this.reason = null; + this.submitButton.addEventListener('click', this.verify.bind(this)); + this.cancelButton.addEventListener('click', this.close.bind(this)); + this.input.addEventListener('keydown', function (e) { + if (e.keyCode === 13) { + _this.verify(); + } + }); + this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), true); + } + + _createClass(PasswordPrompt, [{ + key: 'open', + value: function open() { + var _this2 = this; + + this.overlayManager.open(this.overlayName).then(function () { + _this2.input.focus(); + var promptString = void 0; + if (_this2.reason === _pdfjsLib.PasswordResponses.INCORRECT_PASSWORD) { + promptString = _this2.l10n.get('password_invalid', null, 'Invalid password. Please try again.'); + } else { + promptString = _this2.l10n.get('password_label', null, 'Enter the password to open this PDF file.'); + } + promptString.then(function (msg) { + _this2.label.textContent = msg; + }); + }); + } + }, { + key: 'close', + value: function close() { + var _this3 = this; + + this.overlayManager.close(this.overlayName).then(function () { + _this3.input.value = ''; + }); + } + }, { + key: 'verify', + value: function verify() { + var password = this.input.value; + if (password && password.length > 0) { + this.close(); + return this.updateCallback(password); + } + } + }, { + key: 'setUpdateCallback', + value: function setUpdateCallback(updateCallback, reason) { + this.updateCallback = updateCallback; + this.reason = reason; + } + }]); + + return PasswordPrompt; +}(); + +exports.PasswordPrompt = PasswordPrompt; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFAttachmentViewer = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var PDFAttachmentViewer = function () { + function PDFAttachmentViewer(_ref) { + var container = _ref.container, + eventBus = _ref.eventBus, + downloadManager = _ref.downloadManager; + + _classCallCheck(this, PDFAttachmentViewer); + + this.container = container; + this.eventBus = eventBus; + this.downloadManager = downloadManager; + this.reset(); + this.eventBus.on('fileattachmentannotation', this._appendAttachment.bind(this)); + } + + _createClass(PDFAttachmentViewer, [{ + key: 'reset', + value: function reset() { + var keepRenderedCapability = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + this.attachments = null; + this.container.textContent = ''; + if (!keepRenderedCapability) { + this._renderedCapability = (0, _pdfjsLib.createPromiseCapability)(); + } + } + }, { + key: '_dispatchEvent', + value: function _dispatchEvent(attachmentsCount) { + this._renderedCapability.resolve(); + this.eventBus.dispatch('attachmentsloaded', { + source: this, + attachmentsCount: attachmentsCount + }); + } + }, { + key: '_bindPdfLink', + value: function _bindPdfLink(button, content, filename) { + if (_pdfjsLib.PDFJS.disableCreateObjectURL) { + throw new Error('bindPdfLink: ' + 'Unsupported "PDFJS.disableCreateObjectURL" value.'); + } + var blobUrl = void 0; + button.onclick = function () { + if (!blobUrl) { + blobUrl = (0, _pdfjsLib.createObjectURL)(content, 'application/pdf'); + } + var viewerUrl = void 0; + viewerUrl = '?file=' + encodeURIComponent(blobUrl + '#' + filename); + window.open(viewerUrl); + return false; + }; + } + }, { + key: '_bindLink', + value: function _bindLink(button, content, filename) { + var _this = this; + + button.onclick = function () { + _this.downloadManager.downloadData(content, filename, ''); + return false; + }; + } + }, { + key: 'render', + value: function render(_ref2) { + var attachments = _ref2.attachments, + _ref2$keepRenderedCap = _ref2.keepRenderedCapability, + keepRenderedCapability = _ref2$keepRenderedCap === undefined ? false : _ref2$keepRenderedCap; + + var attachmentsCount = 0; + if (this.attachments) { + this.reset(keepRenderedCapability === true); + } + this.attachments = attachments || null; + if (!attachments) { + this._dispatchEvent(attachmentsCount); + return; + } + var names = Object.keys(attachments).sort(function (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()); + }); + attachmentsCount = names.length; + for (var i = 0; i < attachmentsCount; i++) { + var item = attachments[names[i]]; + var filename = (0, _pdfjsLib.removeNullCharacters)((0, _pdfjsLib.getFilenameFromUrl)(item.filename)); + var div = document.createElement('div'); + div.className = 'attachmentsItem'; + var button = document.createElement('button'); + button.textContent = filename; + if (/\.pdf$/i.test(filename) && !_pdfjsLib.PDFJS.disableCreateObjectURL) { + this._bindPdfLink(button, item.content, filename); + } else { + this._bindLink(button, item.content, filename); + } + div.appendChild(button); + this.container.appendChild(div); + } + this._dispatchEvent(attachmentsCount); + } + }, { + key: '_appendAttachment', + value: function _appendAttachment(_ref3) { + var _this2 = this; + + var id = _ref3.id, + filename = _ref3.filename, + content = _ref3.content; + + this._renderedCapability.promise.then(function () { + var attachments = _this2.attachments; + if (!attachments) { + attachments = Object.create(null); + } else { + for (var name in attachments) { + if (id === name) { + return; + } + } + } + attachments[id] = { + filename: filename, + content: content + }; + _this2.render({ + attachments: attachments, + keepRenderedCapability: true + }); + }); + } + }]); + + return PDFAttachmentViewer; +}(); + +exports.PDFAttachmentViewer = PDFAttachmentViewer; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFDocumentProperties = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DEFAULT_FIELD_CONTENT = '-'; + +var PDFDocumentProperties = function () { + function PDFDocumentProperties(_ref, overlayManager) { + var overlayName = _ref.overlayName, + fields = _ref.fields, + container = _ref.container, + closeButton = _ref.closeButton; + var l10n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _ui_utils.NullL10n; + + _classCallCheck(this, PDFDocumentProperties); + + this.overlayName = overlayName; + this.fields = fields; + this.container = container; + this.overlayManager = overlayManager; + this.l10n = l10n; + this._reset(); + if (closeButton) { + closeButton.addEventListener('click', this.close.bind(this)); + } + this.overlayManager.register(this.overlayName, this.container, this.close.bind(this)); + } + + _createClass(PDFDocumentProperties, [{ + key: 'open', + value: function open() { + var _this = this; + + var freezeFieldData = function freezeFieldData(data) { + Object.defineProperty(_this, 'fieldData', { + value: Object.freeze(data), + writable: false, + enumerable: true, + configurable: true + }); + }; + Promise.all([this.overlayManager.open(this.overlayName), this._dataAvailableCapability.promise]).then(function () { + if (_this.fieldData) { + _this._updateUI(); + return; + } + _this.pdfDocument.getMetadata().then(function (_ref2) { + var info = _ref2.info, + metadata = _ref2.metadata; + + return Promise.all([info, metadata, _this._parseFileSize(_this.maybeFileSize), _this._parseDate(info.CreationDate), _this._parseDate(info.ModDate)]); + }).then(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 5), + info = _ref4[0], + metadata = _ref4[1], + fileSize = _ref4[2], + creationDate = _ref4[3], + modificationDate = _ref4[4]; + + freezeFieldData({ + 'fileName': (0, _ui_utils.getPDFFileNameFromURL)(_this.url), + 'fileSize': fileSize, + 'title': info.Title, + 'author': info.Author, + 'subject': info.Subject, + 'keywords': info.Keywords, + 'creationDate': creationDate, + 'modificationDate': modificationDate, + 'creator': info.Creator, + 'producer': info.Producer, + 'version': info.PDFFormatVersion, + 'pageCount': _this.pdfDocument.numPages + }); + _this._updateUI(); + return _this.pdfDocument.getDownloadInfo(); + }).then(function (_ref5) { + var length = _ref5.length; + + return _this._parseFileSize(length); + }).then(function (fileSize) { + var data = (0, _ui_utils.cloneObj)(_this.fieldData); + data['fileSize'] = fileSize; + freezeFieldData(data); + _this._updateUI(); + }); + }); + } + }, { + key: 'close', + value: function close() { + this.overlayManager.close(this.overlayName); + } + }, { + key: 'setDocument', + value: function setDocument(pdfDocument, url) { + if (this.pdfDocument) { + this._reset(); + this._updateUI(true); + } + if (!pdfDocument) { + return; + } + this.pdfDocument = pdfDocument; + this.url = url; + this._dataAvailableCapability.resolve(); + } + }, { + key: 'setFileSize', + value: function setFileSize(fileSize) { + if (typeof fileSize === 'number' && fileSize > 0) { + this.maybeFileSize = fileSize; + } + } + }, { + key: '_reset', + value: function _reset() { + this.pdfDocument = null; + this.url = null; + this.maybeFileSize = 0; + delete this.fieldData; + this._dataAvailableCapability = (0, _pdfjsLib.createPromiseCapability)(); + } + }, { + key: '_updateUI', + value: function _updateUI() { + var reset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (reset || !this.fieldData) { + for (var id in this.fields) { + this.fields[id].textContent = DEFAULT_FIELD_CONTENT; + } + return; + } + if (this.overlayManager.active !== this.overlayName) { + return; + } + for (var _id in this.fields) { + var content = this.fieldData[_id]; + this.fields[_id].textContent = content || content === 0 ? content : DEFAULT_FIELD_CONTENT; + } + } + }, { + key: '_parseFileSize', + value: function _parseFileSize() { + var fileSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + var kb = fileSize / 1024; + if (!kb) { + return Promise.resolve(undefined); + } else if (kb < 1024) { + return this.l10n.get('document_properties_kb', { + size_kb: (+kb.toPrecision(3)).toLocaleString(), + size_b: fileSize.toLocaleString() + }, '{{size_kb}} KB ({{size_b}} bytes)'); + } + return this.l10n.get('document_properties_mb', { + size_mb: (+(kb / 1024).toPrecision(3)).toLocaleString(), + size_b: fileSize.toLocaleString() + }, '{{size_mb}} MB ({{size_b}} bytes)'); + } + }, { + key: '_parseDate', + value: function _parseDate(inputDate) { + if (!inputDate) { + return; + } + var dateToParse = inputDate; + if (dateToParse.substring(0, 2) === 'D:') { + dateToParse = dateToParse.substring(2); + } + var year = parseInt(dateToParse.substring(0, 4), 10); + var month = parseInt(dateToParse.substring(4, 6), 10) - 1; + var day = parseInt(dateToParse.substring(6, 8), 10); + var hours = parseInt(dateToParse.substring(8, 10), 10); + var minutes = parseInt(dateToParse.substring(10, 12), 10); + var seconds = parseInt(dateToParse.substring(12, 14), 10); + var utRel = dateToParse.substring(14, 15); + var offsetHours = parseInt(dateToParse.substring(15, 17), 10); + var offsetMinutes = parseInt(dateToParse.substring(18, 20), 10); + if (utRel === '-') { + hours += offsetHours; + minutes += offsetMinutes; + } else if (utRel === '+') { + hours -= offsetHours; + minutes -= offsetMinutes; + } + var date = new Date(Date.UTC(year, month, day, hours, minutes, seconds)); + var dateString = date.toLocaleDateString(); + var timeString = date.toLocaleTimeString(); + return this.l10n.get('document_properties_date_string', { + date: dateString, + time: timeString + }, '{{date}}, {{time}}'); + } + }]); + + return PDFDocumentProperties; +}(); + +exports.PDFDocumentProperties = PDFDocumentProperties; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFFindBar = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdf_find_controller = __webpack_require__(7); + +var _ui_utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var PDFFindBar = function () { + function PDFFindBar(options) { + var _this = this; + + var l10n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _ui_utils.NullL10n; + + _classCallCheck(this, PDFFindBar); + + this.opened = false; + this.bar = options.bar || null; + this.toggleButton = options.toggleButton || null; + this.findField = options.findField || null; + this.highlightAll = options.highlightAllCheckbox || null; + this.caseSensitive = options.caseSensitiveCheckbox || null; + this.findMsg = options.findMsg || null; + this.findResultsCount = options.findResultsCount || null; + this.findStatusIcon = options.findStatusIcon || null; + this.findPreviousButton = options.findPreviousButton || null; + this.findNextButton = options.findNextButton || null; + this.findController = options.findController || null; + this.eventBus = options.eventBus; + this.l10n = l10n; + if (this.findController === null) { + throw new Error('PDFFindBar cannot be used without a ' + 'PDFFindController instance.'); + } + this.toggleButton.addEventListener('click', function () { + _this.toggle(); + }); + this.findField.addEventListener('input', function () { + _this.dispatchEvent(''); + }); + this.bar.addEventListener('keydown', function (e) { + switch (e.keyCode) { + case 13: + if (e.target === _this.findField) { + _this.dispatchEvent('again', e.shiftKey); + } + break; + case 27: + _this.close(); + break; + } + }); + this.findPreviousButton.addEventListener('click', function () { + _this.dispatchEvent('again', true); + }); + this.findNextButton.addEventListener('click', function () { + _this.dispatchEvent('again', false); + }); + this.highlightAll.addEventListener('click', function () { + _this.dispatchEvent('highlightallchange'); + }); + this.caseSensitive.addEventListener('click', function () { + _this.dispatchEvent('casesensitivitychange'); + }); + this.eventBus.on('resize', this._adjustWidth.bind(this)); + } + + _createClass(PDFFindBar, [{ + key: 'reset', + value: function reset() { + this.updateUIState(); + } + }, { + key: 'dispatchEvent', + value: function dispatchEvent(type, findPrev) { + this.eventBus.dispatch('find', { + source: this, + type: type, + query: this.findField.value, + caseSensitive: this.caseSensitive.checked, + phraseSearch: true, + highlightAll: this.highlightAll.checked, + findPrevious: findPrev + }); + } + }, { + key: 'updateUIState', + value: function updateUIState(state, previous, matchCount) { + var _this2 = this; + + var notFound = false; + var findMsg = ''; + var status = ''; + switch (state) { + case _pdf_find_controller.FindState.FOUND: + break; + case _pdf_find_controller.FindState.PENDING: + status = 'pending'; + break; + case _pdf_find_controller.FindState.NOT_FOUND: + findMsg = this.l10n.get('find_not_found', null, 'Phrase not found'); + notFound = true; + break; + case _pdf_find_controller.FindState.WRAPPED: + if (previous) { + findMsg = this.l10n.get('find_reached_top', null, 'Reached top of document, continued from bottom'); + } else { + findMsg = this.l10n.get('find_reached_bottom', null, 'Reached end of document, continued from top'); + } + break; + } + if (notFound) { + this.findField.classList.add('notFound'); + } else { + this.findField.classList.remove('notFound'); + } + this.findField.setAttribute('data-status', status); + Promise.resolve(findMsg).then(function (msg) { + _this2.findMsg.textContent = msg; + _this2._adjustWidth(); + }); + this.updateResultsCount(matchCount); + } + }, { + key: 'updateResultsCount', + value: function updateResultsCount(matchCount) { + if (!this.findResultsCount) { + return; + } + if (!matchCount) { + this.findResultsCount.classList.add('hidden'); + this.findResultsCount.textContent = ''; + } else { + this.findResultsCount.textContent = matchCount.toLocaleString(); + this.findResultsCount.classList.remove('hidden'); + } + this._adjustWidth(); + } + }, { + key: 'open', + value: function open() { + if (!this.opened) { + this.opened = true; + this.toggleButton.classList.add('toggled'); + this.bar.classList.remove('hidden'); + } + this.findField.select(); + this.findField.focus(); + this._adjustWidth(); + } + }, { + key: 'close', + value: function close() { + if (!this.opened) { + return; + } + this.opened = false; + this.toggleButton.classList.remove('toggled'); + this.bar.classList.add('hidden'); + this.findController.active = false; + } + }, { + key: 'toggle', + value: function toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } + }, { + key: '_adjustWidth', + value: function _adjustWidth() { + if (!this.opened) { + return; + } + this.bar.classList.remove('wrapContainers'); + var findbarHeight = this.bar.clientHeight; + var inputContainerHeight = this.bar.firstElementChild.clientHeight; + if (findbarHeight > inputContainerHeight) { + this.bar.classList.add('wrapContainers'); + } + } + }]); + + return PDFFindBar; +}(); + +exports.PDFFindBar = PDFFindBar; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isDestArraysEqual = exports.isDestHashesEqual = exports.PDFHistory = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +var _dom_events = __webpack_require__(2); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var HASH_CHANGE_TIMEOUT = 1000; +var POSITION_UPDATED_THRESHOLD = 50; +var UPDATE_VIEWAREA_TIMEOUT = 1000; +function getCurrentHash() { + return document.location.hash; +} +function parseCurrentHash(linkService) { + var hash = unescape(getCurrentHash()).substring(1); + var params = (0, _ui_utils.parseQueryString)(hash); + var page = params.page | 0; + if (!(Number.isInteger(page) && page > 0 && page <= linkService.pagesCount)) { + page = null; + } + return { + hash: hash, + page: page, + rotation: linkService.rotation + }; +} + +var PDFHistory = function () { + function PDFHistory(_ref) { + var _this = this; + + var linkService = _ref.linkService, + eventBus = _ref.eventBus; + + _classCallCheck(this, PDFHistory); + + this.linkService = linkService; + this.eventBus = eventBus || (0, _dom_events.getGlobalEventBus)(); + this.initialized = false; + this.initialBookmark = null; + this.initialRotation = null; + this._boundEvents = Object.create(null); + this._isViewerInPresentationMode = false; + this._isPagesLoaded = false; + this.eventBus.on('presentationmodechanged', function (evt) { + _this._isViewerInPresentationMode = evt.active || evt.switchInProgress; + }); + this.eventBus.on('pagesloaded', function (evt) { + _this._isPagesLoaded = !!evt.pagesCount; + }); + } + + _createClass(PDFHistory, [{ + key: 'initialize', + value: function initialize(fingerprint) { + var resetHistory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!fingerprint || typeof fingerprint !== 'string') { + console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.'); + return; + } + var reInitialized = this.initialized && this.fingerprint !== fingerprint; + this.fingerprint = fingerprint; + if (!this.initialized) { + this._bindEvents(); + } + var state = window.history.state; + this.initialized = true; + this.initialBookmark = null; + this.initialRotation = null; + this._popStateInProgress = false; + this._blockHashChange = 0; + this._currentHash = getCurrentHash(); + this._numPositionUpdates = 0; + this._uid = this._maxUid = 0; + this._destination = null; + this._position = null; + if (!this._isValidState(state) || resetHistory) { + var _parseCurrentHash = parseCurrentHash(this.linkService), + hash = _parseCurrentHash.hash, + page = _parseCurrentHash.page, + rotation = _parseCurrentHash.rotation; + + if (!hash || reInitialized || resetHistory) { + this._pushOrReplaceState(null, true); + return; + } + this._pushOrReplaceState({ + hash: hash, + page: page, + rotation: rotation + }, true); + return; + } + var destination = state.destination; + this._updateInternalState(destination, state.uid, true); + if (destination.rotation !== undefined) { + this.initialRotation = destination.rotation; + } + if (destination.dest) { + this.initialBookmark = JSON.stringify(destination.dest); + this._destination.page = null; + } else if (destination.hash) { + this.initialBookmark = destination.hash; + } else if (destination.page) { + this.initialBookmark = 'page=' + destination.page; + } + } + }, { + key: 'push', + value: function push(_ref2) { + var _this2 = this; + + var namedDest = _ref2.namedDest, + explicitDest = _ref2.explicitDest, + pageNumber = _ref2.pageNumber; + + if (!this.initialized) { + return; + } + if (namedDest && typeof namedDest !== 'string' || !(explicitDest instanceof Array) || !(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.linkService.pagesCount)) { + console.error('PDFHistory.push: Invalid parameters.'); + return; + } + var hash = namedDest || JSON.stringify(explicitDest); + if (!hash) { + return; + } + var forceReplace = false; + if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) { + if (this._destination.page) { + return; + } + forceReplace = true; + } + if (this._popStateInProgress && !forceReplace) { + return; + } + this._pushOrReplaceState({ + dest: explicitDest, + hash: hash, + page: pageNumber, + rotation: this.linkService.rotation + }, forceReplace); + if (!this._popStateInProgress) { + this._popStateInProgress = true; + Promise.resolve().then(function () { + _this2._popStateInProgress = false; + }); + } + } + }, { + key: 'pushCurrentPosition', + value: function pushCurrentPosition() { + if (!this.initialized || this._popStateInProgress) { + return; + } + this._tryPushCurrentPosition(); + } + }, { + key: 'back', + value: function back() { + if (!this.initialized || this._popStateInProgress) { + return; + } + var state = window.history.state; + if (this._isValidState(state) && state.uid > 0) { + window.history.back(); + } + } + }, { + key: 'forward', + value: function forward() { + if (!this.initialized || this._popStateInProgress) { + return; + } + var state = window.history.state; + if (this._isValidState(state) && state.uid < this._maxUid) { + window.history.forward(); + } + } + }, { + key: '_pushOrReplaceState', + value: function _pushOrReplaceState(destination) { + var forceReplace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var shouldReplace = forceReplace || !this._destination; + var newState = { + fingerprint: this.fingerprint, + uid: shouldReplace ? this._uid : this._uid + 1, + destination: destination + }; + this._updateInternalState(destination, newState.uid); + if (shouldReplace) { + window.history.replaceState(newState, '', document.URL); + } else { + this._maxUid = this._uid; + window.history.pushState(newState, '', document.URL); + } + } + }, { + key: '_tryPushCurrentPosition', + value: function _tryPushCurrentPosition() { + var temporary = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (!this._position) { + return; + } + var position = this._position; + if (temporary) { + position = (0, _ui_utils.cloneObj)(this._position); + position.temporary = true; + } + if (!this._destination) { + this._pushOrReplaceState(position); + return; + } + if (this._destination.temporary) { + this._pushOrReplaceState(position, true); + return; + } + if (this._destination.hash === position.hash) { + return; + } + if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) { + return; + } + var forceReplace = false; + if (this._destination.page === position.first || this._destination.page === position.page) { + if (this._destination.dest || !this._destination.first) { + return; + } + forceReplace = true; + } + this._pushOrReplaceState(position, forceReplace); + } + }, { + key: '_isValidState', + value: function _isValidState(state) { + if (!state) { + return false; + } + if (state.fingerprint !== this.fingerprint) { + return false; + } + if (!Number.isInteger(state.uid) || state.uid < 0) { + return false; + } + if (state.destination === null || _typeof(state.destination) !== 'object') { + return false; + } + return true; + } + }, { + key: '_updateInternalState', + value: function _updateInternalState(destination, uid) { + var removeTemporary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + if (removeTemporary && destination && destination.temporary) { + delete destination.temporary; + } + this._destination = destination; + this._uid = uid; + this._numPositionUpdates = 0; + } + }, { + key: '_updateViewarea', + value: function _updateViewarea(_ref3) { + var _this3 = this; + + var location = _ref3.location; + + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + this._position = { + hash: this._isViewerInPresentationMode ? 'page=' + location.pageNumber : location.pdfOpenParams.substring(1), + page: this.linkService.page, + first: location.pageNumber, + rotation: location.rotation + }; + if (this._popStateInProgress) { + return; + } + if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) { + this._numPositionUpdates++; + } + if (UPDATE_VIEWAREA_TIMEOUT > 0) { + this._updateViewareaTimeout = setTimeout(function () { + if (!_this3._popStateInProgress) { + _this3._tryPushCurrentPosition(true); + } + _this3._updateViewareaTimeout = null; + }, UPDATE_VIEWAREA_TIMEOUT); + } + } + }, { + key: '_popState', + value: function _popState(_ref4) { + var _this4 = this; + + var state = _ref4.state; + + var newHash = getCurrentHash(), + hashChanged = this._currentHash !== newHash; + this._currentHash = newHash; + if (!state || false) { + this._uid++; + + var _parseCurrentHash2 = parseCurrentHash(this.linkService), + hash = _parseCurrentHash2.hash, + page = _parseCurrentHash2.page, + rotation = _parseCurrentHash2.rotation; + + this._pushOrReplaceState({ + hash: hash, + page: page, + rotation: rotation + }, true); + return; + } + if (!this._isValidState(state)) { + return; + } + this._popStateInProgress = true; + if (hashChanged) { + this._blockHashChange++; + (0, _ui_utils.waitOnEventOrTimeout)({ + target: window, + name: 'hashchange', + delay: HASH_CHANGE_TIMEOUT + }).then(function () { + _this4._blockHashChange--; + }); + } + var destination = state.destination; + this._updateInternalState(destination, state.uid, true); + if ((0, _ui_utils.isValidRotation)(destination.rotation)) { + this.linkService.rotation = destination.rotation; + } + if (destination.dest) { + this.linkService.navigateTo(destination.dest); + } else if (destination.hash) { + this.linkService.setHash(destination.hash); + } else if (destination.page) { + this.linkService.page = destination.page; + } + Promise.resolve().then(function () { + _this4._popStateInProgress = false; + }); + } + }, { + key: '_bindEvents', + value: function _bindEvents() { + var _this5 = this; + + var _boundEvents = this._boundEvents, + eventBus = this.eventBus; + + _boundEvents.updateViewarea = this._updateViewarea.bind(this); + _boundEvents.popState = this._popState.bind(this); + _boundEvents.pageHide = function (evt) { + if (!_this5._destination) { + _this5._tryPushCurrentPosition(); + } + }; + eventBus.on('updateviewarea', _boundEvents.updateViewarea); + window.addEventListener('popstate', _boundEvents.popState); + window.addEventListener('pagehide', _boundEvents.pageHide); + } + }, { + key: 'popStateInProgress', + get: function get() { + return this.initialized && (this._popStateInProgress || this._blockHashChange > 0); + } + }]); + + return PDFHistory; +}(); + +function isDestHashesEqual(destHash, pushHash) { + if (typeof destHash !== 'string' || typeof pushHash !== 'string') { + return false; + } + if (destHash === pushHash) { + return true; + } + + var _parseQueryString = (0, _ui_utils.parseQueryString)(destHash), + nameddest = _parseQueryString.nameddest; + + if (nameddest === pushHash) { + return true; + } + return false; +} +function isDestArraysEqual(firstDest, secondDest) { + function isEntryEqual(first, second) { + if ((typeof first === 'undefined' ? 'undefined' : _typeof(first)) !== (typeof second === 'undefined' ? 'undefined' : _typeof(second))) { + return false; + } + if (first instanceof Array || second instanceof Array) { + return false; + } + if (first !== null && (typeof first === 'undefined' ? 'undefined' : _typeof(first)) === 'object' && second !== null) { + if (Object.keys(first).length !== Object.keys(second).length) { + return false; + } + for (var key in first) { + if (!isEntryEqual(first[key], second[key])) { + return false; + } + } + return true; + } + return first === second || Number.isNaN(first) && Number.isNaN(second); + } + if (!(firstDest instanceof Array && secondDest instanceof Array)) { + return false; + } + if (firstDest.length !== secondDest.length) { + return false; + } + for (var i = 0, ii = firstDest.length; i < ii; i++) { + if (!isEntryEqual(firstDest[i], secondDest[i])) { + return false; + } + } + return true; +} +exports.PDFHistory = PDFHistory; +exports.isDestHashesEqual = isDestHashesEqual; +exports.isDestArraysEqual = isDestArraysEqual; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFOutlineViewer = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DEFAULT_TITLE = '\u2013'; + +var PDFOutlineViewer = function () { + function PDFOutlineViewer(_ref) { + var container = _ref.container, + linkService = _ref.linkService, + eventBus = _ref.eventBus; + + _classCallCheck(this, PDFOutlineViewer); + + this.container = container; + this.linkService = linkService; + this.eventBus = eventBus; + this.reset(); + } + + _createClass(PDFOutlineViewer, [{ + key: 'reset', + value: function reset() { + this.outline = null; + this.lastToggleIsShow = true; + this.container.textContent = ''; + this.container.classList.remove('outlineWithDeepNesting'); + } + }, { + key: '_dispatchEvent', + value: function _dispatchEvent(outlineCount) { + this.eventBus.dispatch('outlineloaded', { + source: this, + outlineCount: outlineCount + }); + } + }, { + key: '_bindLink', + value: function _bindLink(element, item) { + var _this = this; + + if (item.url) { + (0, _pdfjsLib.addLinkAttributes)(element, { + url: item.url, + target: item.newWindow ? _pdfjsLib.PDFJS.LinkTarget.BLANK : undefined + }); + return; + } + var destination = item.dest; + element.href = this.linkService.getDestinationHash(destination); + element.onclick = function () { + if (destination) { + _this.linkService.navigateTo(destination); + } + return false; + }; + } + }, { + key: '_setStyles', + value: function _setStyles(element, item) { + var styleStr = ''; + if (item.bold) { + styleStr += 'font-weight: bold;'; + } + if (item.italic) { + styleStr += 'font-style: italic;'; + } + if (styleStr) { + element.setAttribute('style', styleStr); + } + } + }, { + key: '_addToggleButton', + value: function _addToggleButton(div) { + var _this2 = this; + + var toggler = document.createElement('div'); + toggler.className = 'outlineItemToggler'; + toggler.onclick = function (evt) { + evt.stopPropagation(); + toggler.classList.toggle('outlineItemsHidden'); + if (evt.shiftKey) { + var shouldShowAll = !toggler.classList.contains('outlineItemsHidden'); + _this2._toggleOutlineItem(div, shouldShowAll); + } + }; + div.insertBefore(toggler, div.firstChild); + } + }, { + key: '_toggleOutlineItem', + value: function _toggleOutlineItem(root, show) { + this.lastToggleIsShow = show; + var togglers = root.querySelectorAll('.outlineItemToggler'); + for (var i = 0, ii = togglers.length; i < ii; ++i) { + togglers[i].classList[show ? 'remove' : 'add']('outlineItemsHidden'); + } + } + }, { + key: 'toggleOutlineTree', + value: function toggleOutlineTree() { + if (!this.outline) { + return; + } + this._toggleOutlineItem(this.container, !this.lastToggleIsShow); + } + }, { + key: 'render', + value: function render(_ref2) { + var outline = _ref2.outline; + + var outlineCount = 0; + if (this.outline) { + this.reset(); + } + this.outline = outline || null; + if (!outline) { + this._dispatchEvent(outlineCount); + return; + } + var fragment = document.createDocumentFragment(); + var queue = [{ + parent: fragment, + items: this.outline + }]; + var hasAnyNesting = false; + while (queue.length > 0) { + var levelData = queue.shift(); + for (var i = 0, len = levelData.items.length; i < len; i++) { + var item = levelData.items[i]; + var div = document.createElement('div'); + div.className = 'outlineItem'; + var element = document.createElement('a'); + this._bindLink(element, item); + this._setStyles(element, item); + element.textContent = (0, _pdfjsLib.removeNullCharacters)(item.title) || DEFAULT_TITLE; + div.appendChild(element); + if (item.items.length > 0) { + hasAnyNesting = true; + this._addToggleButton(div); + var itemsDiv = document.createElement('div'); + itemsDiv.className = 'outlineItems'; + div.appendChild(itemsDiv); + queue.push({ + parent: itemsDiv, + items: item.items + }); + } + levelData.parent.appendChild(div); + outlineCount++; + } + } + if (hasAnyNesting) { + this.container.classList.add('outlineWithDeepNesting'); + } + this.container.appendChild(fragment); + this._dispatchEvent(outlineCount); + } + }]); + + return PDFOutlineViewer; +}(); + +exports.PDFOutlineViewer = PDFOutlineViewer; + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFPresentationMode = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; +var DELAY_BEFORE_HIDING_CONTROLS = 3000; +var ACTIVE_SELECTOR = 'pdfPresentationMode'; +var CONTROLS_SELECTOR = 'pdfPresentationModeControls'; +var MOUSE_SCROLL_COOLDOWN_TIME = 50; +var PAGE_SWITCH_THRESHOLD = 0.1; +var SWIPE_MIN_DISTANCE_THRESHOLD = 50; +var SWIPE_ANGLE_THRESHOLD = Math.PI / 6; + +var PDFPresentationMode = function () { + function PDFPresentationMode(_ref) { + var _this = this; + + var container = _ref.container, + _ref$viewer = _ref.viewer, + viewer = _ref$viewer === undefined ? null : _ref$viewer, + pdfViewer = _ref.pdfViewer, + eventBus = _ref.eventBus, + _ref$contextMenuItems = _ref.contextMenuItems, + contextMenuItems = _ref$contextMenuItems === undefined ? null : _ref$contextMenuItems; + + _classCallCheck(this, PDFPresentationMode); + + this.container = container; + this.viewer = viewer || container.firstElementChild; + this.pdfViewer = pdfViewer; + this.eventBus = eventBus; + this.active = false; + this.args = null; + this.contextMenuOpen = false; + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + this.touchSwipeState = null; + if (contextMenuItems) { + contextMenuItems.contextFirstPage.addEventListener('click', function () { + _this.contextMenuOpen = false; + _this.eventBus.dispatch('firstpage'); + }); + contextMenuItems.contextLastPage.addEventListener('click', function () { + _this.contextMenuOpen = false; + _this.eventBus.dispatch('lastpage'); + }); + contextMenuItems.contextPageRotateCw.addEventListener('click', function () { + _this.contextMenuOpen = false; + _this.eventBus.dispatch('rotatecw'); + }); + contextMenuItems.contextPageRotateCcw.addEventListener('click', function () { + _this.contextMenuOpen = false; + _this.eventBus.dispatch('rotateccw'); + }); + } + } + + _createClass(PDFPresentationMode, [{ + key: 'request', + value: function request() { + if (this.switchInProgress || this.active || !this.viewer.hasChildNodes()) { + return false; + } + this._addFullscreenChangeListeners(); + this._setSwitchInProgress(); + this._notifyStateChange(); + if (this.container.requestFullscreen) { + this.container.requestFullscreen(); + } else if (this.container.mozRequestFullScreen) { + this.container.mozRequestFullScreen(); + } else if (this.container.webkitRequestFullscreen) { + this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); + } else if (this.container.msRequestFullscreen) { + this.container.msRequestFullscreen(); + } else { + return false; + } + this.args = { + page: this.pdfViewer.currentPageNumber, + previousScale: this.pdfViewer.currentScaleValue + }; + return true; + } + }, { + key: '_mouseWheel', + value: function _mouseWheel(evt) { + if (!this.active) { + return; + } + evt.preventDefault(); + var delta = (0, _ui_utils.normalizeWheelEventDelta)(evt); + var currentTime = new Date().getTime(); + var storedTime = this.mouseScrollTimeStamp; + if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { + return; + } + if (this.mouseScrollDelta > 0 && delta < 0 || this.mouseScrollDelta < 0 && delta > 0) { + this._resetMouseScrollState(); + } + this.mouseScrollDelta += delta; + if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) { + var totalDelta = this.mouseScrollDelta; + this._resetMouseScrollState(); + var success = totalDelta > 0 ? this._goToPreviousPage() : this._goToNextPage(); + if (success) { + this.mouseScrollTimeStamp = currentTime; + } + } + } + }, { + key: '_goToPreviousPage', + value: function _goToPreviousPage() { + var page = this.pdfViewer.currentPageNumber; + if (page <= 1) { + return false; + } + this.pdfViewer.currentPageNumber = page - 1; + return true; + } + }, { + key: '_goToNextPage', + value: function _goToNextPage() { + var page = this.pdfViewer.currentPageNumber; + if (page >= this.pdfViewer.pagesCount) { + return false; + } + this.pdfViewer.currentPageNumber = page + 1; + return true; + } + }, { + key: '_notifyStateChange', + value: function _notifyStateChange() { + this.eventBus.dispatch('presentationmodechanged', { + source: this, + active: this.active, + switchInProgress: !!this.switchInProgress + }); + } + }, { + key: '_setSwitchInProgress', + value: function _setSwitchInProgress() { + var _this2 = this; + + if (this.switchInProgress) { + clearTimeout(this.switchInProgress); + } + this.switchInProgress = setTimeout(function () { + _this2._removeFullscreenChangeListeners(); + delete _this2.switchInProgress; + _this2._notifyStateChange(); + }, DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS); + } + }, { + key: '_resetSwitchInProgress', + value: function _resetSwitchInProgress() { + if (this.switchInProgress) { + clearTimeout(this.switchInProgress); + delete this.switchInProgress; + } + } + }, { + key: '_enter', + value: function _enter() { + var _this3 = this; + + this.active = true; + this._resetSwitchInProgress(); + this._notifyStateChange(); + this.container.classList.add(ACTIVE_SELECTOR); + setTimeout(function () { + _this3.pdfViewer.currentPageNumber = _this3.args.page; + _this3.pdfViewer.currentScaleValue = 'page-fit'; + }, 0); + this._addWindowListeners(); + this._showControls(); + this.contextMenuOpen = false; + this.container.setAttribute('contextmenu', 'viewerContextMenu'); + window.getSelection().removeAllRanges(); + } + }, { + key: '_exit', + value: function _exit() { + var _this4 = this; + + var page = this.pdfViewer.currentPageNumber; + this.container.classList.remove(ACTIVE_SELECTOR); + setTimeout(function () { + _this4.active = false; + _this4._removeFullscreenChangeListeners(); + _this4._notifyStateChange(); + _this4.pdfViewer.currentScaleValue = _this4.args.previousScale; + _this4.pdfViewer.currentPageNumber = page; + _this4.args = null; + }, 0); + this._removeWindowListeners(); + this._hideControls(); + this._resetMouseScrollState(); + this.container.removeAttribute('contextmenu'); + this.contextMenuOpen = false; + } + }, { + key: '_mouseDown', + value: function _mouseDown(evt) { + if (this.contextMenuOpen) { + this.contextMenuOpen = false; + evt.preventDefault(); + return; + } + if (evt.button === 0) { + var isInternalLink = evt.target.href && evt.target.classList.contains('internalLink'); + if (!isInternalLink) { + evt.preventDefault(); + if (evt.shiftKey) { + this._goToPreviousPage(); + } else { + this._goToNextPage(); + } + } + } + } + }, { + key: '_contextMenu', + value: function _contextMenu() { + this.contextMenuOpen = true; + } + }, { + key: '_showControls', + value: function _showControls() { + var _this5 = this; + + if (this.controlsTimeout) { + clearTimeout(this.controlsTimeout); + } else { + this.container.classList.add(CONTROLS_SELECTOR); + } + this.controlsTimeout = setTimeout(function () { + _this5.container.classList.remove(CONTROLS_SELECTOR); + delete _this5.controlsTimeout; + }, DELAY_BEFORE_HIDING_CONTROLS); + } + }, { + key: '_hideControls', + value: function _hideControls() { + if (!this.controlsTimeout) { + return; + } + clearTimeout(this.controlsTimeout); + this.container.classList.remove(CONTROLS_SELECTOR); + delete this.controlsTimeout; + } + }, { + key: '_resetMouseScrollState', + value: function _resetMouseScrollState() { + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + } + }, { + key: '_touchSwipe', + value: function _touchSwipe(evt) { + if (!this.active) { + return; + } + if (evt.touches.length > 1) { + this.touchSwipeState = null; + return; + } + switch (evt.type) { + case 'touchstart': + this.touchSwipeState = { + startX: evt.touches[0].pageX, + startY: evt.touches[0].pageY, + endX: evt.touches[0].pageX, + endY: evt.touches[0].pageY + }; + break; + case 'touchmove': + if (this.touchSwipeState === null) { + return; + } + this.touchSwipeState.endX = evt.touches[0].pageX; + this.touchSwipeState.endY = evt.touches[0].pageY; + evt.preventDefault(); + break; + case 'touchend': + if (this.touchSwipeState === null) { + return; + } + var delta = 0; + var dx = this.touchSwipeState.endX - this.touchSwipeState.startX; + var dy = this.touchSwipeState.endY - this.touchSwipeState.startY; + var absAngle = Math.abs(Math.atan2(dy, dx)); + if (Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD && (absAngle <= SWIPE_ANGLE_THRESHOLD || absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)) { + delta = dx; + } else if (Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD && Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD) { + delta = dy; + } + if (delta > 0) { + this._goToPreviousPage(); + } else if (delta < 0) { + this._goToNextPage(); + } + break; + } + } + }, { + key: '_addWindowListeners', + value: function _addWindowListeners() { + this.showControlsBind = this._showControls.bind(this); + this.mouseDownBind = this._mouseDown.bind(this); + this.mouseWheelBind = this._mouseWheel.bind(this); + this.resetMouseScrollStateBind = this._resetMouseScrollState.bind(this); + this.contextMenuBind = this._contextMenu.bind(this); + this.touchSwipeBind = this._touchSwipe.bind(this); + window.addEventListener('mousemove', this.showControlsBind); + window.addEventListener('mousedown', this.mouseDownBind); + window.addEventListener('wheel', this.mouseWheelBind); + window.addEventListener('keydown', this.resetMouseScrollStateBind); + window.addEventListener('contextmenu', this.contextMenuBind); + window.addEventListener('touchstart', this.touchSwipeBind); + window.addEventListener('touchmove', this.touchSwipeBind); + window.addEventListener('touchend', this.touchSwipeBind); + } + }, { + key: '_removeWindowListeners', + value: function _removeWindowListeners() { + window.removeEventListener('mousemove', this.showControlsBind); + window.removeEventListener('mousedown', this.mouseDownBind); + window.removeEventListener('wheel', this.mouseWheelBind); + window.removeEventListener('keydown', this.resetMouseScrollStateBind); + window.removeEventListener('contextmenu', this.contextMenuBind); + window.removeEventListener('touchstart', this.touchSwipeBind); + window.removeEventListener('touchmove', this.touchSwipeBind); + window.removeEventListener('touchend', this.touchSwipeBind); + delete this.showControlsBind; + delete this.mouseDownBind; + delete this.mouseWheelBind; + delete this.resetMouseScrollStateBind; + delete this.contextMenuBind; + delete this.touchSwipeBind; + } + }, { + key: '_fullscreenChange', + value: function _fullscreenChange() { + if (this.isFullscreen) { + this._enter(); + } else { + this._exit(); + } + } + }, { + key: '_addFullscreenChangeListeners', + value: function _addFullscreenChangeListeners() { + this.fullscreenChangeBind = this._fullscreenChange.bind(this); + window.addEventListener('fullscreenchange', this.fullscreenChangeBind); + window.addEventListener('mozfullscreenchange', this.fullscreenChangeBind); + window.addEventListener('webkitfullscreenchange', this.fullscreenChangeBind); + window.addEventListener('MSFullscreenChange', this.fullscreenChangeBind); + } + }, { + key: '_removeFullscreenChangeListeners', + value: function _removeFullscreenChangeListeners() { + window.removeEventListener('fullscreenchange', this.fullscreenChangeBind); + window.removeEventListener('mozfullscreenchange', this.fullscreenChangeBind); + window.removeEventListener('webkitfullscreenchange', this.fullscreenChangeBind); + window.removeEventListener('MSFullscreenChange', this.fullscreenChangeBind); + delete this.fullscreenChangeBind; + } + }, { + key: 'isFullscreen', + get: function get() { + return !!(document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement); + } + }]); + + return PDFPresentationMode; +}(); + +exports.PDFPresentationMode = PDFPresentationMode; + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFThumbnailViewer = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +var _pdf_thumbnail_view = __webpack_require__(20); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var THUMBNAIL_SCROLL_MARGIN = -19; + +var PDFThumbnailViewer = function () { + function PDFThumbnailViewer(_ref) { + var container = _ref.container, + linkService = _ref.linkService, + renderingQueue = _ref.renderingQueue, + _ref$l10n = _ref.l10n, + l10n = _ref$l10n === undefined ? _ui_utils.NullL10n : _ref$l10n; + + _classCallCheck(this, PDFThumbnailViewer); + + this.container = container; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.l10n = l10n; + this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this)); + this._resetView(); + } + + _createClass(PDFThumbnailViewer, [{ + key: '_scrollUpdated', + value: function _scrollUpdated() { + this.renderingQueue.renderHighestPriority(); + } + }, { + key: 'getThumbnail', + value: function getThumbnail(index) { + return this._thumbnails[index]; + } + }, { + key: '_getVisibleThumbs', + value: function _getVisibleThumbs() { + return (0, _ui_utils.getVisibleElements)(this.container, this._thumbnails); + } + }, { + key: 'scrollThumbnailIntoView', + value: function scrollThumbnailIntoView(page) { + var selected = document.querySelector('.thumbnail.selected'); + if (selected) { + selected.classList.remove('selected'); + } + var thumbnail = document.querySelector('div.thumbnail[data-page-number="' + page + '"]'); + if (thumbnail) { + thumbnail.classList.add('selected'); + } + var visibleThumbs = this._getVisibleThumbs(); + var numVisibleThumbs = visibleThumbs.views.length; + if (numVisibleThumbs > 0) { + var first = visibleThumbs.first.id; + var last = numVisibleThumbs > 1 ? visibleThumbs.last.id : first; + if (page <= first || page >= last) { + (0, _ui_utils.scrollIntoView)(thumbnail, { top: THUMBNAIL_SCROLL_MARGIN }); + } + } + } + }, { + key: 'cleanup', + value: function cleanup() { + _pdf_thumbnail_view.PDFThumbnailView.cleanup(); + } + }, { + key: '_resetView', + value: function _resetView() { + this._thumbnails = []; + this._pageLabels = null; + this._pagesRotation = 0; + this._pagesRequests = []; + this.container.textContent = ''; + } + }, { + key: 'setDocument', + value: function setDocument(pdfDocument) { + var _this = this; + + if (this.pdfDocument) { + this._cancelRendering(); + this._resetView(); + } + this.pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + pdfDocument.getPage(1).then(function (firstPage) { + var pagesCount = pdfDocument.numPages; + var viewport = firstPage.getViewport(1.0); + for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) { + var thumbnail = new _pdf_thumbnail_view.PDFThumbnailView({ + container: _this.container, + id: pageNum, + defaultViewport: viewport.clone(), + linkService: _this.linkService, + renderingQueue: _this.renderingQueue, + disableCanvasToImageConversion: false, + l10n: _this.l10n + }); + _this._thumbnails.push(thumbnail); + } + }).catch(function (reason) { + console.error('Unable to initialize thumbnail viewer', reason); + }); + } + }, { + key: '_cancelRendering', + value: function _cancelRendering() { + for (var i = 0, ii = this._thumbnails.length; i < ii; i++) { + if (this._thumbnails[i]) { + this._thumbnails[i].cancelRendering(); + } + } + } + }, { + key: 'setPageLabels', + value: function setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + if (!labels) { + this._pageLabels = null; + } else if (!(labels instanceof Array && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error('PDFThumbnailViewer_setPageLabels: Invalid page labels.'); + } else { + this._pageLabels = labels; + } + for (var i = 0, ii = this._thumbnails.length; i < ii; i++) { + var label = this._pageLabels && this._pageLabels[i]; + this._thumbnails[i].setPageLabel(label); + } + } + }, { + key: '_ensurePdfPageLoaded', + value: function _ensurePdfPageLoaded(thumbView) { + var _this2 = this; + + if (thumbView.pdfPage) { + return Promise.resolve(thumbView.pdfPage); + } + var pageNumber = thumbView.id; + if (this._pagesRequests[pageNumber]) { + return this._pagesRequests[pageNumber]; + } + var promise = this.pdfDocument.getPage(pageNumber).then(function (pdfPage) { + thumbView.setPdfPage(pdfPage); + _this2._pagesRequests[pageNumber] = null; + return pdfPage; + }).catch(function (reason) { + console.error('Unable to get page for thumb view', reason); + _this2._pagesRequests[pageNumber] = null; + }); + this._pagesRequests[pageNumber] = promise; + return promise; + } + }, { + key: 'forceRendering', + value: function forceRendering() { + var _this3 = this; + + var visibleThumbs = this._getVisibleThumbs(); + var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, this.scroll.down); + if (thumbView) { + this._ensurePdfPageLoaded(thumbView).then(function () { + _this3.renderingQueue.renderView(thumbView); + }); + return true; + } + return false; + } + }, { + key: 'pagesRotation', + get: function get() { + return this._pagesRotation; + }, + set: function set(rotation) { + if (!(0, _ui_utils.isValidRotation)(rotation)) { + throw new Error('Invalid thumbnails rotation angle.'); + } + if (!this.pdfDocument) { + return; + } + if (this._pagesRotation === rotation) { + return; + } + this._pagesRotation = rotation; + for (var i = 0, ii = this._thumbnails.length; i < ii; i++) { + this._thumbnails[i].update(rotation); + } + } + }]); + + return PDFThumbnailViewer; +}(); + +exports.PDFThumbnailViewer = PDFThumbnailViewer; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFThumbnailView = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdfjsLib = __webpack_require__(1); + +var _ui_utils = __webpack_require__(0); + +var _pdf_rendering_queue = __webpack_require__(3); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var MAX_NUM_SCALING_STEPS = 3; +var THUMBNAIL_CANVAS_BORDER_WIDTH = 1; +var THUMBNAIL_WIDTH = 98; +var TempImageFactory = function TempImageFactoryClosure() { + var tempCanvasCache = null; + return { + getCanvas: function getCanvas(width, height) { + var tempCanvas = tempCanvasCache; + if (!tempCanvas) { + tempCanvas = document.createElement('canvas'); + tempCanvasCache = tempCanvas; + } + tempCanvas.width = width; + tempCanvas.height = height; + tempCanvas.mozOpaque = true; + var ctx = tempCanvas.getContext('2d', { alpha: false }); + ctx.save(); + ctx.fillStyle = 'rgb(255, 255, 255)'; + ctx.fillRect(0, 0, width, height); + ctx.restore(); + return tempCanvas; + }, + destroyCanvas: function destroyCanvas() { + var tempCanvas = tempCanvasCache; + if (tempCanvas) { + tempCanvas.width = 0; + tempCanvas.height = 0; + } + tempCanvasCache = null; + } + }; +}(); + +var PDFThumbnailView = function () { + function PDFThumbnailView(_ref) { + var container = _ref.container, + id = _ref.id, + defaultViewport = _ref.defaultViewport, + linkService = _ref.linkService, + renderingQueue = _ref.renderingQueue, + _ref$disableCanvasToI = _ref.disableCanvasToImageConversion, + disableCanvasToImageConversion = _ref$disableCanvasToI === undefined ? false : _ref$disableCanvasToI, + _ref$l10n = _ref.l10n, + l10n = _ref$l10n === undefined ? _ui_utils.NullL10n : _ref$l10n; + + _classCallCheck(this, PDFThumbnailView); + + this.id = id; + this.renderingId = 'thumbnail' + id; + this.pageLabel = null; + this.pdfPage = null; + this.rotation = 0; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.renderTask = null; + this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL; + this.resume = null; + this.disableCanvasToImageConversion = disableCanvasToImageConversion; + this.pageWidth = this.viewport.width; + this.pageHeight = this.viewport.height; + this.pageRatio = this.pageWidth / this.pageHeight; + this.canvasWidth = THUMBNAIL_WIDTH; + this.canvasHeight = this.canvasWidth / this.pageRatio | 0; + this.scale = this.canvasWidth / this.pageWidth; + this.l10n = l10n; + var anchor = document.createElement('a'); + anchor.href = linkService.getAnchorUrl('#page=' + id); + this.l10n.get('thumb_page_title', { page: id }, 'Page {{page}}').then(function (msg) { + anchor.title = msg; + }); + anchor.onclick = function () { + linkService.page = id; + return false; + }; + this.anchor = anchor; + var div = document.createElement('div'); + div.className = 'thumbnail'; + div.setAttribute('data-page-number', this.id); + this.div = div; + if (id === 1) { + div.classList.add('selected'); + } + var ring = document.createElement('div'); + ring.className = 'thumbnailSelectionRing'; + var borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; + ring.style.width = this.canvasWidth + borderAdjustment + 'px'; + ring.style.height = this.canvasHeight + borderAdjustment + 'px'; + this.ring = ring; + div.appendChild(ring); + anchor.appendChild(div); + container.appendChild(anchor); + } + + _createClass(PDFThumbnailView, [{ + key: 'setPdfPage', + value: function setPdfPage(pdfPage) { + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + var totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport(1, totalRotation); + this.reset(); + } + }, { + key: 'reset', + value: function reset() { + this.cancelRendering(); + this.pageWidth = this.viewport.width; + this.pageHeight = this.viewport.height; + this.pageRatio = this.pageWidth / this.pageHeight; + this.canvasHeight = this.canvasWidth / this.pageRatio | 0; + this.scale = this.canvasWidth / this.pageWidth; + this.div.removeAttribute('data-loaded'); + var ring = this.ring; + var childNodes = ring.childNodes; + for (var i = childNodes.length - 1; i >= 0; i--) { + ring.removeChild(childNodes[i]); + } + var borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; + ring.style.width = this.canvasWidth + borderAdjustment + 'px'; + ring.style.height = this.canvasHeight + borderAdjustment + 'px'; + if (this.canvas) { + this.canvas.width = 0; + this.canvas.height = 0; + delete this.canvas; + } + if (this.image) { + this.image.removeAttribute('src'); + delete this.image; + } + } + }, { + key: 'update', + value: function update(rotation) { + if (typeof rotation !== 'undefined') { + this.rotation = rotation; + } + var totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: 1, + rotation: totalRotation + }); + this.reset(); + } + }, { + key: 'cancelRendering', + value: function cancelRendering() { + if (this.renderTask) { + this.renderTask.cancel(); + this.renderTask = null; + } + this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL; + this.resume = null; + } + }, { + key: '_getPageDrawContext', + value: function _getPageDrawContext() { + var noCtxScale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var canvas = document.createElement('canvas'); + this.canvas = canvas; + canvas.mozOpaque = true; + var ctx = canvas.getContext('2d', { alpha: false }); + var outputScale = (0, _ui_utils.getOutputScale)(ctx); + canvas.width = this.canvasWidth * outputScale.sx | 0; + canvas.height = this.canvasHeight * outputScale.sy | 0; + canvas.style.width = this.canvasWidth + 'px'; + canvas.style.height = this.canvasHeight + 'px'; + if (!noCtxScale && outputScale.scaled) { + ctx.scale(outputScale.sx, outputScale.sy); + } + return ctx; + } + }, { + key: '_convertCanvasToImage', + value: function _convertCanvasToImage() { + var _this = this; + + if (!this.canvas) { + return; + } + if (this.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) { + return; + } + var id = this.renderingId; + var className = 'thumbnailImage'; + if (this.disableCanvasToImageConversion) { + this.canvas.id = id; + this.canvas.className = className; + this.l10n.get('thumb_page_canvas', { page: this.pageId }, 'Thumbnail of Page {{page}}').then(function (msg) { + _this.canvas.setAttribute('aria-label', msg); + }); + this.div.setAttribute('data-loaded', true); + this.ring.appendChild(this.canvas); + return; + } + var image = document.createElement('img'); + image.id = id; + image.className = className; + this.l10n.get('thumb_page_canvas', { page: this.pageId }, 'Thumbnail of Page {{page}}').then(function (msg) { + image.setAttribute('aria-label', msg); + }); + image.style.width = this.canvasWidth + 'px'; + image.style.height = this.canvasHeight + 'px'; + image.src = this.canvas.toDataURL(); + this.image = image; + this.div.setAttribute('data-loaded', true); + this.ring.appendChild(image); + this.canvas.width = 0; + this.canvas.height = 0; + delete this.canvas; + } + }, { + key: 'draw', + value: function draw() { + var _this2 = this; + + if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) { + console.error('Must be in new state before drawing'); + return Promise.resolve(undefined); + } + this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING; + var renderCapability = (0, _pdfjsLib.createPromiseCapability)(); + var finishRenderTask = function finishRenderTask(error) { + if (renderTask === _this2.renderTask) { + _this2.renderTask = null; + } + if (error === 'cancelled' || error instanceof _pdfjsLib.RenderingCancelledException) { + renderCapability.resolve(undefined); + return; + } + _this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED; + _this2._convertCanvasToImage(); + if (!error) { + renderCapability.resolve(undefined); + } else { + renderCapability.reject(error); + } + }; + var ctx = this._getPageDrawContext(); + var drawViewport = this.viewport.clone({ scale: this.scale }); + var renderContinueCallback = function renderContinueCallback(cont) { + if (!_this2.renderingQueue.isHighestPriority(_this2)) { + _this2.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED; + _this2.resume = function () { + _this2.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING; + cont(); + }; + return; + } + cont(); + }; + var renderContext = { + canvasContext: ctx, + viewport: drawViewport + }; + var renderTask = this.renderTask = this.pdfPage.render(renderContext); + renderTask.onContinue = renderContinueCallback; + renderTask.promise.then(function () { + finishRenderTask(null); + }, function (error) { + finishRenderTask(error); + }); + return renderCapability.promise; + } + }, { + key: 'setImage', + value: function setImage(pageView) { + if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) { + return; + } + var img = pageView.canvas; + if (!img) { + return; + } + if (!this.pdfPage) { + this.setPdfPage(pageView.pdfPage); + } + this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED; + var ctx = this._getPageDrawContext(true); + var canvas = ctx.canvas; + if (img.width <= 2 * canvas.width) { + ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height); + this._convertCanvasToImage(); + return; + } + var reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS; + var reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS; + var reducedImage = TempImageFactory.getCanvas(reducedWidth, reducedHeight); + var reducedImageCtx = reducedImage.getContext('2d'); + while (reducedWidth > img.width || reducedHeight > img.height) { + reducedWidth >>= 1; + reducedHeight >>= 1; + } + reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight); + while (reducedWidth > 2 * canvas.width) { + reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1); + reducedWidth >>= 1; + reducedHeight >>= 1; + } + ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height); + this._convertCanvasToImage(); + } + }, { + key: 'setPageLabel', + value: function setPageLabel(label) { + var _this3 = this; + + this.pageLabel = typeof label === 'string' ? label : null; + this.l10n.get('thumb_page_title', { page: this.pageId }, 'Page {{page}}').then(function (msg) { + _this3.anchor.title = msg; + }); + if (this.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) { + return; + } + this.l10n.get('thumb_page_canvas', { page: this.pageId }, 'Thumbnail of Page {{page}}').then(function (ariaLabel) { + if (_this3.image) { + _this3.image.setAttribute('aria-label', ariaLabel); + } else if (_this3.disableCanvasToImageConversion && _this3.canvas) { + _this3.canvas.setAttribute('aria-label', ariaLabel); + } + }); + } + }, { + key: 'pageId', + get: function get() { + return this.pageLabel !== null ? this.pageLabel : this.id; + } + }], [{ + key: 'cleanup', + value: function cleanup() { + TempImageFactory.destroyCanvas(); + } + }]); + + return PDFThumbnailView; +}(); + +exports.PDFThumbnailView = PDFThumbnailView; + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFViewer = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +var _base_viewer = __webpack_require__(22); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var PDFViewer = function (_BaseViewer) { + _inherits(PDFViewer, _BaseViewer); + + function PDFViewer() { + _classCallCheck(this, PDFViewer); + + return _possibleConstructorReturn(this, (PDFViewer.__proto__ || Object.getPrototypeOf(PDFViewer)).apply(this, arguments)); + } + + _createClass(PDFViewer, [{ + key: '_scrollIntoView', + value: function _scrollIntoView(_ref) { + var pageDiv = _ref.pageDiv, + _ref$pageSpot = _ref.pageSpot, + pageSpot = _ref$pageSpot === undefined ? null : _ref$pageSpot; + + (0, _ui_utils.scrollIntoView)(pageDiv, pageSpot); + } + }, { + key: '_getVisiblePages', + value: function _getVisiblePages() { + if (!this.isInPresentationMode) { + return (0, _ui_utils.getVisibleElements)(this.container, this._pages, true); + } + var currentPage = this._pages[this._currentPageNumber - 1]; + var visible = [{ + id: currentPage.id, + view: currentPage + }]; + return { + first: currentPage, + last: currentPage, + views: visible + }; + } + }, { + key: 'update', + value: function update() { + var visible = this._getVisiblePages(); + var visiblePages = visible.views, + numVisiblePages = visiblePages.length; + if (numVisiblePages === 0) { + return; + } + this._resizeBuffer(numVisiblePages); + this.renderingQueue.renderHighestPriority(visible); + var currentId = this._currentPageNumber; + var stillFullyVisible = false; + for (var i = 0; i < numVisiblePages; ++i) { + var page = visiblePages[i]; + if (page.percent < 100) { + break; + } + if (page.id === currentId) { + stillFullyVisible = true; + break; + } + } + if (!stillFullyVisible) { + currentId = visiblePages[0].id; + } + if (!this.isInPresentationMode) { + this._setCurrentPageNumber(currentId); + } + this._updateLocation(visible.first); + this.eventBus.dispatch('updateviewarea', { + source: this, + location: this._location + }); + } + }, { + key: '_setDocumentViewerElement', + get: function get() { + return (0, _pdfjsLib.shadow)(this, '_setDocumentViewerElement', this.viewer); + } + }]); + + return PDFViewer; +}(_base_viewer.BaseViewer); + +exports.PDFViewer = PDFViewer; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BaseViewer = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdfjsLib = __webpack_require__(1); + +var _ui_utils = __webpack_require__(0); + +var _pdf_rendering_queue = __webpack_require__(3); + +var _annotation_layer_builder = __webpack_require__(23); + +var _dom_events = __webpack_require__(2); + +var _pdf_page_view = __webpack_require__(24); + +var _pdf_link_service = __webpack_require__(5); + +var _text_layer_builder = __webpack_require__(25); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DEFAULT_CACHE_SIZE = 10; +function PDFPageViewBuffer(size) { + var data = []; + this.push = function (view) { + var i = data.indexOf(view); + if (i >= 0) { + data.splice(i, 1); + } + data.push(view); + if (data.length > size) { + data.shift().destroy(); + } + }; + this.resize = function (newSize) { + size = newSize; + while (data.length > size) { + data.shift().destroy(); + } + }; +} +function isSameScale(oldScale, newScale) { + if (newScale === oldScale) { + return true; + } + if (Math.abs(newScale - oldScale) < 1e-15) { + return true; + } + return false; +} +function isPortraitOrientation(size) { + return size.width <= size.height; +} + +var BaseViewer = function () { + function BaseViewer(options) { + _classCallCheck(this, BaseViewer); + + if (this.constructor === BaseViewer) { + throw new Error('Cannot initialize BaseViewer.'); + } + this._name = this.constructor.name; + this.container = options.container; + this.viewer = options.viewer || options.container.firstElementChild; + this.eventBus = options.eventBus || (0, _dom_events.getGlobalEventBus)(); + this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService(); + this.downloadManager = options.downloadManager || null; + this.removePageBorders = options.removePageBorders || false; + this.enhanceTextSelection = options.enhanceTextSelection || false; + this.renderInteractiveForms = options.renderInteractiveForms || false; + this.enablePrintAutoRotate = options.enablePrintAutoRotate || false; + this.renderer = options.renderer || _ui_utils.RendererType.CANVAS; + this.l10n = options.l10n || _ui_utils.NullL10n; + this.defaultRenderingQueue = !options.renderingQueue; + if (this.defaultRenderingQueue) { + this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue(); + this.renderingQueue.setViewer(this); + } else { + this.renderingQueue = options.renderingQueue; + } + this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this)); + this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN; + this._resetView(); + if (this.removePageBorders) { + this.viewer.classList.add('removePageBorders'); + } + } + + _createClass(BaseViewer, [{ + key: 'getPageView', + value: function getPageView(index) { + return this._pages[index]; + } + }, { + key: '_setCurrentPageNumber', + value: function _setCurrentPageNumber(val) { + var resetCurrentPageView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (this._currentPageNumber === val) { + if (resetCurrentPageView) { + this._resetCurrentPageView(); + } + return; + } + if (!(0 < val && val <= this.pagesCount)) { + console.error(this._name + '._setCurrentPageNumber: "' + val + '" is out of bounds.'); + return; + } + var arg = { + source: this, + pageNumber: val, + pageLabel: this._pageLabels && this._pageLabels[val - 1] + }; + this._currentPageNumber = val; + this.eventBus.dispatch('pagechanging', arg); + this.eventBus.dispatch('pagechange', arg); + if (resetCurrentPageView) { + this._resetCurrentPageView(); + } + } + }, { + key: 'setDocument', + value: function setDocument(pdfDocument) { + var _this = this; + + if (this.pdfDocument) { + this._cancelRendering(); + this._resetView(); + } + this.pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + var pagesCount = pdfDocument.numPages; + var pagesCapability = (0, _pdfjsLib.createPromiseCapability)(); + this.pagesPromise = pagesCapability.promise; + pagesCapability.promise.then(function () { + _this._pageViewsReady = true; + _this.eventBus.dispatch('pagesloaded', { + source: _this, + pagesCount: pagesCount + }); + }); + var isOnePageRenderedResolved = false; + var onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)(); + this.onePageRendered = onePageRenderedCapability.promise; + var bindOnAfterAndBeforeDraw = function bindOnAfterAndBeforeDraw(pageView) { + pageView.onBeforeDraw = function () { + _this._buffer.push(pageView); + }; + pageView.onAfterDraw = function () { + if (!isOnePageRenderedResolved) { + isOnePageRenderedResolved = true; + onePageRenderedCapability.resolve(); + } + }; + }; + var firstPagePromise = pdfDocument.getPage(1); + this.firstPagePromise = firstPagePromise; + firstPagePromise.then(function (pdfPage) { + var scale = _this.currentScale; + var viewport = pdfPage.getViewport(scale * _ui_utils.CSS_UNITS); + for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) { + var textLayerFactory = null; + if (!_pdfjsLib.PDFJS.disableTextLayer) { + textLayerFactory = _this; + } + var pageView = new _pdf_page_view.PDFPageView({ + container: _this._setDocumentViewerElement, + eventBus: _this.eventBus, + id: pageNum, + scale: scale, + defaultViewport: viewport.clone(), + renderingQueue: _this.renderingQueue, + textLayerFactory: textLayerFactory, + annotationLayerFactory: _this, + enhanceTextSelection: _this.enhanceTextSelection, + renderInteractiveForms: _this.renderInteractiveForms, + renderer: _this.renderer, + l10n: _this.l10n + }); + bindOnAfterAndBeforeDraw(pageView); + _this._pages.push(pageView); + } + onePageRenderedCapability.promise.then(function () { + if (_pdfjsLib.PDFJS.disableAutoFetch) { + pagesCapability.resolve(); + return; + } + var getPagesLeft = pagesCount; + + var _loop = function _loop(_pageNum) { + pdfDocument.getPage(_pageNum).then(function (pdfPage) { + var pageView = _this._pages[_pageNum - 1]; + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + _this.linkService.cachePageRef(_pageNum, pdfPage.ref); + if (--getPagesLeft === 0) { + pagesCapability.resolve(); + } + }, function (reason) { + console.error('Unable to get page ' + _pageNum + ' to initialize viewer', reason); + if (--getPagesLeft === 0) { + pagesCapability.resolve(); + } + }); + }; + + for (var _pageNum = 1; _pageNum <= pagesCount; ++_pageNum) { + _loop(_pageNum); + } + }); + _this.eventBus.dispatch('pagesinit', { source: _this }); + if (_this.defaultRenderingQueue) { + _this.update(); + } + if (_this.findController) { + _this.findController.resolveFirstPage(); + } + }).catch(function (reason) { + console.error('Unable to initialize viewer', reason); + }); + } + }, { + key: 'setPageLabels', + value: function setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + if (!labels) { + this._pageLabels = null; + } else if (!(labels instanceof Array && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error(this._name + '.setPageLabels: Invalid page labels.'); + } else { + this._pageLabels = labels; + } + for (var i = 0, ii = this._pages.length; i < ii; i++) { + var pageView = this._pages[i]; + var label = this._pageLabels && this._pageLabels[i]; + pageView.setPageLabel(label); + } + } + }, { + key: '_resetView', + value: function _resetView() { + this._pages = []; + this._currentPageNumber = 1; + this._currentScale = _ui_utils.UNKNOWN_SCALE; + this._currentScaleValue = null; + this._pageLabels = null; + this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE); + this._location = null; + this._pagesRotation = 0; + this._pagesRequests = []; + this._pageViewsReady = false; + this.viewer.textContent = ''; + } + }, { + key: '_scrollUpdate', + value: function _scrollUpdate() { + if (this.pagesCount === 0) { + return; + } + this.update(); + } + }, { + key: '_scrollIntoView', + value: function _scrollIntoView(_ref) { + var pageDiv = _ref.pageDiv, + _ref$pageSpot = _ref.pageSpot, + pageSpot = _ref$pageSpot === undefined ? null : _ref$pageSpot, + _ref$pageNumber = _ref.pageNumber, + pageNumber = _ref$pageNumber === undefined ? null : _ref$pageNumber; + + throw new Error('Not implemented: _scrollIntoView'); + } + }, { + key: '_setScaleDispatchEvent', + value: function _setScaleDispatchEvent(newScale, newValue) { + var preset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var arg = { + source: this, + scale: newScale, + presetValue: preset ? newValue : undefined + }; + this.eventBus.dispatch('scalechanging', arg); + this.eventBus.dispatch('scalechange', arg); + } + }, { + key: '_setScaleUpdatePages', + value: function _setScaleUpdatePages(newScale, newValue) { + var noScroll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var preset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + this._currentScaleValue = newValue.toString(); + if (isSameScale(this._currentScale, newScale)) { + if (preset) { + this._setScaleDispatchEvent(newScale, newValue, true); + } + return; + } + for (var i = 0, ii = this._pages.length; i < ii; i++) { + this._pages[i].update(newScale); + } + this._currentScale = newScale; + if (!noScroll) { + var page = this._currentPageNumber, + dest = void 0; + if (this._location && !_pdfjsLib.PDFJS.ignoreCurrentPositionOnZoom && !(this.isInPresentationMode || this.isChangingPresentationMode)) { + page = this._location.pageNumber; + dest = [null, { name: 'XYZ' }, this._location.left, this._location.top, null]; + } + this.scrollPageIntoView({ + pageNumber: page, + destArray: dest, + allowNegativeOffset: true + }); + } + this._setScaleDispatchEvent(newScale, newValue, preset); + if (this.defaultRenderingQueue) { + this.update(); + } + } + }, { + key: '_setScale', + value: function _setScale(value) { + var noScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var scale = parseFloat(value); + if (scale > 0) { + this._setScaleUpdatePages(scale, value, noScroll, false); + } else { + var currentPage = this._pages[this._currentPageNumber - 1]; + if (!currentPage) { + return; + } + var hPadding = this.isInPresentationMode || this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING; + var vPadding = this.isInPresentationMode || this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING; + var pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale; + var pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale; + switch (value) { + case 'page-actual': + scale = 1; + break; + case 'page-width': + scale = pageWidthScale; + break; + case 'page-height': + scale = pageHeightScale; + break; + case 'page-fit': + scale = Math.min(pageWidthScale, pageHeightScale); + break; + case 'auto': + var isLandscape = currentPage.width > currentPage.height; + var horizontalScale = isLandscape ? Math.min(pageHeightScale, pageWidthScale) : pageWidthScale; + scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale); + break; + default: + console.error(this._name + '._setScale: "' + value + '" is an unknown zoom value.'); + return; + } + this._setScaleUpdatePages(scale, value, noScroll, true); + } + } + }, { + key: '_resetCurrentPageView', + value: function _resetCurrentPageView() { + if (this.isInPresentationMode) { + this._setScale(this._currentScaleValue, true); + } + var pageView = this._pages[this._currentPageNumber - 1]; + this._scrollIntoView({ pageDiv: pageView.div }); + } + }, { + key: 'scrollPageIntoView', + value: function scrollPageIntoView(params) { + if (arguments.length > 1 || typeof params === 'number') { + console.error('Call of scrollPageIntoView() with obsolete signature.'); + return; + } + if (!this.pdfDocument) { + return; + } + var pageNumber = params.pageNumber || 0; + var dest = params.destArray || null; + var allowNegativeOffset = params.allowNegativeOffset || false; + if (this.isInPresentationMode || !dest) { + this._setCurrentPageNumber(pageNumber, true); + return; + } + var pageView = this._pages[pageNumber - 1]; + if (!pageView) { + console.error(this._name + '.scrollPageIntoView: Invalid "pageNumber" parameter.'); + return; + } + var x = 0, + y = 0; + var width = 0, + height = 0, + widthScale = void 0, + heightScale = void 0; + var changeOrientation = pageView.rotation % 180 === 0 ? false : true; + var pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _ui_utils.CSS_UNITS; + var pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _ui_utils.CSS_UNITS; + var scale = 0; + switch (dest[1].name) { + case 'XYZ': + x = dest[2]; + y = dest[3]; + scale = dest[4]; + x = x !== null ? x : 0; + y = y !== null ? y : pageHeight; + break; + case 'Fit': + case 'FitB': + scale = 'page-fit'; + break; + case 'FitH': + case 'FitBH': + y = dest[2]; + scale = 'page-width'; + if (y === null && this._location) { + x = this._location.left; + y = this._location.top; + } + break; + case 'FitV': + case 'FitBV': + x = dest[2]; + width = pageWidth; + height = pageHeight; + scale = 'page-height'; + break; + case 'FitR': + x = dest[2]; + y = dest[3]; + width = dest[4] - x; + height = dest[5] - y; + var hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING; + var vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING; + widthScale = (this.container.clientWidth - hPadding) / width / _ui_utils.CSS_UNITS; + heightScale = (this.container.clientHeight - vPadding) / height / _ui_utils.CSS_UNITS; + scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); + break; + default: + console.error(this._name + '.scrollPageIntoView: "' + dest[1].name + '" ' + 'is not a valid destination type.'); + return; + } + if (scale && scale !== this._currentScale) { + this.currentScaleValue = scale; + } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) { + this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + } + if (scale === 'page-fit' && !dest[4]) { + this._scrollIntoView({ + pageDiv: pageView.div, + pageNumber: pageNumber + }); + return; + } + var boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)]; + var left = Math.min(boundingRect[0][0], boundingRect[1][0]); + var top = Math.min(boundingRect[0][1], boundingRect[1][1]); + if (!allowNegativeOffset) { + left = Math.max(left, 0); + top = Math.max(top, 0); + } + this._scrollIntoView({ + pageDiv: pageView.div, + pageSpot: { + left: left, + top: top + }, + pageNumber: pageNumber + }); + } + }, { + key: '_resizeBuffer', + value: function _resizeBuffer(numVisiblePages) { + var suggestedCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1); + this._buffer.resize(suggestedCacheSize); + } + }, { + key: '_updateLocation', + value: function _updateLocation(firstPage) { + var currentScale = this._currentScale; + var currentScaleValue = this._currentScaleValue; + var normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue; + var pageNumber = firstPage.id; + var pdfOpenParams = '#page=' + pageNumber; + pdfOpenParams += '&zoom=' + normalizedScaleValue; + var currentPageView = this._pages[pageNumber - 1]; + var container = this.container; + var topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y); + var intLeft = Math.round(topLeft[0]); + var intTop = Math.round(topLeft[1]); + pdfOpenParams += ',' + intLeft + ',' + intTop; + this._location = { + pageNumber: pageNumber, + scale: normalizedScaleValue, + top: intTop, + left: intLeft, + rotation: this._pagesRotation, + pdfOpenParams: pdfOpenParams + }; + } + }, { + key: 'update', + value: function update() { + throw new Error('Not implemented: update'); + } + }, { + key: 'containsElement', + value: function containsElement(element) { + return this.container.contains(element); + } + }, { + key: 'focus', + value: function focus() { + this.container.focus(); + } + }, { + key: '_getVisiblePages', + value: function _getVisiblePages() { + throw new Error('Not implemented: _getVisiblePages'); + } + }, { + key: 'cleanup', + value: function cleanup() { + for (var i = 0, ii = this._pages.length; i < ii; i++) { + if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) { + this._pages[i].reset(); + } + } + } + }, { + key: '_cancelRendering', + value: function _cancelRendering() { + for (var i = 0, ii = this._pages.length; i < ii; i++) { + if (this._pages[i]) { + this._pages[i].cancelRendering(); + } + } + } + }, { + key: '_ensurePdfPageLoaded', + value: function _ensurePdfPageLoaded(pageView) { + var _this2 = this; + + if (pageView.pdfPage) { + return Promise.resolve(pageView.pdfPage); + } + var pageNumber = pageView.id; + if (this._pagesRequests[pageNumber]) { + return this._pagesRequests[pageNumber]; + } + var promise = this.pdfDocument.getPage(pageNumber).then(function (pdfPage) { + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + _this2._pagesRequests[pageNumber] = null; + return pdfPage; + }).catch(function (reason) { + console.error('Unable to get page for page view', reason); + _this2._pagesRequests[pageNumber] = null; + }); + this._pagesRequests[pageNumber] = promise; + return promise; + } + }, { + key: 'forceRendering', + value: function forceRendering(currentlyVisiblePages) { + var _this3 = this; + + var visiblePages = currentlyVisiblePages || this._getVisiblePages(); + var pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, this.scroll.down); + if (pageView) { + this._ensurePdfPageLoaded(pageView).then(function () { + _this3.renderingQueue.renderView(pageView); + }); + return true; + } + return false; + } + }, { + key: 'getPageTextContent', + value: function getPageTextContent(pageIndex) { + return this.pdfDocument.getPage(pageIndex + 1).then(function (page) { + return page.getTextContent({ normalizeWhitespace: true }); + }); + } + }, { + key: 'createTextLayerBuilder', + value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) { + var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + return new _text_layer_builder.TextLayerBuilder({ + textLayerDiv: textLayerDiv, + eventBus: this.eventBus, + pageIndex: pageIndex, + viewport: viewport, + findController: this.isInPresentationMode ? null : this.findController, + enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection + }); + } + }, { + key: 'createAnnotationLayerBuilder', + value: function createAnnotationLayerBuilder(pageDiv, pdfPage) { + var renderInteractiveForms = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var l10n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _ui_utils.NullL10n; + + return new _annotation_layer_builder.AnnotationLayerBuilder({ + pageDiv: pageDiv, + pdfPage: pdfPage, + renderInteractiveForms: renderInteractiveForms, + linkService: this.linkService, + downloadManager: this.downloadManager, + l10n: l10n + }); + } + }, { + key: 'setFindController', + value: function setFindController(findController) { + this.findController = findController; + } + }, { + key: 'getPagesOverview', + value: function getPagesOverview() { + var pagesOverview = this._pages.map(function (pageView) { + var viewport = pageView.pdfPage.getViewport(1); + return { + width: viewport.width, + height: viewport.height, + rotation: viewport.rotation + }; + }); + if (!this.enablePrintAutoRotate) { + return pagesOverview; + } + var isFirstPagePortrait = isPortraitOrientation(pagesOverview[0]); + return pagesOverview.map(function (size) { + if (isFirstPagePortrait === isPortraitOrientation(size)) { + return size; + } + return { + width: size.height, + height: size.width, + rotation: (size.rotation + 90) % 360 + }; + }); + } + }, { + key: 'pagesCount', + get: function get() { + return this._pages.length; + } + }, { + key: 'pageViewsReady', + get: function get() { + return this._pageViewsReady; + } + }, { + key: 'currentPageNumber', + get: function get() { + return this._currentPageNumber; + }, + set: function set(val) { + if (!Number.isInteger(val)) { + throw new Error('Invalid page number.'); + } + if (!this.pdfDocument) { + return; + } + this._setCurrentPageNumber(val, true); + } + }, { + key: 'currentPageLabel', + get: function get() { + return this._pageLabels && this._pageLabels[this._currentPageNumber - 1]; + }, + set: function set(val) { + var pageNumber = val | 0; + if (this._pageLabels) { + var i = this._pageLabels.indexOf(val); + if (i >= 0) { + pageNumber = i + 1; + } + } + this.currentPageNumber = pageNumber; + } + }, { + key: 'currentScale', + get: function get() { + return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE; + }, + set: function set(val) { + if (isNaN(val)) { + throw new Error('Invalid numeric scale'); + } + if (!this.pdfDocument) { + return; + } + this._setScale(val, false); + } + }, { + key: 'currentScaleValue', + get: function get() { + return this._currentScaleValue; + }, + set: function set(val) { + if (!this.pdfDocument) { + return; + } + this._setScale(val, false); + } + }, { + key: 'pagesRotation', + get: function get() { + return this._pagesRotation; + }, + set: function set(rotation) { + if (!(0, _ui_utils.isValidRotation)(rotation)) { + throw new Error('Invalid pages rotation angle.'); + } + if (!this.pdfDocument) { + return; + } + if (this._pagesRotation === rotation) { + return; + } + this._pagesRotation = rotation; + var pageNumber = this._currentPageNumber; + for (var i = 0, ii = this._pages.length; i < ii; i++) { + var pageView = this._pages[i]; + pageView.update(pageView.scale, rotation); + } + if (this._currentScaleValue) { + this._setScale(this._currentScaleValue, true); + } + this.eventBus.dispatch('rotationchanging', { + source: this, + pagesRotation: rotation, + pageNumber: pageNumber + }); + if (this.defaultRenderingQueue) { + this.update(); + } + } + }, { + key: '_setDocumentViewerElement', + get: function get() { + throw new Error('Not implemented: _setDocumentViewerElement'); + } + }, { + key: 'isInPresentationMode', + get: function get() { + return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN; + } + }, { + key: 'isChangingPresentationMode', + get: function get() { + return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING; + } + }, { + key: 'isHorizontalScrollbarEnabled', + get: function get() { + return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth; + } + }, { + key: 'hasEqualPageSizes', + get: function get() { + var firstPageView = this._pages[0]; + for (var i = 1, ii = this._pages.length; i < ii; ++i) { + var pageView = this._pages[i]; + if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) { + return false; + } + } + return true; + } + }]); + + return BaseViewer; +}(); + +exports.BaseViewer = BaseViewer; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DefaultAnnotationLayerFactory = exports.AnnotationLayerBuilder = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdfjsLib = __webpack_require__(1); + +var _ui_utils = __webpack_require__(0); + +var _pdf_link_service = __webpack_require__(5); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var AnnotationLayerBuilder = function () { + function AnnotationLayerBuilder(_ref) { + var pageDiv = _ref.pageDiv, + pdfPage = _ref.pdfPage, + linkService = _ref.linkService, + downloadManager = _ref.downloadManager, + _ref$renderInteractiv = _ref.renderInteractiveForms, + renderInteractiveForms = _ref$renderInteractiv === undefined ? false : _ref$renderInteractiv, + _ref$l10n = _ref.l10n, + l10n = _ref$l10n === undefined ? _ui_utils.NullL10n : _ref$l10n; + + _classCallCheck(this, AnnotationLayerBuilder); + + this.pageDiv = pageDiv; + this.pdfPage = pdfPage; + this.linkService = linkService; + this.downloadManager = downloadManager; + this.renderInteractiveForms = renderInteractiveForms; + this.l10n = l10n; + this.div = null; + this._cancelled = false; + } + + _createClass(AnnotationLayerBuilder, [{ + key: 'render', + value: function render(viewport) { + var _this = this; + + var intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'display'; + + this.pdfPage.getAnnotations({ intent: intent }).then(function (annotations) { + if (_this._cancelled) { + return; + } + var parameters = { + viewport: viewport.clone({ dontFlip: true }), + div: _this.div, + annotations: annotations, + page: _this.pdfPage, + renderInteractiveForms: _this.renderInteractiveForms, + linkService: _this.linkService, + downloadManager: _this.downloadManager + }; + if (_this.div) { + _pdfjsLib.AnnotationLayer.update(parameters); + } else { + if (annotations.length === 0) { + return; + } + _this.div = document.createElement('div'); + _this.div.className = 'annotationLayer'; + _this.pageDiv.appendChild(_this.div); + parameters.div = _this.div; + _pdfjsLib.AnnotationLayer.render(parameters); + _this.l10n.translate(_this.div); + } + }); + } + }, { + key: 'cancel', + value: function cancel() { + this._cancelled = true; + } + }, { + key: 'hide', + value: function hide() { + if (!this.div) { + return; + } + this.div.setAttribute('hidden', 'true'); + } + }]); + + return AnnotationLayerBuilder; +}(); + +var DefaultAnnotationLayerFactory = function () { + function DefaultAnnotationLayerFactory() { + _classCallCheck(this, DefaultAnnotationLayerFactory); + } + + _createClass(DefaultAnnotationLayerFactory, [{ + key: 'createAnnotationLayerBuilder', + value: function createAnnotationLayerBuilder(pageDiv, pdfPage) { + var renderInteractiveForms = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var l10n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _ui_utils.NullL10n; + + return new AnnotationLayerBuilder({ + pageDiv: pageDiv, + pdfPage: pdfPage, + renderInteractiveForms: renderInteractiveForms, + linkService: new _pdf_link_service.SimpleLinkService(), + l10n: l10n + }); + } + }]); + + return DefaultAnnotationLayerFactory; +}(); + +exports.AnnotationLayerBuilder = AnnotationLayerBuilder; +exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFPageView = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +var _pdfjsLib = __webpack_require__(1); + +var _dom_events = __webpack_require__(2); + +var _pdf_rendering_queue = __webpack_require__(3); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var PDFPageView = function () { + function PDFPageView(options) { + _classCallCheck(this, PDFPageView); + + var container = options.container; + var defaultViewport = options.defaultViewport; + this.id = options.id; + this.renderingId = 'page' + this.id; + this.pdfPage = null; + this.pageLabel = null; + this.rotation = 0; + this.scale = options.scale || _ui_utils.DEFAULT_SCALE; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this.hasRestrictedScaling = false; + this.enhanceTextSelection = options.enhanceTextSelection || false; + this.renderInteractiveForms = options.renderInteractiveForms || false; + this.eventBus = options.eventBus || (0, _dom_events.getGlobalEventBus)(); + this.renderingQueue = options.renderingQueue; + this.textLayerFactory = options.textLayerFactory; + this.annotationLayerFactory = options.annotationLayerFactory; + this.renderer = options.renderer || _ui_utils.RendererType.CANVAS; + this.l10n = options.l10n || _ui_utils.NullL10n; + this.paintTask = null; + this.paintedViewportMap = new WeakMap(); + this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL; + this.resume = null; + this.error = null; + this.onBeforeDraw = null; + this.onAfterDraw = null; + this.annotationLayer = null; + this.textLayer = null; + this.zoomLayer = null; + var div = document.createElement('div'); + div.className = 'page'; + div.style.width = Math.floor(this.viewport.width) + 'px'; + div.style.height = Math.floor(this.viewport.height) + 'px'; + div.setAttribute('data-page-number', this.id); + this.div = div; + container.appendChild(div); + } + + _createClass(PDFPageView, [{ + key: 'setPdfPage', + value: function setPdfPage(pdfPage) { + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + var totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport(this.scale * _ui_utils.CSS_UNITS, totalRotation); + this.stats = pdfPage.stats; + this.reset(); + } + }, { + key: 'destroy', + value: function destroy() { + this.reset(); + if (this.pdfPage) { + this.pdfPage.cleanup(); + } + } + }, { + key: '_resetZoomLayer', + value: function _resetZoomLayer() { + var removeFromDOM = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (!this.zoomLayer) { + return; + } + var zoomLayerCanvas = this.zoomLayer.firstChild; + this.paintedViewportMap.delete(zoomLayerCanvas); + zoomLayerCanvas.width = 0; + zoomLayerCanvas.height = 0; + if (removeFromDOM) { + this.zoomLayer.remove(); + } + this.zoomLayer = null; + } + }, { + key: 'reset', + value: function reset() { + var keepZoomLayer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var keepAnnotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + this.cancelRendering(keepAnnotations); + var div = this.div; + div.style.width = Math.floor(this.viewport.width) + 'px'; + div.style.height = Math.floor(this.viewport.height) + 'px'; + var childNodes = div.childNodes; + var currentZoomLayerNode = keepZoomLayer && this.zoomLayer || null; + var currentAnnotationNode = keepAnnotations && this.annotationLayer && this.annotationLayer.div || null; + for (var i = childNodes.length - 1; i >= 0; i--) { + var node = childNodes[i]; + if (currentZoomLayerNode === node || currentAnnotationNode === node) { + continue; + } + div.removeChild(node); + } + div.removeAttribute('data-loaded'); + if (currentAnnotationNode) { + this.annotationLayer.hide(); + } else if (this.annotationLayer) { + this.annotationLayer.cancel(); + this.annotationLayer = null; + } + if (!currentZoomLayerNode) { + if (this.canvas) { + this.paintedViewportMap.delete(this.canvas); + this.canvas.width = 0; + this.canvas.height = 0; + delete this.canvas; + } + this._resetZoomLayer(); + } + if (this.svg) { + this.paintedViewportMap.delete(this.svg); + delete this.svg; + } + this.loadingIconDiv = document.createElement('div'); + this.loadingIconDiv.className = 'loadingIcon'; + div.appendChild(this.loadingIconDiv); + } + }, { + key: 'update', + value: function update(scale, rotation) { + this.scale = scale || this.scale; + if (typeof rotation !== 'undefined') { + this.rotation = rotation; + } + var totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: this.scale * _ui_utils.CSS_UNITS, + rotation: totalRotation + }); + if (this.svg) { + this.cssTransform(this.svg, true); + this.eventBus.dispatch('pagerendered', { + source: this, + pageNumber: this.id, + cssTransform: true + }); + return; + } + var isScalingRestricted = false; + if (this.canvas && _pdfjsLib.PDFJS.maxCanvasPixels > 0) { + var outputScale = this.outputScale; + if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > _pdfjsLib.PDFJS.maxCanvasPixels) { + isScalingRestricted = true; + } + } + if (this.canvas) { + if (_pdfjsLib.PDFJS.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) { + this.cssTransform(this.canvas, true); + this.eventBus.dispatch('pagerendered', { + source: this, + pageNumber: this.id, + cssTransform: true + }); + return; + } + if (!this.zoomLayer && !this.canvas.hasAttribute('hidden')) { + this.zoomLayer = this.canvas.parentNode; + this.zoomLayer.style.position = 'absolute'; + } + } + if (this.zoomLayer) { + this.cssTransform(this.zoomLayer.firstChild); + } + this.reset(true, true); + } + }, { + key: 'cancelRendering', + value: function cancelRendering() { + var keepAnnotations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (this.paintTask) { + this.paintTask.cancel(); + this.paintTask = null; + } + this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL; + this.resume = null; + if (this.textLayer) { + this.textLayer.cancel(); + this.textLayer = null; + } + if (!keepAnnotations && this.annotationLayer) { + this.annotationLayer.cancel(); + this.annotationLayer = null; + } + } + }, { + key: 'cssTransform', + value: function cssTransform(target) { + var redrawAnnotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var width = this.viewport.width; + var height = this.viewport.height; + var div = this.div; + target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + 'px'; + target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + 'px'; + var relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation; + var absRotation = Math.abs(relativeRotation); + var scaleX = 1, + scaleY = 1; + if (absRotation === 90 || absRotation === 270) { + scaleX = height / width; + scaleY = width / height; + } + var cssTransform = 'rotate(' + relativeRotation + 'deg) ' + 'scale(' + scaleX + ',' + scaleY + ')'; + _pdfjsLib.CustomStyle.setProp('transform', target, cssTransform); + if (this.textLayer) { + var textLayerViewport = this.textLayer.viewport; + var textRelativeRotation = this.viewport.rotation - textLayerViewport.rotation; + var textAbsRotation = Math.abs(textRelativeRotation); + var scale = width / textLayerViewport.width; + if (textAbsRotation === 90 || textAbsRotation === 270) { + scale = width / textLayerViewport.height; + } + var textLayerDiv = this.textLayer.textLayerDiv; + var transX = void 0, + transY = void 0; + switch (textAbsRotation) { + case 0: + transX = transY = 0; + break; + case 90: + transX = 0; + transY = '-' + textLayerDiv.style.height; + break; + case 180: + transX = '-' + textLayerDiv.style.width; + transY = '-' + textLayerDiv.style.height; + break; + case 270: + transX = '-' + textLayerDiv.style.width; + transY = 0; + break; + default: + console.error('Bad rotation value.'); + break; + } + _pdfjsLib.CustomStyle.setProp('transform', textLayerDiv, 'rotate(' + textAbsRotation + 'deg) ' + 'scale(' + scale + ', ' + scale + ') ' + 'translate(' + transX + ', ' + transY + ')'); + _pdfjsLib.CustomStyle.setProp('transformOrigin', textLayerDiv, '0% 0%'); + } + if (redrawAnnotations && this.annotationLayer) { + this.annotationLayer.render(this.viewport, 'display'); + } + } + }, { + key: 'getPagePoint', + value: function getPagePoint(x, y) { + return this.viewport.convertToPdfPoint(x, y); + } + }, { + key: 'draw', + value: function draw() { + var _this = this; + + if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) { + console.error('Must be in new state before drawing'); + this.reset(); + } + if (!this.pdfPage) { + this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED; + return Promise.reject(new Error('Page is not loaded')); + } + this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING; + var pdfPage = this.pdfPage; + var div = this.div; + var canvasWrapper = document.createElement('div'); + canvasWrapper.style.width = div.style.width; + canvasWrapper.style.height = div.style.height; + canvasWrapper.classList.add('canvasWrapper'); + if (this.annotationLayer && this.annotationLayer.div) { + div.insertBefore(canvasWrapper, this.annotationLayer.div); + } else { + div.appendChild(canvasWrapper); + } + var textLayer = null; + if (this.textLayerFactory) { + var textLayerDiv = document.createElement('div'); + textLayerDiv.className = 'textLayer'; + textLayerDiv.style.width = canvasWrapper.style.width; + textLayerDiv.style.height = canvasWrapper.style.height; + if (this.annotationLayer && this.annotationLayer.div) { + div.insertBefore(textLayerDiv, this.annotationLayer.div); + } else { + div.appendChild(textLayerDiv); + } + textLayer = this.textLayerFactory.createTextLayerBuilder(textLayerDiv, this.id - 1, this.viewport, this.enhanceTextSelection); + } + this.textLayer = textLayer; + var renderContinueCallback = null; + if (this.renderingQueue) { + renderContinueCallback = function renderContinueCallback(cont) { + if (!_this.renderingQueue.isHighestPriority(_this)) { + _this.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED; + _this.resume = function () { + _this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING; + cont(); + }; + return; + } + cont(); + }; + } + var finishPaintTask = function finishPaintTask(error) { + if (paintTask === _this.paintTask) { + _this.paintTask = null; + } + if (error === 'cancelled' || error instanceof _pdfjsLib.RenderingCancelledException) { + _this.error = null; + return Promise.resolve(undefined); + } + _this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED; + if (_this.loadingIconDiv) { + div.removeChild(_this.loadingIconDiv); + delete _this.loadingIconDiv; + } + _this._resetZoomLayer(true); + _this.error = error; + _this.stats = pdfPage.stats; + if (_this.onAfterDraw) { + _this.onAfterDraw(); + } + _this.eventBus.dispatch('pagerendered', { + source: _this, + pageNumber: _this.id, + cssTransform: false + }); + if (error) { + return Promise.reject(error); + } + return Promise.resolve(undefined); + }; + var paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper); + paintTask.onRenderContinue = renderContinueCallback; + this.paintTask = paintTask; + var resultPromise = paintTask.promise.then(function () { + return finishPaintTask(null).then(function () { + if (textLayer) { + var readableStream = pdfPage.streamTextContent({ normalizeWhitespace: true }); + textLayer.setTextContentStream(readableStream); + textLayer.render(); + } + }); + }, function (reason) { + return finishPaintTask(reason); + }); + if (this.annotationLayerFactory) { + if (!this.annotationLayer) { + this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, this.renderInteractiveForms, this.l10n); + } + this.annotationLayer.render(this.viewport, 'display'); + } + div.setAttribute('data-loaded', true); + if (this.onBeforeDraw) { + this.onBeforeDraw(); + } + return resultPromise; + } + }, { + key: 'paintOnCanvas', + value: function paintOnCanvas(canvasWrapper) { + var renderCapability = (0, _pdfjsLib.createPromiseCapability)(); + var result = { + promise: renderCapability.promise, + onRenderContinue: function onRenderContinue(cont) { + cont(); + }, + cancel: function cancel() { + renderTask.cancel(); + } + }; + var viewport = this.viewport; + var canvas = document.createElement('canvas'); + canvas.id = this.renderingId; + canvas.setAttribute('hidden', 'hidden'); + var isCanvasHidden = true; + var showCanvas = function showCanvas() { + if (isCanvasHidden) { + canvas.removeAttribute('hidden'); + isCanvasHidden = false; + } + }; + canvasWrapper.appendChild(canvas); + this.canvas = canvas; + canvas.mozOpaque = true; + var ctx = canvas.getContext('2d', { alpha: false }); + var outputScale = (0, _ui_utils.getOutputScale)(ctx); + this.outputScale = outputScale; + if (_pdfjsLib.PDFJS.useOnlyCssZoom) { + var actualSizeViewport = viewport.clone({ scale: _ui_utils.CSS_UNITS }); + outputScale.sx *= actualSizeViewport.width / viewport.width; + outputScale.sy *= actualSizeViewport.height / viewport.height; + outputScale.scaled = true; + } + if (_pdfjsLib.PDFJS.maxCanvasPixels > 0) { + var pixelsInViewport = viewport.width * viewport.height; + var maxScale = Math.sqrt(_pdfjsLib.PDFJS.maxCanvasPixels / pixelsInViewport); + if (outputScale.sx > maxScale || outputScale.sy > maxScale) { + outputScale.sx = maxScale; + outputScale.sy = maxScale; + outputScale.scaled = true; + this.hasRestrictedScaling = true; + } else { + this.hasRestrictedScaling = false; + } + } + var sfx = (0, _ui_utils.approximateFraction)(outputScale.sx); + var sfy = (0, _ui_utils.approximateFraction)(outputScale.sy); + canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]); + canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]); + canvas.style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + 'px'; + canvas.style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + 'px'; + this.paintedViewportMap.set(canvas, viewport); + var transform = !outputScale.scaled ? null : [outputScale.sx, 0, 0, outputScale.sy, 0, 0]; + var renderContext = { + canvasContext: ctx, + transform: transform, + viewport: this.viewport, + renderInteractiveForms: this.renderInteractiveForms + }; + var renderTask = this.pdfPage.render(renderContext); + renderTask.onContinue = function (cont) { + showCanvas(); + if (result.onRenderContinue) { + result.onRenderContinue(cont); + } else { + cont(); + } + }; + renderTask.promise.then(function () { + showCanvas(); + renderCapability.resolve(undefined); + }, function (error) { + showCanvas(); + renderCapability.reject(error); + }); + return result; + } + }, { + key: 'paintOnSvg', + value: function paintOnSvg(wrapper) { + var _this2 = this; + + var cancelled = false; + var ensureNotCancelled = function ensureNotCancelled() { + if (cancelled) { + if (_pdfjsLib.PDFJS.pdfjsNext) { + throw new _pdfjsLib.RenderingCancelledException('Rendering cancelled, page ' + _this2.id, 'svg'); + } else { + throw 'cancelled'; + } + } + }; + var pdfPage = this.pdfPage; + var actualSizeViewport = this.viewport.clone({ scale: _ui_utils.CSS_UNITS }); + var promise = pdfPage.getOperatorList().then(function (opList) { + ensureNotCancelled(); + var svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs); + return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) { + ensureNotCancelled(); + _this2.svg = svg; + _this2.paintedViewportMap.set(svg, actualSizeViewport); + svg.style.width = wrapper.style.width; + svg.style.height = wrapper.style.height; + _this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED; + wrapper.appendChild(svg); + }); + }); + return { + promise: promise, + onRenderContinue: function onRenderContinue(cont) { + cont(); + }, + cancel: function cancel() { + cancelled = true; + } + }; + } + }, { + key: 'setPageLabel', + value: function setPageLabel(label) { + this.pageLabel = typeof label === 'string' ? label : null; + if (this.pageLabel !== null) { + this.div.setAttribute('data-page-label', this.pageLabel); + } else { + this.div.removeAttribute('data-page-label'); + } + } + }, { + key: 'width', + get: function get() { + return this.viewport.width; + } + }, { + key: 'height', + get: function get() { + return this.viewport.height; + } + }]); + + return PDFPageView; +}(); + +exports.PDFPageView = PDFPageView; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DefaultTextLayerFactory = exports.TextLayerBuilder = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _dom_events = __webpack_require__(2); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var EXPAND_DIVS_TIMEOUT = 300; + +var TextLayerBuilder = function () { + function TextLayerBuilder(_ref) { + var textLayerDiv = _ref.textLayerDiv, + eventBus = _ref.eventBus, + pageIndex = _ref.pageIndex, + viewport = _ref.viewport, + _ref$findController = _ref.findController, + findController = _ref$findController === undefined ? null : _ref$findController, + _ref$enhanceTextSelec = _ref.enhanceTextSelection, + enhanceTextSelection = _ref$enhanceTextSelec === undefined ? false : _ref$enhanceTextSelec; + + _classCallCheck(this, TextLayerBuilder); + + this.textLayerDiv = textLayerDiv; + this.eventBus = eventBus || (0, _dom_events.getGlobalEventBus)(); + this.textContent = null; + this.textContentItemsStr = []; + this.textContentStream = null; + this.renderingDone = false; + this.pageIdx = pageIndex; + this.pageNumber = this.pageIdx + 1; + this.matches = []; + this.viewport = viewport; + this.textDivs = []; + this.findController = findController; + this.textLayerRenderTask = null; + this.enhanceTextSelection = enhanceTextSelection; + this._bindMouse(); + } + + _createClass(TextLayerBuilder, [{ + key: '_finishRendering', + value: function _finishRendering() { + this.renderingDone = true; + if (!this.enhanceTextSelection) { + var endOfContent = document.createElement('div'); + endOfContent.className = 'endOfContent'; + this.textLayerDiv.appendChild(endOfContent); + } + this.eventBus.dispatch('textlayerrendered', { + source: this, + pageNumber: this.pageNumber, + numTextDivs: this.textDivs.length + }); + } + }, { + key: 'render', + value: function render() { + var _this = this; + + var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + if (!(this.textContent || this.textContentStream) || this.renderingDone) { + return; + } + this.cancel(); + this.textDivs = []; + var textLayerFrag = document.createDocumentFragment(); + this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({ + textContent: this.textContent, + textContentStream: this.textContentStream, + container: textLayerFrag, + viewport: this.viewport, + textDivs: this.textDivs, + textContentItemsStr: this.textContentItemsStr, + timeout: timeout, + enhanceTextSelection: this.enhanceTextSelection + }); + this.textLayerRenderTask.promise.then(function () { + _this.textLayerDiv.appendChild(textLayerFrag); + _this._finishRendering(); + _this.updateMatches(); + }, function (reason) {}); + } + }, { + key: 'cancel', + value: function cancel() { + if (this.textLayerRenderTask) { + this.textLayerRenderTask.cancel(); + this.textLayerRenderTask = null; + } + } + }, { + key: 'setTextContentStream', + value: function setTextContentStream(readableStream) { + this.cancel(); + this.textContentStream = readableStream; + } + }, { + key: 'setTextContent', + value: function setTextContent(textContent) { + this.cancel(); + this.textContent = textContent; + } + }, { + key: 'convertMatches', + value: function convertMatches(matches, matchesLength) { + var i = 0; + var iIndex = 0; + var textContentItemsStr = this.textContentItemsStr; + var end = textContentItemsStr.length - 1; + var queryLen = this.findController === null ? 0 : this.findController.state.query.length; + var ret = []; + if (!matches) { + return ret; + } + for (var m = 0, len = matches.length; m < len; m++) { + var matchIdx = matches[m]; + while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + if (i === textContentItemsStr.length) { + console.error('Could not find a matching mapping'); + } + var match = { + begin: { + divIdx: i, + offset: matchIdx - iIndex + } + }; + if (matchesLength) { + matchIdx += matchesLength[m]; + } else { + matchIdx += queryLen; + } + while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + match.end = { + divIdx: i, + offset: matchIdx - iIndex + }; + ret.push(match); + } + return ret; + } + }, { + key: 'renderMatches', + value: function renderMatches(matches) { + if (matches.length === 0) { + return; + } + var textContentItemsStr = this.textContentItemsStr; + var textDivs = this.textDivs; + var prevEnd = null; + var pageIdx = this.pageIdx; + var isSelectedPage = this.findController === null ? false : pageIdx === this.findController.selected.pageIdx; + var selectedMatchIdx = this.findController === null ? -1 : this.findController.selected.matchIdx; + var highlightAll = this.findController === null ? false : this.findController.state.highlightAll; + var infinity = { + divIdx: -1, + offset: undefined + }; + function beginText(begin, className) { + var divIdx = begin.divIdx; + textDivs[divIdx].textContent = ''; + appendTextToDiv(divIdx, 0, begin.offset, className); + } + function appendTextToDiv(divIdx, fromOffset, toOffset, className) { + var div = textDivs[divIdx]; + var content = textContentItemsStr[divIdx].substring(fromOffset, toOffset); + var node = document.createTextNode(content); + if (className) { + var span = document.createElement('span'); + span.className = className; + span.appendChild(node); + div.appendChild(span); + return; + } + div.appendChild(node); + } + var i0 = selectedMatchIdx, + i1 = i0 + 1; + if (highlightAll) { + i0 = 0; + i1 = matches.length; + } else if (!isSelectedPage) { + return; + } + for (var i = i0; i < i1; i++) { + var match = matches[i]; + var begin = match.begin; + var end = match.end; + var isSelected = isSelectedPage && i === selectedMatchIdx; + var highlightSuffix = isSelected ? ' selected' : ''; + if (this.findController) { + this.findController.updateMatchPosition(pageIdx, i, textDivs, begin.divIdx); + } + if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { + if (prevEnd !== null) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + beginText(begin); + } else { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset); + } + if (begin.divIdx === end.divIdx) { + appendTextToDiv(begin.divIdx, begin.offset, end.offset, 'highlight' + highlightSuffix); + } else { + appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, 'highlight begin' + highlightSuffix); + for (var n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) { + textDivs[n0].className = 'highlight middle' + highlightSuffix; + } + beginText(end, 'highlight end' + highlightSuffix); + } + prevEnd = end; + } + if (prevEnd) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + } + }, { + key: 'updateMatches', + value: function updateMatches() { + if (!this.renderingDone) { + return; + } + var matches = this.matches; + var textDivs = this.textDivs; + var textContentItemsStr = this.textContentItemsStr; + var clearedUntilDivIdx = -1; + for (var i = 0, len = matches.length; i < len; i++) { + var match = matches[i]; + var begin = Math.max(clearedUntilDivIdx, match.begin.divIdx); + for (var n = begin, end = match.end.divIdx; n <= end; n++) { + var div = textDivs[n]; + div.textContent = textContentItemsStr[n]; + div.className = ''; + } + clearedUntilDivIdx = match.end.divIdx + 1; + } + if (this.findController === null || !this.findController.active) { + return; + } + var pageMatches = void 0, + pageMatchesLength = void 0; + if (this.findController !== null) { + pageMatches = this.findController.pageMatches[this.pageIdx] || null; + pageMatchesLength = this.findController.pageMatchesLength ? this.findController.pageMatchesLength[this.pageIdx] || null : null; + } + this.matches = this.convertMatches(pageMatches, pageMatchesLength); + this.renderMatches(this.matches); + } + }, { + key: '_bindMouse', + value: function _bindMouse() { + var _this2 = this; + + var div = this.textLayerDiv; + var expandDivsTimer = null; + div.addEventListener('mousedown', function (evt) { + if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) { + _this2.textLayerRenderTask.expandTextDivs(true); + if (expandDivsTimer) { + clearTimeout(expandDivsTimer); + expandDivsTimer = null; + } + return; + } + var end = div.querySelector('.endOfContent'); + if (!end) { + return; + } + var adjustTop = evt.target !== div; + adjustTop = adjustTop && window.getComputedStyle(end).getPropertyValue('-moz-user-select') !== 'none'; + if (adjustTop) { + var divBounds = div.getBoundingClientRect(); + var r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height); + end.style.top = (r * 100).toFixed(2) + '%'; + } + end.classList.add('active'); + }); + div.addEventListener('mouseup', function () { + if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) { + expandDivsTimer = setTimeout(function () { + if (_this2.textLayerRenderTask) { + _this2.textLayerRenderTask.expandTextDivs(false); + } + expandDivsTimer = null; + }, EXPAND_DIVS_TIMEOUT); + return; + } + var end = div.querySelector('.endOfContent'); + if (!end) { + return; + } + end.style.top = ''; + end.classList.remove('active'); + }); + } + }]); + + return TextLayerBuilder; +}(); + +var DefaultTextLayerFactory = function () { + function DefaultTextLayerFactory() { + _classCallCheck(this, DefaultTextLayerFactory); + } + + _createClass(DefaultTextLayerFactory, [{ + key: 'createTextLayerBuilder', + value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) { + var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + return new TextLayerBuilder({ + textLayerDiv: textLayerDiv, + pageIndex: pageIndex, + viewport: viewport, + enhanceTextSelection: enhanceTextSelection + }); + } + }]); + + return DefaultTextLayerFactory; +}(); + +exports.TextLayerBuilder = TextLayerBuilder; +exports.DefaultTextLayerFactory = DefaultTextLayerFactory; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SecondaryToolbar = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdf_cursor_tools = __webpack_require__(6); + +var _ui_utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var SecondaryToolbar = function () { + function SecondaryToolbar(options, mainContainer, eventBus) { + _classCallCheck(this, SecondaryToolbar); + + this.toolbar = options.toolbar; + this.toggleButton = options.toggleButton; + this.toolbarButtonContainer = options.toolbarButtonContainer; + this.buttons = [{ + element: options.presentationModeButton, + eventName: 'presentationmode', + close: true + }, { + element: options.openFileButton, + eventName: 'openfile', + close: true + }, { + element: options.printButton, + eventName: 'print', + close: true + }, { + element: options.downloadButton, + eventName: 'download', + close: true + }, { + element: options.viewBookmarkButton, + eventName: null, + close: true + }, { + element: options.firstPageButton, + eventName: 'firstpage', + close: true + }, { + element: options.lastPageButton, + eventName: 'lastpage', + close: true + }, { + element: options.pageRotateCwButton, + eventName: 'rotatecw', + close: false + }, { + element: options.pageRotateCcwButton, + eventName: 'rotateccw', + close: false + }, { + element: options.cursorSelectToolButton, + eventName: 'switchcursortool', + eventDetails: { tool: _pdf_cursor_tools.CursorTool.SELECT }, + close: true + }, { + element: options.cursorHandToolButton, + eventName: 'switchcursortool', + eventDetails: { tool: _pdf_cursor_tools.CursorTool.HAND }, + close: true + }, { + element: options.documentPropertiesButton, + eventName: 'documentproperties', + close: true + }]; + this.items = { + firstPage: options.firstPageButton, + lastPage: options.lastPageButton, + pageRotateCw: options.pageRotateCwButton, + pageRotateCcw: options.pageRotateCcwButton + }; + this.mainContainer = mainContainer; + this.eventBus = eventBus; + this.opened = false; + this.containerHeight = null; + this.previousContainerHeight = null; + this.reset(); + this._bindClickListeners(); + this._bindCursorToolsListener(options); + this.eventBus.on('resize', this._setMaxHeight.bind(this)); + } + + _createClass(SecondaryToolbar, [{ + key: 'setPageNumber', + value: function setPageNumber(pageNumber) { + this.pageNumber = pageNumber; + this._updateUIState(); + } + }, { + key: 'setPagesCount', + value: function setPagesCount(pagesCount) { + this.pagesCount = pagesCount; + this._updateUIState(); + } + }, { + key: 'reset', + value: function reset() { + this.pageNumber = 0; + this.pagesCount = 0; + this._updateUIState(); + } + }, { + key: '_updateUIState', + value: function _updateUIState() { + this.items.firstPage.disabled = this.pageNumber <= 1; + this.items.lastPage.disabled = this.pageNumber >= this.pagesCount; + this.items.pageRotateCw.disabled = this.pagesCount === 0; + this.items.pageRotateCcw.disabled = this.pagesCount === 0; + } + }, { + key: '_bindClickListeners', + value: function _bindClickListeners() { + var _this = this; + + this.toggleButton.addEventListener('click', this.toggle.bind(this)); + + var _loop = function _loop(button) { + var _buttons$button = _this.buttons[button], + element = _buttons$button.element, + eventName = _buttons$button.eventName, + close = _buttons$button.close, + eventDetails = _buttons$button.eventDetails; + + element.addEventListener('click', function (evt) { + if (eventName !== null) { + var details = { source: _this }; + for (var property in eventDetails) { + details[property] = eventDetails[property]; + } + _this.eventBus.dispatch(eventName, details); + } + if (close) { + _this.close(); + } + }); + }; + + for (var button in this.buttons) { + _loop(button); + } + } + }, { + key: '_bindCursorToolsListener', + value: function _bindCursorToolsListener(buttons) { + this.eventBus.on('cursortoolchanged', function (evt) { + buttons.cursorSelectToolButton.classList.remove('toggled'); + buttons.cursorHandToolButton.classList.remove('toggled'); + switch (evt.tool) { + case _pdf_cursor_tools.CursorTool.SELECT: + buttons.cursorSelectToolButton.classList.add('toggled'); + break; + case _pdf_cursor_tools.CursorTool.HAND: + buttons.cursorHandToolButton.classList.add('toggled'); + break; + } + }); + } + }, { + key: 'open', + value: function open() { + if (this.opened) { + return; + } + this.opened = true; + this._setMaxHeight(); + this.toggleButton.classList.add('toggled'); + this.toolbar.classList.remove('hidden'); + } + }, { + key: 'close', + value: function close() { + if (!this.opened) { + return; + } + this.opened = false; + this.toolbar.classList.add('hidden'); + this.toggleButton.classList.remove('toggled'); + } + }, { + key: 'toggle', + value: function toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } + }, { + key: '_setMaxHeight', + value: function _setMaxHeight() { + if (!this.opened) { + return; + } + this.containerHeight = this.mainContainer.clientHeight; + if (this.containerHeight === this.previousContainerHeight) { + return; + } + this.toolbarButtonContainer.setAttribute('style', 'max-height: ' + (this.containerHeight - _ui_utils.SCROLLBAR_PADDING) + 'px;'); + this.previousContainerHeight = this.containerHeight; + } + }, { + key: 'isOpen', + get: function get() { + return this.opened; + } + }]); + + return SecondaryToolbar; +}(); + +exports.SecondaryToolbar = SecondaryToolbar; + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Toolbar = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading'; +var SCALE_SELECT_CONTAINER_PADDING = 8; +var SCALE_SELECT_PADDING = 22; + +var Toolbar = function () { + function Toolbar(options, mainContainer, eventBus) { + var l10n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _ui_utils.NullL10n; + + _classCallCheck(this, Toolbar); + + this.toolbar = options.container; + this.mainContainer = mainContainer; + this.eventBus = eventBus; + this.l10n = l10n; + this.items = options; + this._wasLocalized = false; + this.reset(); + this._bindListeners(); + } + + _createClass(Toolbar, [{ + key: 'setPageNumber', + value: function setPageNumber(pageNumber, pageLabel) { + this.pageNumber = pageNumber; + this.pageLabel = pageLabel; + this._updateUIState(false); + } + }, { + key: 'setPagesCount', + value: function setPagesCount(pagesCount, hasPageLabels) { + this.pagesCount = pagesCount; + this.hasPageLabels = hasPageLabels; + this._updateUIState(true); + } + }, { + key: 'setPageScale', + value: function setPageScale(pageScaleValue, pageScale) { + this.pageScaleValue = pageScaleValue; + this.pageScale = pageScale; + this._updateUIState(false); + } + }, { + key: 'reset', + value: function reset() { + this.pageNumber = 0; + this.pageLabel = null; + this.hasPageLabels = false; + this.pagesCount = 0; + this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + this.pageScale = _ui_utils.DEFAULT_SCALE; + this._updateUIState(true); + } + }, { + key: '_bindListeners', + value: function _bindListeners() { + var _this = this; + + var eventBus = this.eventBus, + items = this.items; + + var self = this; + items.previous.addEventListener('click', function () { + eventBus.dispatch('previouspage'); + }); + items.next.addEventListener('click', function () { + eventBus.dispatch('nextpage'); + }); + items.zoomIn.addEventListener('click', function () { + eventBus.dispatch('zoomin'); + }); + items.zoomOut.addEventListener('click', function () { + eventBus.dispatch('zoomout'); + }); + items.pageNumber.addEventListener('click', function () { + this.select(); + }); + items.pageNumber.addEventListener('change', function () { + eventBus.dispatch('pagenumberchanged', { + source: self, + value: this.value + }); + }); + items.scaleSelect.addEventListener('change', function () { + if (this.value === 'custom') { + return; + } + eventBus.dispatch('scalechanged', { + source: self, + value: this.value + }); + }); + items.presentationModeButton.addEventListener('click', function () { + eventBus.dispatch('presentationmode'); + }); + items.openFile.addEventListener('click', function () { + eventBus.dispatch('openfile'); + }); + items.print.addEventListener('click', function () { + eventBus.dispatch('print'); + }); + items.download.addEventListener('click', function () { + eventBus.dispatch('download'); + }); + items.scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler; + eventBus.on('localized', function () { + _this._localized(); + }); + } + }, { + key: '_localized', + value: function _localized() { + this._wasLocalized = true; + this._adjustScaleWidth(); + this._updateUIState(true); + } + }, { + key: '_updateUIState', + value: function _updateUIState() { + var resetNumPages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (!this._wasLocalized) { + return; + } + var pageNumber = this.pageNumber, + pagesCount = this.pagesCount, + items = this.items; + + var scaleValue = (this.pageScaleValue || this.pageScale).toString(); + var scale = this.pageScale; + if (resetNumPages) { + if (this.hasPageLabels) { + items.pageNumber.type = 'text'; + } else { + items.pageNumber.type = 'number'; + this.l10n.get('of_pages', { pagesCount: pagesCount }, 'of {{pagesCount}}').then(function (msg) { + items.numPages.textContent = msg; + }); + } + items.pageNumber.max = pagesCount; + } + if (this.hasPageLabels) { + items.pageNumber.value = this.pageLabel; + this.l10n.get('page_of_pages', { + pageNumber: pageNumber, + pagesCount: pagesCount + }, '({{pageNumber}} of {{pagesCount}})').then(function (msg) { + items.numPages.textContent = msg; + }); + } else { + items.pageNumber.value = pageNumber; + } + items.previous.disabled = pageNumber <= 1; + items.next.disabled = pageNumber >= pagesCount; + items.zoomOut.disabled = scale <= _ui_utils.MIN_SCALE; + items.zoomIn.disabled = scale >= _ui_utils.MAX_SCALE; + var customScale = Math.round(scale * 10000) / 100; + this.l10n.get('page_scale_percent', { scale: customScale }, '{{scale}}%').then(function (msg) { + var options = items.scaleSelect.options; + var predefinedValueFound = false; + for (var i = 0, ii = options.length; i < ii; i++) { + var option = options[i]; + if (option.value !== scaleValue) { + option.selected = false; + continue; + } + option.selected = true; + predefinedValueFound = true; + } + if (!predefinedValueFound) { + items.customScaleOption.textContent = msg; + items.customScaleOption.selected = true; + } + }); + } + }, { + key: 'updateLoadingIndicatorState', + value: function updateLoadingIndicatorState() { + var loading = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var pageNumberInput = this.items.pageNumber; + if (loading) { + pageNumberInput.classList.add(PAGE_NUMBER_LOADING_INDICATOR); + } else { + pageNumberInput.classList.remove(PAGE_NUMBER_LOADING_INDICATOR); + } + } + }, { + key: '_adjustScaleWidth', + value: function _adjustScaleWidth() { + var container = this.items.scaleSelectContainer; + var select = this.items.scaleSelect; + _ui_utils.animationStarted.then(function () { + if (container.clientWidth === 0) { + container.setAttribute('style', 'display: inherit;'); + } + if (container.clientWidth > 0) { + select.setAttribute('style', 'min-width: inherit;'); + var width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING; + select.setAttribute('style', 'min-width: ' + (width + SCALE_SELECT_PADDING) + 'px;'); + container.setAttribute('style', 'min-width: ' + width + 'px; ' + 'max-width: ' + width + 'px;'); + } + }); + } + }]); + + return Toolbar; +}(); + +exports.Toolbar = Toolbar; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20; + +var ViewHistory = function () { + function ViewHistory(fingerprint) { + var _this = this; + + var cacheSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_VIEW_HISTORY_CACHE_SIZE; + + _classCallCheck(this, ViewHistory); + + this.fingerprint = fingerprint; + this.cacheSize = cacheSize; + this._initializedPromise = this._readFromStorage().then(function (databaseStr) { + var database = JSON.parse(databaseStr || '{}'); + if (!('files' in database)) { + database.files = []; + } + if (database.files.length >= _this.cacheSize) { + database.files.shift(); + } + var index = void 0; + for (var i = 0, length = database.files.length; i < length; i++) { + var branch = database.files[i]; + if (branch.fingerprint === _this.fingerprint) { + index = i; + break; + } + } + if (typeof index !== 'number') { + index = database.files.push({ fingerprint: _this.fingerprint }) - 1; + } + _this.file = database.files[index]; + _this.database = database; + }); + } + + _createClass(ViewHistory, [{ + key: '_writeToStorage', + value: function _writeToStorage() { + var _this2 = this; + + return new Promise(function (resolve) { + var databaseStr = JSON.stringify(_this2.database); + localStorage.setItem('pdfjs.history', databaseStr); + resolve(); + }); + } + }, { + key: '_readFromStorage', + value: function _readFromStorage() { + return new Promise(function (resolve) { + resolve(localStorage.getItem('pdfjs.history')); + }); + } + }, { + key: 'set', + value: function set(name, val) { + var _this3 = this; + + return this._initializedPromise.then(function () { + _this3.file[name] = val; + return _this3._writeToStorage(); + }); + } + }, { + key: 'setMultiple', + value: function setMultiple(properties) { + var _this4 = this; + + return this._initializedPromise.then(function () { + for (var name in properties) { + _this4.file[name] = properties[name]; + } + return _this4._writeToStorage(); + }); + } + }, { + key: 'get', + value: function get(name, defaultValue) { + var _this5 = this; + + return this._initializedPromise.then(function () { + var val = _this5.file[name]; + return val !== undefined ? val : defaultValue; + }); + } + }, { + key: 'getMultiple', + value: function getMultiple(properties) { + var _this6 = this; + + return this._initializedPromise.then(function () { + var values = Object.create(null); + for (var name in properties) { + var val = _this6.file[name]; + values[name] = val !== undefined ? val : properties[name]; + } + return values; + }); + } + }]); + + return ViewHistory; +}(); + +exports.ViewHistory = ViewHistory; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.GenericCom = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _app = __webpack_require__(4); + +var _preferences = __webpack_require__(30); + +var _download_manager = __webpack_require__(31); + +var _genericl10n = __webpack_require__(32); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +; +var GenericCom = {}; + +var GenericPreferences = function (_BasePreferences) { + _inherits(GenericPreferences, _BasePreferences); + + function GenericPreferences() { + _classCallCheck(this, GenericPreferences); + + return _possibleConstructorReturn(this, (GenericPreferences.__proto__ || Object.getPrototypeOf(GenericPreferences)).apply(this, arguments)); + } + + _createClass(GenericPreferences, [{ + key: '_writeToStorage', + value: function _writeToStorage(prefObj) { + return new Promise(function (resolve) { + localStorage.setItem('pdfjs.preferences', JSON.stringify(prefObj)); + resolve(); + }); + } + }, { + key: '_readFromStorage', + value: function _readFromStorage(prefObj) { + return new Promise(function (resolve) { + var readPrefs = JSON.parse(localStorage.getItem('pdfjs.preferences')); + resolve(readPrefs); + }); + } + }]); + + return GenericPreferences; +}(_preferences.BasePreferences); + +var GenericExternalServices = Object.create(_app.DefaultExternalServices); +GenericExternalServices.createDownloadManager = function () { + return new _download_manager.DownloadManager(); +}; +GenericExternalServices.createPreferences = function () { + return new GenericPreferences(); +}; +GenericExternalServices.createL10n = function () { + return new _genericl10n.GenericL10n(_pdfjsLib.PDFJS.locale); +}; +_app.PDFViewerApplication.externalServices = GenericExternalServices; +exports.GenericCom = GenericCom; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BasePreferences = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ui_utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var defaultPreferences = null; +function getDefaultPreferences() { + if (!defaultPreferences) { + defaultPreferences = Promise.resolve({ + "showPreviousViewOnLoad": true, + "defaultZoomValue": "", + "sidebarViewOnLoad": 0, + "enableHandToolOnLoad": false, + "cursorToolOnLoad": 0, + "enableWebGL": false, + "pdfBugEnabled": false, + "disableRange": false, + "disableStream": false, + "disableAutoFetch": false, + "disableFontFace": false, + "disableTextLayer": false, + "useOnlyCssZoom": false, + "externalLinkTarget": 0, + "enhanceTextSelection": false, + "renderer": "canvas", + "renderInteractiveForms": false, + "enablePrintAutoRotate": false, + "disablePageMode": false, + "disablePageLabels": false + }); + } + return defaultPreferences; +} + +var BasePreferences = function () { + function BasePreferences() { + var _this = this; + + _classCallCheck(this, BasePreferences); + + if (this.constructor === BasePreferences) { + throw new Error('Cannot initialize BasePreferences.'); + } + this.prefs = null; + this._initializedPromise = getDefaultPreferences().then(function (defaults) { + Object.defineProperty(_this, 'defaults', { + value: Object.freeze(defaults), + writable: false, + enumerable: true, + configurable: false + }); + _this.prefs = (0, _ui_utils.cloneObj)(defaults); + return _this._readFromStorage(defaults); + }).then(function (prefObj) { + if (prefObj) { + _this.prefs = prefObj; + } + }); + } + + _createClass(BasePreferences, [{ + key: "_writeToStorage", + value: function _writeToStorage(prefObj) { + return Promise.reject(new Error('Not implemented: _writeToStorage')); + } + }, { + key: "_readFromStorage", + value: function _readFromStorage(prefObj) { + return Promise.reject(new Error('Not implemented: _readFromStorage')); + } + }, { + key: "reset", + value: function reset() { + var _this2 = this; + + return this._initializedPromise.then(function () { + _this2.prefs = (0, _ui_utils.cloneObj)(_this2.defaults); + return _this2._writeToStorage(_this2.defaults); + }); + } + }, { + key: "reload", + value: function reload() { + var _this3 = this; + + return this._initializedPromise.then(function () { + return _this3._readFromStorage(_this3.defaults); + }).then(function (prefObj) { + if (prefObj) { + _this3.prefs = prefObj; + } + }); + } + }, { + key: "set", + value: function set(name, value) { + var _this4 = this; + + return this._initializedPromise.then(function () { + if (_this4.defaults[name] === undefined) { + throw new Error("Set preference: \"" + name + "\" is undefined."); + } else if (value === undefined) { + throw new Error('Set preference: no value is specified.'); + } + var valueType = typeof value === "undefined" ? "undefined" : _typeof(value); + var defaultType = _typeof(_this4.defaults[name]); + if (valueType !== defaultType) { + if (valueType === 'number' && defaultType === 'string') { + value = value.toString(); + } else { + throw new Error("Set preference: \"" + value + "\" is a " + valueType + ", " + ("expected a " + defaultType + ".")); + } + } else { + if (valueType === 'number' && !Number.isInteger(value)) { + throw new Error("Set preference: \"" + value + "\" must be an integer."); + } + } + _this4.prefs[name] = value; + return _this4._writeToStorage(_this4.prefs); + }); + } + }, { + key: "get", + value: function get(name) { + var _this5 = this; + + return this._initializedPromise.then(function () { + var defaultValue = _this5.defaults[name]; + if (defaultValue === undefined) { + throw new Error("Get preference: \"" + name + "\" is undefined."); + } else { + var prefValue = _this5.prefs[name]; + if (prefValue !== undefined) { + return prefValue; + } + } + return defaultValue; + }); + } + }]); + + return BasePreferences; +}(); + +exports.BasePreferences = BasePreferences; + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DownloadManager = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _pdfjsLib = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +; +function _download(blobUrl, filename) { + var a = document.createElement('a'); + if (a.click) { + a.href = blobUrl; + a.target = '_parent'; + if ('download' in a) { + a.download = filename; + } + (document.body || document.documentElement).appendChild(a); + a.click(); + a.parentNode.removeChild(a); + } else { + if (window.top === window && blobUrl.split('#')[0] === window.location.href.split('#')[0]) { + var padCharacter = blobUrl.indexOf('?') === -1 ? '?' : '&'; + blobUrl = blobUrl.replace(/#|$/, padCharacter + '$&'); + } + window.open(blobUrl, '_parent'); + } +} + +var DownloadManager = function () { + function DownloadManager() { + _classCallCheck(this, DownloadManager); + } + + _createClass(DownloadManager, [{ + key: 'downloadUrl', + value: function downloadUrl(url, filename) { + if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, 'http://example.com')) { + return; + } + _download(url + '#pdfjs.action=download', filename); + } + }, { + key: 'downloadData', + value: function downloadData(data, filename, contentType) { + if (navigator.msSaveBlob) { + return navigator.msSaveBlob(new Blob([data], { type: contentType }), filename); + } + var blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, _pdfjsLib.PDFJS.disableCreateObjectURL); + _download(blobUrl, filename); + } + }, { + key: 'download', + value: function download(blob, url, filename) { + if (navigator.msSaveBlob) { + if (!navigator.msSaveBlob(blob, filename)) { + this.downloadUrl(url, filename); + } + return; + } + if (_pdfjsLib.PDFJS.disableCreateObjectURL) { + this.downloadUrl(url, filename); + return; + } + var blobUrl = URL.createObjectURL(blob); + _download(blobUrl, filename); + } + }]); + + return DownloadManager; +}(); + +exports.DownloadManager = DownloadManager; + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.GenericL10n = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(33); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var webL10n = document.webL10n; + +var GenericL10n = function () { + function GenericL10n(lang) { + _classCallCheck(this, GenericL10n); + + this._lang = lang; + this._ready = new Promise(function (resolve, reject) { + webL10n.setLanguage(lang, function () { + resolve(webL10n); + }); + }); + } + + _createClass(GenericL10n, [{ + key: 'getDirection', + value: function getDirection() { + return this._ready.then(function (l10n) { + return l10n.getDirection(); + }); + } + }, { + key: 'get', + value: function get(property, args, fallback) { + return this._ready.then(function (l10n) { + return l10n.get(property, args, fallback); + }); + } + }, { + key: 'translate', + value: function translate(element) { + return this._ready.then(function (l10n) { + return l10n.translate(element); + }); + } + }]); + + return GenericL10n; +}(); + +exports.GenericL10n = GenericL10n; + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +document.webL10n = function (window, document, undefined) { + var gL10nData = {}; + var gTextData = ''; + var gTextProp = 'textContent'; + var gLanguage = ''; + var gMacros = {}; + var gReadyState = 'loading'; + var gAsyncResourceLoading = true; + function getL10nResourceLinks() { + return document.querySelectorAll('link[type="application/l10n"]'); + } + function getL10nDictionary() { + var script = document.querySelector('script[type="application/l10n"]'); + return script ? JSON.parse(script.innerHTML) : null; + } + function getTranslatableChildren(element) { + return element ? element.querySelectorAll('*[data-l10n-id]') : []; + } + function getL10nAttributes(element) { + if (!element) return {}; + var l10nId = element.getAttribute('data-l10n-id'); + var l10nArgs = element.getAttribute('data-l10n-args'); + var args = {}; + if (l10nArgs) { + try { + args = JSON.parse(l10nArgs); + } catch (e) { + console.warn('could not parse arguments for #' + l10nId); + } + } + return { + id: l10nId, + args: args + }; + } + function fireL10nReadyEvent(lang) { + var evtObject = document.createEvent('Event'); + evtObject.initEvent('localized', true, false); + evtObject.language = lang; + document.dispatchEvent(evtObject); + } + function xhrLoadText(url, onSuccess, onFailure) { + onSuccess = onSuccess || function _onSuccess(data) {}; + onFailure = onFailure || function _onFailure() {}; + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, gAsyncResourceLoading); + if (xhr.overrideMimeType) { + xhr.overrideMimeType('text/plain; charset=utf-8'); + } + xhr.onreadystatechange = function () { + if (xhr.readyState == 4) { + if (xhr.status == 200 || xhr.status === 0) { + onSuccess(xhr.responseText); + } else { + onFailure(); + } + } + }; + xhr.onerror = onFailure; + xhr.ontimeout = onFailure; + try { + xhr.send(null); + } catch (e) { + onFailure(); + } + } + function parseResource(href, lang, successCallback, failureCallback) { + var baseURL = href.replace(/[^\/]*$/, '') || './'; + function evalString(text) { + if (text.lastIndexOf('\\') < 0) return text; + return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'"); + } + function parseProperties(text, parsedPropertiesCallback) { + var dictionary = {}; + var reBlank = /^\s*|\s*$/; + var reComment = /^\s*#|^\s*$/; + var reSection = /^\s*\[(.*)\]\s*$/; + var reImport = /^\s*@import\s+url\((.*)\)\s*$/i; + var reSplit = /^([^=\s]*)\s*=\s*(.+)$/; + function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) { + var entries = rawText.replace(reBlank, '').split(/[\r\n]+/); + var currentLang = '*'; + var genericLang = lang.split('-', 1)[0]; + var skipLang = false; + var match = ''; + function nextEntry() { + while (true) { + if (!entries.length) { + parsedRawLinesCallback(); + return; + } + var line = entries.shift(); + if (reComment.test(line)) continue; + if (extendedSyntax) { + match = reSection.exec(line); + if (match) { + currentLang = match[1].toLowerCase(); + skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang; + continue; + } else if (skipLang) { + continue; + } + match = reImport.exec(line); + if (match) { + loadImport(baseURL + match[1], nextEntry); + return; + } + } + var tmp = line.match(reSplit); + if (tmp && tmp.length == 3) { + dictionary[tmp[1]] = evalString(tmp[2]); + } + } + } + nextEntry(); + } + function loadImport(url, callback) { + xhrLoadText(url, function (content) { + parseRawLines(content, false, callback); + }, function () { + console.warn(url + ' not found.'); + callback(); + }); + } + parseRawLines(text, true, function () { + parsedPropertiesCallback(dictionary); + }); + } + xhrLoadText(href, function (response) { + gTextData += response; + parseProperties(response, function (data) { + for (var key in data) { + var id, + prop, + index = key.lastIndexOf('.'); + if (index > 0) { + id = key.substring(0, index); + prop = key.substr(index + 1); + } else { + id = key; + prop = gTextProp; + } + if (!gL10nData[id]) { + gL10nData[id] = {}; + } + gL10nData[id][prop] = data[key]; + } + if (successCallback) { + successCallback(); + } + }); + }, failureCallback); + } + function loadLocale(lang, callback) { + if (lang) { + lang = lang.toLowerCase(); + } + callback = callback || function _callback() {}; + clear(); + gLanguage = lang; + var langLinks = getL10nResourceLinks(); + var langCount = langLinks.length; + if (langCount === 0) { + var dict = getL10nDictionary(); + if (dict && dict.locales && dict.default_locale) { + console.log('using the embedded JSON directory, early way out'); + gL10nData = dict.locales[lang]; + if (!gL10nData) { + var defaultLocale = dict.default_locale.toLowerCase(); + for (var anyCaseLang in dict.locales) { + anyCaseLang = anyCaseLang.toLowerCase(); + if (anyCaseLang === lang) { + gL10nData = dict.locales[lang]; + break; + } else if (anyCaseLang === defaultLocale) { + gL10nData = dict.locales[defaultLocale]; + } + } + } + callback(); + } else { + console.log('no resource to load, early way out'); + } + fireL10nReadyEvent(lang); + gReadyState = 'complete'; + return; + } + var onResourceLoaded = null; + var gResourceCount = 0; + onResourceLoaded = function onResourceLoaded() { + gResourceCount++; + if (gResourceCount >= langCount) { + callback(); + fireL10nReadyEvent(lang); + gReadyState = 'complete'; + } + }; + function L10nResourceLink(link) { + var href = link.href; + this.load = function (lang, callback) { + parseResource(href, lang, callback, function () { + console.warn(href + ' not found.'); + console.warn('"' + lang + '" resource not found'); + gLanguage = ''; + callback(); + }); + }; + } + for (var i = 0; i < langCount; i++) { + var resource = new L10nResourceLink(langLinks[i]); + resource.load(lang, onResourceLoaded); + } + } + function clear() { + gL10nData = {}; + gTextData = ''; + gLanguage = ''; + } + function getPluralRules(lang) { + var locales2rules = { + 'af': 3, + 'ak': 4, + 'am': 4, + 'ar': 1, + 'asa': 3, + 'az': 0, + 'be': 11, + 'bem': 3, + 'bez': 3, + 'bg': 3, + 'bh': 4, + 'bm': 0, + 'bn': 3, + 'bo': 0, + 'br': 20, + 'brx': 3, + 'bs': 11, + 'ca': 3, + 'cgg': 3, + 'chr': 3, + 'cs': 12, + 'cy': 17, + 'da': 3, + 'de': 3, + 'dv': 3, + 'dz': 0, + 'ee': 3, + 'el': 3, + 'en': 3, + 'eo': 3, + 'es': 3, + 'et': 3, + 'eu': 3, + 'fa': 0, + 'ff': 5, + 'fi': 3, + 'fil': 4, + 'fo': 3, + 'fr': 5, + 'fur': 3, + 'fy': 3, + 'ga': 8, + 'gd': 24, + 'gl': 3, + 'gsw': 3, + 'gu': 3, + 'guw': 4, + 'gv': 23, + 'ha': 3, + 'haw': 3, + 'he': 2, + 'hi': 4, + 'hr': 11, + 'hu': 0, + 'id': 0, + 'ig': 0, + 'ii': 0, + 'is': 3, + 'it': 3, + 'iu': 7, + 'ja': 0, + 'jmc': 3, + 'jv': 0, + 'ka': 0, + 'kab': 5, + 'kaj': 3, + 'kcg': 3, + 'kde': 0, + 'kea': 0, + 'kk': 3, + 'kl': 3, + 'km': 0, + 'kn': 0, + 'ko': 0, + 'ksb': 3, + 'ksh': 21, + 'ku': 3, + 'kw': 7, + 'lag': 18, + 'lb': 3, + 'lg': 3, + 'ln': 4, + 'lo': 0, + 'lt': 10, + 'lv': 6, + 'mas': 3, + 'mg': 4, + 'mk': 16, + 'ml': 3, + 'mn': 3, + 'mo': 9, + 'mr': 3, + 'ms': 0, + 'mt': 15, + 'my': 0, + 'nah': 3, + 'naq': 7, + 'nb': 3, + 'nd': 3, + 'ne': 3, + 'nl': 3, + 'nn': 3, + 'no': 3, + 'nr': 3, + 'nso': 4, + 'ny': 3, + 'nyn': 3, + 'om': 3, + 'or': 3, + 'pa': 3, + 'pap': 3, + 'pl': 13, + 'ps': 3, + 'pt': 3, + 'rm': 3, + 'ro': 9, + 'rof': 3, + 'ru': 11, + 'rwk': 3, + 'sah': 0, + 'saq': 3, + 'se': 7, + 'seh': 3, + 'ses': 0, + 'sg': 0, + 'sh': 11, + 'shi': 19, + 'sk': 12, + 'sl': 14, + 'sma': 7, + 'smi': 7, + 'smj': 7, + 'smn': 7, + 'sms': 7, + 'sn': 3, + 'so': 3, + 'sq': 3, + 'sr': 11, + 'ss': 3, + 'ssy': 3, + 'st': 3, + 'sv': 3, + 'sw': 3, + 'syr': 3, + 'ta': 3, + 'te': 3, + 'teo': 3, + 'th': 0, + 'ti': 4, + 'tig': 3, + 'tk': 3, + 'tl': 4, + 'tn': 3, + 'to': 0, + 'tr': 0, + 'ts': 3, + 'tzm': 22, + 'uk': 11, + 'ur': 3, + 've': 3, + 'vi': 0, + 'vun': 3, + 'wa': 4, + 'wae': 3, + 'wo': 0, + 'xh': 3, + 'xog': 3, + 'yo': 0, + 'zh': 0, + 'zu': 3 + }; + function isIn(n, list) { + return list.indexOf(n) !== -1; + } + function isBetween(n, start, end) { + return start <= n && n <= end; + } + var pluralRules = { + '0': function _(n) { + return 'other'; + }, + '1': function _(n) { + if (isBetween(n % 100, 3, 10)) return 'few'; + if (n === 0) return 'zero'; + if (isBetween(n % 100, 11, 99)) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '2': function _(n) { + if (n !== 0 && n % 10 === 0) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '3': function _(n) { + if (n == 1) return 'one'; + return 'other'; + }, + '4': function _(n) { + if (isBetween(n, 0, 1)) return 'one'; + return 'other'; + }, + '5': function _(n) { + if (isBetween(n, 0, 2) && n != 2) return 'one'; + return 'other'; + }, + '6': function _(n) { + if (n === 0) return 'zero'; + if (n % 10 == 1 && n % 100 != 11) return 'one'; + return 'other'; + }, + '7': function _(n) { + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '8': function _(n) { + if (isBetween(n, 3, 6)) return 'few'; + if (isBetween(n, 7, 10)) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '9': function _(n) { + if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few'; + if (n == 1) return 'one'; + return 'other'; + }, + '10': function _(n) { + if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few'; + if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one'; + return 'other'; + }, + '11': function _(n) { + if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few'; + if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many'; + if (n % 10 == 1 && n % 100 != 11) return 'one'; + return 'other'; + }, + '12': function _(n) { + if (isBetween(n, 2, 4)) return 'few'; + if (n == 1) return 'one'; + return 'other'; + }, + '13': function _(n) { + if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few'; + if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many'; + if (n == 1) return 'one'; + return 'other'; + }, + '14': function _(n) { + if (isBetween(n % 100, 3, 4)) return 'few'; + if (n % 100 == 2) return 'two'; + if (n % 100 == 1) return 'one'; + return 'other'; + }, + '15': function _(n) { + if (n === 0 || isBetween(n % 100, 2, 10)) return 'few'; + if (isBetween(n % 100, 11, 19)) return 'many'; + if (n == 1) return 'one'; + return 'other'; + }, + '16': function _(n) { + if (n % 10 == 1 && n != 11) return 'one'; + return 'other'; + }, + '17': function _(n) { + if (n == 3) return 'few'; + if (n === 0) return 'zero'; + if (n == 6) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '18': function _(n) { + if (n === 0) return 'zero'; + if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one'; + return 'other'; + }, + '19': function _(n) { + if (isBetween(n, 2, 10)) return 'few'; + if (isBetween(n, 0, 1)) return 'one'; + return 'other'; + }, + '20': function _(n) { + if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few'; + if (n % 1000000 === 0 && n !== 0) return 'many'; + if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two'; + if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one'; + return 'other'; + }, + '21': function _(n) { + if (n === 0) return 'zero'; + if (n == 1) return 'one'; + return 'other'; + }, + '22': function _(n) { + if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one'; + return 'other'; + }, + '23': function _(n) { + if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one'; + return 'other'; + }, + '24': function _(n) { + if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few'; + if (isIn(n, [2, 12])) return 'two'; + if (isIn(n, [1, 11])) return 'one'; + return 'other'; + } + }; + var index = locales2rules[lang.replace(/-.*$/, '')]; + if (!(index in pluralRules)) { + console.warn('plural form unknown for [' + lang + ']'); + return function () { + return 'other'; + }; + } + return pluralRules[index]; + } + gMacros.plural = function (str, param, key, prop) { + var n = parseFloat(param); + if (isNaN(n)) return str; + if (prop != gTextProp) return str; + if (!gMacros._pluralRules) { + gMacros._pluralRules = getPluralRules(gLanguage); + } + var index = '[' + gMacros._pluralRules(n) + ']'; + if (n === 0 && key + '[zero]' in gL10nData) { + str = gL10nData[key + '[zero]'][prop]; + } else if (n == 1 && key + '[one]' in gL10nData) { + str = gL10nData[key + '[one]'][prop]; + } else if (n == 2 && key + '[two]' in gL10nData) { + str = gL10nData[key + '[two]'][prop]; + } else if (key + index in gL10nData) { + str = gL10nData[key + index][prop]; + } else if (key + '[other]' in gL10nData) { + str = gL10nData[key + '[other]'][prop]; + } + return str; + }; + function getL10nData(key, args, fallback) { + var data = gL10nData[key]; + if (!data) { + console.warn('#' + key + ' is undefined.'); + if (!fallback) { + return null; + } + data = fallback; + } + var rv = {}; + for (var prop in data) { + var str = data[prop]; + str = substIndexes(str, args, key, prop); + str = substArguments(str, args, key); + rv[prop] = str; + } + return rv; + } + function substIndexes(str, args, key, prop) { + var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/; + var reMatch = reIndex.exec(str); + if (!reMatch || !reMatch.length) return str; + var macroName = reMatch[1]; + var paramName = reMatch[2]; + var param; + if (args && paramName in args) { + param = args[paramName]; + } else if (paramName in gL10nData) { + param = gL10nData[paramName]; + } + if (macroName in gMacros) { + var macro = gMacros[macroName]; + str = macro(str, param, key, prop); + } + return str; + } + function substArguments(str, args, key) { + var reArgs = /\{\{\s*(.+?)\s*\}\}/g; + return str.replace(reArgs, function (matched_text, arg) { + if (args && arg in args) { + return args[arg]; + } + if (arg in gL10nData) { + return gL10nData[arg]; + } + console.log('argument {{' + arg + '}} for #' + key + ' is undefined.'); + return matched_text; + }); + } + function translateElement(element) { + var l10n = getL10nAttributes(element); + if (!l10n.id) return; + var data = getL10nData(l10n.id, l10n.args); + if (!data) { + console.warn('#' + l10n.id + ' is undefined.'); + return; + } + if (data[gTextProp]) { + if (getChildElementCount(element) === 0) { + element[gTextProp] = data[gTextProp]; + } else { + var children = element.childNodes; + var found = false; + for (var i = 0, l = children.length; i < l; i++) { + if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) { + if (found) { + children[i].nodeValue = ''; + } else { + children[i].nodeValue = data[gTextProp]; + found = true; + } + } + } + if (!found) { + var textNode = document.createTextNode(data[gTextProp]); + element.insertBefore(textNode, element.firstChild); + } + } + delete data[gTextProp]; + } + for (var k in data) { + element[k] = data[k]; + } + } + function getChildElementCount(element) { + if (element.children) { + return element.children.length; + } + if (typeof element.childElementCount !== 'undefined') { + return element.childElementCount; + } + var count = 0; + for (var i = 0; i < element.childNodes.length; i++) { + count += element.nodeType === 1 ? 1 : 0; + } + return count; + } + function translateFragment(element) { + element = element || document.documentElement; + var children = getTranslatableChildren(element); + var elementCount = children.length; + for (var i = 0; i < elementCount; i++) { + translateElement(children[i]); + } + translateElement(element); + } + return { + get: function get(key, args, fallbackString) { + var index = key.lastIndexOf('.'); + var prop = gTextProp; + if (index > 0) { + prop = key.substr(index + 1); + key = key.substring(0, index); + } + var fallback; + if (fallbackString) { + fallback = {}; + fallback[prop] = fallbackString; + } + var data = getL10nData(key, args, fallback); + if (data && prop in data) { + return data[prop]; + } + return '{{' + key + '}}'; + }, + getData: function getData() { + return gL10nData; + }, + getText: function getText() { + return gTextData; + }, + getLanguage: function getLanguage() { + return gLanguage; + }, + setLanguage: function setLanguage(lang, callback) { + loadLocale(lang, function () { + if (callback) callback(); + }); + }, + getDirection: function getDirection() { + var rtlList = ['ar', 'he', 'fa', 'ps', 'ur']; + var shortCode = gLanguage.split('-', 1)[0]; + return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr'; + }, + translate: translateFragment, + getReadyState: function getReadyState() { + return gReadyState; + }, + ready: function ready(callback) { + if (!callback) { + return; + } else if (gReadyState == 'complete' || gReadyState == 'interactive') { + window.setTimeout(function () { + callback(); + }); + } else if (document.addEventListener) { + document.addEventListener('localized', function once() { + document.removeEventListener('localized', once); + callback(); + }); + } + } + }; +}(window, document); + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PDFPrintService = undefined; + +var _ui_utils = __webpack_require__(0); + +var _app = __webpack_require__(4); + +var _pdfjsLib = __webpack_require__(1); + +var activeService = null; +var overlayManager = null; +function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size) { + var scratchCanvas = activeService.scratchCanvas; + var PRINT_RESOLUTION = 150; + var PRINT_UNITS = PRINT_RESOLUTION / 72.0; + scratchCanvas.width = Math.floor(size.width * PRINT_UNITS); + scratchCanvas.height = Math.floor(size.height * PRINT_UNITS); + var width = Math.floor(size.width * _ui_utils.CSS_UNITS) + 'px'; + var height = Math.floor(size.height * _ui_utils.CSS_UNITS) + 'px'; + var ctx = scratchCanvas.getContext('2d'); + ctx.save(); + ctx.fillStyle = 'rgb(255, 255, 255)'; + ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height); + ctx.restore(); + return pdfDocument.getPage(pageNumber).then(function (pdfPage) { + var renderContext = { + canvasContext: ctx, + transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0], + viewport: pdfPage.getViewport(1, size.rotation), + intent: 'print' + }; + return pdfPage.render(renderContext).promise; + }).then(function () { + return { + width: width, + height: height + }; + }); +} +function PDFPrintService(pdfDocument, pagesOverview, printContainer, l10n) { + this.pdfDocument = pdfDocument; + this.pagesOverview = pagesOverview; + this.printContainer = printContainer; + this.l10n = l10n || _ui_utils.NullL10n; + this.currentPage = -1; + this.scratchCanvas = document.createElement('canvas'); +} +PDFPrintService.prototype = { + layout: function layout() { + this.throwIfInactive(); + var body = document.querySelector('body'); + body.setAttribute('data-pdfjsprinting', true); + var hasEqualPageSizes = this.pagesOverview.every(function (size) { + return size.width === this.pagesOverview[0].width && size.height === this.pagesOverview[0].height; + }, this); + if (!hasEqualPageSizes) { + console.warn('Not all pages have the same size. The printed ' + 'result may be incorrect!'); + } + this.pageStyleSheet = document.createElement('style'); + var pageSize = this.pagesOverview[0]; + this.pageStyleSheet.textContent = '@supports ((size:A4) and (size:1pt 1pt)) {' + '@page { size: ' + pageSize.width + 'pt ' + pageSize.height + 'pt;}' + '}'; + body.appendChild(this.pageStyleSheet); + }, + destroy: function destroy() { + if (activeService !== this) { + return; + } + this.printContainer.textContent = ''; + if (this.pageStyleSheet && this.pageStyleSheet.parentNode) { + this.pageStyleSheet.parentNode.removeChild(this.pageStyleSheet); + this.pageStyleSheet = null; + } + this.scratchCanvas.width = this.scratchCanvas.height = 0; + this.scratchCanvas = null; + activeService = null; + ensureOverlay().then(function () { + if (overlayManager.active !== 'printServiceOverlay') { + return; + } + overlayManager.close('printServiceOverlay'); + }); + }, + renderPages: function renderPages() { + var _this = this; + + var pageCount = this.pagesOverview.length; + var renderNextPage = function renderNextPage(resolve, reject) { + _this.throwIfInactive(); + if (++_this.currentPage >= pageCount) { + renderProgress(pageCount, pageCount, _this.l10n); + resolve(); + return; + } + var index = _this.currentPage; + renderProgress(index, pageCount, _this.l10n); + renderPage(_this, _this.pdfDocument, index + 1, _this.pagesOverview[index]).then(_this.useRenderedPage.bind(_this)).then(function () { + renderNextPage(resolve, reject); + }, reject); + }; + return new Promise(renderNextPage); + }, + useRenderedPage: function useRenderedPage(printItem) { + this.throwIfInactive(); + var img = document.createElement('img'); + img.style.width = printItem.width; + img.style.height = printItem.height; + var scratchCanvas = this.scratchCanvas; + if ('toBlob' in scratchCanvas && !_pdfjsLib.PDFJS.disableCreateObjectURL) { + scratchCanvas.toBlob(function (blob) { + img.src = URL.createObjectURL(blob); + }); + } else { + img.src = scratchCanvas.toDataURL(); + } + var wrapper = document.createElement('div'); + wrapper.appendChild(img); + this.printContainer.appendChild(wrapper); + return new Promise(function (resolve, reject) { + img.onload = resolve; + img.onerror = reject; + }); + }, + performPrint: function performPrint() { + var _this2 = this; + + this.throwIfInactive(); + return new Promise(function (resolve) { + setTimeout(function () { + if (!_this2.active) { + resolve(); + return; + } + print.call(window); + setTimeout(resolve, 20); + }, 0); + }); + }, + + get active() { + return this === activeService; + }, + throwIfInactive: function throwIfInactive() { + if (!this.active) { + throw new Error('This print request was cancelled or completed.'); + } + } +}; +var print = window.print; +window.print = function print() { + if (activeService) { + console.warn('Ignored window.print() because of a pending print job.'); + return; + } + ensureOverlay().then(function () { + if (activeService) { + overlayManager.open('printServiceOverlay'); + } + }); + try { + dispatchEvent('beforeprint'); + } finally { + if (!activeService) { + console.error('Expected print service to be initialized.'); + ensureOverlay().then(function () { + if (overlayManager.active === 'printServiceOverlay') { + overlayManager.close('printServiceOverlay'); + } + }); + return; + } + var activeServiceOnEntry = activeService; + activeService.renderPages().then(function () { + return activeServiceOnEntry.performPrint(); + }).catch(function () {}).then(function () { + if (activeServiceOnEntry.active) { + abort(); + } + }); + } +}; +function dispatchEvent(eventType) { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent(eventType, false, false, 'custom'); + window.dispatchEvent(event); +} +function abort() { + if (activeService) { + activeService.destroy(); + dispatchEvent('afterprint'); + } +} +function renderProgress(index, total, l10n) { + var progressContainer = document.getElementById('printServiceOverlay'); + var progress = Math.round(100 * index / total); + var progressBar = progressContainer.querySelector('progress'); + var progressPerc = progressContainer.querySelector('.relative-progress'); + progressBar.value = progress; + l10n.get('print_progress_percent', { progress: progress }, progress + '%').then(function (msg) { + progressPerc.textContent = msg; + }); +} +var hasAttachEvent = !!document.attachEvent; +window.addEventListener('keydown', function (event) { + if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) { + window.print(); + if (hasAttachEvent) { + return; + } + event.preventDefault(); + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } else { + event.stopPropagation(); + } + return; + } +}, true); +if (hasAttachEvent) { + document.attachEvent('onkeydown', function (event) { + event = event || window.event; + if (event.keyCode === 80 && event.ctrlKey) { + event.keyCode = 0; + return false; + } + }); +} +if ('onbeforeprint' in window) { + var stopPropagationIfNeeded = function stopPropagationIfNeeded(event) { + if (event.detail !== 'custom' && event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + }; + window.addEventListener('beforeprint', stopPropagationIfNeeded); + window.addEventListener('afterprint', stopPropagationIfNeeded); +} +var overlayPromise = void 0; +function ensureOverlay() { + if (!overlayPromise) { + overlayManager = _app.PDFViewerApplication.overlayManager; + if (!overlayManager) { + throw new Error('The overlay manager has not yet been initialized.'); + } + overlayPromise = overlayManager.register('printServiceOverlay', document.getElementById('printServiceOverlay'), abort, true); + document.getElementById('printCancel').onclick = abort; + } + return overlayPromise; +} +_app.PDFPrintServiceFactory.instance = { + supportsPrinting: true, + createPrintService: function createPrintService(pdfDocument, pagesOverview, printContainer, l10n) { + if (activeService) { + throw new Error('The print service is created and active.'); + } + activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, l10n); + return activeService; + } +}; +exports.PDFPrintService = PDFPrintService; + +/***/ }) +/******/ ]); +//# sourceMappingURL=viewer.js.map \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/static/plyr/plyr.css b/release/file-preview-service/WEB-INF/classes/static/plyr/plyr.css new file mode 100644 index 0000000..e92820c --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/plyr/plyr.css @@ -0,0 +1 @@ +.plyr input[type=range]:focus,.plyr:focus{outline:0}.plyr .plyr__video-embed iframe,.plyr__tooltip{pointer-events:none}@keyframes plyr-progress{to{background-position:25px 0}}.plyr{position:relative;max-width:100%;min-width:200px;font-family:Avenir,'Avenir Next','Helvetica Neue','Segoe UI',Helvetica,Arial,sans-serif;direction:ltr}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr a,.plyr button,.plyr input,.plyr label{-ms-touch-action:manipulation;touch-action:manipulation}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle;border-radius:inherit}.plyr input[type=range]{display:block;height:20px;width:100%;margin:0;padding:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;background:0 0}.plyr input[type=range]::-webkit-slider-runnable-track{height:8px;background:0 0;border:0;border-radius:4px;-webkit-user-select:none;user-select:none}.plyr input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-moz-range-track{height:8px;background:0 0;border:0;border-radius:4px;-moz-user-select:none;user-select:none}.plyr input[type=range]::-moz-range-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-ms-track{height:8px;background:0 0;border:0;color:transparent}.plyr input[type=range]::-ms-fill-upper{height:8px;background:0 0;border:0;border-radius:4px;-ms-user-select:none;user-select:none}.plyr input[type=range]::-ms-fill-lower{height:8px;border:0;border-radius:4px;-ms-user-select:none;user-select:none;background:#3498db}.plyr input[type=range]::-ms-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.15);box-sizing:border-box;margin-top:0}.plyr input[type=range]::-ms-tooltip{display:none}.plyr input[type=range]::-moz-focus-outer{border:0}.plyr input[type=range].tab-focus:focus{outline-offset:3px}.plyr input[type=range]:active::-webkit-slider-thumb{background:#3498db;border-color:#fff;transform:scale(1.25)}.plyr input[type=range]:active::-moz-range-thumb{background:#3498db;border-color:#fff;transform:scale(1.25)}.plyr input[type=range]:active::-ms-thumb{background:#3498db;border-color:#fff;transform:scale(1.25)}.plyr--video input[type=range].tab-focus:focus{outline:rgba(255,255,255,.5) dotted 1px}.plyr--audio input[type=range].tab-focus:focus{outline:rgba(86,93,100,.5) dotted 1px}.plyr__sr-only{clip:rect(1px,1px,1px,1px);overflow:hidden;position:absolute!important;padding:0!important;border:0!important;height:1px!important;width:1px!important}.plyr__video-wrapper{position:relative;background:#000;border-radius:inherit}.plyr__video-embed{padding-bottom:56.25%;height:0;border-radius:inherit;overflow:hidden;z-index:0}.plyr__video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plyr__video-embed>div{position:relative;padding-bottom:200%;transform:translateY(-35.95%)}.plyr video::-webkit-media-text-track-container{display:none}.plyr__captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px;transform:translateY(-40px);transition:transform .3s ease;color:#fff;font-size:16px;text-align:center;font-weight:400}.plyr__captions span{border-radius:2px;padding:3px 10px;background:rgba(0,0,0,.7);-webkit-box-decoration-break:clone;box-decoration-break:clone;line-height:150%}.plyr__captions span:empty{display:none}@media (min-width:768px){.plyr__captions{font-size:24px}}.plyr--captions-active .plyr__captions{display:block}.plyr--hide-controls .plyr__captions{transform:translateY(-15px)}@media (min-width:1024px){.plyr--fullscreen-active .plyr__captions{font-size:32px}}.plyr ::-webkit-media-controls{display:none}.plyr__controls{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;line-height:1;text-align:center}.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls>button{margin-left:5px}.plyr__controls .plyr__progress:first-child,.plyr__controls .plyr__time:first-child,.plyr__controls>button:first-child{margin-left:0}.plyr__controls .plyr__volume{margin-left:5px}.plyr__controls [data-plyr=pause]{margin-left:0}.plyr__controls button{position:relative;display:inline-block;-ms-flex-negative:0;flex-shrink:0;overflow:visible;vertical-align:middle;padding:7px;border:0;background:0 0;border-radius:3px;cursor:pointer;transition:background .3s ease,color .3s ease,opacity .3s ease;color:inherit}.plyr__controls button svg{width:18px;height:18px;display:block;fill:currentColor}.plyr__controls button:focus{outline:0}.plyr__controls .icon--captions-on,.plyr__controls .icon--exit-fullscreen,.plyr__controls .icon--muted{display:none}@media (min-width:480px){.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls>button{margin-left:10px}}.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none}.plyr--video .plyr__controls{position:absolute;left:0;right:0;bottom:0;z-index:2;padding:50px 10px 10px;background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.5));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:#fff;transition:opacity .3s ease}.plyr--video .plyr__controls button.tab-focus:focus,.plyr--video .plyr__controls button:hover{background:#3498db;color:#fff}.plyr--audio .plyr__controls{padding:10px;border-radius:inherit;background:#fff;border:1px solid #dbe3e8;color:#565D64}.plyr--audio .plyr__controls button.tab-focus:focus,.plyr--audio .plyr__controls button:hover,.plyr__play-large{background:#3498db;color:#fff}.plyr__play-large{display:none;position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%,-50%);padding:10px;border:4px solid currentColor;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,.15);transition:all .3s ease}.plyr__play-large svg{position:relative;left:2px;width:20px;height:20px;display:block;fill:currentColor}.plyr__play-large:focus{outline:rgba(255,255,255,.5) dotted 1px}.plyr .plyr__play-large{display:inline-block}.plyr--audio .plyr__play-large,.plyr--playing .plyr__controls [data-plyr=play],.plyr__controls [data-plyr=pause]{display:none}.plyr--playing .plyr__play-large{opacity:0;visibility:hidden}.plyr--playing .plyr__controls [data-plyr=pause]{display:inline-block}.plyr--captions-active .plyr__controls .icon--captions-on,.plyr--fullscreen-active .icon--exit-fullscreen,.plyr--muted .plyr__controls .icon--muted{display:block}.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr--captions-active .plyr__controls .icon--captions-on+svg,.plyr--fullscreen-active .icon--exit-fullscreen+svg,.plyr--muted .plyr__controls .icon--muted+svg{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block}.plyr__tooltip{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:5px 7.5px;opacity:0;background:rgba(0,0,0,.7);border-radius:3px;color:#fff;font-size:14px;line-height:1.3;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s .1s ease,opacity .2s .1s ease}.plyr__tooltip::before{content:'';position:absolute;width:0;height:0;left:50%;transform:translateX(-50%);bottom:-4px;border-right:4px solid transparent;border-top:4px solid rgba(0,0,0,.7);border-left:4px solid transparent;z-index:2}.plyr button.tab-focus:focus .plyr__tooltip,.plyr button:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%,0) scale(1)}.plyr button:hover .plyr__tooltip{z-index:3}.plyr__controls button:first-child .plyr__tooltip{left:0;transform:translate(0,10px) scale(.8);transform-origin:0 100%}.plyr__controls button:first-child .plyr__tooltip::before{left:16px}.plyr__controls button:last-child .plyr__tooltip{right:0;transform:translate(0,10px) scale(.8);transform-origin:100% 100%}.plyr__controls button:last-child .plyr__tooltip::before{left:auto;right:16px;transform:translateX(50%)}.plyr__controls button:first-child .plyr__tooltip--visible,.plyr__controls button:first-child.tab-focus:focus .plyr__tooltip,.plyr__controls button:first-child:hover .plyr__tooltip,.plyr__controls button:last-child .plyr__tooltip--visible,.plyr__controls button:last-child.tab-focus:focus .plyr__tooltip,.plyr__controls button:last-child:hover .plyr__tooltip{transform:translate(0,0) scale(1)}.plyr__progress{position:relative;display:none;-ms-flex:1;flex:1}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress input[type=range]::-webkit-slider-runnable-track{background:0 0}.plyr__progress input[type=range]::-moz-range-track{background:0 0}.plyr__progress input[type=range]::-ms-fill-upper{background:0 0}.plyr__progress .plyr__tooltip{left:0}.plyr .plyr__progress{display:inline-block}.plyr__progress--buffer,.plyr__progress--played,.plyr__volume--display{position:absolute;left:0;top:50%;width:100%;height:8px;margin:-4px 0 0;padding:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:100px}.plyr__progress--buffer::-webkit-progress-bar,.plyr__progress--played::-webkit-progress-bar,.plyr__volume--display::-webkit-progress-bar{background:0 0}.plyr__progress--buffer::-webkit-progress-value,.plyr__progress--played::-webkit-progress-value,.plyr__volume--display::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer::-moz-progress-bar,.plyr__progress--played::-moz-progress-bar,.plyr__volume--display::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer::-ms-fill,.plyr__progress--played::-ms-fill,.plyr__volume--display::-ms-fill{border-radius:100px}.plyr__progress--played,.plyr__volume--display{z-index:1;color:#3498db;background:0 0;transition:none}.plyr__progress--played::-webkit-progress-value,.plyr__volume--display::-webkit-progress-value{min-width:8px;max-width:99%;border-top-right-radius:0;border-bottom-right-radius:0;transition:none}.plyr__progress--played::-moz-progress-bar,.plyr__volume--display::-moz-progress-bar{min-width:8px;max-width:99%;border-top-right-radius:0;border-bottom-right-radius:0;transition:none}.plyr__progress--played::-ms-fill,.plyr__volume--display::-ms-fill{display:none}.plyr__progress--buffer::-webkit-progress-value{transition:width .2s ease}.plyr__progress--buffer::-moz-progress-bar{transition:width .2s ease}.plyr__progress--buffer::-ms-fill{transition:width .2s ease}.plyr--video .plyr__progress--buffer,.plyr--video .plyr__volume--display{background:rgba(255,255,255,.25)}.plyr--video .plyr__progress--buffer{color:rgba(255,255,255,.25)}.plyr--audio .plyr__progress--buffer,.plyr--audio .plyr__volume--display{background:rgba(198,214,219,.66)}.plyr--audio .plyr__progress--buffer{color:rgba(198,214,219,.66)}.plyr--loading .plyr__progress--buffer{animation:plyr-progress 1s linear infinite;background-size:25px 25px;background-repeat:repeat-x;background-image:linear-gradient(-45deg,rgba(0,0,0,.15) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.15) 50%,rgba(0,0,0,.15) 75%,transparent 75%,transparent);color:transparent}.plyr--video.plyr--loading .plyr__progress--buffer{background-color:rgba(255,255,255,.25)}.plyr--audio.plyr--loading .plyr__progress--buffer{background-color:rgba(198,214,219,.66)}.plyr__time{display:inline-block;vertical-align:middle;font-size:14px}.plyr__time+.plyr__time{display:none}@media (min-width:768px){.plyr__time+.plyr__time{display:inline-block}}.plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}.plyr__volume{display:none}.plyr .plyr__volume{-ms-flex:1;flex:1;position:relative}.plyr .plyr__volume input[type=range]{position:relative;z-index:2}@media (min-width:480px){.plyr .plyr__volume{display:block;max-width:60px}}@media (min-width:768px){.plyr .plyr__volume{max-width:100px}}.plyr--is-ios .plyr__volume,.plyr--is-ios [data-plyr=mute]{display:none!important}.plyr--fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000;border-radius:0!important}.plyr--fullscreen-active video{height:100%}.plyr--fullscreen-active .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen-active .plyr__video-embed{overflow:visible}.plyr--fullscreen-active .plyr__controls{position:absolute;bottom:0;left:0;right:0}.plyr--fullscreen-active.plyr--vimeo .plyr__video-wrapper{height:0;top:50%;transform:translateY(-50%)} \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/static/plyr/plyr.js b/release/file-preview-service/WEB-INF/classes/static/plyr/plyr.js new file mode 100644 index 0000000..9138397 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/static/plyr/plyr.js @@ -0,0 +1,2 @@ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,document):"function"==typeof define&&define.amd?define([],function(){return t(e,document)}):e.plyr=t(e,document)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(){var e,n,r,a=navigator.userAgent,s=navigator.appName,o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10),l=!1,u=!1,c=!1,d=!1;return navigator.appVersion.indexOf("Windows NT")!==-1&&navigator.appVersion.indexOf("rv:11")!==-1?(l=!0,s="IE",o="11"):(n=a.indexOf("MSIE"))!==-1?(l=!0,s="IE",o=a.substring(n+5)):(n=a.indexOf("Chrome"))!==-1?(c=!0,s="Chrome",o=a.substring(n+7)):(n=a.indexOf("Safari"))!==-1?(d=!0,s="Safari",o=a.substring(n+7),(n=a.indexOf("Version"))!==-1&&(o=a.substring(n+8))):(n=a.indexOf("Firefox"))!==-1?(u=!0,s="Firefox",o=a.substring(n+8)):(e=a.lastIndexOf(" ")+1)<(n=a.lastIndexOf("/"))&&(s=a.substring(e,n),o=a.substring(n+1),s.toLowerCase()===s.toUpperCase()&&(s=navigator.appName)),(r=o.indexOf(";"))!==-1&&(o=o.substring(0,r)),(r=o.indexOf(" "))!==-1&&(o=o.substring(0,r)),i=parseInt(""+o,10),isNaN(i)&&(o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10)),{name:s,version:i,isIE:l,isFirefox:u,isChrome:c,isSafari:d,isIos:/(iPad|iPhone|iPod)/g.test(navigator.platform),isIphone:/(iPhone|iPod)/g.test(navigator.userAgent),isTouch:"ontouchstart"in t.documentElement}}function r(e,t){var n=e.media;if("video"===e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"===e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function a(e){if(!t.querySelectorAll('script[src="'+e+'"]').length){var n=t.createElement("script");n.src=e;var r=t.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r)}}function s(e,t){return Array.prototype.indexOf&&e.indexOf(t)!==-1}function o(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function i(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,a=e[n],s=a.parentNode,o=a.nextSibling;return r.appendChild(a),o?s.insertBefore(r,o):s.appendChild(r),r}}function l(e){e&&e.parentNode.removeChild(e)}function u(e,t){e.insertBefore(t,e.firstChild)}function c(e,t){for(var n in t)e.setAttribute(n,O.boolean(t[n])&&t[n]?"":t[n])}function d(e,n,r){var a=t.createElement(e);c(a,r),u(n,a)}function p(e){return e.replace(".","")}function m(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function f(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className))}function y(e,n){var r=Element.prototype,a=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||function(e){return[].indexOf.call(t.querySelectorAll(e),this)!==-1};return a.call(e,n)}function b(e,t,n,r,a){g(e,t,function(t){n&&n.apply(e,[t]),r.apply(e,[t])},a)}function v(e,t,n,r,a){var s=t.split(" ");if(O.boolean(a)||(a=!1),e instanceof NodeList)for(var o=0;o','',''+E.i18n.play+"",""),e.push('
'),s(E.controls,"restart")&&e.push('"),s(E.controls,"rewind")&&e.push('"),s(E.controls,"play")&&e.push('",'"),s(E.controls,"fast-forward")&&e.push('"),s(E.controls,"progress")&&(e.push('','','','','',"0% "+E.i18n.buffered,""),E.tooltips.seek&&e.push('00:00'),e.push("")),s(E.controls,"current-time")&&e.push('',''+E.i18n.currentTime+"",'00:00',""),s(E.controls,"duration")&&e.push('',''+E.i18n.duration+"",'00:00',""),s(E.controls,"mute")&&e.push('"),s(E.controls,"volume")&&e.push('','",'','',""),s(E.controls,"captions")&&e.push('"),s(E.controls,"fullscreen")&&e.push('"),e.push("
"),e.join("")}function q(){if(Ue.supported.full&&("audio"!==Ue.type||E.fullscreen.allowAudio)&&E.fullscreen.enabled){var e=N.supportsFullScreen;e||E.fullscreen.fallback&&!X()?(Je((e?"Native":"Fallback")+" fullscreen enabled"),m(Ue.container,E.classes.fullscreen.enabled,!0)):Je("Fullscreen not supported and fallback disabled"),Ue.buttons&&Ue.buttons.fullscreen&&k(Ue.buttons.fullscreen,!1),$()}}function D(){if("video"===Ue.type){U(E.selectors.captions)||Ue.videoContainer.insertAdjacentHTML("afterbegin",'
'),Ue.usingTextTracks=!1,Ue.media.textTracks&&(Ue.usingTextTracks=!0);for(var e,t="",n=Ue.media.childNodes,r=0;r=10||Ue.browser.isFirefox&&Ue.browser.version>=31)&&(Je("Detected browser with known TextTrack issues - using manual fallback"),Ue.usingTextTracks=!1),Ue.usingTextTracks){Je("TextTracks supported");for(var o=0;o ");for(var r=0;rUe.captions.length-1){Ue.subcount=Ue.captions.length-1;break}Ue.media.currentTime.toFixed(1)>=n(Ue.captions[Ue.subcount][0])&&Ue.media.currentTime.toFixed(1)<=r(Ue.captions[Ue.subcount][0])?(Ue.currentCaption=Ue.captions[Ue.subcount][1],H(Ue.currentCaption)):H()}}function Y(){if(Ue.buttons.captions){m(Ue.container,E.classes.captions.enabled,!0);var e=Ue.storage.captionsEnabled;O.boolean(e)||(e=E.captions.defaultActive),e&&(m(Ue.container,E.classes.captions.active,!0),k(Ue.buttons.captions,!0))}}function B(e){return Ue.container.querySelectorAll(e)}function U(e){return B(e)[0]}function X(){try{return e.self!==e.top}catch(e){return!0}}function $(){function e(e){9===e.which&&Ue.isFullscreen&&(e.target!==r||e.shiftKey?e.target===n&&e.shiftKey&&(e.preventDefault(),r.focus()):(e.preventDefault(),n.focus()))}var t=B("input:not([disabled]), button:not([disabled])"),n=t[0],r=t[t.length-1];g(Ue.container,"keydown",e)}function J(e,t){if(O.string(t))d(e,Ue.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Ue.media,t[n])}function z(){if(E.loadSprite){var e=V();e.absolute?(Je("AJAX loading absolute SVG sprite"+(Ue.browser.isIE?" (due to IE)":"")),C(e.url,"sprite-plyr")):Je("Sprite will be used as external resource directly")}var n=E.html;Je("Injecting custom controls"),n||(n=R()),n=o(n,"{seektime}",E.seekTime),n=o(n,"{id}",Math.floor(1e4*Math.random()));var r;if(O.string(E.selectors.controls.container)&&(r=t.querySelector(E.selectors.controls.container)),O.htmlElement(r)||(r=Ue.container),r.insertAdjacentHTML("beforeend",n),E.tooltips.controls)for(var a=B([E.selectors.controls.wrapper," ",E.selectors.labels," .",E.classes.hidden].join("")),s=a.length-1;s>=0;s--){var i=a[s];m(i,E.classes.hidden,!1),m(i,E.classes.tooltip,!0)}}function G(){try{return Ue.controls=U(E.selectors.controls.wrapper),Ue.buttons={},Ue.buttons.seek=U(E.selectors.buttons.seek),Ue.buttons.play=B(E.selectors.buttons.play),Ue.buttons.pause=U(E.selectors.buttons.pause),Ue.buttons.restart=U(E.selectors.buttons.restart),Ue.buttons.rewind=U(E.selectors.buttons.rewind),Ue.buttons.forward=U(E.selectors.buttons.forward),Ue.buttons.fullscreen=U(E.selectors.buttons.fullscreen),Ue.buttons.mute=U(E.selectors.buttons.mute),Ue.buttons.captions=U(E.selectors.buttons.captions),Ue.progress={},Ue.progress.container=U(E.selectors.progress.container),Ue.progress.buffer={},Ue.progress.buffer.bar=U(E.selectors.progress.buffer),Ue.progress.buffer.text=Ue.progress.buffer.bar&&Ue.progress.buffer.bar.getElementsByTagName("span")[0],Ue.progress.played=U(E.selectors.progress.played),Ue.progress.tooltip=Ue.progress.container&&Ue.progress.container.querySelector("."+E.classes.tooltip),Ue.volume={},Ue.volume.input=U(E.selectors.volume.input),Ue.volume.display=U(E.selectors.volume.display),Ue.duration=U(E.selectors.duration),Ue.currentTime=U(E.selectors.currentTime),Ue.seekTime=B(E.selectors.seekTime),!0}catch(e){return ze("It looks like there is a problem with your controls HTML"),Q(!0),!1}}function K(){m(Ue.container,E.selectors.container.replace(".",""),Ue.supported.full)}function Q(e){e&&s(E.types.html5,Ue.type)?Ue.media.setAttribute("controls",""):Ue.media.removeAttribute("controls")}function Z(e){var t=E.i18n.play;if(O.string(E.title)&&E.title.length&&(t+=", "+E.title,Ue.container.setAttribute("aria-label",E.title)),Ue.supported.full&&Ue.buttons.play)for(var n=Ue.buttons.play.length-1;n>=0;n--)Ue.buttons.play[n].setAttribute("aria-label",t);O.htmlElement(e)&&e.setAttribute("title",E.i18n.frameTitle.replace("{title}",E.title))}function ee(){var t=null;Ue.storage={},L.supported&&E.storage.enabled&&(e.localStorage.removeItem("plyr-volume"),t=e.localStorage.getItem(E.storage.key),t&&(/^\d+(\.\d+)?$/.test(t)?te({volume:parseFloat(t)}):Ue.storage=JSON.parse(t)))}function te(t){L.supported&&E.storage.enabled&&(x(Ue.storage,t),e.localStorage.setItem(E.storage.key,JSON.stringify(Ue.storage)))}function ne(){if(!Ue.media)return void ze("No media element found!");if(Ue.supported.full&&(m(Ue.container,E.classes.type.replace("{0}",Ue.type),!0),s(E.types.embed,Ue.type)&&m(Ue.container,E.classes.type.replace("{0}","video"),!0),m(Ue.container,E.classes.stopped,E.autoplay),m(Ue.ontainer,E.classes.isIos,Ue.browser.isIos),m(Ue.container,E.classes.isTouch,Ue.browser.isTouch),"video"===Ue.type)){var e=t.createElement("div");e.setAttribute("class",E.classes.videoWrapper),i(Ue.media,e),Ue.videoContainer=e}s(E.types.embed,Ue.type)&&re()}function re(){var n,r=t.createElement("div"),s=Ue.type+"-"+Math.floor(1e4*Math.random());switch(Ue.type){case"youtube":n=T(Ue.embedId);break;case"vimeo":n=S(Ue.embedId);break;default:n=Ue.embedId}for(var o=B('[id^="'+Ue.type+'-"]'),i=o.length-1;i>=0;i--)l(o[i]);if(m(Ue.media,E.classes.videoWrapper,!0),m(Ue.media,E.classes.embedWrapper,!0),"youtube"===Ue.type)Ue.media.appendChild(r),r.setAttribute("id",s),O.object(e.YT)?se(n,r):(a(E.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){se(n,r)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Ue.type)if(Ue.supported.full?Ue.media.appendChild(r):r=Ue.media,r.setAttribute("id",s),O.object(e.Vimeo))oe(n,r);else{a(E.urls.vimeo.api);var u=e.setInterval(function(){O.object(e.Vimeo)&&(e.clearInterval(u),oe(n,r))},50)}else if("soundcloud"===Ue.type){var d=t.createElement("iframe");d.loaded=!1,g(d,"load",function(){d.loaded=!0}),c(d,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+n,id:s}),r.appendChild(d),Ue.media.appendChild(r),e.SC||a(E.urls.soundcloud.api);var p=e.setInterval(function(){e.SC&&d.loaded&&(e.clearInterval(p),ie.call(d))},50)}}function ae(){Ue.supported.full&&(We(),Ye()),Z(U("iframe"))}function se(t,n){Ue.embed=new e.YT.Player(n.id,{videoId:t,playerVars:{autoplay:E.autoplay?1:0,controls:Ue.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:E.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onError:function(e){A(Ue.container,"error",!0,{code:e.data,embed:e.target})},onReady:function(t){var n=t.target;Ue.media.play=function(){n.playVideo(),Ue.media.paused=!1},Ue.media.pause=function(){n.pauseVideo(),Ue.media.paused=!0},Ue.media.stop=function(){n.stopVideo(),Ue.media.paused=!0},Ue.media.duration=n.getDuration(),Ue.media.paused=!0,Ue.media.currentTime=0,Ue.media.muted=n.isMuted(),E.title=n.getVideoData().title,Ue.supported.full&&Ue.media.querySelector("iframe").setAttribute("tabindex","-1"),ae(),A(Ue.media,"timeupdate"),A(Ue.media,"durationchange"),e.clearInterval(Xe.buffering),Xe.buffering=e.setInterval(function(){Ue.media.buffered=n.getVideoLoadedFraction(),(null===Ue.media.lastBuffered||Ue.media.lastBufferedr&&(t=r),Ne(t);try{Ue.media.currentTime=t.toFixed(4)}catch(e){}if(s(E.types.embed,Ue.type)){switch(Ue.type){case"youtube":Ue.embed.seekTo(t);break;case"vimeo":Ue.embed.setCurrentTime(t.toFixed(0));break;case"soundcloud":Ue.embed.seekTo(1e3*t)}n&&ue(),A(Ue.media,"timeupdate"),Ue.media.seeking=!0,A(Ue.media,"seeking")}Je("Seeking to "+Ue.media.currentTime+" seconds"),W(t)}function fe(){var e=parseInt(E.duration),t=0;return null===Ue.media.duration||isNaN(Ue.media.duration)||(t=Ue.media.duration),isNaN(e)?t:e}function ye(){m(Ue.container,E.classes.playing,!Ue.media.paused),m(Ue.container,E.classes.stopped,Ue.media.paused),Me(Ue.media.paused)}function be(){P={x:e.pageXOffset||0,y:e.pageYOffset||0}}function ve(){e.scrollTo(P.x,P.y)}function ge(e){var n=N.supportsFullScreen;if(n){if(!e||e.type!==N.fullScreenEventName)return N.isFullScreen(Ue.container)?N.cancelFullScreen():(be(),N.requestFullScreen(Ue.container)),void(Ue.isFullscreen=N.isFullScreen(Ue.container));Ue.isFullscreen=N.isFullScreen(Ue.container)}else Ue.isFullscreen=!Ue.isFullscreen,t.body.style.overflow=Ue.isFullscreen?"hidden":"";m(Ue.container,E.classes.fullscreen.active,Ue.isFullscreen),$(Ue.isFullscreen),Ue.buttons&&Ue.buttons.fullscreen&&k(Ue.buttons.fullscreen,Ue.isFullscreen),A(Ue.container,Ue.isFullscreen?"enterfullscreen":"exitfullscreen",!0),!Ue.isFullscreen&&n&&ve()}function he(e){if(O.boolean(e)||(e=!Ue.media.muted),k(Ue.buttons.mute,e),Ue.media.muted=e,0===Ue.media.volume&&ke(E.volume),s(E.types.embed,Ue.type)){switch(Ue.type){case"youtube":Ue.embed[Ue.media.muted?"mute":"unMute"]();break;case"vimeo":case"soundcloud":Ue.embed.setVolume(Ue.media.muted?0:parseFloat(E.volume/E.volumeMax))}A(Ue.media,"volumechange")}}function ke(e){var t=E.volumeMax,n=E.volumeMin;if(O.undefined(e)&&(e=Ue.storage.volume),(null===e||isNaN(e))&&(e=E.volume),e>t&&(e=t),e0&&he()}function we(e){var t=Ue.media.muted?0:Ue.media.volume*E.volumeMax;O.number(e)||(e=E.volumeStep),ke(t+e)}function xe(e){var t=Ue.media.muted?0:Ue.media.volume*E.volumeMax;O.number(e)||(e=E.volumeStep),ke(t-e)}function Te(){var e=Ue.media.muted?0:Ue.media.volume*E.volumeMax;Ue.supported.full&&(Ue.volume.input&&(Ue.volume.input.value=e),Ue.volume.display&&(Ue.volume.display.value=e)),te({volume:e}),m(Ue.container,E.classes.muted,0===e),Ue.supported.full&&Ue.buttons.mute&&k(Ue.buttons.mute,0===e)}function Se(e){Ue.supported.full&&Ue.buttons.captions&&(O.boolean(e)||(e=Ue.container.className.indexOf(E.classes.captions.active)===-1),Ue.captionsEnabled=e,k(Ue.buttons.captions,Ue.captionsEnabled),m(Ue.container,E.classes.captions.active,Ue.captionsEnabled),A(Ue.container,Ue.captionsEnabled?"captionsenabled":"captionsdisabled",!0),te({captionsEnabled:Ue.captionsEnabled}))}function _e(e){var t="waiting"===e.type;clearTimeout(Xe.loading),Xe.loading=setTimeout(function(){m(Ue.container,E.classes.loading,t),Me(t)},t?250:0)}function Ee(e){if(Ue.supported.full){var t=Ue.progress.played,n=0,r=fe();if(e)switch(e.type){case"timeupdate":case"seeking":if(Ue.controls.pressed)return;n=w(Ue.media.currentTime,r),"timeupdate"===e.type&&Ue.buttons.seek&&(Ue.buttons.seek.value=n);break;case"playing":case"progress":t=Ue.progress.buffer,n=function(){var e=Ue.media.buffered;return e&&e.length?w(e.end(0),r):O.number(e)?100*e:0}()}Ce(t,n)}}function Ce(e,t){if(Ue.supported.full){if(O.undefined(t)&&(t=0),O.undefined(e)){if(!Ue.progress||!Ue.progress.buffer)return;e=Ue.progress.buffer}O.htmlElement(e)?e.value=t:e&&(e.bar&&(e.bar.value=t),e.text&&(e.text.innerHTML=t))}}function Fe(e,t){if(t){isNaN(e)&&(e=0),Ue.secs=parseInt(e%60),Ue.mins=parseInt(e/60%60),Ue.hours=parseInt(e/60/60%60);var n=parseInt(fe()/60/60%60)>0;Ue.secs=("0"+Ue.secs).slice(-2),Ue.mins=("0"+Ue.mins).slice(-2),t.innerHTML=(n?Ue.hours+":":"")+Ue.mins+":"+Ue.secs}}function Ae(){if(Ue.supported.full){var e=fe()||0;!Ue.duration&&E.displayDuration&&Ue.media.paused&&Fe(e,Ue.currentTime),Ue.duration&&Fe(e,Ue.duration),Pe()}}function Ie(e){Fe(Ue.media.currentTime,Ue.currentTime),e&&"timeupdate"===e.type&&Ue.media.seeking||Ee(e)}function Ne(e){O.number(e)||(e=0);var t=fe(),n=w(e,t);Ue.progress&&Ue.progress.played&&(Ue.progress.played.value=n),Ue.buttons&&Ue.buttons.seek&&(Ue.buttons.seek.value=n)}function Pe(e){var t=fe();if(E.tooltips.seek&&Ue.progress.container&&0!==t){var n=Ue.progress.container.getBoundingClientRect(),r=0,a=E.classes.tooltip+"--visible";if(e)r=100/n.width*(e.pageX-n.left);else{if(!f(Ue.progress.tooltip,a))return;r=Ue.progress.tooltip.style.left.replace("%","")}r<0?r=0:r>100&&(r=100),Fe(t/100*r,Ue.progress.tooltip),Ue.progress.tooltip.style.left=r+"%",e&&s(["mouseenter","mouseleave"],e.type)&&m(Ue.progress.tooltip,a,"mouseenter"===e.type)}}function Me(t){if(E.hideControls&&"audio"!==Ue.type){var n=0,r=!1,a=t,o=f(Ue.container,E.classes.loading);if(O.boolean(t)||(t&&t.type?(r="enterfullscreen"===t.type,a=s(["mousemove","touchstart","mouseenter","focus"],t.type),s(["mousemove","touchmove"],t.type)&&(n=2e3),"focus"===t.type&&(n=3e3)):a=f(Ue.container,E.classes.hideControls)),e.clearTimeout(Xe.hover),a||Ue.media.paused||o){if(m(Ue.container,E.classes.hideControls,!1),Ue.media.paused||o)return;Ue.browser.isTouch&&(n=3e3)}a&&Ue.media.paused||(Xe.hover=e.setTimeout(function(){(!Ue.controls.pressed&&!Ue.controls.hover||r)&&m(Ue.container,E.classes.hideControls,!0)},n))}}function Oe(e){if(!O.undefined(e))return void Le(e);var t;switch(Ue.type){case"youtube":t=Ue.embed.getVideoUrl();break;case"vimeo":Ue.embed.getVideoUrl.then(function(e){t=e});break;case"soundcloud":Ue.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Ue.media.currentSrc}return t||""}function Le(e){function n(){if(Ue.embed=null,l(Ue.media),"video"===Ue.type&&Ue.videoContainer&&l(Ue.videoContainer),Ue.container&&Ue.container.removeAttribute("class"),"type"in e&&(Ue.type=e.type,"video"===Ue.type)){var n=e.sources[0];"type"in n&&s(E.types.embed,n.type)&&(Ue.type=n.type)}switch(Ue.supported=F(Ue.type),Ue.type){case"video":Ue.media=t.createElement("video");break;case"audio":Ue.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Ue.media=t.createElement("div"),Ue.embedId=e.sources[0].src}u(Ue.container,Ue.media),O.boolean(e.autoplay)&&(E.autoplay=e.autoplay),s(E.types.html5,Ue.type)&&(E.crossorigin&&Ue.media.setAttribute("crossorigin",""),E.autoplay&&Ue.media.setAttribute("autoplay",""),"poster"in e&&Ue.media.setAttribute("poster",e.poster),E.loop&&Ue.media.setAttribute("loop","")),m(Ue.container,E.classes.fullscreen.active,Ue.isFullscreen),m(Ue.container,E.classes.captions.active,Ue.captionsEnabled),K(),s(E.types.html5,Ue.type)&&J("source",e.sources),ne(),s(E.types.html5,Ue.type)&&("tracks"in e&&J("track",e.tracks),Ue.media.load()),(s(E.types.html5,Ue.type)||s(E.types.embed,Ue.type)&&!Ue.supported.full)&&(We(),Ye()),E.title=e.title,Z()}return O.object(e)&&"sources"in e&&e.sources.length?(m(Ue.container,E.classes.ready,!1),ue(),Ne(),Ce(),qe(),void De(n,!1)):void ze("Invalid source format")}function je(e){"video"===Ue.type&&Ue.media.setAttribute("poster",e)}function Ve(){function n(){var e=ce(),t=Ue.buttons[e?"play":"pause"],n=Ue.buttons[e?"pause":"play"];if(n=n&&n.length>1?n[n.length-1]:n[0]){var r=f(t,E.classes.tabFocus);setTimeout(function(){n.focus(),r&&(m(t,E.classes.tabFocus,!1),m(n,E.classes.tabFocus,!0))},100)}}function r(){var e=t.activeElement;return e=e&&e!==t.body?t.querySelector(":focus"):null}function a(e){return e.keyCode?e.keyCode:e.which}function o(e){for(var t in Ue.buttons){var n=Ue.buttons[t];if(O.nodeList(n))for(var r=0;r0)&&(t?xe(n):we(n)),(e.deltaY>0||e.deltaX<0)&&(t?we(n):xe(n))})}function Re(){if(g(Ue.media,"timeupdate seeking",Ie),g(Ue.media,"timeupdate",W),g(Ue.media,"durationchange loadedmetadata",Ae),g(Ue.media,"ended",function(){"video"===Ue.type&&E.showPosterOnEnd&&("video"===Ue.type&&H(),me(),Ue.media.load())}),g(Ue.media,"progress playing",Ee),g(Ue.media,"volumechange",Te),g(Ue.media,"play pause ended",ye),g(Ue.media,"waiting canplay seeked",_e),E.clickToPlay&&"audio"!==Ue.type){var e=U("."+E.classes.videoWrapper);if(!e)return;e.style.cursor="pointer",g(e,"click",function(){E.hideControls&&Ue.browser.isTouch&&!Ue.media.paused||(Ue.media.paused?le():Ue.media.ended?(me(),le()):ue())})}E.disableContextMenu&&g(Ue.media,"contextmenu",function(e){e.preventDefault()}),g(Ue.media,E.events.concat(["keyup","keydown"]).join(" "),function(e){A(Ue.container,e.type,!0)})}function qe(){if(s(E.types.html5,Ue.type)){for(var e=Ue.media.querySelectorAll("source"),t=0;t=10&&(c=!0);break;case"soundcloud":u=!0,c=!a&&!o;break;default:u=i&&l,c=u&&!a}return{basic:u,full:c}}function A(e,n){function r(e,t){f(t,M.classes.hook)||a.push({target:e,media:t})}var a=[],s=[],o=[M.selectors.html5,M.selectors.embed].join(",");if(O.string(e)?e=t.querySelectorAll(e):O.htmlElement(e)?e=[e]:O.nodeList(e)||O.array(e)||O.string(e)||(O.undefined(n)&&O.object(e)&&(n=e),e=t.querySelectorAll(o)),O.nodeList(e)&&(e=Array.prototype.slice.call(e)),!F().basic||!e.length)return!1;for(var i=0;i \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/web/compress.ftl b/release/file-preview-service/WEB-INF/classes/web/compress.ftl new file mode 100644 index 0000000..e6ea7fb --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/compress.ftl @@ -0,0 +1,106 @@ + + + + + + + + + +
+
    +
    + + + + + \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/web/doc.ftl b/release/file-preview-service/WEB-INF/classes/web/doc.ftl new file mode 100644 index 0000000..4d4d3cf --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/doc.ftl @@ -0,0 +1,9 @@ + + + + + +${doc} + + + \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/web/docxConvert.ftl b/release/file-preview-service/WEB-INF/classes/web/docxConvert.ftl new file mode 100644 index 0000000..3b2ad7d --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/docxConvert.ftl @@ -0,0 +1,11 @@ + + + + + + +${docxConvert} + + + + \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/web/fileNotSupported.ftl b/release/file-preview-service/WEB-INF/classes/web/fileNotSupported.ftl new file mode 100644 index 0000000..eb40ac8 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/fileNotSupported.ftl @@ -0,0 +1,40 @@ + + + + + + + +
    + + + 该文件类型(${fileType})系统暂时不支持在线预览 + 如有需要请联系@陈星星 + +
    + + + diff --git a/release/file-preview-service/WEB-INF/classes/web/html.ftl b/release/file-preview-service/WEB-INF/classes/web/html.ftl new file mode 100644 index 0000000..148dcaf --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/html.ftl @@ -0,0 +1,26 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/web/index.ftl b/release/file-preview-service/WEB-INF/classes/web/index.ftl new file mode 100644 index 0000000..927877a --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/index.ftl @@ -0,0 +1,175 @@ + + + + + 图片预览图 + + + + + + + + +

    相信就能看见,有梦想就有蓝天 蓝星花的博客

    +


    +

    文件预览项目接入和测试界面

    +
    +
    + +
    +
    +
    + 如果你的项目需要接入文件预览项目,达到对docx、excel、ppt、jpg等文件的预览效果,那么通过在你的项目中加入下面的代码就可以 + 成功实现: +
    +    $scope.openWin = function (fileUrl) {
    +        var url = configuration.previewUrl + encodeURIComponent(fileUrl);
    +        var winHeight = window.document.documentElement.clientHeight-10;
    +        $window.open(url, "_blank", "height=" + winHeight
    +            + ",top=80,left=80,toolbar=no, menubar=no, scrollbars=yes, resizable=yes");
    +    };
    +
    +
    +
    + 新增多图片同时预览功能,接口如下: +
    +    var fileUrl =url1+"|"+"url2";//多文件使用“|”字符隔开
    +    var url = "http://localhost:8012/picturesPreview?urls" + encodeURIComponent(fileUrl);
    +    var winHeight = window.document.documentElement.clientHeight-10;
    +    $window.open(url, "_blank", "height=" + winHeight
    +            + ",top=80,left=80,toolbar=no, menubar=no, scrollbars=yes, resizable=yes");
    +
    +
    +
    +
    +
    +
    + +
    +
    +

    因为是测试所以一种文件只允许上传一个

    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + diff --git a/release/file-preview-service/WEB-INF/classes/web/media.ftl b/release/file-preview-service/WEB-INF/classes/web/media.ftl new file mode 100644 index 0000000..2eef250 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/media.ftl @@ -0,0 +1,24 @@ + + + + + 多媒体文件预览 + + + + +
    + +
    + + + + + diff --git a/release/file-preview-service/WEB-INF/classes/web/pdf.ftl b/release/file-preview-service/WEB-INF/classes/web/pdf.ftl new file mode 100644 index 0000000..665a01c --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/pdf.ftl @@ -0,0 +1,31 @@ + + + + + + + + <#if pdfUrl?contains("http://")> + <#assign finalUrl="${pdfUrl}"> + <#else> + <#assign finalUrl="${baseUrl}${pdfUrl}"> + + + + + \ No newline at end of file diff --git a/release/file-preview-service/WEB-INF/classes/web/picture.ftl b/release/file-preview-service/WEB-INF/classes/web/picture.ftl new file mode 100644 index 0000000..47da16c --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/picture.ftl @@ -0,0 +1,30 @@ + + + + + 图片预览图 + + + + +
      + <#list imgurls as img> +
    • + +
    + + + + + diff --git a/release/file-preview-service/WEB-INF/classes/web/txt.ftl b/release/file-preview-service/WEB-INF/classes/web/txt.ftl new file mode 100644 index 0000000..6055504 --- /dev/null +++ b/release/file-preview-service/WEB-INF/classes/web/txt.ftl @@ -0,0 +1,18 @@ + + + + + 普通文件预览 + + + + + + + + + + + diff --git a/release/file-preview-service/WEB-INF/lib/antlr-2.7.7.jar b/release/file-preview-service/WEB-INF/lib/antlr-2.7.7.jar new file mode 100644 index 0000000..5e5f14b Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/antlr-2.7.7.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/byte-buddy-1.4.26.jar b/release/file-preview-service/WEB-INF/lib/byte-buddy-1.4.26.jar new file mode 100644 index 0000000..6402aaa Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/byte-buddy-1.4.26.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/cache-api-1.0.0.jar b/release/file-preview-service/WEB-INF/lib/cache-api-1.0.0.jar new file mode 100644 index 0000000..74c0ed2 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/cache-api-1.0.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/classmate-1.3.4.jar b/release/file-preview-service/WEB-INF/lib/classmate-1.3.4.jar new file mode 100644 index 0000000..5be6d99 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/classmate-1.3.4.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/commons-cli-1.2.jar b/release/file-preview-service/WEB-INF/lib/commons-cli-1.2.jar new file mode 100644 index 0000000..ce4b9ff Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/commons-cli-1.2.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/commons-codec-1.10.jar b/release/file-preview-service/WEB-INF/lib/commons-codec-1.10.jar new file mode 100644 index 0000000..1d7417c Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/commons-codec-1.10.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/commons-compress-1.9.jar b/release/file-preview-service/WEB-INF/lib/commons-compress-1.9.jar new file mode 100644 index 0000000..14e7e86 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/commons-compress-1.9.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/commons-io-2.4.jar b/release/file-preview-service/WEB-INF/lib/commons-io-2.4.jar new file mode 100644 index 0000000..90035a4 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/commons-io-2.4.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/commons-logging-1.1.1.jar b/release/file-preview-service/WEB-INF/lib/commons-logging-1.1.1.jar new file mode 100644 index 0000000..1deef14 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/commons-logging-1.1.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/commons-logging-api-1.1.jar b/release/file-preview-service/WEB-INF/lib/commons-logging-api-1.1.jar new file mode 100644 index 0000000..d1abcbb Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/commons-logging-api-1.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/commons-vfs2-2.0.jar b/release/file-preview-service/WEB-INF/lib/commons-vfs2-2.0.jar new file mode 100644 index 0000000..5e1b0b4 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/commons-vfs2-2.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/dom4j-1.6.1.jar b/release/file-preview-service/WEB-INF/lib/dom4j-1.6.1.jar new file mode 100644 index 0000000..c8c4dbb Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/dom4j-1.6.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.converter-1.0.5.jar b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.converter-1.0.5.jar new file mode 100644 index 0000000..0e1adae Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.converter-1.0.5.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.core-1.0.5.jar b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.core-1.0.5.jar new file mode 100644 index 0000000..2a0a123 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.core-1.0.5.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.document-1.0.5.jar b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.document-1.0.5.jar new file mode 100644 index 0000000..edef774 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.document-1.0.5.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.template-1.0.5.jar b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.template-1.0.5.jar new file mode 100644 index 0000000..9fd04bf Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/fr.opensagres.xdocreport.template-1.0.5.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/freemarker-2.3.26-incubating.jar b/release/file-preview-service/WEB-INF/lib/freemarker-2.3.26-incubating.jar new file mode 100644 index 0000000..9f70a14 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/freemarker-2.3.26-incubating.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/guava-19.0.jar b/release/file-preview-service/WEB-INF/lib/guava-19.0.jar new file mode 100644 index 0000000..b175ca8 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/guava-19.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/hibernate-validator-5.3.5.Final.jar b/release/file-preview-service/WEB-INF/lib/hibernate-validator-5.3.5.Final.jar new file mode 100644 index 0000000..9d1157a Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/hibernate-validator-5.3.5.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jackson-annotations-2.8.0.jar b/release/file-preview-service/WEB-INF/lib/jackson-annotations-2.8.0.jar new file mode 100644 index 0000000..d19b67b Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jackson-annotations-2.8.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jackson-core-2.8.10.jar b/release/file-preview-service/WEB-INF/lib/jackson-core-2.8.10.jar new file mode 100644 index 0000000..700b3c1 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jackson-core-2.8.10.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jackson-databind-2.8.10.jar b/release/file-preview-service/WEB-INF/lib/jackson-databind-2.8.10.jar new file mode 100644 index 0000000..a3bd94d Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jackson-databind-2.8.10.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jackson-dataformat-yaml-2.8.10.jar b/release/file-preview-service/WEB-INF/lib/jackson-dataformat-yaml-2.8.10.jar new file mode 100644 index 0000000..b100508 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jackson-dataformat-yaml-2.8.10.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jboss-logging-3.3.1.Final.jar b/release/file-preview-service/WEB-INF/lib/jboss-logging-3.3.1.Final.jar new file mode 100644 index 0000000..cb66fde Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jboss-logging-3.3.1.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jchardet-1.0.jar b/release/file-preview-service/WEB-INF/lib/jchardet-1.0.jar new file mode 100644 index 0000000..c362d03 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jchardet-1.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jcl-over-slf4j-1.7.25.jar b/release/file-preview-service/WEB-INF/lib/jcl-over-slf4j-1.7.25.jar new file mode 100644 index 0000000..8e7fec8 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jcl-over-slf4j-1.7.25.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jodconverter-core-1.0.0.jar b/release/file-preview-service/WEB-INF/lib/jodconverter-core-1.0.0.jar new file mode 100644 index 0000000..eb0308f Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jodconverter-core-1.0.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jodd-bean-3.7.1.jar b/release/file-preview-service/WEB-INF/lib/jodd-bean-3.7.1.jar new file mode 100644 index 0000000..b7973c1 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jodd-bean-3.7.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jodd-core-3.7.1.jar b/release/file-preview-service/WEB-INF/lib/jodd-core-3.7.1.jar new file mode 100644 index 0000000..5a1f68f Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jodd-core-3.7.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/juh-3.2.1.jar b/release/file-preview-service/WEB-INF/lib/juh-3.2.1.jar new file mode 100644 index 0000000..423a907 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/juh-3.2.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jul-to-slf4j-1.7.25.jar b/release/file-preview-service/WEB-INF/lib/jul-to-slf4j-1.7.25.jar new file mode 100644 index 0000000..98d9668 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jul-to-slf4j-1.7.25.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/junrar-0.7.jar b/release/file-preview-service/WEB-INF/lib/junrar-0.7.jar new file mode 100644 index 0000000..2b6817c Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/junrar-0.7.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/jurt-3.2.1.jar b/release/file-preview-service/WEB-INF/lib/jurt-3.2.1.jar new file mode 100644 index 0000000..a71926b Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/jurt-3.2.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/log4j-over-slf4j-1.7.25.jar b/release/file-preview-service/WEB-INF/lib/log4j-over-slf4j-1.7.25.jar new file mode 100644 index 0000000..ba241a4 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/log4j-over-slf4j-1.7.25.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/logback-classic-1.1.11.jar b/release/file-preview-service/WEB-INF/lib/logback-classic-1.1.11.jar new file mode 100644 index 0000000..22a4f43 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/logback-classic-1.1.11.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/logback-core-1.1.11.jar b/release/file-preview-service/WEB-INF/lib/logback-core-1.1.11.jar new file mode 100644 index 0000000..1dae393 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/logback-core-1.1.11.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/logstash-logback-encoder-4.11.jar b/release/file-preview-service/WEB-INF/lib/logstash-logback-encoder-4.11.jar new file mode 100644 index 0000000..469f3d2 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/logstash-logback-encoder-4.11.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/maven-scm-api-1.4.jar b/release/file-preview-service/WEB-INF/lib/maven-scm-api-1.4.jar new file mode 100644 index 0000000..728104a Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/maven-scm-api-1.4.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/maven-scm-provider-svn-commons-1.4.jar b/release/file-preview-service/WEB-INF/lib/maven-scm-provider-svn-commons-1.4.jar new file mode 100644 index 0000000..12ac966 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/maven-scm-provider-svn-commons-1.4.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/maven-scm-provider-svnexe-1.4.jar b/release/file-preview-service/WEB-INF/lib/maven-scm-provider-svnexe-1.4.jar new file mode 100644 index 0000000..a2a28f5 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/maven-scm-provider-svnexe-1.4.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/netty-buffer-4.0.42.Final.jar b/release/file-preview-service/WEB-INF/lib/netty-buffer-4.0.42.Final.jar new file mode 100644 index 0000000..7e15f9d Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/netty-buffer-4.0.42.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/netty-codec-4.0.42.Final.jar b/release/file-preview-service/WEB-INF/lib/netty-codec-4.0.42.Final.jar new file mode 100644 index 0000000..55a5a82 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/netty-codec-4.0.42.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/netty-common-4.0.42.Final.jar b/release/file-preview-service/WEB-INF/lib/netty-common-4.0.42.Final.jar new file mode 100644 index 0000000..d7739cd Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/netty-common-4.0.42.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/netty-handler-4.0.42.Final.jar b/release/file-preview-service/WEB-INF/lib/netty-handler-4.0.42.Final.jar new file mode 100644 index 0000000..2e75e9d Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/netty-handler-4.0.42.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/netty-transport-4.0.42.Final.jar b/release/file-preview-service/WEB-INF/lib/netty-transport-4.0.42.Final.jar new file mode 100644 index 0000000..f74c744 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/netty-transport-4.0.42.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/ooxml-schemas-1.1.jar b/release/file-preview-service/WEB-INF/lib/ooxml-schemas-1.1.jar new file mode 100644 index 0000000..1bf4693 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/ooxml-schemas-1.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/org.apache.poi.xwpf.converter.core-1.0.5.jar b/release/file-preview-service/WEB-INF/lib/org.apache.poi.xwpf.converter.core-1.0.5.jar new file mode 100644 index 0000000..70dcef2 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/org.apache.poi.xwpf.converter.core-1.0.5.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/org.apache.poi.xwpf.converter.xhtml-1.0.5.jar b/release/file-preview-service/WEB-INF/lib/org.apache.poi.xwpf.converter.xhtml-1.0.5.jar new file mode 100644 index 0000000..8b65085 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/org.apache.poi.xwpf.converter.xhtml-1.0.5.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/plexus-utils-1.5.6.jar b/release/file-preview-service/WEB-INF/lib/plexus-utils-1.5.6.jar new file mode 100644 index 0000000..ed6104e Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/plexus-utils-1.5.6.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/poi-3.12.jar b/release/file-preview-service/WEB-INF/lib/poi-3.12.jar new file mode 100644 index 0000000..a4f4263 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/poi-3.12.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/poi-ooxml-3.10-FINAL.jar b/release/file-preview-service/WEB-INF/lib/poi-ooxml-3.10-FINAL.jar new file mode 100644 index 0000000..0782b07 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/poi-ooxml-3.10-FINAL.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/poi-scratchpad-3.12.jar b/release/file-preview-service/WEB-INF/lib/poi-scratchpad-3.12.jar new file mode 100644 index 0000000..941f5b4 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/poi-scratchpad-3.12.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/reactive-streams-1.0.0.jar b/release/file-preview-service/WEB-INF/lib/reactive-streams-1.0.0.jar new file mode 100644 index 0000000..fe6b283 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/reactive-streams-1.0.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/reactor-core-2.0.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/reactor-core-2.0.8.RELEASE.jar new file mode 100644 index 0000000..42b24c5 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/reactor-core-2.0.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/reactor-stream-2.0.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/reactor-stream-2.0.8.RELEASE.jar new file mode 100644 index 0000000..24abf55 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/reactor-stream-2.0.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/redisson-3.2.0.jar b/release/file-preview-service/WEB-INF/lib/redisson-3.2.0.jar new file mode 100644 index 0000000..a88aefc Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/redisson-3.2.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/regexp-1.3.jar b/release/file-preview-service/WEB-INF/lib/regexp-1.3.jar new file mode 100644 index 0000000..d653a38 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/regexp-1.3.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/ridl-3.2.1.jar b/release/file-preview-service/WEB-INF/lib/ridl-3.2.1.jar new file mode 100644 index 0000000..d232514 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/ridl-3.2.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/slf4j-api-1.7.25.jar b/release/file-preview-service/WEB-INF/lib/slf4j-api-1.7.25.jar new file mode 100644 index 0000000..0143c09 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/slf4j-api-1.7.25.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/snakeyaml-1.17.jar b/release/file-preview-service/WEB-INF/lib/snakeyaml-1.17.jar new file mode 100644 index 0000000..b0372a3 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/snakeyaml-1.17.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-aop-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-aop-4.3.12.RELEASE.jar new file mode 100644 index 0000000..47204bb Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-aop-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-beans-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-beans-4.3.12.RELEASE.jar new file mode 100644 index 0000000..175b87d Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-beans-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-boot-1.5.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-boot-1.5.8.RELEASE.jar new file mode 100644 index 0000000..adabf8b Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-boot-1.5.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-boot-autoconfigure-1.5.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-boot-autoconfigure-1.5.8.RELEASE.jar new file mode 100644 index 0000000..c5ee6b9 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-boot-autoconfigure-1.5.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-boot-starter-1.5.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-1.5.8.RELEASE.jar new file mode 100644 index 0000000..cd37c45 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-1.5.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-boot-starter-freemarker-1.5.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-freemarker-1.5.8.RELEASE.jar new file mode 100644 index 0000000..6114613 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-freemarker-1.5.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-boot-starter-logging-1.5.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-logging-1.5.8.RELEASE.jar new file mode 100644 index 0000000..2ebef7d Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-logging-1.5.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-boot-starter-tomcat-1.5.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-tomcat-1.5.8.RELEASE.jar new file mode 100644 index 0000000..b428e1e Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-tomcat-1.5.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-boot-starter-web-1.5.8.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-web-1.5.8.RELEASE.jar new file mode 100644 index 0000000..892d743 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-boot-starter-web-1.5.8.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-context-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-context-4.3.12.RELEASE.jar new file mode 100644 index 0000000..9ef9e16 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-context-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-context-support-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-context-support-4.3.12.RELEASE.jar new file mode 100644 index 0000000..1d2edf5 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-context-support-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-core-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-core-4.3.12.RELEASE.jar new file mode 100644 index 0000000..d2e6a0a Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-core-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-expression-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-expression-4.3.12.RELEASE.jar new file mode 100644 index 0000000..e3b19ee Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-expression-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-web-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-web-4.3.12.RELEASE.jar new file mode 100644 index 0000000..4b2a35b Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-web-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/spring-webmvc-4.3.12.RELEASE.jar b/release/file-preview-service/WEB-INF/lib/spring-webmvc-4.3.12.RELEASE.jar new file mode 100644 index 0000000..e8997a1 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/spring-webmvc-4.3.12.RELEASE.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/stax-api-1.0.1.jar b/release/file-preview-service/WEB-INF/lib/stax-api-1.0.1.jar new file mode 100644 index 0000000..d9a1665 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/stax-api-1.0.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/tomcat-annotations-api-8.5.23.jar b/release/file-preview-service/WEB-INF/lib/tomcat-annotations-api-8.5.23.jar new file mode 100644 index 0000000..b7103a3 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/tomcat-annotations-api-8.5.23.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/tomcat-embed-core-8.5.23.jar b/release/file-preview-service/WEB-INF/lib/tomcat-embed-core-8.5.23.jar new file mode 100644 index 0000000..0f5ce12 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/tomcat-embed-core-8.5.23.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/tomcat-embed-el-8.5.23.jar b/release/file-preview-service/WEB-INF/lib/tomcat-embed-el-8.5.23.jar new file mode 100644 index 0000000..b7041e9 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/tomcat-embed-el-8.5.23.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/tomcat-embed-websocket-8.5.23.jar b/release/file-preview-service/WEB-INF/lib/tomcat-embed-websocket-8.5.23.jar new file mode 100644 index 0000000..3585102 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/tomcat-embed-websocket-8.5.23.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/unoil-3.2.1.jar b/release/file-preview-service/WEB-INF/lib/unoil-3.2.1.jar new file mode 100644 index 0000000..e5bd96c Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/unoil-3.2.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/validation-api-1.1.0.Final.jar b/release/file-preview-service/WEB-INF/lib/validation-api-1.1.0.Final.jar new file mode 100644 index 0000000..de85403 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/validation-api-1.1.0.Final.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/xml-apis-1.4.01.jar b/release/file-preview-service/WEB-INF/lib/xml-apis-1.4.01.jar new file mode 100644 index 0000000..4673346 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/xml-apis-1.4.01.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/xmlbeans-2.3.0.jar b/release/file-preview-service/WEB-INF/lib/xmlbeans-2.3.0.jar new file mode 100644 index 0000000..ccd8163 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/xmlbeans-2.3.0.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/xpp3_min-1.1.4c.jar b/release/file-preview-service/WEB-INF/lib/xpp3_min-1.1.4c.jar new file mode 100644 index 0000000..813a9a8 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/xpp3_min-1.1.4c.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/xstream-1.3.1.jar b/release/file-preview-service/WEB-INF/lib/xstream-1.3.1.jar new file mode 100644 index 0000000..4ef4219 Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/xstream-1.3.1.jar differ diff --git a/release/file-preview-service/WEB-INF/lib/zero-allocation-hashing-0.5.jar b/release/file-preview-service/WEB-INF/lib/zero-allocation-hashing-0.5.jar new file mode 100644 index 0000000..596eb4f Binary files /dev/null and b/release/file-preview-service/WEB-INF/lib/zero-allocation-hashing-0.5.jar differ diff --git a/release/file-preview-service/file-preview-service.war b/release/file-preview-service/file-preview-service.war new file mode 100644 index 0000000..f6a4ab7 Binary files /dev/null and b/release/file-preview-service/file-preview-service.war differ diff --git a/release/file-preview-service/org/springframework/boot/loader/ExecutableArchiveLauncher$1.class b/release/file-preview-service/org/springframework/boot/loader/ExecutableArchiveLauncher$1.class new file mode 100644 index 0000000..d01a3cf Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/ExecutableArchiveLauncher$1.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/ExecutableArchiveLauncher.class b/release/file-preview-service/org/springframework/boot/loader/ExecutableArchiveLauncher.class new file mode 100644 index 0000000..bae01af Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/ExecutableArchiveLauncher.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/JarLauncher.class b/release/file-preview-service/org/springframework/boot/loader/JarLauncher.class new file mode 100644 index 0000000..55fcb81 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/JarLauncher.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/LaunchedURLClassLoader$1.class b/release/file-preview-service/org/springframework/boot/loader/LaunchedURLClassLoader$1.class new file mode 100644 index 0000000..3771dd5 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/LaunchedURLClassLoader$1.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/LaunchedURLClassLoader.class b/release/file-preview-service/org/springframework/boot/loader/LaunchedURLClassLoader.class new file mode 100644 index 0000000..44b6f20 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/LaunchedURLClassLoader.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/Launcher.class b/release/file-preview-service/org/springframework/boot/loader/Launcher.class new file mode 100644 index 0000000..bac4878 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/Launcher.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/MainMethodRunner.class b/release/file-preview-service/org/springframework/boot/loader/MainMethodRunner.class new file mode 100644 index 0000000..05f6369 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/MainMethodRunner.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$1.class b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$1.class new file mode 100644 index 0000000..b7a2204 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$1.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class new file mode 100644 index 0000000..7ad9c7c Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class new file mode 100644 index 0000000..d78a735 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher.class b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher.class new file mode 100644 index 0000000..7816062 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/PropertiesLauncher.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/WarLauncher.class b/release/file-preview-service/org/springframework/boot/loader/WarLauncher.class new file mode 100644 index 0000000..fea7ff3 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/WarLauncher.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/Archive$Entry.class b/release/file-preview-service/org/springframework/boot/loader/archive/Archive$Entry.class new file mode 100644 index 0000000..3313486 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/Archive$Entry.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/Archive$EntryFilter.class b/release/file-preview-service/org/springframework/boot/loader/archive/Archive$EntryFilter.class new file mode 100644 index 0000000..b01a633 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/Archive$EntryFilter.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/Archive.class b/release/file-preview-service/org/springframework/boot/loader/archive/Archive.class new file mode 100644 index 0000000..45bbe94 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/Archive.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$1.class b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$1.class new file mode 100644 index 0000000..86b5b27 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$1.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class new file mode 100644 index 0000000..80c9cd8 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator$EntryComparator.class b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator$EntryComparator.class new file mode 100644 index 0000000..91fabfd Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator$EntryComparator.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator.class b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator.class new file mode 100644 index 0000000..1673e85 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive.class b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive.class new file mode 100644 index 0000000..2dc2977 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/ExplodedArchive.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class b/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class new file mode 100644 index 0000000..5a3b870 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class b/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class new file mode 100644 index 0000000..1bdca25 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive.class b/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive.class new file mode 100644 index 0000000..7b59fd3 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/archive/JarFileArchive.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/data/ByteArrayRandomAccessData.class b/release/file-preview-service/org/springframework/boot/loader/data/ByteArrayRandomAccessData.class new file mode 100644 index 0000000..9899820 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/data/ByteArrayRandomAccessData.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessData$ResourceAccess.class b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessData$ResourceAccess.class new file mode 100644 index 0000000..008788e Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessData$ResourceAccess.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessData.class b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessData.class new file mode 100644 index 0000000..9149938 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessData.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class new file mode 100644 index 0000000..f5a2d6f Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile$FilePool.class b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile$FilePool.class new file mode 100644 index 0000000..cce760c Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile$FilePool.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile.class b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile.class new file mode 100644 index 0000000..df1d23c Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/data/RandomAccessDataFile.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/AsciiBytes.class b/release/file-preview-service/org/springframework/boot/loader/jar/AsciiBytes.class new file mode 100644 index 0000000..62cffce Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/AsciiBytes.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/Bytes.class b/release/file-preview-service/org/springframework/boot/loader/jar/Bytes.class new file mode 100644 index 0000000..5087ba2 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/Bytes.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class new file mode 100644 index 0000000..fed7346 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class new file mode 100644 index 0000000..07b2b67 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryParser.class b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryParser.class new file mode 100644 index 0000000..98d859d Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryParser.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryVisitor.class b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryVisitor.class new file mode 100644 index 0000000..eceb543 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/CentralDirectoryVisitor.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/FileHeader.class b/release/file-preview-service/org/springframework/boot/loader/jar/FileHeader.class new file mode 100644 index 0000000..885f531 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/FileHeader.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/Handler.class b/release/file-preview-service/org/springframework/boot/loader/jar/Handler.class new file mode 100644 index 0000000..9666210 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/Handler.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarEntry.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarEntry.class new file mode 100644 index 0000000..10f5d11 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarEntry.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarEntryFilter.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarEntryFilter.class new file mode 100644 index 0000000..5989633 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarEntryFilter.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$1.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$1.class new file mode 100644 index 0000000..540af36 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$1.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$2.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$2.class new file mode 100644 index 0000000..7ee1a1d Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$2.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$3.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$3.class new file mode 100644 index 0000000..645f73c Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$3.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$JarFileType.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$JarFileType.class new file mode 100644 index 0000000..f5dfc7e Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile$JarFileType.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFile.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile.class new file mode 100644 index 0000000..f3d5698 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFile.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries$1.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries$1.class new file mode 100644 index 0000000..d565447 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries$1.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class new file mode 100644 index 0000000..902aa9b Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries.class new file mode 100644 index 0000000..ca95120 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarFileEntries.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection$1.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection$1.class new file mode 100644 index 0000000..9d6ccf8 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection$1.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class new file mode 100644 index 0000000..1657514 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection.class b/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection.class new file mode 100644 index 0000000..b859321 Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/JarURLConnection.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/jar/ZipInflaterInputStream.class b/release/file-preview-service/org/springframework/boot/loader/jar/ZipInflaterInputStream.class new file mode 100644 index 0000000..4f7bd9c Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/jar/ZipInflaterInputStream.class differ diff --git a/release/file-preview-service/org/springframework/boot/loader/util/SystemPropertyUtils.class b/release/file-preview-service/org/springframework/boot/loader/util/SystemPropertyUtils.class new file mode 100644 index 0000000..a7fddae Binary files /dev/null and b/release/file-preview-service/org/springframework/boot/loader/util/SystemPropertyUtils.class differ diff --git a/release/start-file-preview-service.bat b/release/start-file-preview-service.bat new file mode 100644 index 0000000..05b2de8 --- /dev/null +++ b/release/start-file-preview-service.bat @@ -0,0 +1,3 @@ +@echo off +chcp 65001 +java -jar file-preview-service/file-preview-service.war \ No newline at end of file diff --git a/基于 HDFS 的分布式团队网盘系统结题答辩.pptx b/基于 HDFS 的分布式团队网盘系统结题答辩.pptx new file mode 100644 index 0000000..cd3fe8f Binary files /dev/null and b/基于 HDFS 的分布式团队网盘系统结题答辩.pptx differ diff --git a/测试计划说明.doc b/测试计划说明.doc new file mode 100644 index 0000000..875facb Binary files /dev/null and b/测试计划说明.doc differ diff --git a/软件测试验收报告.doc b/软件测试验收报告.doc new file mode 100644 index 0000000..c71cc31 Binary files /dev/null and b/软件测试验收报告.doc differ diff --git a/集成测试.docx b/集成测试.docx new file mode 100644 index 0000000..8b060c1 Binary files /dev/null and b/集成测试.docx differ