{% extends "base.jinja2" %} {% block page_title %}{{ title }}{% endblock %} {% block jumbotron %}

{{page_headline}}

Design your label and print it...

{% endblock %} {% block content %}
Some more settings will show here, once implemented.

Status

- undefined -
{% endblock %} {% block javascript %} var text = $('#labelText'); function formData() { //var text = $('#labelText').val().replace(/\n/g, "%0A"); var text = $('#labelText').val(); if (text == '') text = ' '; return { text: text, font_family: $('#fontFamily option:selected').text(), font_size: $('#fontSize').val(), label_size: $('#labelSize option:selected').val(), align: $('input[name=fontAlign]:checked').val() } } function preview() { $.ajax({ type: 'POST', url: '/api/preview/text?return_format=base64', contentType: 'application/x-www-form-urlencoded; charset=UTF-8', data: formData(), success: function( data ) { $('#previewImg').attr('src', 'data:image/png;base64,' + data); } }); } function setStatus(data) { if (data['success']) $('#statusPanel').html(''); else $('#statusPanel').html(''); $('#printButton').prop('disabled', false); } function print() { $('#printButton').prop('disabled', true); $('#statusPanel').html(''); $.ajax({ type: 'POST', dataType: 'json', data: formData(), url: '/api/print/text', success: setStatus, error: setStatus }); } preview() {% endblock %}