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
2016-01-03 21:27:38 -05:00
parent 9509363f46
commit 096045614c
647 changed files with 11693 additions and 7648 deletions

View File

@@ -18,11 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.htmls.ns_files; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
import gplx.core.primitives.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.parsers.lnkis.*;
class Xoh_file_page__other_resolutions extends gplx.core.brys.Bfr_arg_base {
class Xoh_file_page__other_resolutions implements gplx.core.brys.Bfr_arg {
private Xow_repo_mgr repo_mgr; private Xof_file_itm orig_itm; private Xoh_file_page_wtr file_page;
private final Xof_img_size img_size = new Xof_img_size(); private final Xof_url_bldr url_bldr = Xof_url_bldr.new_v2();
public Xoh_file_page__other_resolutions Init_by_fmtr(Xow_repo_mgr repo_mgr, Xof_file_itm orig_itm, Xoh_file_page_wtr file_page) {this.repo_mgr = repo_mgr; this.orig_itm = orig_itm; this.file_page = file_page; return this;}
@Override public void Bfr_arg__add(Bry_bfr bfr) {
public void Bfr_arg__add(Bry_bfr bfr) {
Int_2_ref[] ary = file_page.Size_alts();
Xof_file_itm xfer_itm = new Xof_fsdb_itm();
int len = ary.length;

View File

@@ -52,7 +52,7 @@ public class Xoh_file_page_wtr {
public Bry_fmtr Html_main_img() {return html_main_img;} private final Bry_fmtr html_main_img = Bry_fmtr.new_(String_.Concat_lines_nl_skip_last
( "<div class=\"fullImageLink\" id=\"file\">"
, " <a href=\"~{orig_href}\" xowa_title=\"~{thumb_name}\">"
, " <img id=\"xowa_file_img_~{elem_id}\" alt=\"~{thumb_alt}\" src=\"~{thumb_href}\" width=\"~{thumb_width}\" height=\"~{thumb_height}\" />"
, " <img id=\"xoimg_~{elem_id}\" alt=\"~{thumb_alt}\" src=\"~{thumb_href}\" width=\"~{thumb_width}\" height=\"~{thumb_height}\" />"
, " </a>"
, " <div class=\"mw-filepage-resolutioninfo\">Size of this preview: "
, " <a href=\"~{thumb_href}\" class=\"mw-thumbnail-link\" xowa_title=\"~{thumb_name}\">"
@@ -90,7 +90,7 @@ public class Xoh_file_page_wtr {
( "<div class=\"fullImageLink\" id=\"file\">"
, " <div>"
, " <a href=\"~{lnki_href}\" class=\"~{lnki_class}\" title=\"~{xowa_title}\">"
, " <img id=\"xowa_file_img_~{elem_id}\" src=\"~{lnki_src}\" width=\"~{lnki_width}\" height=\"~{lnki_height}\" alt=\"~{lnki_alt}\" />"
, " <img id=\"xoimg_~{elem_id}\" src=\"~{lnki_src}\" width=\"~{lnki_width}\" height=\"~{lnki_height}\" alt=\"~{lnki_alt}\" />"
, " </a>"
, " </div>"
, " <div>"

View File

@@ -20,7 +20,7 @@ import gplx.core.primitives.*;
import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.xfers.*; import gplx.xowa.files.origs.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.lnkis.*;
public class Xoh_ns_file_page_mgr extends gplx.core.brys.Bfr_arg_base {
public class Xoh_ns_file_page_mgr implements gplx.core.brys.Bfr_arg {
private Xoa_ttl ttl; private Xoh_file_page_wtr html_wtr; private final Xoh_file_page__other_resolutions alt_wtr = new Xoh_file_page__other_resolutions();
private final Bry_bfr tmp_bfr = Bry_bfr.new_();
private Xow_repo_mgr repo_mgr;
@@ -45,7 +45,7 @@ public class Xoh_ns_file_page_mgr extends gplx.core.brys.Bfr_arg_base {
this.file_size_bry = Bry_.new_a7(gplx.core.ios.Io_size_.To_str(file_size));
}
String commons_notice = page.Commons_mgr().Xowa_mockup()
? String_.Format(Str_commons_notice, gplx.langs.htmls.Html_utl.Escape_for_atr_val_as_bry(tmp_bfr, Byte_ascii.Apos, page.Ttl().Full_db_as_str()))
? String_.Format(Str_commons_notice, gplx.langs.htmls.Gfh_utl.Escape_for_atr_val_as_bry(tmp_bfr, Byte_ascii.Apos, page.Ttl().Full_db_as_str()))
: "";
html_wtr.Html_main().Bld_bfr_many(bfr, this, commons_notice);
}
@@ -56,7 +56,7 @@ public class Xoh_ns_file_page_mgr extends gplx.core.brys.Bfr_arg_base {
this.xfer_itm = xfer_itm; this.file_size_bry = file_size_bry;
html_wtr.Html_main().Bld_bfr_many(bfr, this, "");
}
@Override public void Bfr_arg__add(Bry_bfr bfr) {
public void Bfr_arg__add(Bry_bfr bfr) {
alt_wtr.Init_by_fmtr(repo_mgr, xfer_itm, html_wtr);
Xof_ext orig_ext = xfer_itm.Orig_ext();
byte[] alt_bry = gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url.Encode(ttl.Full_txt());

View File

@@ -26,7 +26,7 @@ public class Xoh_ns_file_page_mgr_tst {
( Xoh_ns_file_page_mgr_fxt.Hdr
, "<div class=\"fullImageLink\" id=\"file\">"
, " <a href=\"file:///mem/file/orig.png\" xowa_title=\"Test.png\">"
, " <img id=\"xowa_file_img_0\" alt=\"Test.png\" src=\"file:///mem/file/cur.png\" width=\"300\" height=\"200\" />"
, " <img id=\"xoimg_0\" alt=\"Test.png\" src=\"file:///mem/file/cur.png\" width=\"300\" height=\"200\" />"
, " </a>"
, " <div class=\"mw-filepage-resolutioninfo\">Size of this preview: "
, " <a href=\"file:///mem/file/cur.png\" class=\"mw-thumbnail-link\" xowa_title=\"Test.png\">"
@@ -72,7 +72,7 @@ public class Xoh_ns_file_page_mgr_tst {
, "<div class=\"fullImageLink\" id=\"file\">"
, " <div>"
, " <a href=\"file:///mem/file/thumb.png\" class=\"image\" title=\"Test.ogv\">"
, " <img id=\"xowa_file_img_0\" src=\"file:///mem/file/thumb.png\" width=\"300\" height=\"200\" alt=\"\" />"
, " <img id=\"xoimg_0\" src=\"file:///mem/file/thumb.png\" width=\"300\" height=\"200\" alt=\"\" />"
, " </a>"
, " </div>"
, " <div>"