mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Xomw: Add title=enlarge
This commit is contained in:
parent
7894c6d6f4
commit
7924a85b33
File diff suppressed because it is too large
Load Diff
@ -418,7 +418,7 @@ public class XomwLinker {
|
||||
frameParams.align = parser.Env().Lang__align_end;
|
||||
}
|
||||
bfr.Add(prefix);
|
||||
makeThumbLink2(bfr, pctx, title, file, frameParams, handlerParams, time, query);
|
||||
makeThumbLink2(bfr, env, pctx, title, file, frameParams, handlerParams, time, query);
|
||||
bfr.Add(postfix);
|
||||
return;
|
||||
}
|
||||
@ -538,7 +538,7 @@ public class XomwLinker {
|
||||
* @return String
|
||||
*/
|
||||
// XO.MW:SYNC:1.29; DATE:2017-02-08
|
||||
private void makeThumbLink2(Bry_bfr bfr, Xomw_parser_ctx pctx, XomwTitle title, XomwFile file, Xomw_params_frame frameParams, Xomw_params_handler handlerParams, Object time, byte[] query) {
|
||||
private void makeThumbLink2(Bry_bfr bfr, Xomw_parser_env env, Xomw_parser_ctx pctx, XomwTitle title, XomwFile file, Xomw_params_frame frameParams, Xomw_params_handler handlerParams, Object time, byte[] query) {
|
||||
boolean exists = file != null && file.exists();
|
||||
|
||||
int page = handlerParams.page;
|
||||
@ -654,9 +654,8 @@ public class XomwLinker {
|
||||
, tmp_attribs.Clear()
|
||||
.Add(Gfh_atr_.Bry__href , url)
|
||||
.Add(Gfh_atr_.Bry__class, Class__internal)
|
||||
// .Add(Gfh_atr_.Bry__title, wfMessage('thumbnail-more')->text())
|
||||
.Add(Gfh_atr_.Bry__title, XomwGlobalFunctions.wfMessage(env, "thumbnail-more").text())
|
||||
, Bry_.Empty);
|
||||
// env.Message_mgr().Get_by_str("thumbnail-more").text();
|
||||
byte[] zoom_anch = tmp.To_bry_and_clear();
|
||||
html_utl.Raw_element(tmp, Gfh_tag_.Bry__div, tmp_attribs.Clear().Add(Gfh_atr_.Bry__class, Class__magnify), zoom_anch);
|
||||
zoom_icon = tmp.To_bry_and_clear();
|
||||
|
@ -17,6 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
|
||||
public class XomwMessage {
|
||||
public byte[] text() {return null;}
|
||||
public byte[] escaped() {return null;}
|
||||
public XomwMessage(byte[] textBry) {
|
||||
this.textBry = textBry;
|
||||
}
|
||||
public byte[] text() {return textBry;} private byte[] textBry;
|
||||
public byte[] escaped() {throw Err_.new_unimplemented();}
|
||||
}
|
||||
|
@ -18,5 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
|
||||
public class XomwMessageMgr {
|
||||
private final Hash_adp hash = Hash_adp_.New();
|
||||
public void Add(String key, String val) {
|
||||
hash.Add(key, new XomwMessage(Bry_.new_u8(val)));
|
||||
}
|
||||
public XomwMessage Get_by_str(String key) {return (XomwMessage)hash.Get_by(key);}
|
||||
}
|
||||
|
@ -29,8 +29,7 @@ public class Xomw_lnki_wkr__file__tst {
|
||||
fxt.Test__to_html("[[File:A.png]]", "<a href='/wiki/File:A.png' class='image'><img alt='A.png' src='/orig/7/70/A.png' width='300' height='200' /></a>");
|
||||
}
|
||||
@Test public void Thumb() {
|
||||
// TODO.XO:message=enlarge
|
||||
fxt.Test__to_html("[[File:A.png|thumb]]", "<div class='thumb tright'><div class='thumbinner' style='width:222px;'><a href='/wiki/File:A.png' class='image'><img alt='A.png' src='/thumb/7/70/A.png/220px-A.png' width='220' height='146' class='thumbimage' /></a> <div class='thumbcaption'><div class='magnify'><a href='/wiki/File:A.png' class='internal'></a></div></div></div></div>");
|
||||
fxt.Test__to_html("[[File:A.png|thumb]]", "<div class='thumb tright'><div class='thumbinner' style='width:222px;'><a href='/wiki/File:A.png' class='image'><img alt='A.png' src='/thumb/7/70/A.png/220px-A.png' width='220' height='146' class='thumbimage' /></a> <div class='thumbcaption'><div class='magnify'><a href='/wiki/File:A.png' class='internal' title='enlarge'></a></div></div></div></div>");
|
||||
}
|
||||
@Test public void Size() {
|
||||
fxt.Test__to_html("[[File:A.png|123x456px]]", "<a href='/wiki/File:A.png' class='image'><img alt='A.png' src='/thumb/7/70/A.png/123px-A.png' width='123' height='82' /></a>");
|
||||
@ -83,6 +82,7 @@ class Xomw_lnki_wkr__fxt {
|
||||
parser.Env().File_finder_(file_finder);
|
||||
parser.Env().Magic_word_mgr().Add(Bry_.new_u8("img_thumbnail"), Bool_.Y, Bry_.Ary("thumb"));
|
||||
parser.Env().Magic_word_mgr().Add(Bry_.new_u8("img_width"), Bool_.Y, Bry_.Ary("$1px"));
|
||||
parser.Env().Message_mgr().Add("thumbnail-more", "enlarge");
|
||||
parser.Init_by_wiki(wiki);
|
||||
|
||||
// ctx
|
||||
|
Loading…
Reference in New Issue
Block a user