Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Update jQuery to v1.9.1 (stable) & include jQuery Migrate #3123

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4c813c0
Include jQuery 2.0.0b2 & jQuery Migrate 1.1.1
TuckerWhitehouse Mar 11, 2013
b5f4a99
Replace .isResolved and .isRejected with .state
TuckerWhitehouse Mar 11, 2013
f9fecca
Replace .andSelf with .addBack
TuckerWhitehouse Mar 11, 2013
a227d99
$(html) must start with <, not whitespace
TuckerWhitehouse Mar 11, 2013
b365b91
Use jQuery 1.9.1 instead of 2.0
TuckerWhitehouse Mar 11, 2013
15b1d33
Merge remote-tracking branch 'upstream/master' into update_jQuery
TuckerWhitehouse Mar 11, 2013
6244b0d
Missed a period...
TuckerWhitehouse Mar 12, 2013
37413ed
Use require to include JSON so that it works in test
TuckerWhitehouse Mar 12, 2013
3a23bd1
Include LESS with require and wrap in try/catch
TuckerWhitehouse Mar 12, 2013
22c20b8
Merge pull request #1 from TuckerWhitehouse/LiveDevelopment_require
TuckerWhitehouse Mar 12, 2013
a474519
Merge remote-tracking branch 'upstream/master' into update_jQuery
TuckerWhitehouse Mar 12, 2013
36ce47c
Use $()[0].style instead of $().css in InlineCodeEditor
TuckerWhitehouse Mar 13, 2013
93c4fe6
Merge remote-tracking branch 'upstream/master' into update_jQuery
TuckerWhitehouse Mar 13, 2013
cefdc64
.error() is deprecated, use .on('error', ...)
TuckerWhitehouse Mar 13, 2013
54a9415
Update Gruntfile.js :)
TuckerWhitehouse Mar 13, 2013
08c898a
Merge remote-tracking branch 'upstream/master' into update_jQuery
TuckerWhitehouse Mar 13, 2013
24cb20f
Revert brackets-concat.js
TuckerWhitehouse Mar 13, 2013
e4e9f19
Discard Whitespace Changes (oops...)
TuckerWhitehouse Mar 13, 2013
bb739fc
Put back newline at EOF
TuckerWhitehouse Mar 13, 2013
ef39c48
Use Master LiveDev files
TuckerWhitehouse Mar 22, 2013
6f15f87
Marge Upstream
TuckerWhitehouse Mar 22, 2013
0c61c18
Merge remote-tracking branch 'upstream/master' into update_jQuery
TuckerWhitehouse Mar 26, 2013
f5d8d08
Use Upstream StaticServer/main
TuckerWhitehouse Apr 8, 2013
1fcf761
Merge remote-tracking branch 'upstream/master' into update_jQuery
TuckerWhitehouse Apr 10, 2013
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
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ module.exports = function (grunt) {
specs : '<%= meta.specs %>',
/* Keep in sync with test/SpecRunner.html dependencies */
vendor : [
'src/thirdparty/jquery-1.7.js',
'src/thirdparty/jquery-1.9.1.min.js',
'src/thirdparty/jquery-migrate-1.1.1.js',
'src/thirdparty/CodeMirror2/lib/codemirror.js',
'src/thirdparty/CodeMirror2/lib/util/dialog.js',
'src/thirdparty/CodeMirror2/lib/util/searchcursor.js',
Expand Down
2 changes: 1 addition & 1 deletion src/editor/CodeHintManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ define(function (require, exports, module) {
if (sessionEditor) {
if (sessionEditor === editor &&
(hintList.isOpen() ||
(deferredHints && !deferredHints.isResolved() && !deferredHints.isRejected()))) {
(deferredHints && deferredHints.state() === "pending"))) {
return true;
} else {
// the editor has changed
Expand Down
8 changes: 3 additions & 5 deletions src/extensions/default/HTMLCodeHints/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ define(function (require, exports, module) {
self.cachedHints.queryDir = queryDir;
self.cachedHints.docDir = docDir;

if (!self.cachedHints.deferred.isRejected()) {
if (self.cachedHints.deferred.state() !== "rejected") {
var currentDeferred = self.cachedHints.deferred;
// Since we've cached the results, the next call to _getUrlList should be synchronous.
// If it isn't, we've got a problem and should reject both the current deferred
Expand All @@ -296,13 +296,11 @@ define(function (require, exports, module) {
if (syncResults instanceof Array) {
currentDeferred.resolveWith(self, [syncResults]);
} else {
if (currentDeferred && !currentDeferred.isResolved() && !currentDeferred.isRejected()) {
if (currentDeferred && currentDeferred.state() === "pending") {
currentDeferred.reject();
}

if (self.cachedHints.deferred &&
!self.cachedHints.deferred.isResolved() &&
!self.cachedHints.deferred.isRejected()) {
if (self.cachedHints.deferred && self.cachedHints.deferred.state() === "pending") {
self.cachedHints.deferred.reject();
self.cachedHints.deferred = null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/default/InlineColorEditor/ColorEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ define(function (require, exports, module) {
case KeyEvent.DOM_VK_LEFT:
case KeyEvent.DOM_VK_RIGHT:
step = event.shiftKey ? step * STEP_MULTIPLIER : step;
xOffset = Number($.trim(this.$selectionBase.css("left").replace("%", "")));
xOffset = Number($.trim(this.$selectionBase[0].style.left.replace("%", ""))); // $().css returns px instead of % (as authored)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All throughout InlineColorEditor, the use of $().css("left") was returning the px value, as opposed to the authored value which was a %. I'm not sure why exactly this happens, because $().css("bottom") would return the % as expected, but I replaced both with $()[0].style and the % value is returned as expected.

adjustedOffset = (event.keyCode === KeyEvent.DOM_VK_LEFT) ? (xOffset - step) : (xOffset + step);
xOffset = Math.min(100, Math.max(0, adjustedOffset));
hsv.s = xOffset / 100;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<div tabindex="-1" class="color-editor">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

$(html) requires the first character to be "<" in jQuery 1.9.1, so I removed the whitespace here.

<section>
<div class="sliders">
Expand Down
8 changes: 4 additions & 4 deletions src/extensions/default/InlineColorEditor/unittests.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ define(function (require, exports, module) {
runs(function () {
checkPercentageNear(colorEditor.$hueSelector.css("bottom"), 25);
checkPercentageNear(colorEditor.$opacitySelector.css("bottom"), 50);
checkPercentageNear(colorEditor.$selectionBase.css("left"), 74);
checkPercentageNear(colorEditor.$selectionBase.css("bottom"), 47);
checkPercentageNear(colorEditor.$selectionBase[0].style.left, 74); // $().css returns px instead of % (as authored)
checkPercentageNear(colorEditor.$selectionBase[0].style.bottom, 47);// $().css returns px instead of % (as authored)
});
});

Expand All @@ -439,8 +439,8 @@ define(function (require, exports, module) {
runs(function () {
checkPercentageNear(colorEditor.$hueSelector.css("bottom"), 25);
checkPercentageNear(colorEditor.$opacitySelector.css("bottom"), 50);
checkPercentageNear(colorEditor.$selectionBase.css("left"), 74);
checkPercentageNear(colorEditor.$selectionBase.css("bottom"), 47);
checkPercentageNear(colorEditor.$selectionBase[0].style.left, 74); // $().css returns px instead of % (as authored)
checkPercentageNear(colorEditor.$selectionBase[0].style.bottom, 47);// $().css returns px instead of % (as authored)
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
<!-- JavaScript -->

<!-- Pre-load third party scripts that cannot be async loaded. -->
<script src="thirdparty/jquery-1.7.min.js"></script>
<script src="thirdparty/jquery-1.9.1.min.js"></script>
<script src="thirdparty/jquery-migrate-1.1.1.js"></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

jQuery Migrate is included because the bootstrap plugins utilize $.browser, and this polyfill's it. Also, it makes it easier for other devs to note when they are using a deprecated function (a message is displayed in the console).

<script src="thirdparty/CodeMirror2/lib/codemirror.js"></script>
<script src="thirdparty/CodeMirror2/addon/edit/matchbrackets.js"></script>
<script src="thirdparty/CodeMirror2/addon/edit/closebrackets.js"></script>
Expand Down
Loading