Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
109 lines (104 sloc) 2.44 KB
<!--
Path pattern: .*
Insertion position: Head of all pages(全てのページのヘッダ)
Type: HTML
テキストエリアで入力補完
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/at.js/1.5.2/js/jquery.atwho.min.js" defer async></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Caret.js/0.3.1/jquery.caret.min.js" defer async></script>
<style>
.atwho-view {
position:absolute;
top: 0;
left: 0;
display: none;
margin-top: 18px;
background: white;
color: black;
border: 1px solid #DDD;
border-radius: 3px;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
min-width: 120px;
z-index: 11110 !important;
}
.atwho-view .atwho-header {
padding: 5px;
margin: 5px;
cursor: pointer;
border-bottom: solid 1px #eaeff1;
color: #6f8092;
font-size: 11px;
font-weight: bold;
}
.atwho-view .atwho-header .small {
color: #6f8092;
float: right;
padding-top: 2px;
margin-right: -5px;
font-size: 12px;
font-weight: normal;
}
.atwho-view .atwho-header:hover {
cursor: default;
}
.atwho-view .cur {
background: #3366FF;
color: white;
}
.atwho-view .cur small {
color: white;
}
.atwho-view strong {
color: #3366FF;
}
.atwho-view .cur strong {
color: white;
font:bold;
}
.atwho-view ul {
/* width: 100px; */
list-style:none;
padding:0;
margin:auto;
max-height: 200px;
overflow-y: auto;
}
.atwho-view ul li {
display: block;
padding: 5px 10px;
border-bottom: 1px solid #DDD;
cursor: pointer;
/* border-top: 1px solid #C8C8C8; */
}
.atwho-view small {
font-size: smaller;
color: #777;
font-weight: normal;
}
</style>
<script>
$(function() {
$('textarea.wiki-edit').atwho({
at: '<pre',
data: [
{name: 'java', content: '<pre><code class="java">\n</code></pre>'},
{name: 'sql', content: '<pre><code class="sql">\n</code></pre>'}],
insertTpl: '${content}',
suffix: ''
}).atwho({
at: '{{',
data: [
{name: 'collapse', content: '{{collapse(詳細を表示...)\n}}'},
{name: 'thumbnail', content: '{{thumbnail(image.png)}}'}],
insertTpl: '${content}',
suffix: ''
}).atwho({
at: 'template',
data: [
{name: 'バグ', content: 'h2. 発生バージョン\n\nh2. 再現手順\n\nh2. ログ\n\n'},
{name: '問い合わせ', content: 'h2. 問い合わせ内容\n\nh2. 回答期限\n\n'}],
insertTpl: '${content}',
suffix: ''
});
});
</script>
You can’t perform that action at this time.