砂場/tooltip

Last-modified: 2023-06-09 (金) 20:29:55

Fixed

&tooltip("昔むかし&color(#00b8ee){あるところに};");

昔むかしあるところに

Outdated

  • https://wikiwiki.jp/sample/ツールチップによると書式は以下の通りです。
    &tooltip(<term>){<definition>};
    • このうち<definition>は他のプラグインが子要素として有効になります。
      &tooltip(昔むかしあるところに){&color(#d600ff){おじいさん};と&color(#00dd9d){おばあさん};が&br;[[住んで]]おりました&ref(画像/香涎チーズ.webp,12x0);};
      昔むかしあるところに
    • しかし<term>に他のプラグインを記述すると表示が崩れます。
      &tooltip(昔むかし&color(#00b8ee){あるところに};);
      昔むかし&color(#00b8ee);
  • https://wikiwiki.jp/shinycolors/編集の手引きにあるように
    • shadowheader, fold, region プラグインは引数で子要素が有効です
      #shadowheader(3,"&ref(画像/黒パンソーダかき氷.webp,12x0);イルミネーションスターズ")
      #fold("&attachref([[野菜たっぷりスープ.webp,nolink,32x32);"){{
      }}

      黒パンソーダかき氷.webpイルミネーションスターズ

      野菜たっぷりスープ.webp
  • tooltipプラグインでも<term>引数において
    • ブランケットネームのリンクが有効になるだけではなく
      &tooltip([[白露]]);
      白露
    • 他のいずれのインラインプラグインが子要素として有効になるような挙動になってほしいです
      &tooltip(昔むかし&color(#00b8ee){あるところに};);
      昔むかし&color(#00b8ee);
  • おそらく具体的には、ここら辺でconvert_html()すればうまくいきそうな気もしますが、実環境では確認していません
    function plugin_tooltip_inline() {
    $term      = array_shift($args);
    ・・・
    if ( is_page($page) ) {
    ・・・
    }
    else {
    [+] $term = convert_html($term);
    return <<<EOD
    <span class="tooltip" title="$s_glossary" onmouseover="javascript:this.style.backgroundColor='#ffe4e1';" onmouseout="javascript:this.style.backgroundColor='transparent';">$term</span>
    EOD;
    }
    ・・・