summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/js
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2016-03-17 02:15:12 -0700
committerNOYB <Al_Stu@Frontier.com>2016-03-17 02:15:12 -0700
commit6c6d20271a39d9c562f934d9d3e04b759899c199 (patch)
tree6b1df24a5542516429e78d0bb8c5ed1b4381c537 /src/usr/local/www/js
parent508e44ffd85785e74aca87fee02a9511ca3027fc (diff)
downloadpfsense-6c6d20271a39d9c562f934d9d3e04b759899c199.zip
pfsense-6c6d20271a39d9c562f934d9d3e04b759899c199.tar.gz
jquery folder rename to js
Diffstat (limited to 'src/usr/local/www/js')
-rw-r--r--src/usr/local/www/js/polyfills.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/usr/local/www/js/polyfills.js b/src/usr/local/www/js/polyfills.js
new file mode 100644
index 0000000..268ca1f
--- /dev/null
+++ b/src/usr/local/www/js/polyfills.js
@@ -0,0 +1,22 @@
+/***
+**
+** Polyfill for older browsers that don't yet have the newer string "includes()" method implemented.
+** Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes?#Polyfill
+** Documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
+**
+***/
+
+if (!String.prototype.includes) {
+ String.prototype.includes = function(search, start) {
+ 'use strict';
+ if (typeof start !== 'number') {
+ start = 0;
+ }
+
+ if (start + search.length > this.length) {
+ return false;
+ } else {
+ return this.indexOf(search, start) !== -1;
+ }
+ };
+}
OpenPOWER on IntegriCloud