diff --git a/.jshintignore b/.jshintignore index 1d7c897db..de77cc86c 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,11 +1,5 @@ node_modules/ www/bower_components/ -www/common/less.min.js -www/common/pdfjs/ -www/common/tippy/ -www/common/textFit.min.js -www/common/highlight/ -www/common/jquery-ui/ www/common/onlyoffice/sdkjs www/common/onlyoffice/web-apps www/common/onlyoffice/x2t @@ -14,7 +8,6 @@ www/common/onlyoffice/v2* www/common/onlyoffice/v4 server.js -www/common/old-media-tag.js www/scratch www/accounts www/lib diff --git a/bower.json b/bower.json index 82a9931ea..efa70c1bb 100644 --- a/bower.json +++ b/bower.json @@ -36,7 +36,6 @@ "alertifyjs": "1.0.11", "scrypt-async": "1.2.0", "require-css": "0.1.10", - "less": "3.7.1", "bootstrap": "^v4.0.0", "diff-dom": "2.1.1", "nthen": "0.1.7", diff --git a/customize.dist/pages/index.js b/customize.dist/pages/index.js index 8ea334667..ac37ac104 100644 --- a/customize.dist/pages/index.js +++ b/customize.dist/pages/index.js @@ -5,7 +5,7 @@ define([ '/common/common-feedback.js', '/common/common-interface.js', '/common/common-hash.js', - '/common/textFit.min.js', + '/lib/textFit.min.js', '/customize/messages.js', '/customize/application_config.js', '/common/outer/local-store.js', @@ -67,6 +67,7 @@ define([ icons.forEach(function (a) { setTimeout(function () { + // ensure that text in our app icons doesn't overflow TextFit($(a).find('.pad-button-text')[0], {minFontSize: 13, maxFontSize: 18}); }); }); diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js index df46f344c..a10936644 100644 --- a/www/common/LessLoader.js +++ b/www/common/LessLoader.js @@ -110,7 +110,7 @@ define([ if (lessEngine) { cb(lessEngine); } else { - require(['/common/less.min.js'], function (Less) { + require(['/lib/less.min.js'], function (Less) { if (lessEngine) { return void cb(lessEngine); } lessEngine = Less; Less.functions.functionRegistry.add('LessLoader_currentFile', function () { diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 5aea35c78..588fdf5fa 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -15,15 +15,15 @@ define([ '/common/common-notifier.js', '/customize/application_config.js', '/bower_components/alertifyjs/dist/js/alertify.js', - '/common/tippy/tippy.min.js', + '/lib/tippy/tippy.min.js', '/common/hyperscript.js', '/customize/loading.js', '/common/test.js', - '/common/jquery-ui/jquery-ui.min.js', + '/lib/jquery-ui/jquery-ui.min.js', // autocomplete widget '/bower_components/bootstrap-tokenfield/dist/bootstrap-tokenfield.js', - 'css!/common/tippy/tippy.css', - 'css!/common/jquery-ui/jquery-ui.min.css' + 'css!/lib/tippy/tippy.css', + 'css!/lib/jquery-ui/jquery-ui.min.css' ], function ($, Messages, Util, Hash, Notifier, AppConfig, Alertify, Tippy, h, Loading, Test) { var UI = {}; diff --git a/www/common/common-thumbnail.js b/www/common/common-thumbnail.js index 012c2c9b4..01e89e5d1 100644 --- a/www/common/common-thumbnail.js +++ b/www/common/common-thumbnail.js @@ -145,7 +145,7 @@ define([ video.src = url; }; Thumb.fromPdfBlob = function (blob, cb) { - require.config({paths: {'pdfjs-dist': '/common/pdfjs'}}); + require.config({paths: {'pdfjs-dist': '/lib/pdfjs'}}); require(['pdfjs-dist/build/pdf'], function (PDFJS) { var url = URL.createObjectURL(blob); var makeThumb = function (page) { diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index 0fe8aed0a..1f62f27f1 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -8,13 +8,13 @@ define([ '/common/inner/common-mediatag.js', '/common/media-tag.js', '/customize/messages.js', - '/common/less.min.js', + '/lib/less.min.js', '/customize/pages.js', - '/common/highlight/highlight.pack.js', + '/lib/highlight/highlight.pack.js', '/lib/diff-dom/diffDOM.js', '/bower_components/tweetnacl/nacl-fast.min.js', - 'css!/common/highlight/styles/'+ (window.CryptPad_theme === 'dark' ? 'dark.css' : 'github.css') + 'css!/lib/highlight/styles/'+ (window.CryptPad_theme === 'dark' ? 'dark.css' : 'github.css') ],function ($, ApiConfig, Marked, Hash, Util, h, MT, MediaTag, Messages, Less, Pages) { var DiffMd = {}; @@ -424,7 +424,7 @@ define([ // Only allow iframe, video and audio with local source var checkSrc = function (root) { if (restrictedTags.indexOf(root.nodeName.toUpperCase()) === -1) { return true; } - return root.getAttribute && /^(blob\:|\/common\/pdfjs)/.test(root.getAttribute('src')); + return root.getAttribute && /^(blob\:|\/lib\/pdfjs)/.test(root.getAttribute('src')); }; var removeForbiddenTags = function (root) { diff --git a/www/common/inner/common-mediatag.js b/www/common/inner/common-mediatag.js index b8550fcac..1d88e1029 100644 --- a/www/common/inner/common-mediatag.js +++ b/www/common/inner/common-mediatag.js @@ -20,7 +20,7 @@ define([ // This file is loaded by sframe-common so the following config is used in all the inner apps if (MediaTag) { MediaTag.setDefaultConfig('pdf', { - viewer: '/common/pdfjs/web/viewer.html' + viewer: '/lib/pdfjs/web/viewer.html' }); MediaTag.setDefaultConfig('download', { text: Messages.mediatag_saveButton, diff --git a/www/common/requireconfig.js b/www/common/requireconfig.js index 1689c0527..4e3baf857 100644 --- a/www/common/requireconfig.js +++ b/www/common/requireconfig.js @@ -13,8 +13,6 @@ define([ "mermaid": "/code/mermaid.min", // json.sortify same "json.sortify": "/bower_components/json.sortify/dist/JSON.sortify", - //"pdfjs-dist/build/pdf": "/bower_components/pdfjs-dist/build/pdf", - //"pdfjs-dist/build/pdf.worker": "/bower_components/pdfjs-dist/build/pdf.worker" cm: '/bower_components/codemirror', 'tui-code-snippet': '/lib/calendar/tui-code-snippet.min', 'tui-date-picker': '/lib/calendar/date-picker', diff --git a/www/common/textFit.min.js b/www/common/textFit.min.js deleted file mode 100644 index f6ce43954..000000000 --- a/www/common/textFit.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define([],factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.textFit=factory()}})(typeof global==="object"?global:this,function(){"use strict";var defaultSettings={alignVert:false,alignHoriz:false,multiLine:false,detectMultiLine:true,minFontSize:6,maxFontSize:80,reProcess:true,widthOnly:false,alignVertWithFlexbox:false};return function textFit(els,options){if(!options)options={};var settings={};for(var key in defaultSettings){if(options.hasOwnProperty(key)){settings[key]=options[key]}else{settings[key]=defaultSettings[key]}}if(typeof els.toArray==="function"){els=els.toArray()}var elType=Object.prototype.toString.call(els);if(elType!=="[object Array]"&&elType!=="[object NodeList]"&&elType!=="[object HTMLCollection]"){els=[els]}for(var i=0;i=parseInt(window.getComputedStyle(innerSpan)["font-size"],10)*2){multiLine=true}if(!multiLine){el.style["white-space"]="nowrap"}low=settings.minFontSize+1;high=settings.maxFontSize+1;while(low<=high){mid=parseInt((low+high)/2,10);innerSpan.style.fontSize=mid+"px";if(innerSpan.scrollWidth<=originalWidth&&(settings.widthOnly||innerSpan.scrollHeight<=originalHeight)){low=mid+1}else{high=mid-1}}innerSpan.style.fontSize=mid-1+"px";if(settings.alignVert){addStyleSheet();var height=innerSpan.scrollHeight;if(window.getComputedStyle(el)["position"]==="static"){el.style["position"]="relative"}if(!hasClass(innerSpan,"textFitAlignVert")){innerSpan.className=innerSpan.className+" textFitAlignVert"}innerSpan.style["height"]=height+"px";if(settings.alignVertWithFlexbox&&!hasClass(el,"textFitAlignVertFlex")){el.className=el.className+" textFitAlignVertFlex"}}}function innerHeight(el){var style=window.getComputedStyle(el,null);return el.clientHeight-parseInt(style.getPropertyValue("padding-top"),10)-parseInt(style.getPropertyValue("padding-bottom"),10)}function innerWidth(el){var style=window.getComputedStyle(el,null);return el.clientWidth-parseInt(style.getPropertyValue("padding-left"),10)-parseInt(style.getPropertyValue("padding-right"),10)}function isElement(o){return typeof HTMLElement==="object"?o instanceof HTMLElement:o&&typeof o==="object"&&o!==null&&o.nodeType===1&&typeof o.nodeName==="string"}function hasClass(element,cls){return(" "+element.className+" ").indexOf(" "+cls+" ")>-1}function addStyleSheet(){if(document.getElementById("textFitStyleSheet"))return;var style=[".textFitAlignVert{","position: absolute;","top: 0; right: 0; bottom: 0; left: 0;","margin: auto;","display: flex;","justify-content: center;","flex-direction: column;","}",".textFitAlignVertFlex{","display: flex;","}",".textFitAlignVertFlex .textFitAlignVert{","position: static;","}"].join("");var css=document.createElement("style");css.type="text/css";css.id="textFitStyleSheet";css.innerHTML=style;document.body.appendChild(css)}}); \ No newline at end of file diff --git a/www/lib/changelog.md b/www/lib/changelog.md index 86ef6ec22..1913b78df 100644 --- a/www/lib/changelog.md +++ b/www/lib/changelog.md @@ -1,4 +1,11 @@ This file is intended to be used as a log of what third-party source we have vendored, where we got it, and what modifications we have made to it (if any). * [turndown v7.1.1](https://github.com/mixmark-io/turndown/releases/tag/v7.1.1) built from unmodified source as per its build scripts. +* [less.min.js v3.11.1](https://github.com/less/less.js/releases/tag/v3.11.1) with a minor modification to produce slightly more compact CSS +* [textFit.min.js v2.4.0 ](https://github.com/STRML/textFit/releases/tag/v2.4.0) to ensure that app names fit inside their icon containers on the home page +* [highlightjs](https://github.com/highlightjs/highlight.js/) for syntax highlighting in our code editor +* [our fork of tippy.js](https://github.com/xwiki-labs/tippyjs) for adding tooltips. +* [jscolor v2.0.5](https://jscolor.com/) for providing a consistent color picker across all browsers +* [jquery.ui 1.12.1](https://jqueryui.com/) for its 'autocomplete' extension which is used for our tag picker +* [pdfjs](https://mozilla.github.io/pdf.js/) with some minor modifications to prevent CSP errors diff --git a/www/common/highlight/highlight.pack.js b/www/lib/highlight/highlight.pack.js similarity index 100% rename from www/common/highlight/highlight.pack.js rename to www/lib/highlight/highlight.pack.js diff --git a/www/common/highlight/styles/dark.css b/www/lib/highlight/styles/dark.css similarity index 100% rename from www/common/highlight/styles/dark.css rename to www/lib/highlight/styles/dark.css diff --git a/www/common/highlight/styles/default.css b/www/lib/highlight/styles/default.css similarity index 100% rename from www/common/highlight/styles/default.css rename to www/lib/highlight/styles/default.css diff --git a/www/common/highlight/styles/github.css b/www/lib/highlight/styles/github.css similarity index 100% rename from www/common/highlight/styles/github.css rename to www/lib/highlight/styles/github.css diff --git a/www/common/jquery-ui/jquery-ui.min.css b/www/lib/jquery-ui/jquery-ui.min.css similarity index 100% rename from www/common/jquery-ui/jquery-ui.min.css rename to www/lib/jquery-ui/jquery-ui.min.css diff --git a/www/common/jquery-ui/jquery-ui.min.js b/www/lib/jquery-ui/jquery-ui.min.js similarity index 100% rename from www/common/jquery-ui/jquery-ui.min.js rename to www/lib/jquery-ui/jquery-ui.min.js diff --git a/www/common/less.min.js b/www/lib/less.min.js similarity index 100% rename from www/common/less.min.js rename to www/lib/less.min.js diff --git a/www/common/pdfjs/api/draft/AnnotationBorderStyle.html b/www/lib/pdfjs/api/draft/AnnotationBorderStyle.html similarity index 100% rename from www/common/pdfjs/api/draft/AnnotationBorderStyle.html rename to www/lib/pdfjs/api/draft/AnnotationBorderStyle.html diff --git a/www/common/pdfjs/api/draft/AnnotationFactory.html b/www/lib/pdfjs/api/draft/AnnotationFactory.html similarity index 100% rename from www/common/pdfjs/api/draft/AnnotationFactory.html rename to www/lib/pdfjs/api/draft/AnnotationFactory.html diff --git a/www/common/pdfjs/api/draft/PDFDataRangeTransport.html b/www/lib/pdfjs/api/draft/PDFDataRangeTransport.html similarity index 100% rename from www/common/pdfjs/api/draft/PDFDataRangeTransport.html rename to www/lib/pdfjs/api/draft/PDFDataRangeTransport.html diff --git a/www/common/pdfjs/api/draft/PDFDocumentLoadingTask.html b/www/lib/pdfjs/api/draft/PDFDocumentLoadingTask.html similarity index 100% rename from www/common/pdfjs/api/draft/PDFDocumentLoadingTask.html rename to www/lib/pdfjs/api/draft/PDFDocumentLoadingTask.html diff --git a/www/common/pdfjs/api/draft/PDFDocumentProxy.html b/www/lib/pdfjs/api/draft/PDFDocumentProxy.html similarity index 100% rename from www/common/pdfjs/api/draft/PDFDocumentProxy.html rename to www/lib/pdfjs/api/draft/PDFDocumentProxy.html diff --git a/www/common/pdfjs/api/draft/PDFJS.html b/www/lib/pdfjs/api/draft/PDFJS.html similarity index 100% rename from www/common/pdfjs/api/draft/PDFJS.html rename to www/lib/pdfjs/api/draft/PDFJS.html diff --git a/www/common/pdfjs/api/draft/PDFPageProxy.html b/www/lib/pdfjs/api/draft/PDFPageProxy.html similarity index 100% rename from www/common/pdfjs/api/draft/PDFPageProxy.html rename to www/lib/pdfjs/api/draft/PDFPageProxy.html diff --git a/www/common/pdfjs/api/draft/PDFWorker.html b/www/lib/pdfjs/api/draft/PDFWorker.html similarity index 100% rename from www/common/pdfjs/api/draft/PDFWorker.html rename to www/lib/pdfjs/api/draft/PDFWorker.html diff --git a/www/common/pdfjs/api/draft/PageViewport.html b/www/lib/pdfjs/api/draft/PageViewport.html similarity index 100% rename from www/common/pdfjs/api/draft/PageViewport.html rename to www/lib/pdfjs/api/draft/PageViewport.html diff --git a/www/common/pdfjs/api/draft/RenderTask.html b/www/lib/pdfjs/api/draft/RenderTask.html similarity index 100% rename from www/common/pdfjs/api/draft/RenderTask.html rename to www/lib/pdfjs/api/draft/RenderTask.html diff --git a/www/common/pdfjs/api/draft/core_annotation.js.html b/www/lib/pdfjs/api/draft/core_annotation.js.html similarity index 100% rename from www/common/pdfjs/api/draft/core_annotation.js.html rename to www/lib/pdfjs/api/draft/core_annotation.js.html diff --git a/www/common/pdfjs/api/draft/display_api.js.html b/www/lib/pdfjs/api/draft/display_api.js.html similarity index 100% rename from www/common/pdfjs/api/draft/display_api.js.html rename to www/lib/pdfjs/api/draft/display_api.js.html diff --git a/www/common/pdfjs/api/draft/display_global.js.html b/www/lib/pdfjs/api/draft/display_global.js.html similarity index 100% rename from www/common/pdfjs/api/draft/display_global.js.html rename to www/lib/pdfjs/api/draft/display_global.js.html diff --git a/www/common/pdfjs/api/draft/doc_helper.js.html b/www/lib/pdfjs/api/draft/doc_helper.js.html similarity index 100% rename from www/common/pdfjs/api/draft/doc_helper.js.html rename to www/lib/pdfjs/api/draft/doc_helper.js.html diff --git a/www/common/pdfjs/api/draft/external-Promise.html b/www/lib/pdfjs/api/draft/external-Promise.html similarity index 100% rename from www/common/pdfjs/api/draft/external-Promise.html rename to www/lib/pdfjs/api/draft/external-Promise.html diff --git a/www/common/pdfjs/api/draft/fonts/OpenSans-Light-webfont.eot b/www/lib/pdfjs/api/draft/fonts/OpenSans-Light-webfont.eot similarity index 100% rename from www/common/pdfjs/api/draft/fonts/OpenSans-Light-webfont.eot rename to www/lib/pdfjs/api/draft/fonts/OpenSans-Light-webfont.eot diff --git a/www/common/pdfjs/api/draft/fonts/OpenSans-Light-webfont.svg b/www/lib/pdfjs/api/draft/fonts/OpenSans-Light-webfont.svg similarity index 100% rename from www/common/pdfjs/api/draft/fonts/OpenSans-Light-webfont.svg rename to www/lib/pdfjs/api/draft/fonts/OpenSans-Light-webfont.svg diff --git a/www/common/pdfjs/api/draft/fonts/OpenSans-Light-webfont.woff b/www/lib/pdfjs/api/draft/fonts/OpenSans-Light-webfont.woff similarity index 100% rename from www/common/pdfjs/api/draft/fonts/OpenSans-Light-webfont.woff rename to www/lib/pdfjs/api/draft/fonts/OpenSans-Light-webfont.woff diff --git a/www/common/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.eot b/www/lib/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.eot similarity index 100% rename from www/common/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.eot rename to www/lib/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.eot diff --git a/www/common/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.svg b/www/lib/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.svg similarity index 100% rename from www/common/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.svg rename to www/lib/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.svg diff --git a/www/common/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.woff b/www/lib/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.woff similarity index 100% rename from www/common/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.woff rename to www/lib/pdfjs/api/draft/fonts/OpenSans-Regular-webfont.woff diff --git a/www/common/pdfjs/api/draft/global.html b/www/lib/pdfjs/api/draft/global.html similarity index 100% rename from www/common/pdfjs/api/draft/global.html rename to www/lib/pdfjs/api/draft/global.html diff --git a/www/common/pdfjs/api/draft/index.html b/www/lib/pdfjs/api/draft/index.html similarity index 100% rename from www/common/pdfjs/api/draft/index.html rename to www/lib/pdfjs/api/draft/index.html diff --git a/www/common/pdfjs/api/draft/scripts/linenumber.js b/www/lib/pdfjs/api/draft/scripts/linenumber.js similarity index 100% rename from www/common/pdfjs/api/draft/scripts/linenumber.js rename to www/lib/pdfjs/api/draft/scripts/linenumber.js diff --git a/www/common/pdfjs/api/draft/scripts/prettify/lang-css.js b/www/lib/pdfjs/api/draft/scripts/prettify/lang-css.js similarity index 100% rename from www/common/pdfjs/api/draft/scripts/prettify/lang-css.js rename to www/lib/pdfjs/api/draft/scripts/prettify/lang-css.js diff --git a/www/common/pdfjs/api/draft/scripts/prettify/prettify.js b/www/lib/pdfjs/api/draft/scripts/prettify/prettify.js similarity index 100% rename from www/common/pdfjs/api/draft/scripts/prettify/prettify.js rename to www/lib/pdfjs/api/draft/scripts/prettify/prettify.js diff --git a/www/common/pdfjs/api/draft/shared_util.js.html b/www/lib/pdfjs/api/draft/shared_util.js.html similarity index 100% rename from www/common/pdfjs/api/draft/shared_util.js.html rename to www/lib/pdfjs/api/draft/shared_util.js.html diff --git a/www/common/pdfjs/api/draft/styles/jsdoc-default.css b/www/lib/pdfjs/api/draft/styles/jsdoc-default.css similarity index 100% rename from www/common/pdfjs/api/draft/styles/jsdoc-default.css rename to www/lib/pdfjs/api/draft/styles/jsdoc-default.css diff --git a/www/common/pdfjs/api/draft/styles/prettify-tomorrow.css b/www/lib/pdfjs/api/draft/styles/prettify-tomorrow.css similarity index 100% rename from www/common/pdfjs/api/draft/styles/prettify-tomorrow.css rename to www/lib/pdfjs/api/draft/styles/prettify-tomorrow.css diff --git a/www/common/pdfjs/api/index.html b/www/lib/pdfjs/api/index.html similarity index 100% rename from www/common/pdfjs/api/index.html rename to www/lib/pdfjs/api/index.html diff --git a/www/common/pdfjs/build/pdf.js b/www/lib/pdfjs/build/pdf.js similarity index 100% rename from www/common/pdfjs/build/pdf.js rename to www/lib/pdfjs/build/pdf.js diff --git a/www/common/pdfjs/build/pdf.worker.js b/www/lib/pdfjs/build/pdf.worker.js similarity index 100% rename from www/common/pdfjs/build/pdf.worker.js rename to www/lib/pdfjs/build/pdf.worker.js diff --git a/www/common/pdfjs/css/bootstrap.min.css b/www/lib/pdfjs/css/bootstrap.min.css similarity index 100% rename from www/common/pdfjs/css/bootstrap.min.css rename to www/lib/pdfjs/css/bootstrap.min.css diff --git a/www/common/pdfjs/css/main.css b/www/lib/pdfjs/css/main.css similarity index 100% rename from www/common/pdfjs/css/main.css rename to www/lib/pdfjs/css/main.css diff --git a/www/common/pdfjs/images/favicon.ico b/www/lib/pdfjs/images/favicon.ico similarity index 100% rename from www/common/pdfjs/images/favicon.ico rename to www/lib/pdfjs/images/favicon.ico diff --git a/www/common/pdfjs/images/logo.svg b/www/lib/pdfjs/images/logo.svg similarity index 100% rename from www/common/pdfjs/images/logo.svg rename to www/lib/pdfjs/images/logo.svg diff --git a/www/common/pdfjs/js/bootstrap.min.js b/www/lib/pdfjs/js/bootstrap.min.js similarity index 100% rename from www/common/pdfjs/js/bootstrap.min.js rename to www/lib/pdfjs/js/bootstrap.min.js diff --git a/www/common/pdfjs/js/jquery-2.1.0.min.js b/www/lib/pdfjs/js/jquery-2.1.0.min.js similarity index 100% rename from www/common/pdfjs/js/jquery-2.1.0.min.js rename to www/lib/pdfjs/js/jquery-2.1.0.min.js diff --git a/www/common/pdfjs/web/images/findbarButton-next-rtl.png b/www/lib/pdfjs/web/images/findbarButton-next-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-next-rtl.png rename to www/lib/pdfjs/web/images/findbarButton-next-rtl.png diff --git a/www/common/pdfjs/web/images/findbarButton-next-rtl@2x.png b/www/lib/pdfjs/web/images/findbarButton-next-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-next-rtl@2x.png rename to www/lib/pdfjs/web/images/findbarButton-next-rtl@2x.png diff --git a/www/common/pdfjs/web/images/findbarButton-next.png b/www/lib/pdfjs/web/images/findbarButton-next.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-next.png rename to www/lib/pdfjs/web/images/findbarButton-next.png diff --git a/www/common/pdfjs/web/images/findbarButton-next@2x.png b/www/lib/pdfjs/web/images/findbarButton-next@2x.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-next@2x.png rename to www/lib/pdfjs/web/images/findbarButton-next@2x.png diff --git a/www/common/pdfjs/web/images/findbarButton-previous-rtl.png b/www/lib/pdfjs/web/images/findbarButton-previous-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-previous-rtl.png rename to www/lib/pdfjs/web/images/findbarButton-previous-rtl.png diff --git a/www/common/pdfjs/web/images/findbarButton-previous-rtl@2x.png b/www/lib/pdfjs/web/images/findbarButton-previous-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-previous-rtl@2x.png rename to www/lib/pdfjs/web/images/findbarButton-previous-rtl@2x.png diff --git a/www/common/pdfjs/web/images/findbarButton-previous.png b/www/lib/pdfjs/web/images/findbarButton-previous.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-previous.png rename to www/lib/pdfjs/web/images/findbarButton-previous.png diff --git a/www/common/pdfjs/web/images/findbarButton-previous@2x.png b/www/lib/pdfjs/web/images/findbarButton-previous@2x.png similarity index 100% rename from www/common/pdfjs/web/images/findbarButton-previous@2x.png rename to www/lib/pdfjs/web/images/findbarButton-previous@2x.png diff --git a/www/common/pdfjs/web/images/grab.cur b/www/lib/pdfjs/web/images/grab.cur similarity index 100% rename from www/common/pdfjs/web/images/grab.cur rename to www/lib/pdfjs/web/images/grab.cur diff --git a/www/common/pdfjs/web/images/grabbing.cur b/www/lib/pdfjs/web/images/grabbing.cur similarity index 100% rename from www/common/pdfjs/web/images/grabbing.cur rename to www/lib/pdfjs/web/images/grabbing.cur diff --git a/www/common/pdfjs/web/images/loading-icon.gif b/www/lib/pdfjs/web/images/loading-icon.gif similarity index 100% rename from www/common/pdfjs/web/images/loading-icon.gif rename to www/lib/pdfjs/web/images/loading-icon.gif diff --git a/www/common/pdfjs/web/images/loading-small.png b/www/lib/pdfjs/web/images/loading-small.png similarity index 100% rename from www/common/pdfjs/web/images/loading-small.png rename to www/lib/pdfjs/web/images/loading-small.png diff --git a/www/common/pdfjs/web/images/loading-small@2x.png b/www/lib/pdfjs/web/images/loading-small@2x.png similarity index 100% rename from www/common/pdfjs/web/images/loading-small@2x.png rename to www/lib/pdfjs/web/images/loading-small@2x.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-documentProperties.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-documentProperties.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-documentProperties.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-documentProperties.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-firstPage.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-firstPage.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-firstPage.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-firstPage.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-handTool.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-handTool.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-handTool.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-handTool.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-lastPage.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-lastPage.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-lastPage.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-lastPage.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-rotateCw.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCw.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-rotateCw.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCw.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-selectTool.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-selectTool.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-selectTool.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-selectTool.png diff --git a/www/common/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png b/www/lib/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png similarity index 100% rename from www/common/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png rename to www/lib/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png diff --git a/www/common/pdfjs/web/images/shadow.png b/www/lib/pdfjs/web/images/shadow.png similarity index 100% rename from www/common/pdfjs/web/images/shadow.png rename to www/lib/pdfjs/web/images/shadow.png diff --git a/www/common/pdfjs/web/images/texture.png b/www/lib/pdfjs/web/images/texture.png similarity index 100% rename from www/common/pdfjs/web/images/texture.png rename to www/lib/pdfjs/web/images/texture.png diff --git a/www/common/pdfjs/web/images/toolbarButton-bookmark.png b/www/lib/pdfjs/web/images/toolbarButton-bookmark.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-bookmark.png rename to www/lib/pdfjs/web/images/toolbarButton-bookmark.png diff --git a/www/common/pdfjs/web/images/toolbarButton-bookmark@2x.png b/www/lib/pdfjs/web/images/toolbarButton-bookmark@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-bookmark@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-bookmark@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-download.png b/www/lib/pdfjs/web/images/toolbarButton-download.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-download.png rename to www/lib/pdfjs/web/images/toolbarButton-download.png diff --git a/www/common/pdfjs/web/images/toolbarButton-download@2x.png b/www/lib/pdfjs/web/images/toolbarButton-download@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-download@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-download@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-menuArrows.png b/www/lib/pdfjs/web/images/toolbarButton-menuArrows.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-menuArrows.png rename to www/lib/pdfjs/web/images/toolbarButton-menuArrows.png diff --git a/www/common/pdfjs/web/images/toolbarButton-menuArrows@2x.png b/www/lib/pdfjs/web/images/toolbarButton-menuArrows@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-menuArrows@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-menuArrows@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-openFile.png b/www/lib/pdfjs/web/images/toolbarButton-openFile.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-openFile.png rename to www/lib/pdfjs/web/images/toolbarButton-openFile.png diff --git a/www/common/pdfjs/web/images/toolbarButton-openFile@2x.png b/www/lib/pdfjs/web/images/toolbarButton-openFile@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-openFile@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-openFile@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageDown-rtl.png b/www/lib/pdfjs/web/images/toolbarButton-pageDown-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageDown-rtl.png rename to www/lib/pdfjs/web/images/toolbarButton-pageDown-rtl.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageDown-rtl@2x.png b/www/lib/pdfjs/web/images/toolbarButton-pageDown-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageDown-rtl@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-pageDown-rtl@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageDown.png b/www/lib/pdfjs/web/images/toolbarButton-pageDown.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageDown.png rename to www/lib/pdfjs/web/images/toolbarButton-pageDown.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageDown@2x.png b/www/lib/pdfjs/web/images/toolbarButton-pageDown@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageDown@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-pageDown@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageUp-rtl.png b/www/lib/pdfjs/web/images/toolbarButton-pageUp-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageUp-rtl.png rename to www/lib/pdfjs/web/images/toolbarButton-pageUp-rtl.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageUp-rtl@2x.png b/www/lib/pdfjs/web/images/toolbarButton-pageUp-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageUp-rtl@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-pageUp-rtl@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageUp.png b/www/lib/pdfjs/web/images/toolbarButton-pageUp.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageUp.png rename to www/lib/pdfjs/web/images/toolbarButton-pageUp.png diff --git a/www/common/pdfjs/web/images/toolbarButton-pageUp@2x.png b/www/lib/pdfjs/web/images/toolbarButton-pageUp@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-pageUp@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-pageUp@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-presentationMode.png b/www/lib/pdfjs/web/images/toolbarButton-presentationMode.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-presentationMode.png rename to www/lib/pdfjs/web/images/toolbarButton-presentationMode.png diff --git a/www/common/pdfjs/web/images/toolbarButton-presentationMode@2x.png b/www/lib/pdfjs/web/images/toolbarButton-presentationMode@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-presentationMode@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-presentationMode@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-print.png b/www/lib/pdfjs/web/images/toolbarButton-print.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-print.png rename to www/lib/pdfjs/web/images/toolbarButton-print.png diff --git a/www/common/pdfjs/web/images/toolbarButton-print@2x.png b/www/lib/pdfjs/web/images/toolbarButton-print@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-print@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-print@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-search.png b/www/lib/pdfjs/web/images/toolbarButton-search.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-search.png rename to www/lib/pdfjs/web/images/toolbarButton-search.png diff --git a/www/common/pdfjs/web/images/toolbarButton-search@2x.png b/www/lib/pdfjs/web/images/toolbarButton-search@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-search@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-search@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl.png b/www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl.png rename to www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl.png diff --git a/www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png b/www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png b/www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png rename to www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png diff --git a/www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png b/www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-sidebarToggle-rtl.png b/www/lib/pdfjs/web/images/toolbarButton-sidebarToggle-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-sidebarToggle-rtl.png rename to www/lib/pdfjs/web/images/toolbarButton-sidebarToggle-rtl.png diff --git a/www/common/pdfjs/web/images/toolbarButton-sidebarToggle-rtl@2x.png b/www/lib/pdfjs/web/images/toolbarButton-sidebarToggle-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-sidebarToggle-rtl@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-sidebarToggle-rtl@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-sidebarToggle.png b/www/lib/pdfjs/web/images/toolbarButton-sidebarToggle.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-sidebarToggle.png rename to www/lib/pdfjs/web/images/toolbarButton-sidebarToggle.png diff --git a/www/common/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png b/www/lib/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewAttachments.png b/www/lib/pdfjs/web/images/toolbarButton-viewAttachments.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewAttachments.png rename to www/lib/pdfjs/web/images/toolbarButton-viewAttachments.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewAttachments@2x.png b/www/lib/pdfjs/web/images/toolbarButton-viewAttachments@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewAttachments@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-viewAttachments@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewOutline-rtl.png b/www/lib/pdfjs/web/images/toolbarButton-viewOutline-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewOutline-rtl.png rename to www/lib/pdfjs/web/images/toolbarButton-viewOutline-rtl.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewOutline-rtl@2x.png b/www/lib/pdfjs/web/images/toolbarButton-viewOutline-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewOutline-rtl@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-viewOutline-rtl@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewOutline.png b/www/lib/pdfjs/web/images/toolbarButton-viewOutline.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewOutline.png rename to www/lib/pdfjs/web/images/toolbarButton-viewOutline.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewOutline@2x.png b/www/lib/pdfjs/web/images/toolbarButton-viewOutline@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewOutline@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-viewOutline@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewThumbnail.png b/www/lib/pdfjs/web/images/toolbarButton-viewThumbnail.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewThumbnail.png rename to www/lib/pdfjs/web/images/toolbarButton-viewThumbnail.png diff --git a/www/common/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png b/www/lib/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-zoomIn.png b/www/lib/pdfjs/web/images/toolbarButton-zoomIn.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-zoomIn.png rename to www/lib/pdfjs/web/images/toolbarButton-zoomIn.png diff --git a/www/common/pdfjs/web/images/toolbarButton-zoomIn@2x.png b/www/lib/pdfjs/web/images/toolbarButton-zoomIn@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-zoomIn@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-zoomIn@2x.png diff --git a/www/common/pdfjs/web/images/toolbarButton-zoomOut.png b/www/lib/pdfjs/web/images/toolbarButton-zoomOut.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-zoomOut.png rename to www/lib/pdfjs/web/images/toolbarButton-zoomOut.png diff --git a/www/common/pdfjs/web/images/toolbarButton-zoomOut@2x.png b/www/lib/pdfjs/web/images/toolbarButton-zoomOut@2x.png similarity index 100% rename from www/common/pdfjs/web/images/toolbarButton-zoomOut@2x.png rename to www/lib/pdfjs/web/images/toolbarButton-zoomOut@2x.png diff --git a/www/common/pdfjs/web/images/treeitem-collapsed-rtl.png b/www/lib/pdfjs/web/images/treeitem-collapsed-rtl.png similarity index 100% rename from www/common/pdfjs/web/images/treeitem-collapsed-rtl.png rename to www/lib/pdfjs/web/images/treeitem-collapsed-rtl.png diff --git a/www/common/pdfjs/web/images/treeitem-collapsed-rtl@2x.png b/www/lib/pdfjs/web/images/treeitem-collapsed-rtl@2x.png similarity index 100% rename from www/common/pdfjs/web/images/treeitem-collapsed-rtl@2x.png rename to www/lib/pdfjs/web/images/treeitem-collapsed-rtl@2x.png diff --git a/www/common/pdfjs/web/images/treeitem-collapsed.png b/www/lib/pdfjs/web/images/treeitem-collapsed.png similarity index 100% rename from www/common/pdfjs/web/images/treeitem-collapsed.png rename to www/lib/pdfjs/web/images/treeitem-collapsed.png diff --git a/www/common/pdfjs/web/images/treeitem-collapsed@2x.png b/www/lib/pdfjs/web/images/treeitem-collapsed@2x.png similarity index 100% rename from www/common/pdfjs/web/images/treeitem-collapsed@2x.png rename to www/lib/pdfjs/web/images/treeitem-collapsed@2x.png diff --git a/www/common/pdfjs/web/images/treeitem-expanded.png b/www/lib/pdfjs/web/images/treeitem-expanded.png similarity index 100% rename from www/common/pdfjs/web/images/treeitem-expanded.png rename to www/lib/pdfjs/web/images/treeitem-expanded.png diff --git a/www/common/pdfjs/web/images/treeitem-expanded@2x.png b/www/lib/pdfjs/web/images/treeitem-expanded@2x.png similarity index 100% rename from www/common/pdfjs/web/images/treeitem-expanded@2x.png rename to www/lib/pdfjs/web/images/treeitem-expanded@2x.png diff --git a/www/common/pdfjs/web/locale/fr/viewer.properties b/www/lib/pdfjs/web/locale/fr/viewer.properties similarity index 100% rename from www/common/pdfjs/web/locale/fr/viewer.properties rename to www/lib/pdfjs/web/locale/fr/viewer.properties diff --git a/www/common/pdfjs/web/locale/locale.properties b/www/lib/pdfjs/web/locale/locale.properties similarity index 100% rename from www/common/pdfjs/web/locale/locale.properties rename to www/lib/pdfjs/web/locale/locale.properties diff --git a/www/common/pdfjs/web/viewer.css b/www/lib/pdfjs/web/viewer.css similarity index 100% rename from www/common/pdfjs/web/viewer.css rename to www/lib/pdfjs/web/viewer.css diff --git a/www/common/pdfjs/web/viewer.html b/www/lib/pdfjs/web/viewer.html similarity index 100% rename from www/common/pdfjs/web/viewer.html rename to www/lib/pdfjs/web/viewer.html diff --git a/www/common/pdfjs/web/viewer.js b/www/lib/pdfjs/web/viewer.js similarity index 100% rename from www/common/pdfjs/web/viewer.js rename to www/lib/pdfjs/web/viewer.js diff --git a/www/lib/textFit.min.js b/www/lib/textFit.min.js new file mode 100644 index 000000000..71f316404 --- /dev/null +++ b/www/lib/textFit.min.js @@ -0,0 +1 @@ +(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define([],factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.textFit=factory()}})(typeof global==="object"?global:this,function(){"use strict";var defaultSettings={alignVert:false,alignHoriz:false,multiLine:false,detectMultiLine:true,minFontSize:6,maxFontSize:80,reProcess:true,widthOnly:false,alignVertWithFlexbox:false};return function textFit(els,options){if(!options)options={};var settings={};for(var key in defaultSettings){if(options.hasOwnProperty(key)){settings[key]=options[key]}else{settings[key]=defaultSettings[key]}}if(typeof els.toArray==="function"){els=els.toArray()}var elType=Object.prototype.toString.call(els);if(elType!=="[object Array]"&&elType!=="[object NodeList]"&&elType!=="[object HTMLCollection]"){els=[els]}for(var i=0;i=parseInt(window.getComputedStyle(innerSpan)["font-size"],10)*2){multiLine=true}if(!multiLine){el.style["white-space"]="nowrap"}low=settings.minFontSize;high=settings.maxFontSize;var size=low;while(low<=high){mid=high+low>>1;innerSpan.style.fontSize=mid+"px";var innerSpanBoundingClientRect=innerSpan.getBoundingClientRect();if(innerSpanBoundingClientRect.width<=originalWidth&&(settings.widthOnly||innerSpanBoundingClientRect.height<=originalHeight)){size=mid;low=mid+1}else{high=mid-1}}if(innerSpan.style.fontSize!=size+"px")innerSpan.style.fontSize=size+"px";if(settings.alignVert){addStyleSheet();var height=innerSpan.scrollHeight;if(window.getComputedStyle(el)["position"]==="static"){el.style["position"]="relative"}if(!hasClass(innerSpan,"textFitAlignVert")){innerSpan.className=innerSpan.className+" textFitAlignVert"}innerSpan.style["height"]=height+"px";if(settings.alignVertWithFlexbox&&!hasClass(el,"textFitAlignVertFlex")){el.className=el.className+" textFitAlignVertFlex"}}}function innerHeight(el){var style=window.getComputedStyle(el,null);return el.getBoundingClientRect().height-parseInt(style.getPropertyValue("padding-top"),10)-parseInt(style.getPropertyValue("padding-bottom"),10)}function innerWidth(el){var style=window.getComputedStyle(el,null);return el.getBoundingClientRect().width-parseInt(style.getPropertyValue("padding-left"),10)-parseInt(style.getPropertyValue("padding-right"),10)}function isElement(o){return typeof HTMLElement==="object"?o instanceof HTMLElement:o&&typeof o==="object"&&o!==null&&o.nodeType===1&&typeof o.nodeName==="string"}function hasClass(element,cls){return(" "+element.className+" ").indexOf(" "+cls+" ")>-1}function addStyleSheet(){if(document.getElementById("textFitStyleSheet"))return;var style=[".textFitAlignVert{","position: absolute;","top: 0; right: 0; bottom: 0; left: 0;","margin: auto;","display: flex;","justify-content: center;","flex-direction: column;","}",".textFitAlignVertFlex{","display: flex;","}",".textFitAlignVertFlex .textFitAlignVert{","position: static;","}"].join("");var css=document.createElement("style");css.type="text/css";css.id="textFitStyleSheet";css.innerHTML=style;document.body.appendChild(css)}}); diff --git a/www/common/tippy/tippy.css b/www/lib/tippy/tippy.css similarity index 100% rename from www/common/tippy/tippy.css rename to www/lib/tippy/tippy.css diff --git a/www/common/tippy/tippy.min.js b/www/lib/tippy/tippy.min.js similarity index 100% rename from www/common/tippy/tippy.min.js rename to www/lib/tippy/tippy.min.js diff --git a/www/mediatag/main.js b/www/mediatag/main.js index d2f1691ae..40bf33ddc 100644 --- a/www/mediatag/main.js +++ b/www/mediatag/main.js @@ -6,7 +6,7 @@ require([ console.log(MediaTag); console.log($('media-tag')); if (typeof MediaTag === "function") { - MediaTag.PdfPlugin.viewer = '/common/pdfjs/web/viewer.html'; + MediaTag.PdfPlugin.viewer = '/lib/pdfjs/web/viewer.html'; var config = { allowed: ['download'], diff --git a/www/slide/inner.js b/www/slide/inner.js index e40bd6d79..9c9b9c70b 100644 --- a/www/slide/inner.js +++ b/www/slide/inner.js @@ -261,9 +261,10 @@ define([ $textarea.val(invalidStyle || slideOptionsTmp.styleLess || slideOptionsTmp.style); window.setTimeout(function () { $textarea.focus(); }, 0); - require(['/bower_components/less/dist/less.min.js'], function () { }); + var lessPath = '/lib/less.min.js'; + require([lessPath], function () { }); var parseLess = function (less, cb) { - require(['/bower_components/less/dist/less.min.js'], function (Less) { + require([lessPath], function (Less) { Less.render(less, {}, function(err, css) { if (err) { return void cb(err); } cb(undefined, css.css); diff --git a/www/worker/worker.js b/www/worker/worker.js index f1e0c8a0f..93539cede 100644 --- a/www/worker/worker.js +++ b/www/worker/worker.js @@ -16,8 +16,6 @@ require.config({ "jquery": "/bower_components/jquery/dist/jquery.min", // json.sortify same "json.sortify": "/bower_components/json.sortify/dist/JSON.sortify", - //"pdfjs-dist/build/pdf": "/bower_components/pdfjs-dist/build/pdf", - //"pdfjs-dist/build/pdf.worker": "/bower_components/pdfjs-dist/build/pdf.worker" cm: '/bower_components/codemirror' }, map: {