Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
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
7 changes: 7 additions & 0 deletions src/htmlContent/search-dialog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{CMD_FIND}}:
<input type="text" id="searchInput" value="{{value}}" style="width: 10em" />
<div class="message">
<span id="searchlabel">{{{label}}}</span>
<span style="color: #888">({{SEARCH_REGEXP_INFO}})</span>
</div>
<div class="error"></div>
8 changes: 8 additions & 0 deletions src/htmlContent/search-panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div id="search-results" class="bottom-panel vert-resizable top-resizer no-focus">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually the old search-results.html, but renamed so I could use the results name for the results table.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this panel only used by find in files? I'm wondering if we only need one template rather than two (the new search-results.html template get's merged in where {{SEARCH_RESULTS}} appears in this template)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This panel is only used for find in files currently, but could eventually be used for something else later (like replace all).

This template is used to create one time only a panel to place the results in. Once it is created on start up is not used anymore. The content template is used after every search, so merging both templates would require to destroy the current panel and re-create it after each search, and once paging is added, for every new page. I think that the current solution using 2 templates is cleaner.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, that seems reasonable. Thanks for the explanation!

<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 resizable-content"></div>
</div>
24 changes: 16 additions & 8 deletions src/htmlContent/search-results.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<div id="search-results" class="bottom-panel vert-resizable top-resizer no-focus">
<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 resizable-content"></div>
</div>
<table class="table table-striped table-condensed row-highlight">
<tbody>
{{#searchList}}
<tr class="file-section" data-file="{{file}}">
<td colspan="3"><span class="disclosure-triangle expanded"></span>{{{filename}}}</td>
</tr>
{{#items}}
<tr data-file="{{file}}" data-item="{{item}}">
<td></td>
<td style="white-space: nowrap">{{line}}</td>
<td>{{pre}}<span class="highlight">{{highlight}}</span>{{post}}</td>
</tr>
{{/items}}
{{/searchList}}
</tbody>
</table>
2 changes: 1 addition & 1 deletion src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ define({
"FIND_IN_FILES_MORE_THAN" : "More than ",
"FIND_IN_FILES_MAX" : " (showing the first {0} matches)",
"FIND_IN_FILES_FILE_PATH" : "File: <span class='dialog-filename'>{0}</span>",
"FIND_IN_FILES_LINE" : "line:&nbsp;{0}",
"FIND_IN_FILES_LINE" : "line: {0}",

"ERROR_FETCHING_UPDATE_INFO_TITLE" : "Error getting update info",
"ERROR_FETCHING_UPDATE_INFO_MSG" : "There was a problem getting the latest update information from the server. Please make sure you are connected to the internet and try again.",
Expand Down
Loading