diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index 0e062fbd..1a53b11b 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -320,6 +320,28 @@ ul.tagit input { height: auto !important; margin: -4px 0 !important; } +.related-tags { + padding: 0.5em; + background: rgba(255,255,255,0.7); + border-radius: 3px; + margin: 0.4em 0 0.2em 0; + font-size: 95%; +} +.related-tags ul { + list-style-type: none; + margin: 0; + padding: 0; + display: block; + overflow: hidden; +} +.related-tags p { + float: left; + margin: 0 1em 0 0; +} +.related-tags li { + display: inline-block; + margin: 0 1em 0 0; +} @@ -427,7 +449,6 @@ blockquote>*:last-child { } .ui-state-default, -.ui-widget-content .ui-state-default, -.ui-widget-header .ui-state-default { +.ui-state-default a { color: hsla(0,70%,45%,0.8) !important; } diff --git a/public_html/media/js/core.js b/public_html/media/js/core.js index b389dc88..ca0d5c90 100644 --- a/public_html/media/js/core.js +++ b/public_html/media/js/core.js @@ -268,11 +268,52 @@ $(function() }); }); -function attachTagIt(element) +function attachTagIt(target) { var tagItOptions = { caseSensitive: false, + onTagClicked: function(e, ui) + { + var targetTagit = ui.tag.parents('.tagit'); + options = { tag: ui.tagLabel }; + if (targetTagit.siblings('.related-tags:eq(0)').data('for') == options.tag) + { + targetTagit.siblings('.related-tags').slideUp(function() + { + $(this).remove(); + }); + return; + } + + $.getJSON('/tags-related?json', options, function(data) + { + var list = $('