From 2af1c41ab807a44131a728cce1f9414da6d36fa4 Mon Sep 17 00:00:00 2001 From: Keith Banner Date: Thu, 30 Nov 2023 19:18:04 -0700 Subject: [PATCH] Add aria-label to page length select for accessibility --- Readme.md | 5 +++++ build/lib/markdown.php | 6 +++--- build/make.sh | 6 +++++- js/core/core.length.js | 4 +++- js/model/model.defaults.js | 23 ++++++++++++++++++++++- 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index 5105701e8..b10f0d467 100644 --- a/Readme.md +++ b/Readme.md @@ -37,6 +37,11 @@ A number of programs are required out your computer to be able to build DataTabl * [Sass](https://sass-lang.com/install) - CSS compiler * [JSHint 2.1+](https://jshint.com/install/) - Linter (optional) +PHP Libraries + +* [libcurl](https://curl.se/) (On ubuntu `sudo apt-get install php-curl`) +* xml (On ubunutu `sudo apt-get install php-xml`) + The build script assumes that a Mac or Linux environment is being used - Windows builds are not currently directly supported (although would be possible using [Cygwin](https://www.cygwin.com/)). Additionally, you may need to alter the paths for the above programs to reflect where they are installed on your own computer - this can be done in the [`build/include.sh`](build/include.sh) script. The output files are placed into `built/DataTables/` which is a temporary directory. No changes should be made in that directory as they will be **overwritten** when you next build the software. diff --git a/build/lib/markdown.php b/build/lib/markdown.php index ab53ce38c..879238cca 100644 --- a/build/lib/markdown.php +++ b/build/lib/markdown.php @@ -1656,9 +1656,9 @@ function _initDetab() { # regular expression. # if (function_exists($this->utf8_strlen)) return; - $this->utf8_strlen = create_function('$text', 'return preg_match_all( - "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", - $text, $m);'); + $this->utf8_strlen = function($text) { + return preg_match_all("/[\\x00-\\xBF]|[\\xC0-\\xFF][\\x80-\\xBF]*/", $text, $m); + }; } diff --git a/build/make.sh b/build/make.sh index e6038050c..ed1fca4e3 100755 --- a/build/make.sh +++ b/build/make.sh @@ -70,6 +70,8 @@ function build_js { else echo_error "JSHint failed" fi + else + echo_msg "No JSHint installed" fi js_compress $OUT_FILE @@ -375,8 +377,10 @@ function usage { # cd $BASE_DIR +CURR_BRANCH="$(git rev-parse --abbrev-ref HEAD)" + echo "" -echo_section "DataTables build ($VERSION) - branch: $SYNC_BRANCH" +echo_section "DataTables build ($VERSION) - branch: $CURR_BRANCH" echo "" diff --git a/js/core/core.length.js b/js/core/core.length.js index 04785eaa1..2125c450f 100644 --- a/js/core/core.length.js +++ b/js/core/core.length.js @@ -25,11 +25,13 @@ function _fnFeatureHtmlLength ( settings ) menu = settings.aLengthMenu, d2 = Array.isArray( menu[0] ), lengths = d2 ? menu[0] : menu, - language = d2 ? menu[1] : menu; + language = d2 ? menu[1] : menu, + oAria = settings.oLanguage.oAria; var select = $('