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

Fix for issue #1122 #1661

Merged
merged 17 commits into from
Oct 8, 2012
Merged
Show file tree
Hide file tree
Changes from 12 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
3 changes: 2 additions & 1 deletion src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ define(function (require, exports, module) {
UpdateNotification = require("utils/UpdateNotification"),
UrlParams = require("utils/UrlParams").UrlParams,
NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem,
PreferencesManager = require("preferences/PreferencesManager");
PreferencesManager = require("preferences/PreferencesManager"),
Resizer = require("utils/Resizer");

// Local variables
var params = new UrlParams(),
Expand Down
9 changes: 5 additions & 4 deletions src/htmlContent/main-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,20 @@
</div>
</div>

<div id="jslint-results" class="bottom-panel">
<div id="jslint-results" class="bottom-panel ver-resizable top-resizer">
<div class="toolbar simple-toolbar-layout">
<div class="title">{{JSLINT_ERRORS}}</div>
</div>
<div class="table-container"></div>
<div class="table-container resizable-content"></div>
</div>
<div id="search-results" class="bottom-panel">

<div id="search-results" class="bottom-panel ver-resizable top-resizer">
<div class="toolbar simple-toolbar-layout">
<div class="title">{{SEARCH_RESULTS}}</div>
<div class="title" id="search-result-summary"></div>
<a href="#" class="close">&times;</a>
</div>
<div class="table-container"></div>
<div class="table-container resizable-content"></div>
</div>
</div>

Expand Down
36 changes: 30 additions & 6 deletions src/language/JSLintUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, $, brackets, JSLINT, PathUtils */
/*global define, $, JSLINT, PathUtils, document, window */
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like both document and window are no longer used and can be removed


/**
* Allows JSLint to run on the current document and report results in a UI panel.
Expand All @@ -44,8 +44,13 @@ define(function (require, exports, module) {
EditorManager = require("editor/EditorManager"),
PreferencesManager = require("preferences/PreferencesManager"),
PerfUtils = require("utils/PerfUtils"),
Strings = require("strings");

Strings = require("strings"),
AppInit = require("utils/AppInit"),
Resizer = require("utils/Resizer");

var PREFERENCES_CLIENT_ID = module.id,
defaultPrefs = { height: 200, enabled: true };

/**
* @private
* @type {PreferenceStorage}
Expand Down Expand Up @@ -200,16 +205,35 @@ define(function (require, exports, module) {
setEnabled(!getEnabled());
}


// Register command handlers
CommandManager.register(Strings.CMD_JSLINT, Commands.TOGGLE_JSLINT, _handleToggleJSLint);

// Init PreferenceStorage
_prefs = PreferencesManager.getPreferenceStorage(module.id, { enabled: !!brackets.config.enable_jslint });
_prefs = PreferencesManager.getPreferenceStorage(PREFERENCES_CLIENT_ID, defaultPrefs);
_setEnabled(_prefs.getValue("enabled"));

// Initialize items dependent on HTML DOM
AppInit.htmlReady(function () {
var height = Math.max(_prefs.getValue("height"), 100),
$jslintResults = $("#jslint-results"),
$jslintContent = $("#jslint-results .table-container");

$jslintResults.height(height);
$jslintContent.height(height - 27);
Copy link
Contributor

Choose a reason for hiding this comment

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

27 seems to be the header height and should be defined in a constant. Same comment for the FiF panel.


if (_enabled) {
EditorManager.resizeEditor();
}

$.when(Resizer.resizing($jslintResults)).progress(function (status, height) {
if (status === "end") {
_prefs.setValue("height", height);
}
});
});

// Define public API
exports.run = run;
exports.getEnabled = getEnabled;
exports.setEnabled = setEnabled;
});
});
32 changes: 27 additions & 5 deletions src/search/FindInFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, PathUtils, window */
/*global define, $, PathUtils, window, document */
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like both document and window are no longer used and can be removed


/*
* Adds a "find in files" command to allow the user to find all occurances of a string in all files in
Expand Down Expand Up @@ -50,11 +50,16 @@ define(function (require, exports, module) {
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
FileIndexManager = require("project/FileIndexManager"),
KeyEvent = require("utils/KeyEvent");

PreferencesManager = require("preferences/PreferencesManager"),
KeyEvent = require("utils/KeyEvent"),
AppInit = require("utils/AppInit"),
Resizer = require("utils/Resizer");

var FIND_IN_FILES_MAX = 100;


var PREFERENCES_CLIENT_ID = module.id,
defaultPrefs = { height: 200 };

// This dialog class was mostly copied from QuickOpen. We should have a common dialog
// class that everyone can use.

Expand Down Expand Up @@ -332,6 +337,23 @@ define(function (require, exports, module) {
}
});
}

// Initialize items dependent on HTML DOM
AppInit.htmlReady(function () {
var $searchResults = $("#search-results"),
$searchContent = $("#search-results .table-container"),
prefs = PreferencesManager.getPreferenceStorage(module.id, defaultPrefs),
height = prefs.getValue("height");

$searchResults.height(height);
$searchContent.height(height - 27);

$.when(Resizer.resizing($("#search-results"))).progress(function (status, height) {
if (status === "end") {
prefs.setValue("height", height);
}
});
});

CommandManager.register(Strings.CMD_FIND_IN_FILES, Commands.EDIT_FIND_IN_FILES, doFindInFiles);
});
});
28 changes: 26 additions & 2 deletions src/styles/brackets.less
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ body {
&.resizing a, &.resizing #projects a, &.resizing .main-view, &.resizing .CodeMirror-lines {
cursor: col-resize;
}

/* This appears to be necessary in Firefox when body is set to display: box. */
height: 100%;
&.ver-resizing a, &.ver-resizing #projects a, &.ver-resizing .main-view, &.ver-resizing .CodeMirror-lines {
cursor: row-resize;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Brackets currently doesn't support Firefox, so is this necessary? Maybe the comment is incorrect.

}


Expand Down Expand Up @@ -108,14 +114,32 @@ a, img {
background: @background-color-2 url('images/no_content_bg.svg') no-repeat center 45%;
}
}


.ver-resizer {
position: absolute;
height: 6px;
width: 100%;
z-index: @z-index-brackets-panel-resizer;
opacity: 0;
cursor: row-resize;
}

.hor-resizer {
position: absolute;
height: 100%;
width: 6px;
z-index: @z-index-brackets-panel-resizer;
opacity: 0;
cursor: col-resize;
}

.bottom-panel {
display: none;
height: 200px;
border-top-style: solid;
border-width: 1px;
border-color: lighten(@bc-grey, @bc-color-step-size*4);

.toolbar {
height: auto;
padding-top: @base-padding / 2;
Expand Down
1 change: 1 addition & 0 deletions src/styles/brackets_variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@

@z-index-brackets-sidebar-resizer: @z-index-brackets-ui + 2;
@z-index-brackets-resizer-div: @z-index-brackets-sidebar-resizer + 1;
@z-index-brackets-panel-resizer: @z-index-brackets-ui + 2;

@z-index-brackets-context-menu-base: 1000;
Loading