Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix

This commit is contained in:
Julian Harty 2014-10-06 16:21:55 +01:00
commit 05dc41157c
6 changed files with 20231 additions and 20215 deletions

View File

@ -512,7 +512,10 @@ namespace kiwix {
if (ok == true && !publisher.empty() && itr->publisher != publisher)
ok = false;
if ((ok == true && !search.empty()) && !(matchRegex(itr->title, search) || matchRegex(itr->description, search)))
if ((ok == true && !search.empty()) && !(matchRegex(itr->title, "\\Q" + search + "\\E") ||
matchRegex(itr->description, "\\Q" + search + "\\E") ||
matchRegex(itr->language, "\\Q" + search + "\\E")
))
ok = false;
if (ok == true) {

View File

@ -421,14 +421,21 @@ namespace kiwix {
article = article.getRedirectArticle();
}
/* Compute base url (might be different from the url if redirects */
baseUrl = "/" + std::string(1, article.getNamespace()) + "/" + article.getUrl();
if (loopCounter < 42) {
/* Compute base url (might be different from the url if redirects */
baseUrl = "/" + std::string(1, article.getNamespace()) + "/" + article.getUrl();
/* Get the content mime-type */
contentType = string(article.getMimeType().data(), article.getMimeType().size());
/* Get the content mime-type */
try {
contentType = string(article.getMimeType().data(), article.getMimeType().size());
} catch (exception &e) {
cerr << "Unable to get the mimetype for "<< baseUrl<< ":" << e.what() << endl;
contentType = "application/octet-stream";
}
/* Get the data */
content = string(article.getData().data(), article.getArticleSize());
/* Get the data */
content = string(article.getData().data(), article.getArticleSize());
}
/* Try to set a stub HTML header/footer if necesssary */
if (contentType.find("text/html") != string::npos &&

File diff suppressed because it is too large Load Diff

View File

@ -33,8 +33,6 @@ void kiwix::loadICUExternalTables() {
#endif
}
#ifndef __ANDROID__
/* Prepare integer for display */
std::string kiwix::beautifyInteger(const unsigned int number) {
std::stringstream numberStream;
@ -143,8 +141,6 @@ std::string kiwix::urlEncode(const std::string &c) {
return escaped;
}
#endif
static char charFromHex(std::string a) {
std::istringstream Blat(a);
int Z;

View File

@ -39,8 +39,6 @@
namespace kiwix {
#ifndef __ANDROID__
std::string removeAccents(const std::string &text);
std::string beautifyInteger(const unsigned int number);
std::string beautifyFileSize(const unsigned int number);
@ -49,8 +47,6 @@ namespace kiwix {
void printStringInHexadecimal(UnicodeString s);
void stringReplacement(std::string& str, const std::string& oldStr, const std::string& newStr);
#endif
void loadICUExternalTables();
std::string urlDecode(const std::string &c);

View File

@ -2,10 +2,10 @@
<link type="text/css" href="/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" />
<span class="kiwix">
<span id="kiwixtoolbar" class="ui-widget-header">
<form action="/" method="GET"><input type="submit" value="Library" id="kiwixlibrary" /></form>
<form action="/__CONTENT__/" method="GET"><input type="submit" value="Home" id="kiwixhome" /></form>
<form action="/random" method="GET"><input type="submit" value="Random" id="kiwixrandom" /><input type="hidden" name="content" value="__CONTENT__" /></form>
<form method="GET" action="/search" id="kiwixsearchform"><input type="hidden" name="content" value="__CONTENT__" /><input type="submit" id="kiwixsearch" value="Search" /><input type="text" id="kiwixsearchbox" name="pattern" /></form>
<form action="/" method="GET" style="float: left; font-size: 1em !important; height: 1px;"><input type="submit" value="Library" id="kiwixlibrary" /></form>
<form action="/__CONTENT__/" method="GET" style="float: left; font-size: 1em !important; height: 1px;"><input type="submit" value="Home" id="kiwixhome" /></form>
<form action="/random" method="GET" style="float: left; font-size: 1em !important; height: 1px;"><input type="submit" value="Random" id="kiwixrandom" /><input type="hidden" name="content" value="__CONTENT__" /></form>
<form method="GET" action="/search" id="kiwixsearchform" style="font-size: 1em !important; height: 1px; "><input type="hidden" name="content" value="__CONTENT__" /><input type="submit" id="kiwixsearch" value="Search" /><input type="text" id="kiwixsearchbox" name="pattern" /></form>
</span>
</span>
<div style="display: block; height: 35px;"></div>