Mercurial > hg > orthanc-stone
changeset 1660:05b55b89a134
use local copy of open-sans, remove ua-parser
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 19 Nov 2020 10:21:20 +0100 |
parents | 641d39cc8537 |
children | e4589378ad8b |
files | Applications/StoneWebViewer/Resources/Fonts.txt Applications/StoneWebViewer/Resources/Graveyard/print-2.js Applications/StoneWebViewer/Resources/Graveyard/print.js Applications/StoneWebViewer/Resources/NOTES.txt Applications/StoneWebViewer/Resources/OpenSans/2017-11-13-OpenSans-Regular.ttf Applications/StoneWebViewer/Resources/OpenSans/2017-11-13-OpenSans-Regular.woff2 Applications/StoneWebViewer/Resources/OpenSans/LICENSE.txt Applications/StoneWebViewer/Resources/Styles.txt Applications/StoneWebViewer/WebApplication/index.html Applications/StoneWebViewer/WebApplication/open-sans.css Applications/StoneWebViewer/WebApplication/ua-parser.js Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/JavaScriptLibraries.cmake |
diffstat | 13 files changed, 347 insertions(+), 926 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Applications/StoneWebViewer/Resources/Fonts.txt Thu Nov 19 10:21:20 2020 +0100 @@ -0,0 +1,104 @@ + + +Tools for handling TTF and WOFF2 +================================ + +https://fr.wikipedia.org/wiki/Web_Open_Font_Format_2 + + +Print info about a TTF +---------------------- + +$ sudo apt-get install fontconfig +$ fc-query ./2017-11-13-OpenSans-Regular.ttf + + => The "lang" and the "capability" are interesting to know the + supported language. "en" and "otlayout:latn" are a must. + + +Get version of a TTF +-------------------- + +$ fc-query -f '%{fontversion}\n' ./OpenSans/2017-11-13-OpenSans-Regular.ttf | \ + grep -v 'id' | perl -E 'printf "%.3f\n", <>/65536.0' + + => "1.100" indicates version "1.1" + +Source: https://stackoverflow.com/a/43614521/881731 + + +Conversion from TTF to WOFF2 +---------------------------- + +$ sudo apt install woff2 +$ woff2_compress 2017-11-13-OpenSans-Regular.ttf + +Source: https://dev.to/benjaminblack/converting-ttf-fonts-to-woff2-and-woff-3f5b + + + +OpenSans +======== + +General information +------------------- + +Official repository: +https://github.com/googlefonts/opensans/tree/master/ + +License: +Apache License 2.0 + +Google Fonts: +https://fonts.google.com/specimen/Open+Sans#license + +Google CDN: +https://fonts.googleapis.com/css?family=Open+Sans + +Debian package: + +$ sudo apt-get install fonts-open-sans +$ ls -l /usr/share/fonts/truetype/open-sans/ + + +Playing with the CDN +-------------------- + +To fetch the WOFF2 from CDN (selecting WOFF2 instead of TTF is done by +setting the HTTP Header User-Agent): + +$ cd /tmp +$ curl -H 'User-Agent: AppleWebKit/537 Chrome/85' 'https://fonts.googleapis.com/css?family=Open+Sans' + => The "latin" section is what we're looking for +$ wget https://fonts.gstatic.com/s/opensans/v18/mem8YaGs126MiZpBA-UFVZ0b.woff2 + + +To fetch the TTF from CDN: + +$ curl 'https://fonts.googleapis.com/css?family=Open+Sans' +$ wget https://fonts.gstatic.com/s/opensans/v18/mem8YaGs126MiZpBA-UFVZ0e.ttf +$ woff2_compress mem8YaGs126MiZpBA-UFVZ0e.ttf +$ diff -s ./mem8YaGs126MiZpBA-UFVZ0e.woff2 ./mem8YaGs126MiZpBA-UFVZ0b.woff2 + + => The files are identical + + +As of 2020-11-19, the version of the TTF is "1.101": + +$ fc-query -f '%{fontversion}\n' ./mem8YaGs126MiZpBA-UFVZ0e.ttf | \ + grep -v 'id' | perl -E 'printf "%.3f\n", <>/65536.0' + + + +Generation of the "./OpenSans" folder +------------------------------------- + +$ mkdir ./OpenSans +$ cd ./OpenSans +$ REVISION=c0d8ce7dd46291a5d429ac537ddcd3617f4dc229 +$ wget https://github.com/googlefonts/opensans/raw/master/LICENSE.txt +$ curl https://raw.githubusercontent.com/googlefonts/opensans/${REVISION}/ttfs/OpenSans-Regular.ttf > 2017-11-13-OpenSans-Regular.ttf +$ woff2_compress 2017-11-13-OpenSans-Regular.ttf + + => Note that the version of the TTF font is "2.010" (so more recent + than the font on Google Fonts CDN)
--- a/Applications/StoneWebViewer/Resources/Graveyard/print-2.js Thu Nov 19 09:10:36 2020 +0100 +++ b/Applications/StoneWebViewer/Resources/Graveyard/print-2.js Thu Nov 19 10:21:20 2020 +0100 @@ -19,6 +19,8 @@ **/ +// DEPENDENCY: https://github.com/faisalman/ua-parser-js + function beforePrint(event) { var body = $('body'); body.addClass('print');
--- a/Applications/StoneWebViewer/Resources/Graveyard/print.js Thu Nov 19 09:10:36 2020 +0100 +++ b/Applications/StoneWebViewer/Resources/Graveyard/print.js Thu Nov 19 10:21:20 2020 +0100 @@ -19,6 +19,9 @@ **/ +// DEPENDENCY: https://github.com/faisalman/ua-parser-js + + function beforePrint(event){ console.log('beforePrint'); var $body = $('body');
--- a/Applications/StoneWebViewer/Resources/NOTES.txt Thu Nov 19 09:10:36 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - -Origin of SCSS -============== - -The "Styles" folder is a copy of: -https://bitbucket.org/osimis/osimis-webviewer-plugin/src/master/frontend/src/styles/ - - - -Generation of CSS from the SCSS -=============================== - -$ npm install node-sass -$ ./node_modules/node-sass/bin/node-sass ./Styles/styles.scss > ../WebApplication/app.css -$ ./GenerateImages.py
Binary file Applications/StoneWebViewer/Resources/OpenSans/2017-11-13-OpenSans-Regular.ttf has changed
Binary file Applications/StoneWebViewer/Resources/OpenSans/2017-11-13-OpenSans-Regular.woff2 has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Applications/StoneWebViewer/Resources/OpenSans/LICENSE.txt Thu Nov 19 10:21:20 2020 +0100 @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Applications/StoneWebViewer/Resources/Styles.txt Thu Nov 19 10:21:20 2020 +0100 @@ -0,0 +1,15 @@ + +Origin of SCSS +============== + +The "Styles" folder is a copy of: +https://bitbucket.org/osimis/osimis-webviewer-plugin/src/master/frontend/src/styles/ + + + +Generation of CSS from the SCSS +=============================== + +$ npm install node-sass +$ ./node_modules/node-sass/bin/node-sass ./Styles/styles.scss > ../WebApplication/app.css +$ ./GenerateImages.py
--- a/Applications/StoneWebViewer/WebApplication/index.html Thu Nov 19 09:10:36 2020 +0100 +++ b/Applications/StoneWebViewer/WebApplication/index.html Thu Nov 19 10:21:20 2020 +0100 @@ -11,8 +11,7 @@ <link rel="stylesheet" href="css/all.css"> <!-- Font Awesome --> <link rel="stylesheet" href="css/bootstrap.css"> - <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> - + <link rel="stylesheet" href="open-sans.css"> <link rel="stylesheet" href="app.css"> <!-- https://stackoverflow.com/a/16863182/881731 -->
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Applications/StoneWebViewer/WebApplication/open-sans.css Thu Nov 19 10:21:20 2020 +0100 @@ -0,0 +1,17 @@ +/* Web browsers will choose the last font-face that matches the + family. So, TTF must be the first definition, so that Web browsers + choose WOFF2 if they support it. */ + +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: url(webfonts/2017-11-13-OpenSans-Regular.ttf) format('truetype'); +} + +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: url(webfonts/2017-11-13-OpenSans-Regular.woff2) format('woff2'); +}
--- a/Applications/StoneWebViewer/WebApplication/ua-parser.js Thu Nov 19 09:10:36 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,908 +0,0 @@ -/*! - * UAParser.js v0.7.21 - * Lightweight JavaScript-based User-Agent string parser - * https://github.com/faisalman/ua-parser-js - * - * Copyright © 2012-2019 Faisal Salman <f@faisalman.com> - * Licensed under MIT License - */ - -(function (window, undefined) { - - 'use strict'; - - ////////////// - // Constants - ///////////// - - - var LIBVERSION = '0.7.21', - EMPTY = '', - UNKNOWN = '?', - FUNC_TYPE = 'function', - UNDEF_TYPE = 'undefined', - OBJ_TYPE = 'object', - STR_TYPE = 'string', - MAJOR = 'major', // deprecated - MODEL = 'model', - NAME = 'name', - TYPE = 'type', - VENDOR = 'vendor', - VERSION = 'version', - ARCHITECTURE= 'architecture', - CONSOLE = 'console', - MOBILE = 'mobile', - TABLET = 'tablet', - SMARTTV = 'smarttv', - WEARABLE = 'wearable', - EMBEDDED = 'embedded'; - - - /////////// - // Helper - ////////// - - - var util = { - extend : function (regexes, extensions) { - var mergedRegexes = {}; - for (var i in regexes) { - if (extensions[i] && extensions[i].length % 2 === 0) { - mergedRegexes[i] = extensions[i].concat(regexes[i]); - } else { - mergedRegexes[i] = regexes[i]; - } - } - return mergedRegexes; - }, - has : function (str1, str2) { - if (typeof str1 === "string") { - return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; - } else { - return false; - } - }, - lowerize : function (str) { - return str.toLowerCase(); - }, - major : function (version) { - return typeof(version) === STR_TYPE ? version.replace(/[^\d\.]/g,'').split(".")[0] : undefined; - }, - trim : function (str) { - return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); - } - }; - - - /////////////// - // Map helper - ////////////// - - - var mapper = { - - rgx : function (ua, arrays) { - - var i = 0, j, k, p, q, matches, match; - - // loop through all regexes maps - while (i < arrays.length && !matches) { - - var regex = arrays[i], // even sequence (0,2,4,..) - props = arrays[i + 1]; // odd sequence (1,3,5,..) - j = k = 0; - - // try matching uastring with regexes - while (j < regex.length && !matches) { - - matches = regex[j++].exec(ua); - - if (!!matches) { - for (p = 0; p < props.length; p++) { - match = matches[++k]; - q = props[p]; - // check if given property is actually array - if (typeof q === OBJ_TYPE && q.length > 0) { - if (q.length == 2) { - if (typeof q[1] == FUNC_TYPE) { - // assign modified match - this[q[0]] = q[1].call(this, match); - } else { - // assign given value, ignore regex match - this[q[0]] = q[1]; - } - } else if (q.length == 3) { - // check whether function or regex - if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) { - // call function (usually string mapper) - this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; - } else { - // sanitize match using given regex - this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; - } - } else if (q.length == 4) { - this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; - } - } else { - this[q] = match ? match : undefined; - } - } - } - } - i += 2; - } - }, - - str : function (str, map) { - - for (var i in map) { - // check if array - if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { - for (var j = 0; j < map[i].length; j++) { - if (util.has(map[i][j], str)) { - return (i === UNKNOWN) ? undefined : i; - } - } - } else if (util.has(map[i], str)) { - return (i === UNKNOWN) ? undefined : i; - } - } - return str; - } - }; - - - /////////////// - // String map - ////////////// - - - var maps = { - - browser : { - oldsafari : { - version : { - '1.0' : '/8', - '1.2' : '/1', - '1.3' : '/3', - '2.0' : '/412', - '2.0.2' : '/416', - '2.0.3' : '/417', - '2.0.4' : '/419', - '?' : '/' - } - } - }, - - device : { - amazon : { - model : { - 'Fire Phone' : ['SD', 'KF'] - } - }, - sprint : { - model : { - 'Evo Shift 4G' : '7373KT' - }, - vendor : { - 'HTC' : 'APA', - 'Sprint' : 'Sprint' - } - } - }, - - os : { - windows : { - version : { - 'ME' : '4.90', - 'NT 3.11' : 'NT3.51', - 'NT 4.0' : 'NT4.0', - '2000' : 'NT 5.0', - 'XP' : ['NT 5.1', 'NT 5.2'], - 'Vista' : 'NT 6.0', - '7' : 'NT 6.1', - '8' : 'NT 6.2', - '8.1' : 'NT 6.3', - '10' : ['NT 6.4', 'NT 10.0'], - 'RT' : 'ARM' - } - } - } - }; - - - ////////////// - // Regex map - ///////////// - - - var regexes = { - - browser : [[ - - // Presto based - /(opera\smini)\/([\w\.-]+)/i, // Opera Mini - /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet - /(opera).+version\/([\w\.]+)/i, // Opera > 9.80 - /(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80 - ], [NAME, VERSION], [ - - /(opios)[\/\s]+([\w\.]+)/i // Opera mini on iphone >= 8.0 - ], [[NAME, 'Opera Mini'], VERSION], [ - - /\s(opr)\/([\w\.]+)/i // Opera Webkit - ], [[NAME, 'Opera'], VERSION], [ - - // Mixed - /(kindle)\/([\w\.]+)/i, // Kindle - /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i, - // Lunascape/Maxthon/Netfront/Jasmine/Blazer - // Trident based - /(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i, - // Avant/IEMobile/SlimBrowser - /(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i, // Baidu Browser - /(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer - - // Webkit/KHTML based - /(rekonq)\/([\w\.]*)/i, // Rekonq - /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i - // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon - ], [NAME, VERSION], [ - - /(konqueror)\/([\w\.]+)/i // Konqueror - ], [[NAME, 'Konqueror'], VERSION], [ - - /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11 - ], [[NAME, 'IE'], VERSION], [ - - /(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i // Microsoft Edge - ], [[NAME, 'Edge'], VERSION], [ - - /(yabrowser)\/([\w\.]+)/i // Yandex - ], [[NAME, 'Yandex'], VERSION], [ - - /(Avast)\/([\w\.]+)/i // Avast Secure Browser - ], [[NAME, 'Avast Secure Browser'], VERSION], [ - - /(AVG)\/([\w\.]+)/i // AVG Secure Browser - ], [[NAME, 'AVG Secure Browser'], VERSION], [ - - /(puffin)\/([\w\.]+)/i // Puffin - ], [[NAME, 'Puffin'], VERSION], [ - - /(focus)\/([\w\.]+)/i // Firefox Focus - ], [[NAME, 'Firefox Focus'], VERSION], [ - - /(opt)\/([\w\.]+)/i // Opera Touch - ], [[NAME, 'Opera Touch'], VERSION], [ - - /((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i // UCBrowser - ], [[NAME, 'UCBrowser'], VERSION], [ - - /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon - ], [[NAME, /_/g, ' '], VERSION], [ - - /(windowswechat qbcore)\/([\w\.]+)/i // WeChat Desktop for Windows Built-in Browser - ], [[NAME, 'WeChat(Win) Desktop'], VERSION], [ - - /(micromessenger)\/([\w\.]+)/i // WeChat - ], [[NAME, 'WeChat'], VERSION], [ - - /(brave)\/([\w\.]+)/i // Brave browser - ], [[NAME, 'Brave'], VERSION], [ - - /(qqbrowserlite)\/([\w\.]+)/i // QQBrowserLite - ], [NAME, VERSION], [ - - /(QQ)\/([\d\.]+)/i // QQ, aka ShouQ - ], [NAME, VERSION], [ - - /m?(qqbrowser)[\/\s]?([\w\.]+)/i // QQBrowser - ], [NAME, VERSION], [ - - /(baiduboxapp)[\/\s]?([\w\.]+)/i // Baidu App - ], [NAME, VERSION], [ - - /(2345Explorer)[\/\s]?([\w\.]+)/i // 2345 Browser - ], [NAME, VERSION], [ - - /(MetaSr)[\/\s]?([\w\.]+)/i // SouGouBrowser - ], [NAME], [ - - /(LBBROWSER)/i // LieBao Browser - ], [NAME], [ - - /xiaomi\/miuibrowser\/([\w\.]+)/i // MIUI Browser - ], [VERSION, [NAME, 'MIUI Browser']], [ - - /;fbav\/([\w\.]+);/i // Facebook App for iOS & Android - ], [VERSION, [NAME, 'Facebook']], [ - - /safari\s(line)\/([\w\.]+)/i, // Line App for iOS - /android.+(line)\/([\w\.]+)\/iab/i // Line App for Android - ], [NAME, VERSION], [ - - /headlesschrome(?:\/([\w\.]+)|\s)/i // Chrome Headless - ], [VERSION, [NAME, 'Chrome Headless']], [ - - /\swv\).+(chrome)\/([\w\.]+)/i // Chrome WebView - ], [[NAME, /(.+)/, '$1 WebView'], VERSION], [ - - /((?:oculus|samsung)browser)\/([\w\.]+)/i - ], [[NAME, /(.+(?:g|us))(.+)/, '$1 $2'], VERSION], [ // Oculus / Samsung Browser - - /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i // Android Browser - ], [VERSION, [NAME, 'Android Browser']], [ - - /(sailfishbrowser)\/([\w\.]+)/i // Sailfish Browser - ], [[NAME, 'Sailfish Browser'], VERSION], [ - - /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i - // Chrome/OmniWeb/Arora/Tizen/Nokia - ], [NAME, VERSION], [ - - /(dolfin)\/([\w\.]+)/i // Dolphin - ], [[NAME, 'Dolphin'], VERSION], [ - - /(qihu|qhbrowser|qihoobrowser|360browser)/i // 360 - ], [[NAME, '360 Browser']], [ - - /((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS - ], [[NAME, 'Chrome'], VERSION], [ - - /(coast)\/([\w\.]+)/i // Opera Coast - ], [[NAME, 'Opera Coast'], VERSION], [ - - /fxios\/([\w\.-]+)/i // Firefox for iOS - ], [VERSION, [NAME, 'Firefox']], [ - - /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari - ], [VERSION, [NAME, 'Mobile Safari']], [ - - /version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile - ], [VERSION, NAME], [ - - /webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Google Search Appliance on iOS - ], [[NAME, 'GSA'], VERSION], [ - - /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 - ], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [ - - /(webkit|khtml)\/([\w\.]+)/i - ], [NAME, VERSION], [ - - // Gecko based - /(navigator|netscape)\/([\w\.-]+)/i // Netscape - ], [[NAME, 'Netscape'], VERSION], [ - /(swiftfox)/i, // Swiftfox - /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, - // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror - /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i, - - // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix - /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla - - // Other - /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, - // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir - /(links)\s\(([\w\.]+)/i, // Links - /(gobrowser)\/?([\w\.]*)/i, // GoBrowser - /(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser - /(mosaic)[\/\s]([\w\.]+)/i // Mosaic - ], [NAME, VERSION] - ], - - cpu : [[ - - /(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64 - ], [[ARCHITECTURE, 'amd64']], [ - - /(ia32(?=;))/i // IA32 (quicktime) - ], [[ARCHITECTURE, util.lowerize]], [ - - /((?:i[346]|x)86)[;\)]/i // IA32 - ], [[ARCHITECTURE, 'ia32']], [ - - // PocketPC mistakenly identified as PowerPC - /windows\s(ce|mobile);\sppc;/i - ], [[ARCHITECTURE, 'arm']], [ - - /((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC - ], [[ARCHITECTURE, /ower/, '', util.lowerize]], [ - - /(sun4\w)[;\)]/i // SPARC - ], [[ARCHITECTURE, 'sparc']], [ - - /((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i - // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC - ], [[ARCHITECTURE, util.lowerize]] - ], - - device : [[ - - /\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i // iPad/PlayBook - ], [MODEL, VENDOR, [TYPE, TABLET]], [ - - /applecoremedia\/[\w\.]+ \((ipad)/ // iPad - ], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [ - - /(apple\s{0,1}tv)/i // Apple TV - ], [[MODEL, 'Apple TV'], [VENDOR, 'Apple'], [TYPE, SMARTTV]], [ - - /(archos)\s(gamepad2?)/i, // Archos - /(hp).+(touchpad)/i, // HP TouchPad - /(hp).+(tablet)/i, // HP Tablet - /(kindle)\/([\w\.]+)/i, // Kindle - /\s(nook)[\w\s]+build\/(\w+)/i, // Nook - /(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak - ], [VENDOR, MODEL, [TYPE, TABLET]], [ - - /(kf[A-z]+)\sbuild\/.+silk\//i // Kindle Fire HD - ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [ - /(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i // Fire Phone - ], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [ - /android.+aft([bms])\sbuild/i // Fire TV - ], [MODEL, [VENDOR, 'Amazon'], [TYPE, SMARTTV]], [ - - /\((ip[honed|\s\w*]+);.+(apple)/i // iPod/iPhone - ], [MODEL, VENDOR, [TYPE, MOBILE]], [ - /\((ip[honed|\s\w*]+);/i // iPod/iPhone - ], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [ - - /(blackberry)[\s-]?(\w+)/i, // BlackBerry - /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i, - // BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron - /(hp)\s([\w\s]+\w)/i, // HP iPAQ - /(asus)-?(\w+)/i // Asus - ], [VENDOR, MODEL, [TYPE, MOBILE]], [ - /\(bb10;\s(\w+)/i // BlackBerry 10 - ], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [ - // Asus Tablets - /android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i - ], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [ - - /(sony)\s(tablet\s[ps])\sbuild\//i, // Sony - /(sony)?(?:sgp.+)\sbuild\//i - ], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [ - /android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i - ], [MODEL, [VENDOR, 'Sony'], [TYPE, MOBILE]], [ - - /\s(ouya)\s/i, // Ouya - /(nintendo)\s([wids3u]+)/i // Nintendo - ], [VENDOR, MODEL, [TYPE, CONSOLE]], [ - - /android.+;\s(shield)\sbuild/i // Nvidia - ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [ - - /(playstation\s[34portablevi]+)/i // Playstation - ], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [ - - /(sprint\s(\w+))/i // Sprint Phones - ], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [ - - /(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i, // HTC - /(zte)-(\w*)/i, // ZTE - /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i - // Alcatel/GeeksPhone/Nexian/Panasonic/Sony - ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ - - /(nexus\s9)/i // HTC Nexus 9 - ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [ - - /d\/huawei([\w\s-]+)[;\)]/i, - /(nexus\s6p|vog-l29|ane-lx1|eml-l29|ele-l29)/i // Huawei - ], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [ - - /android.+(bah2?-a?[lw]\d{2})/i // Huawei MediaPad - ], [MODEL, [VENDOR, 'Huawei'], [TYPE, TABLET]], [ - - /(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia - ], [VENDOR, MODEL, [TYPE, MOBILE]], [ - - /[\s\(;](xbox(?:\sone)?)[\s\);]/i // Microsoft Xbox - ], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [ - /(kin\.[onetw]{3})/i // Microsoft Kin - ], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [ - - // Motorola - /\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i, - /mot[\s-]?(\w*)/i, - /(XT\d{3,4}) build\//i, - /(nexus\s6)/i - ], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [ - /android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i - ], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [ - - /hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i // HbbTV devices - ], [[VENDOR, util.trim], [MODEL, util.trim], [TYPE, SMARTTV]], [ - - /hbbtv.+maple;(\d+)/i - ], [[MODEL, /^/, 'SmartTV'], [VENDOR, 'Samsung'], [TYPE, SMARTTV]], [ - - /\(dtv[\);].+(aquos)/i // Sharp - ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [ - - /android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i, - /((SM-T\w+))/i - ], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung - /smart-tv.+(samsung)/i - ], [VENDOR, [TYPE, SMARTTV], MODEL], [ - /((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i, - /(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i, - /sec-((sgh\w+))/i - ], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [ - - /sie-(\w*)/i // Siemens - ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [ - - /(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia - /(nokia)[\s_-]?([\w-]*)/i - ], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [ - - /android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i // Acer - ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [ - - /android.+([vl]k\-?\d{3})\s+build/i // LG Tablet - ], [MODEL, [VENDOR, 'LG'], [TYPE, TABLET]], [ - /android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet - ], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [ - /(lg) netcast\.tv/i // LG SmartTV - ], [VENDOR, MODEL, [TYPE, SMARTTV]], [ - /(nexus\s[45])/i, // LG - /lg[e;\s\/-]+(\w*)/i, - /android.+lg(\-?[\d\w]+)\s+build/i - ], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [ - - /(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i // Lenovo tablets - ], [VENDOR, MODEL, [TYPE, TABLET]], [ - /android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo - ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [ - /(lenovo)[_\s-]?([\w-]+)/i - ], [VENDOR, MODEL, [TYPE, MOBILE]], [ - - /linux;.+((jolla));/i // Jolla - ], [VENDOR, MODEL, [TYPE, MOBILE]], [ - - /((pebble))app\/[\d\.]+\s/i // Pebble - ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ - - /android.+;\s(oppo)\s?([\w\s]+)\sbuild/i // OPPO - ], [VENDOR, MODEL, [TYPE, MOBILE]], [ - - /crkey/i // Google Chromecast - ], [[MODEL, 'Chromecast'], [VENDOR, 'Google'], [TYPE, SMARTTV]], [ - - /android.+;\s(glass)\s\d/i // Google Glass - ], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [ - - /android.+;\s(pixel c)[\s)]/i // Google Pixel C - ], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [ - - /android.+;\s(pixel( [23])?( xl)?)[\s)]/i // Google Pixel - ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [ - - /android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models - /android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi - /android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i, - // Xiaomi Mi - /android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i // Redmi Phones - ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [ - /android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i // Mi Pad tablets - ],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [ - /android.+;\s(m[1-5]\snote)\sbuild/i // Meizu - ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [ - /(mz)-([\w-]{2,})/i - ], [[VENDOR, 'Meizu'], MODEL, [TYPE, MOBILE]], [ - - /android.+a000(1)\s+build/i, // OnePlus - /android.+oneplus\s(a\d{4})[\s)]/i - ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [ - - /android.+[;\/]\s*(RCT[\d\w]+)\s+build/i // RCA Tablets - ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [ - - /android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i // Dell Venue Tablets - ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [ - - /android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i // Verizon Tablet - ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [ - - /android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i // Barnes & Noble Tablet - ], [[VENDOR, 'Barnes & Noble'], MODEL, [TYPE, TABLET]], [ - - /android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i // Barnes & Noble Tablet - ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [ - - /android.+;\s(k88)\sbuild/i // ZTE K Series Tablet - ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [ - - /android.+[;\/]\s*(gen\d{3})\s+build.*49h/i // Swiss GEN Mobile - ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [ - - /android.+[;\/]\s*(zur\d{3})\s+build/i // Swiss ZUR Tablet - ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [ - - /android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i // Zeki Tablets - ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [ - - /(android).+[;\/]\s+([YR]\d{2})\s+build/i, - /android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i // Dragon Touch Tablet - ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [ - - /android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i // Insignia Tablets - ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [ - - /android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i // NextBook Tablets - ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [ - - /android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i - ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ // Voice Xtreme Phones - - /android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i // LvTel Phones - ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [ - - /android.+;\s(PH-1)\s/i - ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [ // Essential PH-1 - - /android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i // Envizen Tablets - ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [ - - /android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i // Le Pan Tablets - ], [VENDOR, MODEL, [TYPE, TABLET]], [ - - /android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i // MachSpeed Tablets - ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [ - - /android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i // Trinity Tablets - ], [VENDOR, MODEL, [TYPE, TABLET]], [ - - /android.+[;\/]\s*TU_(1491)\s+build/i // Rotor Tablets - ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [ - - /android.+(KS(.+))\s+build/i // Amazon Kindle Tablets - ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [ - - /android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i // Gigaset Tablets - ], [VENDOR, MODEL, [TYPE, TABLET]], [ - - /\s(tablet|tab)[;\/]/i, // Unidentifiable Tablet - /\s(mobile)(?:[;\/]|\ssafari)/i // Unidentifiable Mobile - ], [[TYPE, util.lowerize], VENDOR, MODEL], [ - - /[\s\/\(](smart-?tv)[;\)]/i // SmartTV - ], [[TYPE, SMARTTV]], [ - - /(android[\w\.\s\-]{0,9});.+build/i // Generic Android Device - ], [MODEL, [VENDOR, 'Generic']] - ], - - engine : [[ - - /windows.+\sedge\/([\w\.]+)/i // EdgeHTML - ], [VERSION, [NAME, 'EdgeHTML']], [ - - /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink - ], [VERSION, [NAME, 'Blink']], [ - - /(presto)\/([\w\.]+)/i, // Presto - /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, - // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna - /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links - /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab - ], [NAME, VERSION], [ - - /rv\:([\w\.]{1,9}).+(gecko)/i // Gecko - ], [VERSION, NAME] - ], - - os : [[ - - // Windows based - /microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes) - ], [NAME, VERSION], [ - /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT - /(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, // Windows Phone - /(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i - ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ - /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i - ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ - - // Mobile/Embedded OS - /\((bb)(10);/i // BlackBerry 10 - ], [[NAME, 'BlackBerry'], VERSION], [ - /(blackberry)\w*\/?([\w\.]*)/i, // Blackberry - /(tizen|kaios)[\/\s]([\w\.]+)/i, // Tizen/KaiOS - /(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i - // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki/Sailfish OS - ], [NAME, VERSION], [ - /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i // Symbian - ], [[NAME, 'Symbian'], VERSION], [ - /\((series40);/i // Series 40 - ], [NAME], [ - /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS - ], [[NAME, 'Firefox OS'], VERSION], [ - - // Console - /(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation - - // GNU/Linux based - /(mint)[\/\s\(]?(\w*)/i, // Mint - /(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux - /(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i, - // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware - // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus - /(hurd|linux)\s?([\w\.]*)/i, // Hurd/Linux - /(gnu)\s?([\w\.]*)/i // GNU - ], [NAME, VERSION], [ - - /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS - ], [[NAME, 'Chromium OS'], VERSION],[ - - // Solaris - /(sunos)\s?([\w\.\d]*)/i // Solaris - ], [[NAME, 'Solaris'], VERSION], [ - - // BSD based - /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly - ], [NAME, VERSION],[ - - /(haiku)\s(\w+)/i // Haiku - ], [NAME, VERSION],[ - - /cfnetwork\/.+darwin/i, - /ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i // iOS - ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ - - /(mac\sos\sx)\s?([\w\s\.]*)/i, - /(macintosh|mac(?=_powerpc)\s)/i // Mac OS - ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ - - // Other - /((?:open)?solaris)[\/\s-]?([\w\.]*)/i, // Solaris - /(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, // AIX - /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i, - // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS/Fuchsia - /(unix)\s?([\w\.]*)/i // UNIX - ], [NAME, VERSION] - ] - }; - - - ///////////////// - // Constructor - //////////////// - var UAParser = function (uastring, extensions) { - - if (typeof uastring === 'object') { - extensions = uastring; - uastring = undefined; - } - - if (!(this instanceof UAParser)) { - return new UAParser(uastring, extensions).getResult(); - } - - var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); - var rgxmap = extensions ? util.extend(regexes, extensions) : regexes; - - this.getBrowser = function () { - var browser = { name: undefined, version: undefined }; - mapper.rgx.call(browser, ua, rgxmap.browser); - browser.major = util.major(browser.version); // deprecated - return browser; - }; - this.getCPU = function () { - var cpu = { architecture: undefined }; - mapper.rgx.call(cpu, ua, rgxmap.cpu); - return cpu; - }; - this.getDevice = function () { - var device = { vendor: undefined, model: undefined, type: undefined }; - mapper.rgx.call(device, ua, rgxmap.device); - return device; - }; - this.getEngine = function () { - var engine = { name: undefined, version: undefined }; - mapper.rgx.call(engine, ua, rgxmap.engine); - return engine; - }; - this.getOS = function () { - var os = { name: undefined, version: undefined }; - mapper.rgx.call(os, ua, rgxmap.os); - return os; - }; - this.getResult = function () { - return { - ua : this.getUA(), - browser : this.getBrowser(), - engine : this.getEngine(), - os : this.getOS(), - device : this.getDevice(), - cpu : this.getCPU() - }; - }; - this.getUA = function () { - return ua; - }; - this.setUA = function (uastring) { - ua = uastring; - return this; - }; - return this; - }; - - UAParser.VERSION = LIBVERSION; - UAParser.BROWSER = { - NAME : NAME, - MAJOR : MAJOR, // deprecated - VERSION : VERSION - }; - UAParser.CPU = { - ARCHITECTURE : ARCHITECTURE - }; - UAParser.DEVICE = { - MODEL : MODEL, - VENDOR : VENDOR, - TYPE : TYPE, - CONSOLE : CONSOLE, - MOBILE : MOBILE, - SMARTTV : SMARTTV, - TABLET : TABLET, - WEARABLE: WEARABLE, - EMBEDDED: EMBEDDED - }; - UAParser.ENGINE = { - NAME : NAME, - VERSION : VERSION - }; - UAParser.OS = { - NAME : NAME, - VERSION : VERSION - }; - - /////////// - // Export - ////////// - - - // check js environment - if (typeof(exports) !== UNDEF_TYPE) { - // nodejs env - if (typeof module !== UNDEF_TYPE && module.exports) { - exports = module.exports = UAParser; - } - exports.UAParser = UAParser; - } else { - // requirejs env (optional) - if (typeof(define) === 'function' && define.amd) { - define(function () { - return UAParser; - }); - } else if (window) { - // browser env - window.UAParser = UAParser; - } - } - - // jQuery/Zepto specific (optional) - // Note: - // In AMD env the global scope should be kept clean, but jQuery is an exception. - // jQuery always exports to global scope, unless jQuery.noConflict(true) is used, - // and we should catch that. - var $ = window && (window.jQuery || window.Zepto); - if ($ && !$.ua) { - var parser = new UAParser(); - $.ua = parser.getResult(); - $.ua.get = function () { - return parser.getUA(); - }; - $.ua.set = function (uastring) { - parser.setUA(uastring); - var result = parser.getResult(); - for (var prop in result) { - $.ua[prop] = result[prop]; - } - }; - } - -})(typeof window === 'object' ? window : this);
--- a/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Thu Nov 19 09:10:36 2020 +0100 +++ b/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Thu Nov 19 10:21:20 2020 +0100 @@ -158,9 +158,9 @@ ${CMAKE_SOURCE_DIR}/../WebApplication/app.css ${CMAKE_SOURCE_DIR}/../WebApplication/app.js ${CMAKE_SOURCE_DIR}/../WebApplication/index.html + ${CMAKE_SOURCE_DIR}/../WebApplication/open-sans.css ${CMAKE_SOURCE_DIR}/../WebApplication/pdf-viewer.js ${CMAKE_SOURCE_DIR}/../WebApplication/print.js - ${CMAKE_SOURCE_DIR}/../WebApplication/ua-parser.js # TODO => Package this from https://github.com/faisalman/ua-parser-js/releases ${STONE_WRAPPER} DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX} )
--- a/Applications/StoneWebViewer/WebAssembly/JavaScriptLibraries.cmake Thu Nov 19 09:10:36 2020 +0100 +++ b/Applications/StoneWebViewer/WebAssembly/JavaScriptLibraries.cmake Thu Nov 19 10:21:20 2020 +0100 @@ -95,5 +95,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/fontawesome-free-5.14.0-web/webfonts/fa-solid-900.ttf ${CMAKE_CURRENT_BINARY_DIR}/fontawesome-free-5.14.0-web/webfonts/fa-solid-900.woff ${CMAKE_CURRENT_BINARY_DIR}/fontawesome-free-5.14.0-web/webfonts/fa-solid-900.woff2 + ${CMAKE_SOURCE_DIR}/../Resources/OpenSans/2017-11-13-OpenSans-Regular.ttf + ${CMAKE_SOURCE_DIR}/../Resources/OpenSans/2017-11-13-OpenSans-Regular.woff2 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/webfonts )