• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision1a7474701c441774106ed5788bed3fd96a203465 (tree)
Time2020-02-09 09:21:33
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2499 Set Heading anchor text "user-select:none;"

Change Summary

Incremental Difference

--- a/lib/convert_html.php
+++ b/lib/convert_html.php
@@ -993,7 +993,7 @@ class Body extends Element
993993 $id = & $autoid;
994994 $anchor = '';
995995 } else {
996- $anchor = ' &aname(' . $id . ',super,full){' . $_symbol_anchor . '};';
996+ $anchor = ' &aname(' . $id . ',super,full,nouserselect){' . $_symbol_anchor . '};';
997997 }
998998
999999 $text = ' ' . $text;
--- a/plugin/aname.inc.php
+++ b/plugin/aname.inc.php
@@ -1,8 +1,8 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone
3-// $Id: aname.inc.php,v 1.28 2011/01/25 15:01:01 henoheno Exp $
4-// Copyright (C)
5-// 2002-2005 PukiWiki Developers Team
3+// aname.inc.php
4+// Copyright
5+// 2002-2020 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -33,7 +33,7 @@ function plugin_aname_usage($convert = TRUE, $message = '')
3333 }
3434 } else {
3535 if ($message == '') {
36- return '&amp;aname(anchorID[,super][,full][,noid]){[Link title]};';
36+ return '&amp;aname(anchorID[,super][,full][,noid][,nouserselect]){[Link title]};';
3737 } else {
3838 return '&amp;aname: ' . $message . ';';
3939 }
@@ -80,6 +80,7 @@ function plugin_aname_tag($args = array(), $convert = TRUE)
8080 $f_noid = in_array('noid', $args); // Option: Without id attribute
8181 $f_super = in_array('super', $args); // Option: CSS class
8282 $f_full = in_array('full', $args); // Option: With full(absolute) URI
83+ $f_nouserselect = in_array('nouserselect', $args); // Option: user-select:none;
8384
8485 if ($body == '') {
8586 if ($f_noid) return plugin_aname_usage($convert, 'Meaningless(No link-title with \'noid\')');
@@ -103,14 +104,17 @@ function plugin_aname_tag($args = array(), $convert = TRUE)
103104 $class = $f_super ? 'anchor_super' : 'anchor';
104105 $attr_id = $f_noid ? '' : ' id="' . $id . '"';
105106 $url = $f_full ? get_page_uri($vars['page']) : '';
107+ $astyle = '';
106108 if ($body != '') {
107109 $href = ' href="' . $url . '#' . $id . '"';
108110 $title = ' title="' . $id . '"';
111+ if ($f_nouserselect) {
112+ $astyle = ' style="user-select:none;"';
113+ }
109114 } else {
110115 $href = $title = '';
111116 }
112-
113- return '<a class="' . $class . '"' . $attr_id . $href . $title . '>' .
117+ return '<a class="' . $class . '"' . $attr_id . $href . $title .
118+ $astyle . '>' .
114119 $body . '</a>';
115120 }
116-