hqDefine("hqwebapp/js/captcha", function () {
    $(function () {
        // http://stackoverflow.com/a/20371801
        $('img.captcha').after(
            $('<span> <button class="captcha-refresh">' +
              '<i class="fa fa-refresh icon icon-refresh"></i></button></span>')
        );
        $('.captcha-refresh').click(function () {
            var $form = $(this).parent().closest('form');
            $.getJSON("/captcha/refresh/", {}, function (json) {
                $form.find('input[name$="captcha_0"]').val(json.key);
                $form.find('img.captcha').attr('src', json.image_url);
            });
            return false;
        });
    });
});

@@ -25,16 +25,34 @@
 ptcha%22, 
+%5B%0A    'jquery',%0A%5D,
 function
@@ -45,32 +45,39 @@
 y',%0A%5D,function (
+%0A    $%0A
 ) %7B%0A    $(functi

update captcha.js to make sure it is requirejs compliant