Compare commits

...

6 Commits

Author SHA1 Message Date
Aaron O'Mullan 633e52c4be Bump version to 0.7.1 2014-08-08 15:37:03 -07:00
Aaron O'Mullan 1512bcf808 Update fs-extra to 0.10.0
Fixes potential race condition on copies
2014-08-08 15:31:49 -07:00
Samy Pessé 4e46d088ca Add build for search results 2014-08-05 09:47:08 -07:00
Samy Pessé 388c7ffd32 Merge pull request #396 from codepiano/hold-search-keyword
keep the search result list after user click a link
2014-08-05 09:44:54 -07:00
codepiano 7ba8653935 keep the search result list after user click a link
Record search keyword to LocalStorage, when navigate to a new url,fetch
keyword from LocalStorage, init the search input element,then filter the
sidebar menu.
So User can iterator the result list without type the keyword every
time.
2014-08-05 15:14:10 +08:00
Samy Pessé a4403aad1e Add changes for 0.7.0 2014-08-01 14:01:20 -07:00
5 changed files with 38 additions and 8 deletions
+10
View File
@@ -1,5 +1,15 @@
# Release notes
## 0.7.1
- Update `fs-extra` to `0.10.0` (fixes potential race conditions)
## 0.7.0
- Add page break in ebook (pdf, epub, mobi) between chapters/articles
- Start using kramed instead of marked
- Fix display of inline math
- Switch to graceful-fs to fix EMFILE errors
- Add sharing to weibo.com
## 0.6.2
- Support generating a plugin's book info dynamically
- Improve navigation on dark theme
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "gitbook",
"version": "0.7.0",
"version": "0.7.1",
"homepage": "http://www.gitbook.io/",
"description": "Library and cmd utility to generate GitBooks",
"main": "lib/index.js",
@@ -15,7 +15,7 @@
"fstream-ignore": "0.0.7",
"commander": "2.2.0",
"graceful-fs": "3.0.2",
"fs-extra": "0.8.1",
"fs-extra": "0.10.0",
"highlight.js": "8.0.0",
"tmp": "0.0.23",
"semver": "2.2.1",
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -3
View File
@@ -6,8 +6,9 @@ define([
"core/progress",
"core/exercise",
"core/quiz",
"core/loading"
], function($, URL, events, state, progress, exercises, quiz, loading) {
"core/loading",
"core/search"
], function($, URL, events, state, progress, exercises, quiz, loading, search) {
var prev, next;
var usePushState = (typeof history.pushState !== "undefined");
@@ -55,6 +56,8 @@ define([
// Update state
state.update($("html"));
// recover search keyword
search.recover();
preparePage();
})
.fail(function (e) {
@@ -146,4 +149,5 @@ define([
goNext: goNext,
goPrev: goPrev
};
});
});
+18 -2
View File
@@ -81,18 +81,34 @@ define([
}
if (q.length == 0) {
sidebar.filter(null);
storage.remove("keyword");
} else {
var results = search(q);
sidebar.filter(
_.pluck(results, "path")
);
storage.set("keyword", q);
}
})
};
// filter sidebar menu with current search keyword
var recoverSearch = function() {
var keyword = storage.get("keyword", "");
if(keyword.length > 0) {
if(!isSearchOpen()){
toggleSearch();
}
sidebar.filter(_.pluck(search(keyword), "path"));
}
$(".book-search input").val(keyword);
};
return {
init: init,
search: search,
toggle: toggleSearch
toggle: toggleSearch,
recover:recoverSearch
};
});
});