     correct_badge_position()
     make_recent_date()
     monitor_device_mode()
+    wrap_img()
 
-    $('img').each (_, img) ->
-        alt = $(img).attr('alt')
-        if alt?.trim().length
-            $(img).wrap($('<div>').addClass('figure'))
-                  .after($('<p>').html($('<em>').html(alt)))
-                  .wrap('<p>')
 
     $('.tag-sort').click (event) ->
         event.preventDefault()

    $('.list-toggle').click (event) ->
        event.preventDefault()
        list_toggle(this)

    $('#menu-toggle').click (event) ->
        event.preventDefault()

    $('ul li span.badge').each (_, badge) ->
        parent = $(badge).parent()
        $(badge).detach().prependTo(parent)

wrap_img = () ->
    $('img').each (_, img) ->
        alt = $(img).attr('alt')
        if alt?.trim().length
            $(img).wrap($('<div>').addClass('figure'))
                  .after($('<p>').html($('<em>').html(alt)))
                  .wrap('<p>')

list_toggle = (it) ->
    parent = $(it).parent()
