Exemplo n.º 1
0
 public void Xtn_parse(
     Xowe_wiki wiki, Xop_ctx ctx, Xop_root_tkn root, byte[] src, Xop_xnde_tkn xnde) {
   Xox_xnde_.Xatr__set(wiki, this, xatrs_hash, src, xnde);
   this.html =
       Xop_parser_.Parse_text_to_html(
           wiki,
           ctx,
           ctx.Page(),
           ctx.Page().Ttl(),
           Bry_.Mid(src, xnde.Tag_open_end(), xnde.Tag_close_bgn()),
           false);
   Indicator_html_bldr html_bldr = ctx.Page().Html_data().Indicators();
   if (this.name != null)
     html_bldr.Add(this); // NOTE: must do null-check b/c Add will use Name as key for hashtable
 }
Exemplo n.º 2
0
 @Override
 public void Func_evaluate(Bry_bfr bfr, Xop_ctx ctx, Xot_invk caller, Xot_invk self, byte[] src) {
   byte[] user_name = Eval_argx(ctx, src, caller, self);
   byte[] when_m = Bry_.Empty, when_f = Bry_.Empty, when_u = Bry_.Empty;
   int self_args_len = self.Args_len();
   if (self_args_len == 0) return; // per MW: EX: {{gender:name}} -> ""
   else {
     if (self_args_len > 0) {
       when_m =
           when_u =
               Pf_func_.Eval_arg_or_empty(
                   ctx, src, caller, self, self_args_len, 0); // default when_u to when_m
       if (self_args_len > 1) {
         when_f = Pf_func_.Eval_arg_or_empty(ctx, src, caller, self, self_args_len, 1);
         if (self_args_len > 2) {
           when_u = Pf_func_.Eval_arg_or_empty(ctx, src, caller, self, self_args_len, 2);
         }
       }
     }
   }
   if (self_args_len == 1) {
     bfr.Add(when_m);
     return;
   } // per MW: EX: {{gender:name|a}} -> "a"
   int gender = Get_gender(ctx.App().User(), user_name);
   Xol_lang_itm lang = ctx.Page().Lang();
   bfr.Add(lang.Gender().Gender_eval(gender, when_m, when_f, when_u));
 }
Exemplo n.º 3
0
 public void Xtn_parse(
     Xowe_wiki wiki, Xop_ctx ctx, Xop_root_tkn root, byte[] src, Xop_xnde_tkn xnde) {
   itm.Parse(wiki, ctx, ctx.Page().Ttl().Full_txt_w_ttl_case(), src, xnde);
   Dpl_page_finder.Find_pages(pages, wiki, itm);
   if (itm.Sort_ascending() != Bool_.__byte) pages.Sort_by(new Dpl_page_sorter(itm));
 }