1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-09-20 23:43:51 -04:00
parent 5fe27b5b3b
commit fa70c05354
1056 changed files with 8375 additions and 7095 deletions

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.users; import gplx.*; import gplx.xowa.*;
import gplx.xowa.apps.*; import gplx.xowa.wikis.*;
import gplx.xowa.apps.gfss.*; import gplx.xowa.wikis.*;
public class Xou_fsys_mgr implements GfoInvkAble {
private Io_url app_root_dir; private Io_url wiki_root_dir; private Io_url cur_root;
public Xou_fsys_mgr(Xoae_app app, Xoue_user usr, Io_url user_dir) {

View File

@@ -16,7 +16,8 @@ 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.users; import gplx.*; import gplx.xowa.*;
import gplx.xowa.langs.cases.*; import gplx.xowa.wikis.*; import gplx.xowa.xtns.scribunto.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.cases.*; import gplx.xowa.wikis.*; import gplx.xowa.xtns.scribunto.*;
import gplx.xowa.nss.*;
import gplx.xowa.wikis.domains.*;
class Xou_user_ {
public static Xowe_wiki new_or_create_(Xoue_user user, Xoae_app app) {

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.users; import gplx.*; import gplx.xowa.*;
import gplx.dbs.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*;
import gplx.xowa.wikis.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.users.history.*; import gplx.xowa.xtns.scribunto.*; import gplx.xowa.users.data.*;
import gplx.xowa.files.*; import gplx.xowa.files.caches.*;
import gplx.xowa.langs.genders.*;
@@ -118,7 +119,7 @@ public class Xoue_user implements Xou_user, GfoEvMgrOwner, GfoInvkAble {
}
}
private void Available_from_bulk(byte[] raw) {
byte[][] wikis = Bry_.Split(raw, Byte_ascii.Nl);
byte[][] wikis = Bry_split_.Split(raw, Byte_ascii.Nl);
Xowe_wiki usr_wiki = Wiki();
int wikis_len = wikis.length;
for (int i = 0; i < wikis_len; i++)

View File

@@ -0,0 +1,24 @@
/*
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/>.
*/
package gplx.xowa.users; import gplx.*; import gplx.xowa.*;
public class Xouv_cfg_keys {
public static final String
Key_history_stack = "xowa.gui.history_stack"
, Key_history_idx = "xowa.gui.history.idx"
;
}

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.users.bmks; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
import gplx.core.json.*; import gplx.html.*;
import gplx.langs.jsons.*; import gplx.langs.htmls.*;
import gplx.xowa.users.data.*; import gplx.xowa.users.bmks.*;
import gplx.xowa.html.bridges.*; import gplx.xowa.html.bridges.dbuis.*; import gplx.xowa.html.bridges.dbuis.tbls.*; import gplx.xowa.html.bridges.dbuis.fmtrs.*;
public class Dbui_tbl_itm__bmk implements Dbui_tbl_itm {

View File

@@ -38,7 +38,7 @@ class Xoud_opt_scope_parser {
list.Clear();
int pos = 0; int src_len = src.length;
while (pos < src_len) {
int comma_pos = Bry_finder.Find_fwd(src, Byte_ascii.Comma, pos, src_len); if (comma_pos == Bry_finder.Not_found) comma_pos = src_len;
int comma_pos = Bry_find_.Find_fwd(src, Byte_ascii.Comma, pos, src_len); if (comma_pos == Bry_find_.Not_found) comma_pos = src_len;
Xoud_opt_scope itm = Parse_itm(src, pos, comma_pos);
if (itm == Xoud_opt_scope.App) return Ary_app;
list.Add(itm);
@@ -47,7 +47,7 @@ class Xoud_opt_scope_parser {
return (Xoud_opt_scope[])list.To_ary_and_clear(Xoud_opt_scope.class);
}
public Xoud_opt_scope Parse_itm(byte[] src, int bgn, int end) {
int lang_dot = Bry_finder.Find_fwd(src, Byte_ascii.Dot, bgn, end); if (lang_dot == Bry_finder.Not_found) return Warn("scope.parse.missing_lang_dot: src=~{0}", src, bgn, end);
int lang_dot = Bry_find_.Find_fwd(src, Byte_ascii.Dot, bgn, end); if (lang_dot == Bry_find_.Not_found) return Warn("scope.parse.missing_lang_dot: src=~{0}", src, bgn, end);
int lang_id = Int_.Min_value;
if (lang_dot == 1 && src[bgn] == Byte_ascii.Star)
lang_id = Xoud_opt_scope.Lang_id_wildcard;

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.users.history; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
import gplx.core.json.*; import gplx.html.*;
import gplx.langs.jsons.*; import gplx.langs.htmls.*;
import gplx.xowa.users.data.*; import gplx.xowa.users.bmks.*;
import gplx.xowa.html.bridges.*; import gplx.xowa.html.bridges.dbuis.*; import gplx.xowa.html.bridges.dbuis.tbls.*; import gplx.xowa.html.bridges.dbuis.fmtrs.*;
public class Dbui_tbl_itm__history implements Dbui_tbl_itm {

View File

@@ -38,7 +38,7 @@ public class Prefs_converter {
}
public String Convert(String raw) {
list.Clear();
GfoMsg root_msg = gplx.gfs.Gfs_msg_bldr._.ParseToMsg(raw);
GfoMsg root_msg = gplx.langs.gfss.Gfs_msg_bldr._.ParseToMsg(raw);
int len = root_msg.Subs_count();
for (int i = 0; i < len; i++) {
GfoMsg msg = root_msg.Subs_getAt(i);

View File

@@ -41,14 +41,14 @@ class Prefs_converter_fxt {
}
public void Parse(String raw_str) {
byte[] raw_bry = Bry_.new_u8(raw_str);
int bgn_pos = Bry_finder.Find_fwd(raw_bry, Byte_ascii.Paren_bgn);
int bgn_pos = Bry_find_.Find_fwd(raw_bry, Byte_ascii.Paren_bgn);
if (bgn_pos == Bry_.NotFound) throw Err_.new_wo_type("unable to find paren_bgn", "raw", raw_str);
int end_pos = Bry_finder.Find_fwd(raw_bry, Byte_ascii.Paren_end, bgn_pos);
int end_pos = Bry_find_.Find_fwd(raw_bry, Byte_ascii.Paren_end, bgn_pos);
if (end_pos == Bry_.NotFound) throw Err_.new_wo_type("unable to find paren_end", "raw", raw_str);
raw_bry = Bry_.Mid(raw_bry, bgn_pos, end_pos);
int len = raw_bry.length;
for (int i = 0; i < len; i++) {
byte[] c = gplx.intl.Utf8_.Get_char_at_pos_as_bry(raw_bry, i);
byte[] c = gplx.core.intls.Utf8_.Get_char_at_pos_as_bry(raw_bry, i);
if (c.length == 1) {
switch (c[0]) {
case Byte_ascii.Dash:

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.users.prefs; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
import gplx.html.*;
import gplx.langs.htmls.*;
class Prefs_html_wtr {
public Prefs_html_wtr(Prefs_mgr prefs_mgr) {this.prefs_mgr = prefs_mgr;} Prefs_mgr prefs_mgr; Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
public void Write(Bry_bfr bfr, byte[] src, Html_nde hnde, int prop_idx, byte[] trg_type, byte[] trg_val) {

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.users.prefs; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
import gplx.core.primitives.*; import gplx.core.net.*; import gplx.html.*; import gplx.gfui.*;
import gplx.core.primitives.*; import gplx.core.net.*; import gplx.langs.htmls.*; import gplx.gfui.*;
import gplx.xowa.gui.views.*;
import gplx.xowa.urls.*;
import gplx.xowa.parsers.*;
@@ -55,7 +55,7 @@ public class Prefs_mgr implements GfoInvkAble {
private void Props_set_and_reload() {
Xoae_page page = app.Gui_mgr().Browser_win().Active_page();
Props_set(page.Data_raw());
page.Wikie().ParsePage_root(page, true); // reparse in order to save new values to root; needed for history and going back / fwd; DATE:2014-02-07
page.Wikie().Parser_mgr().Parse(page, true); // reparse in order to save new values to root; needed for history and going back / fwd; DATE:2014-02-07
// app.Api_root().Gui().Page().View().Reload(); // force reload to update page; needed for language; DATE:2014-05-26; NOTE: deactivate on 2015-08-13; refreshing page causes options to not show
Xog_tab_itm tab = app.Gui_mgr().Browser_win().Active_tab(); if (tab != null) tab.Exec_notify(Bool_.Y, "options saved");
}
@@ -105,7 +105,7 @@ public class Prefs_mgr implements GfoInvkAble {
Xowe_wiki wiki = app.Usere().Wiki(); // NOTE: this limits prefs to home_wiki only
Xop_root_tkn root = new Xop_root_tkn();
Xop_ctx ctx = Xop_ctx.new_(wiki); // NOTE: always create new ctx; do not reuse existing, else popup will clear out existing page's prefs; DATE:2015-04-29
wiki.Parser().Parse_text_to_wdom(root, ctx, ctx.Tkn_mkr(), src, 0);
wiki.Parser_mgr().Main().Parse_text_to_wdom(root, ctx, ctx.Tkn_mkr(), src, 0);
return root.Data_mid();
}
public Object Eval(byte[] code) {return app.Gfs_mgr().Run_str(String_.new_a7(code));}

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.users.prefs; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
import org.junit.*;
import gplx.gfui.*; import gplx.xowa.apps.*;
import gplx.gfui.*; import gplx.xowa.apps.gfss.*;
import gplx.xowa.gui.views.*;
public class Prefs_mgr_tst {
private Prefs_mgr_fxt fxt = new Prefs_mgr_fxt();

View File

@@ -58,7 +58,7 @@ class Xofs_url_itm_parser {
}
else {
int name_bgn = i + 2; // skip "~{"
int name_end = Bry_finder.Find_fwd(raw, Byte_ascii.Curly_end, name_bgn);
int name_end = Bry_find_.Find_fwd(raw, Byte_ascii.Curly_end, name_bgn);
byte[] name = (byte[])names.Get_by_mid(raw, name_bgn, name_end);
if (name == null) throw Err_.new_wo_type("name not found", "raw", raw_str, "name", String_.new_u8(raw, name_bgn, name_end));
url_bfr.Add(name);