Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Upgrade jquery to 1.12 #1353

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/js/vendor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/src/bundles/vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require('json-js');

// jQuery plugins require that the jQuery object is exposed as a global
// webpack.ProvidePlugin is used to ensure that jQuery and $ are provided to all includes
require('script-loader!../../../thirdparty/jquery/jquery.js');
require('script-loader!jquery');
require('expose-loader?jQuery!jquery');

// Expose the libraries as globals for other modules to access
Expand Down
8 changes: 0 additions & 8 deletions client/src/jquery.js

This file was deleted.

3 changes: 2 additions & 1 deletion client/src/legacy/LeftAndMain.ActionTabSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ $.entwine('ss', function($) {
containerSouth = activePanel.parents('.toolbar--south');
if (containerSouth){
// If container is the southern panel, make tab appear from the top of the container
padding = activeTab.offset().top - containerSouth.offset().top;
const offset = activeTab.offset();
padding = offset ? (offset.top - containerSouth.offset().top) : 0;
Comment on lines +127 to +128
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tabs are now an empty object - there is no offset() function on them - so this just checks if there was an offset or not to avoid "that is undefined" error.

topPosition = topPosition-padding;
}
$(activePanel).css('top',topPosition+"px");
Expand Down
23 changes: 12 additions & 11 deletions client/src/legacy/LeftAndMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,18 @@ $.entwine('ss', function($) {
*/
onadd: function() {
// Browser detection
if($.browser.msie && parseInt($.browser.version, 10) < 8) {
$('.ss-loading-screen').append(
'<p class="ss-loading-incompat-warning"><span class="notice">' +
'Your browser is not compatible with the CMS interface. Please use Internet Explorer 8+, Google Chrome or Mozilla Firefox.' +
'</span></p>'
).css('z-index', $('.ss-loading-screen').css('z-index')+1);
$('.loading-animation').remove();

this._super();
return;
}
// We'll need to replace this with some other library's implementation
// if($.browser.msie && parseInt($.browser.version, 10) < 8) {
// $('.ss-loading-screen').append(
// '<p class="ss-loading-incompat-warning"><span class="notice">' +
// 'Your browser is not compatible with the CMS interface. Please use Internet Explorer 8+, Google Chrome or Mozilla Firefox.' +
// '</span></p>'
// ).css('z-index', $('.ss-loading-screen').css('z-index')+1);
// $('.loading-animation').remove();

// this._super();
// return;
// }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be replaced with some more appropriate third-party solution - for now I removed it because jquery doesn't have a browser property anymore.


// Initialize layouts
this.redraw();
Expand Down
2 changes: 1 addition & 1 deletion client/src/legacy/SelectionGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import $ from 'jquery';
$(document).ready(function() {
// Support both bootstrap / legacy selectors
$('ul.SelectionGroup input.selector, ul.selection-group input.selector')
.live('click', function() {
.on('click', function() {
var li = $(this).closest('li');
li.addClass('selected');

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"graphql-fragments": "^0.1.0",
"graphql-tag": "^2.10.0",
"isomorphic-fetch": "^2.2.1",
"jquery": "^1",
"jquery-sizes": "^0.33.0",
"json-js": "^1.1.2",
"lodash.debounce": "^4.0.8",
Expand Down
46 changes: 0 additions & 46 deletions thirdparty/jquery-entwine/dist/jquery.entwine-dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -748,35 +748,6 @@ Sizzle is good for finding elements for a selector, but not so good for telling
/* src/jquery.focusinout.js */

(function($){

/**
* Add focusin and focusout support to bind and live for browers other than IE. Designed to be usable in a delegated fashion (like $.live)
* Copyright (c) 2007 Jörn Zaefferer
*/
if ($.support.focusinBubbles === undefined) {
$.support.focusinBubbles = !!($.browser.msie);
}

if (!$.support.focusinBubbles && !$.event.special.focusin) {
// Emulate focusin and focusout by binding focus and blur in capturing mode
$.each({focus: 'focusin', blur: 'focusout'}, function(original, fix){
$.event.special[fix] = {
setup: function(){
if (!this.addEventListener) return false;
this.addEventListener(original, $.event.special[fix].handler, true);
},
teardown: function(){
if (!this.removeEventListener) return false;
this.removeEventListener(original, $.event.special[fix].handler, true);
},
handler: function(e){
arguments[0] = $.event.fix(e);
arguments[0].type = fix;
return $.event.handle.apply(this, arguments);
}
};
});
}
Comment on lines -751 to -779
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$.support is deprecated and $.browser doesn't exist - and anyway we aren't interested in supporting such old browsers so the easy fix to the errors this caused was to remove it.


(function(){
//IE has some trouble with focusout with select and keyboard navigation
Expand Down Expand Up @@ -1465,23 +1436,6 @@ catch (e) {

(function($) {

/** Taken from jQuery 1.5.2 for backwards compatibility */
if ($.support.changeBubbles == undefined) {
$.support.changeBubbles = true;

var el = document.createElement("div");
eventName = "onchange";

if (el.attachEvent) {
var isSupported = (eventName in el);
if (!isSupported) {
el.setAttribute(eventName, "return;");
isSupported = typeof el[eventName] === "function";
}

$.support.changeBubbles = isSupported;
}
}
Comment on lines -1468 to -1484
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$.support is deprecated - and anyway we aren't interested in supporting such old browsers so the easy fix to the errors this caused was to remove it.


/* Return true if node b is the same as, or is a descendant of, node a */
if (document.compareDocumentPosition) {
Expand Down
Loading