给write-post加了个标签列表
1.1的效果是这样
现在升级到1.2
效果变成这样了
源代码是这样的
代码: 全选
<section class="typecho-post-option">
<label for="token-input-tags" class="typecho-label"><?php _e('标签'); ?></label>
<p>
<input id="tags" name="tags" type="text" value="<?php $post->tags(',', false); ?>" class="w-100 text" />
<style>.tagshelper a{cursor: pointer; padding: 0px 6px; margin: 2px 0;display: inline-block;border-radius: 2px;text-decoration: none;}.tagshelper a:hover{background: #ccc;color: #fff;}
</style>
<script> $(document).ready(function(){
$('#tags').after('<div style="margin-top: 35px;" class="tagshelper">标签选择:<ul style="list-style: none;border: 1px solid #D9D9D6;padding: 6px 12px; max-height: 240px;overflow: auto;background-color: #FFF;border-radius: 2px;"><?php
$stack = Typecho_Widget::widget('Widget_Metas_Tag_Cloud')->stack;
$i = 0;
while (isset($stack[$i])) {
echo "<a id=\"$i\" onclick=\"$(\'#tags\').tokenInput(\'add\', {id: \'".$stack[$i]['name']."\', tags: \'".$stack[$i]['name']."\'});\">",$stack[$i]['name'], "</a>";
$i++;
if (isset($stack[$i])) echo " ";}
?></ul></div>');
});
</script>
</p>
</section>
感激不尽