{#{% if user.is_authenticated %}#}
    <script type="text/javascript" src="{{ STATIC_URL }}markitup/jquery.markitup.js"></script>
    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}markitup/skins/simple/style.css">
    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}markitup/sets/{{ PYBB_MARKUP }}/style.css">
    <script type="text/javascript" src="{{ STATIC_URL }}markitup/sets/{{ PYBB_MARKUP }}/set.js"></script>

    <script type="text/javascript">
    $(function() {
        mySettings['previewParserPath'] = '{% url pybb:post_ajax_preview %}';
        mySettings['previewPosition'] = 'before';
        mySettings['resizeHandle'] = true;
        mySettings['markupSet'] = [
            {name:'Bold', key:'B', openWith:'[b]', closeWith:'[/b]'},
            {name:'Italic', key:'I', openWith:'[i]', closeWith:'[/i]'},
            {name:'Underline', key:'U', openWith:'[u]', closeWith:'[/u]'},
            {separator:'---------------' },
            {name:'Picture', key:'P', replaceWith:'[img][![Url]!][/img]'},
            {name:'Link', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'},
            {separator:'---------------' },
            {name:'Bulleted list', openWith:'[list]\n', closeWith:'\n[/list]'},
            {name:'Numeric list', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'},
            {name:'List item', openWith:'[*] '},
            {separator:'---------------' },
            {name:'Quotes', openWith:'[quote]', closeWith:'[/quote]'},
            {name:'Code', openWith:'[code]', closeWith:'[/code]'},
            {separator:'---------------' },
            {name:'Clean', className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } },
            {name:'Preview', className:"preview", call:'preview' }
	    ];
        $('textarea').markItUp(mySettings);

        $('#emoticons a').click(function() {
            var emoticon = $(this).attr("title");
            $.markItUp({replaceWith: emoticon});
            return false;
        });
    });
    </script>
{#{% endif %}#}