Skip to content

Commit 74cf7fb

Browse files
committed
Address #1916, Remove PhantomJs
This address a bad default causing issues with non-ascii chars in sifter, and default to headless chrome instead of the unmaintained phantomJS for unit testing
1 parent cd98f45 commit 74cf7fb

11 files changed

+28
-330
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ifeq ($(strip $(version)),)
1616
@echo "\033[31mERROR:\033[0;39m No version provided."
1717
@echo "\033[1;30mmake release version=1.0.0\033[0;39m"
1818
else
19-
sed -i 's/"version": "[^"]*"/"version": "$(version)"/' selectize.jquery.json
2019
sed -i 's/"version": "[^"]*"/"version": "$(version)"/' package.json
2120
sed -i "s/\"version\": \"$(CURRENT_VERSION)\"/\"version\": \"$(version)\"/" package-lock.json
2221
make compile

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ changed.
121121
Please ensure all the tests pass:
122122

123123
```sh
124-
npm test # phantomjs
124+
npm test # defaults to ChromHeadless
125125
BROWSERS=Firefox npm test
126126
BROWSERS=Firefox,Chrome npm test
127127
BROWSERS=Firefox,Chrome,Safari npm test

dist/js/selectize.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ var escape_regex = function (str) {
691691
return (str + '').replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
692692
};
693693

694-
var is_array = Array.isArray || (typeof $ !== 'undefined' && $.isArray) || function (object) {
694+
var is_array = Array.isArray || function (object) {
695695
return Object.prototype.toString.call(object) === '[object Array]';
696696
};
697697

@@ -725,29 +725,25 @@ var DIACRITICS = {
725725

726726
var asciifold = (function () {
727727
var i, n, k, chunk;
728-
var foreignletters = '';
728+
var i18nChars = '';
729729
var lookup = {};
730730
for (k in DIACRITICS) {
731731
if (DIACRITICS.hasOwnProperty(k)) {
732732
chunk = DIACRITICS[k].substring(2, DIACRITICS[k].length - 1);
733-
foreignletters += chunk;
733+
i18nChars += chunk;
734734
for (i = 0, n = chunk.length; i < n; i++) {
735735
lookup[chunk.charAt(i)] = k;
736736
}
737737
}
738738
}
739-
var regexp = new RegExp('[' + foreignletters + ']', 'g');
739+
var regexp = new RegExp('[' + i18nChars + ']', 'g');
740740
return function (str) {
741-
return str.replace(regexp, function (foreignletter) {
742-
return lookup[foreignletter];
741+
return str.replace(regexp, function (i18nChar) {
742+
return lookup[i18nChar];
743743
}).toLowerCase();
744744
};
745745
})();
746746

747-
748-
// export
749-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
750-
751747
function uaDetect(platform, re) {
752748
if (navigator.userAgentData) {
753749
return platform === navigator.userAgentData.platform;
@@ -3657,7 +3653,8 @@ Selectize.defaults = {
36573653
sortField: '$order',
36583654
searchField: ['text'],
36593655
searchConjunction: 'and',
3660-
respect_word_boundaries: true,
3656+
respect_word_boundaries: false, // Originally defaulted to true, but breaks unicode support. See #1916 & https://stackoverflow.com/questions/10590098/javascript-regexp-word-boundaries-unicode-characters
3657+
normalize: true,
36613658

36623659
mode: null,
36633660
wrapperClass: '',
@@ -3672,7 +3669,7 @@ Selectize.defaults = {
36723669
sizeType: 'auto', // 'numberItems' or 'fixedHeight'
36733670
sizeValue: 'auto', // number of items or height value (px is default) or CSS height (px, rem, em, vh)
36743671
},
3675-
normalize: false,
3672+
36763673
ignoreOnDropwdownHeight: 'img, i',
36773674
search: true,
36783675

dist/js/selectize.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

karma.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = function (config) {
22
var targets = {
3-
'phantomjs': ['PhantomJS']
3+
'ChromeHeadless': ['ChromeHeadless']
44
};
55

6-
var browsers = targets[process.env.TARGET || 'phantomjs'];
6+
var browsers = targets[process.env.TARGET || 'ChromeHeadless'];
77
if (process.env.BROWSERS) {
88
browsers = process.env.BROWSERS.split(',');
99
}

0 commit comments

Comments
 (0)