Skip to content

Commit

Permalink
jquery version mismatch for bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed May 21, 2021
1 parent c44423a commit 31cc39f
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 3 deletions.
132 changes: 132 additions & 0 deletions client/src/js/browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*!
* jQuery Browser Plugin 0.1.0
* https://github.com/gabceb/jquery-browser-plugin
*
* Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors
* http://jquery.org/license
*
* Modifications Copyright 2015 Gabriel Cebrian
* https://github.com/gabceb
*
* Released under the MIT license
*
* Date: 23-11-2015
*/ !(function (a) {
"function" == typeof define && define.amd
? define(["jquery"], function (b) {
return a(b);
})
: "object" == typeof module && "object" == typeof module.exports
? (module.exports = a(require("jquery")))
: a(window.jQuery);
})(function (a) {
"use strict";
function b(a) {
void 0 === a && (a = window.navigator.userAgent), (a = a.toLowerCase());
var b =
/(edge)\/([\w.]+)/.exec(a) ||
/(opr)[\/]([\w.]+)/.exec(a) ||
/(chrome)[ \/]([\w.]+)/.exec(a) ||
/(iemobile)[\/]([\w.]+)/.exec(a) ||
/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(
a
) ||
/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(
a
) ||
/(webkit)[ \/]([\w.]+)/.exec(a) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a) ||
/(msie) ([\w.]+)/.exec(a) ||
(a.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(a)) ||
(a.indexOf("compatible") < 0 &&
/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)) ||
[],
c =
/(ipad)/.exec(a) ||
/(ipod)/.exec(a) ||
/(windows phone)/.exec(a) ||
/(iphone)/.exec(a) ||
/(kindle)/.exec(a) ||
/(silk)/.exec(a) ||
/(android)/.exec(a) ||
/(win)/.exec(a) ||
/(mac)/.exec(a) ||
/(linux)/.exec(a) ||
/(cros)/.exec(a) ||
/(playbook)/.exec(a) ||
/(bb)/.exec(a) ||
/(blackberry)/.exec(a) ||
[],
d = {},
e = {
browser: b[5] || b[3] || b[1] || "",
version: b[2] || b[4] || "0",
versionNumber: b[4] || b[2] || "0",
platform: c[0] || "",
};
if (
(e.browser &&
((d[e.browser] = !0),
(d.version = e.version),
(d.versionNumber = parseInt(e.versionNumber, 10))),
e.platform && (d[e.platform] = !0),
(d.android ||
d.bb ||
d.blackberry ||
d.ipad ||
d.iphone ||
d.ipod ||
d.kindle ||
d.playbook ||
d.silk ||
d["windows phone"]) &&
(d.mobile = !0),
(d.cros || d.mac || d.linux || d.win) && (d.desktop = !0),
(d.chrome || d.opr || d.safari) && (d.webkit = !0),
d.rv || d.iemobile)
) {
var f = "msie";
(e.browser = f), (d[f] = !0);
}
if (d.edge) {
delete d.edge;
var g = "msedge";
(e.browser = g), (d[g] = !0);
}
if (d.safari && d.blackberry) {
var h = "blackberry";
(e.browser = h), (d[h] = !0);
}
if (d.safari && d.playbook) {
var i = "playbook";
(e.browser = i), (d[i] = !0);
}
if (d.bb) {
var j = "blackberry";
(e.browser = j), (d[j] = !0);
}
if (d.opr) {
var k = "opera";
(e.browser = k), (d[k] = !0);
}
if (d.safari && d.android) {
var l = "android";
(e.browser = l), (d[l] = !0);
}
if (d.safari && d.kindle) {
var m = "kindle";
(e.browser = m), (d[m] = !0);
}
if (d.safari && d.silk) {
var n = "silk";
(e.browser = n), (d[n] = !0);
}
return (d.name = e.browser), (d.platform = e.platform), d;
}
return (
(window.jQBrowser = b(window.navigator.userAgent)),
(window.jQBrowser.uaMatch = b),
a && (a.browser = window.jQBrowser),
window.jQBrowser
);
});
3 changes: 1 addition & 2 deletions client/src/js/queuedjobprogressfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ window.jQuery.entwine("ss", ($) => {

$(".queuedjob__progress").entwine({
onmatch() {
console.log("match");
$(this)
.find(".progress-bar")
.popover({
Expand All @@ -74,7 +73,7 @@ window.jQuery.entwine("ss", ($) => {

var link = $(this).data("live"),
self = $(this);
console.log(link);

if (link) {
setTimeout(function () {
self.fetchData();
Expand Down
4 changes: 3 additions & 1 deletion src/QueuedJobProgressController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public function progress()
return $this->httpError(404);
}

Requirements::javascript('silverstripe/admin:thirdparty/jquery/jquery.js');
Requirements::block('silverstripe/admin:thirdparty/jquery/jquery.js');
Requirements::javascript('https://code.jquery.com/jquery-1.12.4.min.js');
Requirements::javascript('fullscreeninteractive/silverstripe-queuedjob-progressfield:client/src/js/browser.js');
Requirements::javascript('https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
Requirements::javascript('https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js');
Requirements::javascript('silverstripe/admin:thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Expand Down

0 comments on commit 31cc39f

Please sign in to comment.