Files @ 19d93bd709bf
Branch filter:

Location: kallithea/kallithea/templates/base/flash_msg.html

mads
html: put 'use strict' on separate lines

use.py:
import re
import sys
for fn in sys.argv[1:]:
with open(fn) as f:
s = f.read()
s = re.sub(r'''(<script>)('use strict';)\n( *)''', r'''\1\n\3\2\n\3''', s)
with open(fn, 'w') as f:
f.write(s)

python use.py $(hg loc 'kallithea/templates/**.html')
<div class="flash_msg">
    <% messages = h.pop_flash_messages() %>
    % if messages:
        <% alert_categories = {'warning': 'alert-warning', 'notice': 'alert-info', 'error': 'alert-danger', 'success': 'alert-success'} %>
        % for message in messages:
            <div class="alert alert-dismissable ${alert_categories[message.category]}" role="alert">
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true"><i class="icon-cancel-circled"></i></button>
              ${message.message|n}
            </div>
        % endfor
    % endif
    <script>
    'use strict';
    if (typeof jQuery != 'undefined') {
        $(".alert").alert();
    }
    </script>
</div>