From 1607790ea3acd396be7ece256094bf4652a73170 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Fri, 11 Apr 2014 14:59:09 -0700 Subject: [PATCH] Updated jQuery UI from 1.10.3 to 1.10.4 for Treema autocomplete bug. --- app/views/account/settings_view.coffee | 5 +- app/views/employers_view.coffee | 2 +- ...3.custom.js => jquery-ui-1.10.4.custom.js} | 140 ++++++++++-------- ...custom.css => jquery-ui-1.10.4.custom.css} | 90 +++++------ 4 files changed, 131 insertions(+), 106 deletions(-) rename vendor/scripts/{jquery-ui-1.10.3.custom.js => jquery-ui-1.10.4.custom.js} (98%) rename vendor/styles/{jquery-ui-1.10.3.custom.css => jquery-ui-1.10.4.custom.css} (85%) diff --git a/app/views/account/settings_view.coffee b/app/views/account/settings_view.coffee index be4a79c59..c75225d69 100644 --- a/app/views/account/settings_view.coffee +++ b/app/views/account/settings_view.coffee @@ -81,13 +81,10 @@ module.exports = class SettingsView extends View buildPictureTreema: -> data = photoURL: me.get('photoURL') - if data.photoURL?.search('gravatar') isnt -1 - # Old style - data.photoURL = null + data.photoURL = null if data.photoURL?.search('gravatar') isnt -1 # Old style schema = _.cloneDeep me.schema().attributes schema.properties = _.pick me.schema().get('properties'), 'photoURL' schema.required = ['photoURL'] - console.log 'schema is', schema treemaOptions = filePath: "db/user/#{me.id}" schema: schema diff --git a/app/views/employers_view.coffee b/app/views/employers_view.coffee index 744db1954..cdbf8f074 100644 --- a/app/views/employers_view.coffee +++ b/app/views/employers_view.coffee @@ -80,7 +80,7 @@ module.exports = class EmployersView extends View onCandidateClicked: (e) -> id = $(e.target).closest('tr').data('candidate-id') - if not id + if id url = "/account/profile/#{id}" app.router.navigate url, {trigger: true} else diff --git a/vendor/scripts/jquery-ui-1.10.3.custom.js b/vendor/scripts/jquery-ui-1.10.4.custom.js similarity index 98% rename from vendor/scripts/jquery-ui-1.10.3.custom.js rename to vendor/scripts/jquery-ui-1.10.4.custom.js index 991276d15..0aa0374c8 100644 --- a/vendor/scripts/jquery-ui-1.10.3.custom.js +++ b/vendor/scripts/jquery-ui-1.10.4.custom.js @@ -1,7 +1,7 @@ -/*! jQuery UI - v1.10.3 - 2013-09-04 +/*! jQuery UI - v1.10.4 - 2014-04-11 * http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.resizable.js, jquery.ui.sortable.js, jquery.ui.autocomplete.js, jquery.ui.menu.js, jquery.ui.slider.js, jquery.ui.effect.js, jquery.ui.effect-bounce.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-shake.js, jquery.ui.effect-transfer.js -* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ (function( $, undefined ) { @@ -12,7 +12,7 @@ var uuid = 0, $.ui = $.ui || {}; $.extend( $.ui, { - version: "1.10.3", + version: "1.10.4", keyCode: { BACKSPACE: 8, @@ -411,7 +411,7 @@ $.widget = function( name, base, prototype ) { // TODO: remove support for widgetEventPrefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name + widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name }, proxiedPrototype, { constructor: constructor, namespace: namespace, @@ -620,12 +620,12 @@ $.Widget.prototype = { curOption = curOption[ parts[ i ] ]; } key = parts.pop(); - if ( value === undefined ) { + if ( arguments.length === 1 ) { return curOption[ key ] === undefined ? null : curOption[ key ]; } curOption[ key ] = value; } else { - if ( value === undefined ) { + if ( arguments.length === 1 ) { return this.options[ key ] === undefined ? null : this.options[ key ]; } options[ key ] = value; @@ -832,7 +832,7 @@ $( document ).mouseup( function() { }); $.widget("ui.mouse", { - version: "1.10.3", + version: "1.10.4", options: { cancel: "input,textarea,button,select,option", distance: 1, @@ -1042,7 +1042,7 @@ $.position = { return cachedScrollbarWidth; } var w1, w2, - div = $( "
" ), + div = $( "
" ), innerDiv = div.children()[0]; $( "body" ).append( div ); @@ -1060,8 +1060,10 @@ $.position = { return (cachedScrollbarWidth = w1 - w2); }, getScrollInfo: function( within ) { - var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ), - overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ), + var overflowX = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-x" ), + overflowY = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-y" ), hasOverflowX = overflowX === "scroll" || ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), hasOverflowY = overflowY === "scroll" || @@ -1073,10 +1075,12 @@ $.position = { }, getWithinInfo: function( element ) { var withinElement = $( element || window ), - isWindow = $.isWindow( withinElement[0] ); + isWindow = $.isWindow( withinElement[0] ), + isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9; return { element: withinElement, isWindow: isWindow, + isDocument: isDocument, offset: withinElement.offset() || { left: 0, top: 0 }, scrollLeft: withinElement.scrollLeft(), scrollTop: withinElement.scrollTop(), @@ -1408,7 +1412,7 @@ $.ui.position = { } } else if ( overBottom > 0 ) { - newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { position.top += myOffset + atOffset + offset; } @@ -1478,7 +1482,7 @@ function isNumber(value) { } $.widget("ui.resizable", $.ui.mouse, { - version: "1.10.3", + version: "1.10.4", widgetEventPrefix: "resize", options: { alsoResize: false, @@ -1747,7 +1751,7 @@ $.widget("ui.resizable", $.ui.mouse, { //Store needed variables this.offset = this.helper.offset(); this.position = { left: curleft, top: curtop }; - this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: el.width(), height: el.height() }; this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; this.originalPosition = { left: curleft, top: curtop }; this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; @@ -2228,8 +2232,8 @@ $.ui.plugin.add("resizable", "containment", { isParent = that.containerElement.get(0) === that.element.parent().get(0); isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position")); - if(isParent && isOffsetRelative) { - woset -= that.parentData.left; + if ( isParent && isOffsetRelative ) { + woset -= Math.abs( that.parentData.left ); } if (woset + that.size.width >= that.parentData.width) { @@ -2410,10 +2414,20 @@ $.ui.plugin.add("resizable", "grid", { that.size.height = newHeight; that.position.left = op.left - ox; } else { - that.size.width = newWidth; - that.size.height = newHeight; - that.position.top = op.top - oy; - that.position.left = op.left - ox; + if ( newHeight - gridY > 0 ) { + that.size.height = newHeight; + that.position.top = op.top - oy; + } else { + that.size.height = gridY; + that.position.top = op.top + os.height - gridY; + } + if ( newWidth - gridX > 0 ) { + that.size.width = newWidth; + that.position.left = op.left - ox; + } else { + that.size.width = gridX; + that.position.left = op.left + os.width - gridX; + } } } @@ -2422,8 +2436,6 @@ $.ui.plugin.add("resizable", "grid", { })(jQuery); (function( $, undefined ) { -/*jshint loopfunc: true */ - function isOverAxis( x, reference, size ) { return ( x > reference ) && ( x < ( reference + size ) ); } @@ -2433,7 +2445,7 @@ function isFloating(item) { } $.widget("ui.sortable", $.ui.mouse, { - version: "1.10.3", + version: "1.10.4", widgetEventPrefix: "sort", ready: false, options: { @@ -2774,12 +2786,12 @@ $.widget("ui.sortable", $.ui.mouse, { } // Only put the placeholder inside the current Container, skip all - // items form other containers. This works because when moving + // items from other containers. This works because when moving // an item from one container to another the // currentContainer is switched before the placeholder is moved. // - // Without this moving items in "sub-sortables" can cause the placeholder to jitter - // beetween the outer and inner container. + // Without this, moving items in "sub-sortables" can cause + // the placeholder to jitter beetween the outer and inner container. if (item.instance !== this.currentContainer) { continue; } @@ -3047,10 +3059,11 @@ $.widget("ui.sortable", $.ui.mouse, { queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]); + function addItems() { + items.push( this ); + } for (i = queries.length - 1; i >= 0; i--){ - queries[i][0].each(function() { - items.push(this); - }); + queries[i][0].each( addItems ); } return $(items); @@ -3608,12 +3621,17 @@ $.widget("ui.sortable", $.ui.mouse, { //Post events to containers + function delayEvent( type, instance, container ) { + return function( event ) { + container._trigger( type, event, instance._uiHash( instance ) ); + }; + } for (i = this.containers.length - 1; i >= 0; i--){ - if(!noPropagation) { - delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if (!noPropagation) { + delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); } if(this.containers[i].containerCache.over) { - delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); this.containers[i].containerCache.over = 0; } } @@ -3692,11 +3710,8 @@ $.widget("ui.sortable", $.ui.mouse, { })(jQuery); (function( $, undefined ) { -// used to prevent race conditions with remote data sources -var requestIndex = 0; - $.widget( "ui.autocomplete", { - version: "1.10.3", + version: "1.10.4", defaultElement: "", options: { appendTo: null, @@ -3720,6 +3735,7 @@ $.widget( "ui.autocomplete", { select: null }, + requestIndex: 0, pending: 0, _create: function() { @@ -3753,7 +3769,6 @@ $.widget( "ui.autocomplete", { this._on( this.element, { keydown: function( event ) { - /*jshint maxcomplexity:15*/ if ( this.element.prop( "readOnly" ) ) { suppressKeyPress = true; suppressInput = true; @@ -4096,19 +4111,18 @@ $.widget( "ui.autocomplete", { }, _response: function() { - var that = this, - index = ++requestIndex; + var index = ++this.requestIndex; - return function( content ) { - if ( index === requestIndex ) { - that.__response( content ); + return $.proxy(function( content ) { + if ( index === this.requestIndex ) { + this.__response( content ); } - that.pending--; - if ( !that.pending ) { - that.element.removeClass( "ui-autocomplete-loading" ); + this.pending--; + if ( !this.pending ) { + this.element.removeClass( "ui-autocomplete-loading" ); } - }; + }, this ); }, __response: function( content ) { @@ -4287,7 +4301,7 @@ $.widget( "ui.autocomplete", $.ui.autocomplete, { (function( $, undefined ) { $.widget( "ui.menu", { - version: "1.10.3", + version: "1.10.4", defaultElement: "