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

FOR REVIEW: Update to jQuery 2.0.1, LESS 1.3.3 and Bootstrap 2.3.1 #4054

Merged
merged 37 commits into from
Jun 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ff8d55c
Updated bootstrap to 2.3.1 and less to 1.3.3 (needed for bootstrap)
WebsiteDeveloper Apr 30, 2013
54394b0
Fixed Context Menu
WebsiteDeveloper May 1, 2013
6c23c49
Three more migration fixes
WebsiteDeveloper May 1, 2013
de6c29d
Fixed a few UI issues and removed unused responsive files
WebsiteDeveloper May 10, 2013
b276e04
Fixed missed log statement
WebsiteDeveloper May 10, 2013
ceb6297
Fix scroller-shadow
WebsiteDeveloper May 10, 2013
c21ab02
Fix install extensions unit tests
WebsiteDeveloper May 11, 2013
b34eb06
Fixed find and JSLint UI
WebsiteDeveloper May 11, 2013
ceca9bc
Fixed modal layout issues
WebsiteDeveloper May 11, 2013
ad63c37
Fix for menu positioning
WebsiteDeveloper May 11, 2013
c58b5e6
Parsed LESS to CSS and load the css file
WebsiteDeveloper May 11, 2013
026f9dd
Moved dropdown menu styles to fix recent projects UI
WebsiteDeveloper May 11, 2013
9c6a57e
Added data-button-id to the dialog templates
WebsiteDeveloper May 11, 2013
43d5435
Fixes for ContextMenus and Dialogs
WebsiteDeveloper May 26, 2013
180ad2a
Merge branch 'WebsiteDeveloper-bootstrap' into jQueryLESSBootstrap
dangoor May 30, 2013
93b629d
Merge branch 'dangoor/jquery-deprecations' into jQueryLESSBootstrap
dangoor May 30, 2013
1978f85
Update to jQuery 2.0.1
dangoor May 30, 2013
1cb9550
Update to jQuery 2.0.1
dangoor May 30, 2013
d8b9421
Merge branch 'dangoor/jQuery-2.0' into jQueryLESSBootstrap
dangoor May 30, 2013
fd77d76
switch from .andSelf to .addBack
dangoor May 30, 2013
3da4dcb
Merge branch 'dangoor/jQuery-2.0' into jQueryLESSBootstrap
dangoor May 30, 2013
c04cf47
Fixes after review
WebsiteDeveloper May 30, 2013
ec69402
Merge branch 'WebsiteDeveloper-bootstrap' into jQueryLESSBootstrap
dangoor May 31, 2013
2e777df
this line apparently had a bad merge
dangoor May 31, 2013
72f652f
Update twipsy-mod to use tooltip styles and work with jQuery 2.0
gruehle May 31, 2013
6cc7b77
Use .val() instead of .attr('value')
gruehle May 31, 2013
bb5a7f1
Fix most of the inline color editor unit tests. One is still failing.
gruehle May 31, 2013
79f799a
Merge with master
gruehle Jun 2, 2013
305a196
Fix the extension manager tests.
dangoor Jun 3, 2013
c1bdc00
Fix deprecated isRejected() calls in UrlCodeHints.
dangoor Jun 3, 2013
30e3c12
Merge branch 'master' into jQueryLESSBootstrap
dangoor Jun 3, 2013
435c3e9
Fix Inline Color Editor use of .attr vs. .val.
dangoor Jun 3, 2013
0f747ca
Convert .attr to .prop for "disabled" (and one case of "val").
dangoor Jun 3, 2013
81eff5f
Code cleanup
gruehle Jun 3, 2013
d454d87
Remove data-dismiss
gruehle Jun 4, 2013
c3acbd6
Remove redundant dropdown("toggle") calls
gruehle Jun 4, 2013
26e12d6
Use updated version of $.support.transition
gruehle Jun 4, 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
4 changes: 2 additions & 2 deletions src/command/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ define(function (require, exports, module) {

var $newMenu = $("<li class='dropdown context-menu' id='" + StringUtils.jQueryIdEscape(id) + "'></li>"),
$popUp = $("<ul class='dropdown-menu'></ul>"),
$toggle = $("<a href='#' class='dropdown-toggle'></a>").hide();
$toggle = $("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>").hide();

// assemble the menu fragments
$newMenu.append($toggle).append($popUp);
Expand Down Expand Up @@ -934,7 +934,7 @@ define(function (require, exports, module) {
}
posTop -= 30; // shift top for hidden parent element
posLeft += 5;

var rightOverhang = posLeft + $menuWindow.width() - $window.width();
if (rightOverhang > 0) {
posLeft = Math.max(0, posLeft - rightOverhang);
Expand Down
10 changes: 5 additions & 5 deletions src/extensibility/ExtensionManagerDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ define(function (require, exports, module) {

function updateSearch() {
if (view.model.filterSet.length === 0) {
$search.attr("disabled", "disabled");
$searchClear.attr("disabled", "disabled");
$search.prop("disabled", true);
$searchClear.prop("disabled", true);
} else {
$search.removeAttr("disabled");
$searchClear.removeAttr("disabled");
$search.prop("disabled", false);
$searchClear.prop("disabled", false);
}
}

Expand Down Expand Up @@ -90,7 +90,7 @@ define(function (require, exports, module) {
});

updateSearch();
if (!$search.attr("disabled")) {
if (!$search.prop("disabled")) {
$dlg.find(".search").focus();
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/extensibility/ExtensionManagerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ define(function (require, exports, module) {
self._setupEventHandlers();
self._render();
}).fail(function () {
$("<div class='alert-message error load-error'/>")
$("<div class='alert error load-error'/>")
.text(Strings.EXTENSION_MANAGER_ERROR_LOAD)
.appendTo(self.$el);
}).always(function () {
Expand Down
8 changes: 4 additions & 4 deletions src/extensibility/InstallExtensionDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ define(function (require, exports, module) {
this.$msgArea.hide();
this.$inputArea.show();
this.$okButton
.attr("disabled", "disabled")
.prop("disabled", true)
.text(Strings.INSTALL);
break;

case STATE_VALID_URL:
this.$okButton.removeAttr("disabled");
this.$okButton.prop("disabled", false);
break;

case STATE_INSTALLING:
Expand All @@ -136,7 +136,7 @@ define(function (require, exports, module) {
this.$msg.text(StringUtils.format(Strings.INSTALLING_FROM, url))
.append("<span class='spinner spin'/>");
this.$msgArea.show();
this.$okButton.attr("disabled", "disabled");
this.$okButton.prop("disabled", true);
this._installer.install(url)
.done(function () {
self._enterState(STATE_INSTALLED);
Expand All @@ -156,7 +156,7 @@ define(function (require, exports, module) {
case STATE_CANCELING_INSTALL:
// This should call back the STATE_INSTALLING fail() handler above, unless it's too late to cancel
// in which case we'll still jump to STATE_INSTALLED after this
this.$cancelButton.attr("disabled", "disabled");
this.$cancelButton.prop("disabled", true);
this.$msg.text(Strings.CANCELING_INSTALL);
this._installer.cancel();
window.setTimeout(function () {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/default/DebugCommands/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ define(function (require, exports, module) {

function setLanguage(event) {
locale = $select.val();
$submit.attr("disabled", false);
$submit.prop("disabled", false);
}

// returns the localized label for the given locale
Expand Down
6 changes: 3 additions & 3 deletions src/extensions/default/InlineColorEditor/ColorEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ define(function (require, exports, module) {
hueColor = "hsl(" + this._hsv.h + ", 100%, 50%)";

this._updateColorTypeRadioButtons(colorObject.format);
this.$colorValue.attr("value", colorValue);
this.$colorValue.val(colorValue);
this.$currentColor.css("background-color", colorValue);
this.$selection.css("background-color", hueColor);
this.$hueBase.css("background-color", hueColor);
Expand Down Expand Up @@ -597,7 +597,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("%", "")));
Copy link
Contributor

Choose a reason for hiding this comment

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

@dangoor - Why was this change necessary? I didn't see anything in the migration guides about it. Is it because .css() is supposed to get the computed property (in pixels)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this isn't in the migration guides, but was a change in jQuery 1.8. The css() function always returns pixel values.

Copy link
Contributor

Choose a reason for hiding this comment

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

When I ran into this issue in my original pull for the jQuery 2.0 upgrade, it seems that jQuery makes no guarantee about the units it will return (in my findings, the left value returned in pixels, but the bottom value returned the expected [as authored] percentage). Not sure if it has since been updated to always return pixels?

adjustedOffset = (event.keyCode === KeyEvent.DOM_VK_LEFT) ? (xOffset - step) : (xOffset + step);
xOffset = Math.min(100, Math.max(0, adjustedOffset));
hsv.s = xOffset / 100;
Expand All @@ -606,7 +606,7 @@ define(function (require, exports, module) {
case KeyEvent.DOM_VK_DOWN:
case KeyEvent.DOM_VK_UP:
step = event.shiftKey ? step * STEP_MULTIPLIER : step;
yOffset = Number($.trim(this.$selectionBase.css("bottom").replace("%", "")));
yOffset = Number($.trim(this.$selectionBase[0].style.bottom.replace("%", "")));
adjustedOffset = (event.keyCode === KeyEvent.DOM_VK_DOWN) ? (yOffset - step) : (yOffset + step);
yOffset = Math.min(100, Math.max(0, adjustedOffset));
hsv.v = yOffset / 100;
Expand Down
20 changes: 10 additions & 10 deletions src/extensions/default/InlineColorEditor/unittests.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ define(function (require, exports, module) {
runs(function () {
makeUI(colorStr);
expect(colorEditor.getColor().toString()).toBe(colorStr);
expect(colorEditor.$colorValue.attr("value")).toBe(colorStr);
expect(colorEditor.$colorValue.val()).toBe(colorStr);
expect(tinycolor.equals(colorEditor.$currentColor.css("background-color"), colorStr)).toBe(true);

// Not sure why the tolerances need to be larger for these.
Expand All @@ -413,10 +413,10 @@ define(function (require, exports, module) {
waits(1);

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.$hueSelector[0].style.bottom, 25);
checkPercentageNear(colorEditor.$opacitySelector[0].style.bottom, 50);
checkPercentageNear(colorEditor.$selectionBase[0].style.left, 74);
checkPercentageNear(colorEditor.$selectionBase[0].style.bottom, 47);
});
});

Expand All @@ -428,7 +428,7 @@ define(function (require, exports, module) {
makeUI("#0a0a0a");
colorEditor.setColorFromString(colorStr);
expect(colorEditor.getColor().toString()).toBe(colorStr);
expect(colorEditor.$colorValue.attr("value")).toBe(colorStr);
expect(colorEditor.$colorValue.val()).toBe(colorStr);
expect(tinycolor.equals(colorEditor.$currentColor.css("background-color"), colorStr)).toBe(true);
checkNear(tinycolor(colorEditor.$selection.css("background-color")).toHsv().h, tinycolor(colorStr).toHsv().h);
checkNear(tinycolor(colorEditor.$hueBase.css("background-color")).toHsv().h, tinycolor(colorStr).toHsv().h);
Expand All @@ -439,10 +439,10 @@ define(function (require, exports, module) {
waits(1);

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.$hueSelector[0].style.bottom, 25);
checkPercentageNear(colorEditor.$opacitySelector[0].style.bottom, 50);
checkPercentageNear(colorEditor.$selectionBase[0].style.left, 74);
checkPercentageNear(colorEditor.$selectionBase[0].style.bottom, 47);
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<table class="zebra-striped row-highlight condensed-table">
<table class="table table-striped table-condensed row-highlight">
<tbody>
{{#reportList}}
<tr>
Expand Down
7 changes: 3 additions & 4 deletions src/extensions/default/UrlCodeHints/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,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 @@ -163,13 +163,12 @@ 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()) {
self.cachedHints.deferred.state() === "pending") {
self.cachedHints.deferred.reject();
self.cachedHints.deferred = null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/htmlContent/extension-manager-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<input class="search" type="text" placeholder="Search">
<h1 class="dialog-title">{{EXTENSION_MANAGER_TITLE}}</h1>
</div>
<div class="modal-body no-padding zebra-striped"></div>
<div class="modal-body no-padding table-striped"></div>
<div class="modal-footer">
<button class="btn left install-from-url">{{INSTALL_FROM_URL}}</button>
<button class="dialog-button btn primary" data-button-id="close">{{CLOSE}}</button>
Expand Down
2 changes: 1 addition & 1 deletion src/htmlContent/extension-manager-view-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</td>
<td class="ext-desc">
{{^isCompatible}}
<div class="alert-message warning">
<div class="alert warning">
{{#requiresNewer}}{{Strings.EXTENSION_INCOMPATIBLE_NEWER}}{{/requiresNewer}}
{{^requiresNewer}}{{Strings.EXTENSION_INCOMPATIBLE_OLDER}}{{/requiresNewer}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@

<!-- TODO (Issue #278): switch between runtime LESS compilation in dev mode and precompiled version -->
<link rel="stylesheet/less" href="styles/brackets.less">
<script src="thirdparty/less-1.3.0.min.js"></script>
<script src="thirdparty/less-1.3.3.min.js"></script>
<script src="thirdparty/mustache/mustache.js"></script>
<!-- <link rel="stylesheet" href="brackets.min.css"> -->

<!-- JavaScript -->

<!-- Pre-load third party scripts that cannot be async loaded. -->
<script src="thirdparty/jquery-1.7.min.js"></script>
<script src="thirdparty/jquery-2.0.1.min.js"></script>
<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
2 changes: 1 addition & 1 deletion src/preferences/PreferencesDialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ define(function (require, exports, module) {

// Error message
if (errorMessage) {
$dlg.find(".field-container").append("<div class='alert-message' style='margin-bottom: 0'>" + errorMessage + "</div>");
$dlg.find(".field-container").append("<div class='alert' style='margin-bottom: 0'>" + errorMessage + "</div>");
}

// Give focus to first control
Expand Down
6 changes: 3 additions & 3 deletions src/search/FindInFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ define(function (require, exports, module) {
$(".modal-bar .message").css("display", "none");
$(".modal-bar .error")
.css("display", "inline-block")
.html("<div class='alert-message' style='margin-bottom: 0'>" + e.message + "</div>");
.html("<div class='alert' style='margin-bottom: 0'>" + e.message + "</div>");
return null;
}
}
Expand Down Expand Up @@ -164,7 +164,7 @@ define(function (require, exports, module) {
var $searchField = $("input#findInFilesInput");
var that = this;

$searchField.attr("value", initialString || "");
$searchField.val(initialString || "");
$searchField.get(0).select();

$("#findInFilesScope").html(_labelForScope(scope));
Expand Down Expand Up @@ -245,7 +245,7 @@ define(function (require, exports, module) {

function _showSearchResults(searchResults, query, scope) {
if (searchResults && searchResults.length) {
var $resultTable = $("<table class='zebra-striped row-highlight condensed-table' />")
var $resultTable = $("<table class='table table-striped table-condensed row-highlight' />")
.append("<tbody>");

// Count the total number of matches
Expand Down
10 changes: 5 additions & 5 deletions src/search/FindReplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ define(function (require, exports, module) {
$(".modal-bar .message").css("display", "none");
$(".modal-bar .error")
.css("display", "inline-block")
.html("<div class='alert-message' style='margin-bottom: 0'>" + e.message + "</div>");
.html("<div class='alert' style='margin-bottom: 0'>" + e.message + "</div>");
return "";
}
}
Expand Down Expand Up @@ -231,7 +231,7 @@ define(function (require, exports, module) {
if (modalBar) {
// The modalBar was already up. When creating the new modalBar, copy the
// current query instead of using the passed-in selected text.
initialQuery = getDialogTextField().attr("value");
initialQuery = getDialogTextField().val();
}

createModalBar(queryDialog, true);
Expand All @@ -255,7 +255,7 @@ define(function (require, exports, module) {

var $input = getDialogTextField();
$input.on("input", function () {
findFirst($input.attr("value"));
findFirst($input.val());
});

// Prepopulate the search field with the current selection, if any.
Expand All @@ -267,7 +267,7 @@ define(function (require, exports, module) {
}

$input
.attr("value", initialQuery)
.val(initialQuery)
.get(0).select();
findFirst(initialQuery);
// Clear the "findNextCalled" flag here so we have a clean start
Expand Down Expand Up @@ -352,7 +352,7 @@ define(function (require, exports, module) {

// Prepopulate the replace field with the current selection, if any
getDialogTextField()
.attr("value", cm.getSelection())
.val(cm.getSelection())
.get(0).select();
}

Expand Down
3 changes: 0 additions & 3 deletions src/styles/bootstrap/VERSION

This file was deleted.

34 changes: 34 additions & 0 deletions src/styles/bootstrap/accordion.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// Accordion
// --------------------------------------------------


// Parent container
.accordion {
margin-bottom: @baseLineHeight;
}

// Group == heading + body
.accordion-group {
margin-bottom: 2px;
border: 1px solid #e5e5e5;
.border-radius(@baseBorderRadius);
}
.accordion-heading {
border-bottom: 0;
}
.accordion-heading .accordion-toggle {
display: block;
padding: 8px 15px;
}

// General toggle styles
.accordion-toggle {
cursor: pointer;
}

// Inner needs the styles because you can't animate properly with any styles on the element
.accordion-inner {
padding: 9px 15px;
border-top: 1px solid #e5e5e5;
}
Loading