Update chart.js to 2.9.4

This commit is contained in:
Laurent Destailleur 2020-12-07 21:57:29 +01:00
parent 796fe5cd8a
commit 85bb3fa909
19 changed files with 180 additions and 2875 deletions

View File

@ -39,7 +39,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
JS libraries:
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
ChartJS 2.9.3 MIT License Yes JS library for graph
ChartJS 2.9.4 MIT License Yes JS library for graph
jQuery 3.5.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css

View File

@ -581,23 +581,36 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
# Removed files installed by the awful composer
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/composer`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/doctrine`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/docs`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/.github`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/docs`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
@ -612,21 +625,17 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
}
# Build package for each target

View File

@ -59,4 +59,4 @@
"ext-zip" : "ODT, Excel and file compression support",
"ext-xml" : "Excel support"
}
}
}

261
composer.lock generated
View File

@ -6,6 +6,53 @@
],
"content-hash": "1dbd2d05cc0836acfca5988f29005cf2",
"packages": [
{
"name": "Psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2020-03-23T09:12:05+00:00"
},
{
"name": "ckeditor/ckeditor",
"version": "4.12.1",
@ -221,12 +268,12 @@
"source": {
"type": "git",
"url": "https://github.com/chartjs/Chart.js.git",
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2"
"reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/06f73dc3590084b2c464bf08189c7aee2b6b92d2",
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2",
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/9bd4cf82fda9f50a5fb50b72843e06ab88124278",
"reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278",
"shasum": ""
},
"require": {
@ -254,7 +301,11 @@
"JS",
"chart"
],
"time": "2019-11-14T18:37:30+00:00"
"support": {
"issues": "https://github.com/chartjs/Chart.js/issues",
"source": "https://github.com/chartjs/Chart.js/tree/v2.9.4"
},
"time": "2020-10-19T12:22:11+00:00"
},
{
"name": "phpoffice/phpexcel",
@ -314,53 +365,6 @@
"abandoned": "phpoffice/phpspreadsheet",
"time": "2015-05-01T07:00:55+00:00"
},
{
"name": "Psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2020-03-23T09:12:05+00:00"
},
{
"name": "restler/framework",
"version": "3.0.0-RC6",
@ -2037,159 +2041,6 @@
],
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "639447d008615574653fb3bc60d1986d7172eaae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
"reference": "639447d008615574653fb3bc60d1986d7172eaae",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php72\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981",
"reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981",
"shasum": ""
},
"require": {
"php": ">=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "symfony/yaml",
"version": "v3.4.32",
@ -2312,5 +2163,5 @@
"ext-curl": "*"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"
"plugin-api-version": "2.0.0"
}

View File

@ -1,142 +0,0 @@
# Frequently Asked Questions (FAQ)
## Can I print to File Format X with this?
If you are trying to generate XPS, PDF or DOCX or HTML files from PHP, then you are most likely in the wrong place.
The purpose of this driver it to generate binary ESC/POS code, which is understood by many embedded thermal receipt and impact printers.
## I have Printer X. Can I use this driver?
If the printer understands ESC/POS, and you know how to get raw binary data to it, then yes. Otherwise, no.
The [list of printers that are known to work](https://github.com/mike42/escpos-php/blob/development/README.md#printers) is crowd-sourced. We appreciate it when developers try out the driver, then [file information on the bug tracker](https://github.com/mike42/escpos-php/issues/new) with some information about which features worked on their model of printer.
To see how well your printer works, first check that it supports ESC/POS, then begin by attempting to send the text "Hello World" to your printer on the command-line, from the computer that will run PHP.
Once you solve this, [try to do the same from PHP](https://github.com/mike42/escpos-php/blob/development/README.md#basic-usage) using the default profile. Further details are in the [README](https://github.com/mike42/escpos-php/blob/development/README.md) file.
## Can you add support for Printer X?
Features vary between printers, so we collaborate on an ESC/POS printer compatibility database to collect known differences: [receipt-print-hq/escpos-printer-db](https://github.com/receipt-print-hq/escpos-printer-db).
If you encounter garbage output when you try to print images or special characters, then please submit a test page and a link to vendor documentation to the `escpos-printer-db` project, so that support can be improved for future versions.
## I have a printer that does not understand ESC/POS. Can I use this driver?
No. The purpose of this driver it to generate binary ESC/POS code. If your printer doesn't understand that, then this code wont be much use to you.
Some printers do have an emulation mode for ESC/POS. The vendor docs will tell if this is the case, and how to enable it.
## Why do I get this error when I try to print?
Start by testing that you can send text to your printer outside of escpos-php. The examples linked to in the README are commented with some commands to get you started.
Generally, initial setup problems seem to have one of these causes:
1. You are writing to the wrong place. Writing to `LPT1` does not output to parallel port on Linux, and `/dev/ttyS0` is not a serial printer on Windows.
2. The printer has not been set up to accept printing the way you expect. This means permissions on Linux, network printers being configured, and shared printers having user accounts and firewalls set up correctly on the print server.
3. Your printer actually doesn't work (rare but possible).
To be clear, these are not escpos-php issues: No amount of PHP code can set up your printer for you. Instead, the driver relies on developers determining how their setup is going to work before using a connector to transport data to their printer.
Once you have a working command to send text to your printer (from the PHP server), you are ready to use escpos-php. You can try to use a PrintConnector now, based on your operating system and printer interface. A table is located in the README to help you select the right one.
The connectors are-
- `FilePrintConnector` and `NetworkPrintConnector` directly use files or network sockets.
- `WindowsPrintConnector` and `CupsPrintConnector` tie in with Windows and Unix system printing.
- `DummyPrintConnector` does not connect to a real printer, and can be used to save ESC/POS receipts to a database, for example.
At this point, you might find that the way you would like to print is not supported by escpos-php. You can post your printing command as a feature request on the issue tracker.
Lastly, you may run in to the final common trap:
4. Your PHP is not running with the same sort of permissions as your login account. Again, no amount of PHP code can fix this. For example, on LAMP, your `www-data` user needs to be in the `lp` group, while on WAMP, `Local Service` account may run in to problems. SELinux and firewalls are also worth a look.
When printing fails, you can expect a PHP Exception that explains what went wrong. They are all clues:
- `Warning: copy(\\pc\printer): failed to open stream: Permission denied`
- `/dev/usb/lp0: Permission denied`
- `User name or password is incorrect`
Ensure that while you are developing, you configure PHP to show error messages, so that you can see these problems.
Please file a bug if you think that there is a specific situation which escpos-php could provide better error messages for.
## Can I print over the network?
Certainly, as long as your printer is available over the network.
- `NetworkPrintConnector` will speak directly to an Ethernet-connected printer on port 9100.
For USB or Serial printers, you need to install the printer on a computer and then share it, so that it becomes network-accessible.
- `WindowsPrintConnector` will connect to Windows shared printers from Windows or Linux (Linux users will need Samba).
- `CupsPrintConnector` will connect to CUPS-shared printers from Linux or Mac.
Always start by testing your shared printer setup outside of escpos-php. The examples linked to in the README are commented with some example commands to get you started. Typically, networks, firewalls and permissions need to be set up.
Once you have a working command to send text to your printer (from the PHP server), you are ready to use escpos-php.
If you have any issues at this stage, please ask on the issue tracker, and include the commands that you used to verify your setup.
## Can I print from my server on the Internet?
Since PHP is a server-side language, escpos-php is a server-side print library. The driver is able to transport data between a server and a printer in a few different ways, all of them server-side. For example, you may print to a USB printer *connected to the server running PHP*, or an Ethernet printer *on a network accessible to the server*.
Many developers dream of having an application that is hosted on the public Internet, with POS terminals accessing it, and printing via a web browser. Because the webserver cannot see the printer in this sort of setup, a server-side print driver is not much use.
Because of this, there are no cut-and-paste recipes available, but here are two top-level approaches you could take:
1. Architect your application so that the server can see your printer
2. Use an application which runs client-side to deliver print data instead
### Option 1: Allow the server to print
Server-side printing is viable if the server can get to the printer. Here are some ways it could work:
- Run your server on the LAN instead, and read the section above about printing over the network
- Set up a VPN so that your cloud-hosted server can also access the LAN
- Expose the printer via some other secure tunnel to the server, via SSH or TLS
Please do your own research to determine how these may apply to your setup- the escpos-php issue tracker is not a place where you should be requesting network support.
### Option 2: Use client software to print
If you aren't able to set up some network infrastructure to implement the above, then you cannot use a server-side print driver.
Here are some browser-based printing tools which you may like to consider instead.
- Use system printing with a vendor driver, and some good `@media print` CSS
- [Chrome Raw Print](https://github.com/receipt-print-hq/chrome-raw-print) app
- [qz](https://qz.io/)
- [ePOS-Device SDK for JavaScript](https://reference.epson-biz.com/modules/ref_epos_device_js_en/index.php?content_id=139). Requires network interface card that supports ePOS (UB-E04/R04)
Please direct queries about client-side printing products to the appropriate project.
## Why is image printing slow?
Three things tend to slow down the image processing:
1. Slow PHP code
2. Data link
3. The printer itself
First, ensure you have the Imagick plugin loaded. The driver will avoid a slower image processing implementation once you've got it.
Next, connect over a faster interface. Serial printers have a low bit-rate, and the printer spends a lot of time waiting for data. If you have USB or Ethernet, then use it (note: storing graphics to the printer memory is not currently implemented).
Lastly, the printer will go faster if you use less pixels. Since images are two-dimensional, scaling down by 50% removes 75% of the pixels. The driver can then print at a half the density, so that your lower resolution image appears the same size when printed.
## How can I get the status of the printer?
This feature is not implemented, but a solution for some Epson printers is planned.
Only `FilePrintConnector` or `NetworkPrintConnector` will support reading from the printer, ensure that you migrate to those if you would like these features.
## How do I produce this complex layout?
ESC/POS "page mode" is not currently supported, which would allow some printers to render some more complex layouts natively
Since the output is raster anyway, it is suggested that you render your output to an image and print that instead. The driver supports PDF printing via Imagick, and an example that uses `wkhtmltoimage` is available in the repository.

View File

@ -1,20 +0,0 @@
html: escpos.doxyfile
# Compile
doxygen escpos.doxyfile
# Filter out warnings on README.md- doxygen cannot handle image links that
# are used there: [![Caption](https://example.com/target)](https://example.com/image)
sed -i '/README.md\:/d' warnings.log
# Show warnings log
cat warnings.log
# Return failure if there were any doc warnings
[ ! -s warnings.log ]
latex: html
# Do nothing
xml: html
xsltproc xml/combine.xslt xml/index.xml > all.xml
clean:
rm --preserve-root -Rf html latex xml doxygen_sqlite3.db all.xml warnings.log

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +0,0 @@
**Reporting issues**
1. Specify the User-agent by visiting [http://demo.mobiledetect.net](http://demo.mobiledetect.net).
1. Specify the expected behaviour.
**Developing**
1. Fork Mobile Detect repository. See ["How to fork"](https://help.github.com/articles/fork-a-repo/#fork-an-example-repository) example.
1. `git clone https://github.com/[yourname]/Mobile-Detect.git`
1. `git add remote serbanghita https://github.com/serbanghita/Mobile-Detect.git`
1. `git remote -v` - You should see:
```
origin git@github.com:serbanghita/Mobile-Detect.git
serbanghita https://github.com/serbanghita/Mobile-Detect.git
```
1. `git checkout -b devel origin/devel`
1. `composer install`
1. Start working on your changes.
1. If you add new methods or make structural changes to the `Mobile_Detect.php` class
you need to add unit tests!
1. If you add new regexes make sure you commit the User-Agents in [`tests/providers/vendors`](https://github.com/serbanghita/Mobile-Detect/tree/master/tests/providers/vendors)
1. Run tests `vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-text --strict-coverage --stop-on-risky`
1. `git status` or `git diff` - inspect your changes
1 `git stage .`
1. `git commit -m "[your commit message here]`
1. `git push origin devel`
1. Go to your repo on GitHub and ["Submit the PR"](https://help.github.com/articles/about-pull-requests/)
**New module, plugin, plugin or port**
[Submit new module, plugin, port](../../issues/new?title=New%203rd%20party%20module&body=Name,%20Link%20and%20Description%20of%20the%20module.)
including the following information:
* Module name
* Description
* Link
* Author
Or you can submit a PR against `README.md`.
**Website updates**
1. Our official website is hosted at [http://mobiledetect.net](http://mobiledetect.net).
1. The files are found on the `gh-pages` branch.
1. `git checkout gh-pages`
1. `npm install -g browser-sync`
1. `browser-sync start --s . --f . --port 3000 --reload-debounce 1500 --no-ui`
1. Go to `http://localhost:3000` and make changes.
1. Commit, push and submit the PR against `serbanghita:gh-pages`.

View File

@ -1,11 +0,0 @@
The first version of the script was developed in 2009 and it was hosted at https://code.google.com/p/php-mobile-detect/, it was a small project with around 30 stars. (Original blog post by Victor: http://victorstanciu.ro/detectarea-platformelor-mobile-in-php/)
In December 2011 it received a major update from the first version, an important number of issues were fixed, then 2.0 was launched. The new version marks a new mindset and also featuring tablet detection.
Throughout 2012 the script has been updated constantly and we have received tons of feedback and requests.
In July 2012 we moved the repository from Google Code to GitHub in order to quickly accommodate the frequent updates and to involve more people.
In August 2013 the library has 1800+ stargazers and support for: composer, PHPUnit tests, PSR standards and a new webpage http://mobiledetect.net
Mobile Detect library and user contributions are <a href="https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt">MIT Licensed</a>.

View File

@ -1,15 +0,0 @@
-------------delete this message-------------
* By submitting a new issue I acknowledge that I already read the README, CODE EXAMPLES and KNOWN LIMITATIONS.
* I understand that the current version `2.x` is only meant to detect `mobile` devices.
* Please post your User-Agent string! On a real device/s, the library is expected to work correctly.
-------------delete this message-------------
**Issue description**
**User-Agent(s)**
**Suggestions**

View File

@ -1,12 +0,0 @@
**Known limitations**
* Mobile Detect script was designed to detect `mobile` devices. Implicitly other devices are considered to be `desktop`.
* User-Agent and HTTP headers sniffing is a non reliable method of detecting a mobile device.
* If the mobile browser is set on `Desktop mode`, the Mobile Detect script has no way of knowing that the device is `mobile`.
* Some touchscreen devices (eg. Microsoft Surface) are tough to detect as mobile since they can be used in a laptop mode. See: [#32](https://github.com/serbanghita/Mobile-Detect/issues/32), [#461](https://github.com/serbanghita/Mobile-Detect/issues/461), [#667](https://github.com/serbanghita/Mobile-Detect/issues/667)
* Some mobile devices (eg. IPadOS, Google Pixel Slate). See: [#795](https://github.com/serbanghita/Mobile-Detect/issues/795), [#788](https://github.com/serbanghita/Mobile-Detect/issues/788)
* Detecting the device brand (eg. Apple, Samsung, HTC) is not 100% reliable.
* We don't monitor the quality of the 3rd party tools based on Mobile Detect script.
We cannot guarantee that they are using the class properly or if they provide the latest version.
* Version `2.x` is made to be PHP 5.3 compatible because of the backward compatibility changes of PHP.
* There are hundreds of devices launched every month, we cannot keep a 100% up to date detection rate.

View File

@ -1,6 +1,8 @@
language: node_js
node_js:
- lts/*
# Using node 12.18.2 instead of lts
# https://github.com/chartjs/Chart.js/issues/7863#issuecomment-705222874
- "12.18.2"
before_install:
- "export CHROME_BIN=/usr/bin/google-chrome"

View File

@ -1,25 +1,26 @@
{
"name" : "nnnick/chartjs",
"type" : "library",
"description" : "Simple HTML5 charts using the canvas element.",
"keywords" : [
"chart",
"js"
],
"homepage" : "https://www.chartjs.org/",
"license" : "MIT",
"authors" : [{
"name" : "NICK DOWNIE",
"email" : "hello@nickdownie.com"
}
],
"require" : {
"php" : ">=5.3.3"
},
"minimum-stability" : "stable",
"extra" : {
"branch-alias" : {
"release/2.0" : "v2.0-dev"
}
}
}
"name": "nnnick/chartjs",
"type": "library",
"description": "Simple HTML5 charts using the canvas element.",
"keywords": [
"chart",
"js"
],
"homepage": "https://www.chartjs.org/",
"license": "MIT",
"authors": [
{
"name": "NICK DOWNIE",
"email": "hello@nickdownie.com"
}
],
"require": {
"php": ">=5.3.3"
},
"minimum-stability": "stable",
"extra": {
"branch-alias": {
"release/2.0": "v2.0-dev"
}
}
}

View File

@ -1,7 +1,7 @@
/*!
* Chart.js v2.9.3
* Chart.js v2.9.4
* https://www.chartjs.org
* (c) 2019 Chart.js Contributors
* (c) 2020 Chart.js Contributors
* Released under the MIT License
*/
(function (global, factory) {
@ -2107,6 +2107,10 @@ if (typeof window !== 'undefined') {
var chartjsColor = Color;
function isValidKey(key) {
return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;
}
/**
* @namespace Chart.helpers
*/
@ -2282,7 +2286,7 @@ var helpers = {
}
if (helpers.isObject(source)) {
var target = {};
var target = Object.create(source);
var keys = Object.keys(source);
var klen = keys.length;
var k = 0;
@ -2303,6 +2307,12 @@ var helpers = {
* @private
*/
_merger: function(key, target, source, options) {
if (!isValidKey(key)) {
// We want to ensure we do not copy prototypes over
// as this can pollute global namespaces
return;
}
var tval = target[key];
var sval = source[key];
@ -2318,6 +2328,12 @@ var helpers = {
* @private
*/
_mergerIf: function(key, target, source) {
if (!isValidKey(key)) {
// We want to ensure we do not copy prototypes over
// as this can pollute global namespaces
return;
}
var tval = target[key];
var sval = source[key];
@ -3816,7 +3832,7 @@ helpers$1.extend(DatasetController.prototype, {
*/
_configure: function() {
var me = this;
me._config = helpers$1.merge({}, [
me._config = helpers$1.merge(Object.create(null), [
me.chart.options.datasets[me._type],
me.getDataset(),
], {
@ -7086,7 +7102,8 @@ function updateDims(chartArea, params, layout) {
chartArea.h = newHeight;
// return true if chart area changed in layout's direction
return layout.horizontal ? newWidth !== chartArea.w : newHeight !== chartArea.h;
var sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];
return sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));
}
}
@ -8098,7 +8115,7 @@ var core_scaleService = {
},
getScaleDefaults: function(type) {
// Return the scale defaults merged with the global settings so that we always use the latest ones
return this.defaults.hasOwnProperty(type) ? helpers$1.merge({}, [core_defaults.scale, this.defaults[type]]) : {};
return this.defaults.hasOwnProperty(type) ? helpers$1.merge(Object.create(null), [core_defaults.scale, this.defaults[type]]) : {};
},
updateScaleDefaults: function(type, additions) {
var me = this;
@ -9173,7 +9190,7 @@ core_defaults._set('global', {
* returns a deep copy of the result, thus doesn't alter inputs.
*/
function mergeScaleConfig(/* config objects ... */) {
return helpers$1.merge({}, [].slice.call(arguments), {
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
merger: function(key, target, source, options) {
if (key === 'xAxes' || key === 'yAxes') {
var slen = source[key].length;
@ -9213,9 +9230,9 @@ function mergeScaleConfig(/* config objects ... */) {
* a deep copy of the result, thus doesn't alter inputs.
*/
function mergeConfig(/* config objects ... */) {
return helpers$1.merge({}, [].slice.call(arguments), {
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
merger: function(key, target, source, options) {
var tval = target[key] || {};
var tval = target[key] || Object.create(null);
var sval = source[key];
if (key === 'scales') {
@ -9232,7 +9249,7 @@ function mergeConfig(/* config objects ... */) {
}
function initConfig(config) {
config = config || {};
config = config || Object.create(null);
// Do NOT use mergeConfig for the data object because this method merges arrays
// and so would change references to labels and datasets, preventing data updates.
@ -11213,6 +11230,8 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
var widths = [];
var heights = [];
var offsets = [];
var widestLabelSize = 0;
var highestLabelSize = 0;
var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
for (i = 0; i < length; ++i) {
@ -11240,11 +11259,13 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
widths.push(width);
heights.push(height);
offsets.push(lineHeight / 2);
widestLabelSize = Math.max(width, widestLabelSize);
highestLabelSize = Math.max(height, highestLabelSize);
}
garbageCollect(caches, length);
widest = widths.indexOf(Math.max.apply(null, widths));
highest = heights.indexOf(Math.max.apply(null, heights));
widest = widths.indexOf(widestLabelSize);
highest = heights.indexOf(highestLabelSize);
function valueAt(idx) {
return {

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/*!
* Chart.js v2.9.3
* Chart.js v2.9.4
* https://www.chartjs.org
* (c) 2019 Chart.js Contributors
* (c) 2020 Chart.js Contributors
* Released under the MIT License
*/
(function (global, factory) {
@ -2103,6 +2103,10 @@ if (typeof window !== 'undefined') {
var chartjsColor = Color;
function isValidKey(key) {
return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;
}
/**
* @namespace Chart.helpers
*/
@ -2278,7 +2282,7 @@ var helpers = {
}
if (helpers.isObject(source)) {
var target = {};
var target = Object.create(source);
var keys = Object.keys(source);
var klen = keys.length;
var k = 0;
@ -2299,6 +2303,12 @@ var helpers = {
* @private
*/
_merger: function(key, target, source, options) {
if (!isValidKey(key)) {
// We want to ensure we do not copy prototypes over
// as this can pollute global namespaces
return;
}
var tval = target[key];
var sval = source[key];
@ -2314,6 +2324,12 @@ var helpers = {
* @private
*/
_mergerIf: function(key, target, source) {
if (!isValidKey(key)) {
// We want to ensure we do not copy prototypes over
// as this can pollute global namespaces
return;
}
var tval = target[key];
var sval = source[key];
@ -3812,7 +3828,7 @@ helpers$1.extend(DatasetController.prototype, {
*/
_configure: function() {
var me = this;
me._config = helpers$1.merge({}, [
me._config = helpers$1.merge(Object.create(null), [
me.chart.options.datasets[me._type],
me.getDataset(),
], {
@ -7082,7 +7098,8 @@ function updateDims(chartArea, params, layout) {
chartArea.h = newHeight;
// return true if chart area changed in layout's direction
return layout.horizontal ? newWidth !== chartArea.w : newHeight !== chartArea.h;
var sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];
return sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));
}
}
@ -8094,7 +8111,7 @@ var core_scaleService = {
},
getScaleDefaults: function(type) {
// Return the scale defaults merged with the global settings so that we always use the latest ones
return this.defaults.hasOwnProperty(type) ? helpers$1.merge({}, [core_defaults.scale, this.defaults[type]]) : {};
return this.defaults.hasOwnProperty(type) ? helpers$1.merge(Object.create(null), [core_defaults.scale, this.defaults[type]]) : {};
},
updateScaleDefaults: function(type, additions) {
var me = this;
@ -9169,7 +9186,7 @@ core_defaults._set('global', {
* returns a deep copy of the result, thus doesn't alter inputs.
*/
function mergeScaleConfig(/* config objects ... */) {
return helpers$1.merge({}, [].slice.call(arguments), {
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
merger: function(key, target, source, options) {
if (key === 'xAxes' || key === 'yAxes') {
var slen = source[key].length;
@ -9209,9 +9226,9 @@ function mergeScaleConfig(/* config objects ... */) {
* a deep copy of the result, thus doesn't alter inputs.
*/
function mergeConfig(/* config objects ... */) {
return helpers$1.merge({}, [].slice.call(arguments), {
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
merger: function(key, target, source, options) {
var tval = target[key] || {};
var tval = target[key] || Object.create(null);
var sval = source[key];
if (key === 'scales') {
@ -9228,7 +9245,7 @@ function mergeConfig(/* config objects ... */) {
}
function initConfig(config) {
config = config || {};
config = config || Object.create(null);
// Do NOT use mergeConfig for the data object because this method merges arrays
// and so would change references to labels and datasets, preventing data updates.
@ -11209,6 +11226,8 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
var widths = [];
var heights = [];
var offsets = [];
var widestLabelSize = 0;
var highestLabelSize = 0;
var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
for (i = 0; i < length; ++i) {
@ -11236,11 +11255,13 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
widths.push(width);
heights.push(height);
offsets.push(lineHeight / 2);
widestLabelSize = Math.max(width, widestLabelSize);
highestLabelSize = Math.max(height, highestLabelSize);
}
garbageCollect(caches, length);
widest = widths.indexOf(Math.max.apply(null, widths));
highest = heights.indexOf(Math.max.apply(null, heights));
widest = widths.indexOf(widestLabelSize);
highest = heights.indexOf(highestLabelSize);
function valueAt(idx) {
return {

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "chart.js",
"version": "2.9.3",
"version": "2.9.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -2,7 +2,7 @@
"name": "chart.js",
"homepage": "https://www.chartjs.org",
"description": "Simple HTML5 charts using the canvas element.",
"version": "2.9.3",
"version": "2.9.4",
"license": "MIT",
"jsdelivr": "dist/Chart.min.js",
"unpkg": "dist/Chart.min.js",