1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

v2.11.1.1

This commit is contained in:
gnosygnu
2015-11-01 20:50:05 -05:00
parent 4f43f51b18
commit b990ec409f
858 changed files with 6758 additions and 4187 deletions

View File

@@ -73,7 +73,7 @@ public class Xows_mgr {
}
public void Special_gen(Xowe_wiki wiki, Xoae_page page, Xoa_url url, Xoa_ttl ttl) {
int slash_pos = Bry_find_.Find_fwd(ttl.Page_txt_wo_qargs(), Xoa_ttl.Subpage_spr); // check for slash
byte[] special_name = slash_pos == Bry_.NotFound
byte[] special_name = slash_pos == Bry_find_.Not_found
? ttl.Base_txt_wo_qarg() // no slash found; use base_txt; ignore qry args and just get page_names; EX: Search/Earth?fulltext=y; Allpages?from=Earth...
: Bry_.Mid(ttl.Page_txt_wo_qargs(), 0, slash_pos); // slash found; use root page; EX: Special:ItemByTitle/enwiki/Earth
Object o = hash.Get_by_bry(special_name);

View File

@@ -19,7 +19,7 @@ package gplx.xowa.specials.allPages; import gplx.*; import gplx.xowa.*; import g
import gplx.core.primitives.*; import gplx.core.net.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*;
import gplx.xowa.wikis.nss.*;
import gplx.xowa.htmls.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.lnkis.*;
import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.apps.urls.*;
public class Xows_page_allpages implements GfoInvkAble, Bry_fmtr_arg, Xows_page {

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import org.junit.*; import gplx.xowa.wikis.tdbs.*; import gplx.xowa.wikis.tdbs.hives.*; import gplx.xowa.wikis.data.tbls.*;
import org.junit.*; import gplx.core.encoders.*; import gplx.xowa.wikis.tdbs.*; import gplx.xowa.wikis.tdbs.hives.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.wikis.nss.*;
public class Xosrh_page_mgr_tst {
@Before public void init() {fxt.Clear();} private Xosrh_page_mgr_fxt fxt = new Xosrh_page_mgr_fxt();
@@ -46,7 +46,7 @@ class Xosrh_page_mgr_fxt {
Xowd_page_itm tmp_itm = new Xowd_page_itm();
for (int i = bgn; i < end; i++) {
byte[] id_bry = new byte[5]; // NOTE: do not reuse; will break hive_mgr
Base85_utl.XtoStrByAry(i, id_bry, 0, 5);
Base85_.Set_bry(i, id_bry, 0, 5);
tmp_itm.Ns_id_(Xow_ns_.Id_main).Init(i, Bry_.To_a7_bry(i, 0), false, 10, 0, i - bgn);
Xotdb_page_itm_.Txt_id_save(tmp_bfr, tmp_itm);
hive_mgr.Create(id_bry, tmp_bfr.To_bry_and_clear(), null);

View File

@@ -99,7 +99,7 @@ class Xosrh_qry_itm {
byte[] itm_ttl = itm.Ttl_page_db();
itm_ttl = wiki.Lang().Case_mgr().Case_build_lower(itm_ttl, 0, itm_ttl.length); // lowercase ttl (since all search words are lower-cased)
itm_ttl = Bry_.Replace(itm_ttl, Byte_ascii.Underline, Byte_ascii.Space); // replace _ with " " (assume user will use spaces in search term)
if (Bry_find_.Find_fwd(itm_ttl, word) != Bry_.NotFound)
if (Bry_find_.Find_fwd(itm_ttl, word) != Bry_find_.Not_found)
ids.Add(itm);
}
break;

View File

@@ -44,7 +44,7 @@ class Xosrh_scanner {
case Xosrh_qry_tkn.Tid_quote: // find end quote and add as word
int quote_bgn = pos + 1;
int quote_end = Bry_find_.Find_fwd(src, Byte_ascii.Quote, quote_bgn, src_len);
if (quote_end == Bry_.NotFound) throw Err_.new_wo_type("could not find end quote", "src", String_.new_u8(src));
if (quote_end == Bry_find_.Not_found) throw Err_.new_wo_type("could not find end quote", "src", String_.new_u8(src));
Tkns_add_word(Xosrh_qry_tkn.Tid_word_quoted, quote_bgn, quote_end);
pos = quote_end + 1; // +1 to place after quote
break;

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import gplx.langs.htmls.*; import gplx.xowa.htmls.wtrs.*; import gplx.xowa.langs.numbers.*;
import gplx.langs.htmls.*; import gplx.xowa.htmls.core.htmls.utls.*; import gplx.xowa.langs.numbers.*;
class Xows_html_wkr {
private final Bry_bfr tmp_bfr = Bry_bfr.new_(255);
private Xows_ui_qry qry; private Xow_wiki wiki; private Xol_num_mgr num_mgr;

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import org.junit.*; import gplx.xowa.htmls.wtrs.*; import gplx.xowa.wikis.tdbs.*;
import org.junit.*; import gplx.xowa.htmls.core.htmls.utls.*; import gplx.xowa.wikis.tdbs.*;
import gplx.xowa.wikis.domains.*;
import gplx.xowa.wikis.data.tbls.*;
public class Xows_html_wkr_tst {

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.search; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*;
import org.junit.*; import gplx.xowa.htmls.wtrs.*; import gplx.xowa.files.gui.*;
import org.junit.*; import gplx.xowa.htmls.core.htmls.utls.*; import gplx.xowa.files.gui.*;
public class Xows_ui_async_tst {
@Before public void init() {fxt.Clear();} private Xows_ui_async_fxt fxt = new Xows_ui_async_fxt();
@Test public void Basic() {

View File

@@ -45,7 +45,7 @@ class Xows_ui_cmd implements GfoInvkAble, Cancelable, Xog_tab_close_lnr {
if (!cache.Done() && (qry.Itms_end() > cache.Itms_end())) {
if (async) {
fill_from_cache = false; // NOTE: do not retrieve cached results to page, else ui_async cmd will add out of order; DATE:2015-04-24
if (async_wkr == null) async_wkr = new Xows_ui_async(this, new Xows_html_row(new gplx.xowa.htmls.wtrs.Xoh_lnki_bldr(wiki.App(), wiki.App().Html__href_wtr())), js_wkr, qry.Page_len(), wiki.Domain_bry());
if (async_wkr == null) async_wkr = new Xows_ui_async(this, new Xows_html_row(new gplx.xowa.htmls.core.htmls.utls.Xoh_lnki_bldr(wiki.App(), wiki.App().Html__href_wtr())), js_wkr, qry.Page_len(), wiki.Domain_bry());
Thread_adp_.invk_(gplx.xowa.apps.Xoa_thread_.Key_special_search_db, this, Invk_search_db).Start();
}
else

View File

@@ -45,7 +45,7 @@ class Xow_search_scanner {
case Xow_search_tkn.Tid_quote: // find end quote and add as word
int quote_bgn = pos + 1;
int quote_end = Bry_find_.Find_fwd(src, Byte_ascii.Quote, quote_bgn, src_len);
if (quote_end == Bry_.NotFound) throw Err_.new_wo_type("could not find end quote", "src", String_.new_u8(src));
if (quote_end == Bry_find_.Not_found) throw Err_.new_wo_type("could not find end quote", "src", String_.new_u8(src));
Tkns_add_word(Xow_search_tkn.Tid_word_quoted, quote_bgn, quote_end);
pos = quote_end + 1; // +1 to place after quote
break;

View File

@@ -1,63 +0,0 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//namespace gplx.xowa.specials.search.quicks {
// using gplx.dbs;
// public class Xoa_search_tbl : RlsAble {
// private final String tbl_name = "quick_search"; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
// private final String fld_page_id, fld_page_title, fld_page_title_lower, fld_page_ns, fld_page_score, fld_page_len, fld_page_links, fld_page_descrip, fld_page_file_title;
// private final Db_conn conn; // private Db_stmt stmt_insert, stmt_update, stmt_select;
// public Db_conn Conn() {return conn;}
// public Xoa_search_tbl(Db_conn conn) {
// this.conn = conn;
// fld_page_id = flds.Add_int ("page_id");
// fld_page_title = flds.Add_str ("page_title", 255);
// fld_page_title_lower = flds.Add_str ("page_title_lower", 255);
// fld_page_ns = flds.Add_int ("page_ns");
// fld_page_score = flds.Add_byte ("page_score");
// fld_page_len = flds.Add_byte ("page_len");
// fld_page_links = flds.Add_byte ("page_links");
// fld_page_descrip = flds.Add_str ("page_descrip", 1024);
// fld_page_file_title = flds.Add_str ("page_file_title", 255);
// conn.Rls_reg(this);
// }
// public void Insert(int page_id, byte[] page_title, int page_ns, int page_score, int page_len, int page_links, byte[] page_descrip, byte[] page_file_title) {
// Db_stmt stmt_insert = conn.Stmt_insert(tbl_name, flds);
// stmt_insert.Clear()
// .Val_int(fld_page_id, page_id).Val_bry_as_str(fld_page_title, page_title)
// .Val_int(fld_page_ns, page_ns).Val_int(fld_page_len, page_len)
// .Val_int(fld_page_links, page_links).Val_bry_as_str(fld_page_descrip, page_descrip)
// .Val_bry_as_str(fld_page_file_title, page_file_title)
// .Exec_insert();
// }
// public void Rls() {
// }
// }
///*
//quick_search
//. page_id 123
//. page_title Earth
//. page_title_lower earth
//. page_ns 0
//. page_score 0
//. page_len 140
//. page_pagelinks 20
//. page_descrip planet earth
//. page_file Earth.png
//
//*/
//}

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.xowa.diags; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import gplx.ios.*; import gplx.core.net.*;
import gplx.core.ios.*; import gplx.core.net.*;
import gplx.fsdb.meta.*;
import gplx.xowa.apps.urls.*;
class Xows_cmd__fs_check {

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.xowa.diags; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import gplx.ios.*; import gplx.core.primitives.*; import gplx.core.net.*;
import gplx.core.ios.*; import gplx.core.primitives.*; import gplx.core.net.*;
import gplx.dbs.*;
import gplx.fsdb.meta.*;
import gplx.xowa.apps.urls.*;

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import gplx.langs.htmls.encoders.*;
import gplx.ios.*; import gplx.xowa.apps.*; import gplx.xowa.wikis.*;
import gplx.core.ios.*; import gplx.xowa.apps.*; import gplx.xowa.wikis.*;
interface Xosp_fbrow_cmd {
Xosp_fbrow_cmd Make_new();
Xosp_fbrow_rslt Write_html(Xoa_url_arg_mgr arg_mgr, GfoInvkAble select_invkable);

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import gplx.ios.*;
import gplx.core.ios.*;
class Xosp_fbrow_data_dir {
private final Ordered_hash hash = Ordered_hash_.New();
public Xosp_fbrow_data_dir(Io_url url) {this.url = url;}

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import gplx.xowa.specials.*; import gplx.ios.*; import gplx.core.net.*;
import gplx.xowa.specials.*; import gplx.core.ios.*; import gplx.core.net.*;
public class Xosp_fbrow_special implements Xows_page {
private static final Xoa_url_arg_mgr url_args = new Xoa_url_arg_mgr(null);
public Xows_special_meta Special_meta() {return Xows_special_meta_.Itm__file_browser;}

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.specials.xowa.file_browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.specials.*; import gplx.xowa.specials.xowa.*;
import org.junit.*; import gplx.core.net.*; import gplx.ios.*;
import org.junit.*; import gplx.core.net.*; import gplx.core.ios.*;
public class Xosp_fbrow_special_tst {
@Before public void init() {fxt.Clear();} private Xosp_fbrow_special_fxt fxt = new Xosp_fbrow_special_fxt();
@Test public void Basic() {