moved all files into "extensions" sub directory
This commit is contained in:
BIN
extensions/inkstitch/bin/print/resources/barlow-bold.ttf
Normal file
BIN
extensions/inkstitch/bin/print/resources/barlow-bold.ttf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
extensions/inkstitch/bin/print/resources/barlow-extra-bold.ttf
Normal file
BIN
extensions/inkstitch/bin/print/resources/barlow-extra-bold.ttf
Normal file
Binary file not shown.
BIN
extensions/inkstitch/bin/print/resources/barlow.ttf
Normal file
BIN
extensions/inkstitch/bin/print/resources/barlow.ttf
Normal file
Binary file not shown.
BIN
extensions/inkstitch/bin/print/resources/barlow_condensed.ttf
Normal file
BIN
extensions/inkstitch/bin/print/resources/barlow_condensed.ttf
Normal file
Binary file not shown.
BIN
extensions/inkstitch/bin/print/resources/favicon.ico
Normal file
BIN
extensions/inkstitch/bin/print/resources/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
98
extensions/inkstitch/bin/print/resources/inkstitch-logo.svg
Normal file
98
extensions/inkstitch/bin/print/resources/inkstitch-logo.svg
Normal file
@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Creator: CorelDRAW X7 -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xml:space="preserve"
|
||||
width="75.204422mm"
|
||||
height="67.78524mm"
|
||||
version="1.1"
|
||||
style="clip-rule:evenodd;fill-rule:evenodd;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision"
|
||||
viewBox="0 0 11362.647 10242"
|
||||
id="svg20"
|
||||
sodipodi:docname="inkstitch-logo.svg"
|
||||
inkscape:version="0.92.4 (unknown)"><metadata
|
||||
id="metadata24"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="973"
|
||||
id="namedview22"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="0.647537"
|
||||
inkscape:cx="145.20721"
|
||||
inkscape:cy="128.09809"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_x0020_1" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<style
|
||||
type="text/css"
|
||||
id="style2">
|
||||
<![CDATA[
|
||||
.fil0 {fill:none}
|
||||
.fil3 {fill:black}
|
||||
.fil1 {fill:#003399}
|
||||
.fil4 {fill:gray}
|
||||
.fil2 {fill:white}
|
||||
]]>
|
||||
</style>
|
||||
</defs>
|
||||
<g
|
||||
id="Layer_x0020_1"
|
||||
transform="translate(-1873.2349,-2164)">
|
||||
<metadata
|
||||
id="CorelCorpID_0Corel-Layer" />
|
||||
|
||||
<path
|
||||
class="fil1"
|
||||
d="m 9857,7480 v -51 c 0,-15 12,-27 27,-27 h 295 c 15,0 27,12 27,27 v 51 c 0,15 -12,28 -27,28 h -295 c -15,0 -27,-13 -27,-28 z m 2819,-1566 c 10,66 67,116 135,116 v 0 c 75,0 137,-61 137,-137 v -144 c 0,-37 18,-68 49,-88 32,-19 69,-20 101,-2 83,43 138,125 138,232 v 2788 c 0,147 -121,268 -268,268 h -292 v 443 c 0,1659 -1357,3016 -3016,3016 H 5450 c -1659,0 -3017,-1357 -3017,-3016 v -402 h -286 c -151,0 -274,-123 -274,-273 V 5937 c 0,-150 123,-273 274,-273 h 286 v -484 c 0,-1659 1358,-3016 3017,-3016 h 4210 c 1659,0 3016,1357 3016,3016 z M 2220,7600 h 107 c 43,0 81,21 106,52 v 170 c -25,32 -63,52 -106,52 h -107 c -75,0 -136,-62 -136,-137 v 0 c 0,-75 61,-137 136,-137 z m 54,710 c 75,0 136,61 136,136 0,76 -61,137 -136,137 -76,0 -137,-61 -137,-137 0,-75 61,-136 137,-136 z m 10515,-710 h 107 c 75,0 137,62 137,137 v 0 c 0,75 -62,137 -137,137 h -107 c -47,0 -88,-24 -113,-61 v -152 c 25,-36 66,-61 113,-61 z m 54,711 c 75,0 135,60 135,135 0,75 -60,136 -135,136 -75,0 -136,-61 -136,-136 0,-75 61,-135 136,-135 z m -1957,-838 c -676,154 -776,166 -1566,74 l -1848,18 c -374,4 -659,116 -1029,116 H 4373 l -138,-75 v -302 l 138,-75 h 2070 c 370,0 655,111 1029,115 l 1848,19 c 790,-92 890,-80 1566,73 9,2 15,10 15,19 0,9 -6,16 -15,18 z M 4562,6641 V 4478 h 516 v 2163 z m 1562,0 V 4407 h 50 L 7521,5670 V 4478 h 477 v 2246 h -45 L 6601,5461 v 1180 z m 2865,0 V 4478 h 510 v 941 l 715,-941 h 614 l -816,1029 881,1134 h -624 l -770,-996 v 996 z M 4180,9422 c 86,52 160,89 220,111 60,21 119,31 177,31 57,0 104,-13 139,-38 35,-26 53,-58 53,-98 0,-57 -63,-122 -188,-193 -20,-12 -36,-21 -46,-27 l -95,-54 c -92,-52 -161,-111 -205,-177 -45,-66 -67,-140 -67,-223 0,-113 43,-206 128,-278 85,-72 195,-108 330,-108 50,0 103,5 161,17 58,12 123,30 194,54 v 329 c -68,-43 -132,-75 -193,-98 -61,-23 -112,-35 -155,-35 -47,0 -84,10 -111,30 -27,21 -41,48 -41,83 0,24 8,47 25,68 16,22 40,41 72,58 l 165,91 c 137,76 230,147 277,211 48,65 72,141 72,230 0,136 -47,247 -140,331 -93,84 -217,126 -371,126 -52,0 -109,-5 -171,-16 -61,-11 -128,-28 -202,-51 z m 1440,396 V 8708 h -445 v -293 h 1224 v 293 h -444 v 1110 z m 986,0 V 8415 h 335 v 1403 z m 989,0 V 8708 h -446 v -293 h 1225 v 293 h -444 v 1110 z m 1983,-959 c -60,-63 -122,-109 -184,-139 -62,-30 -128,-45 -196,-45 -119,0 -216,41 -291,122 -76,82 -113,188 -113,316 0,128 37,232 112,312 75,79 172,119 292,119 71,0 142,-14 213,-44 70,-30 141,-74 211,-134 l -22,373 c -60,40 -125,71 -196,92 -72,22 -146,32 -223,32 -82,0 -161,-12 -237,-38 -76,-26 -146,-64 -209,-115 -91,-71 -160,-157 -208,-259 -48,-102 -72,-214 -72,-335 0,-104 18,-201 53,-292 36,-91 87,-171 155,-241 68,-70 147,-123 237,-160 90,-37 184,-55 283,-55 79,0 154,10 226,33 72,21 140,55 205,99 z m 261,959 V 8415 h 331 v 515 h 541 v -515 h 329 v 1403 h -329 v -589 h -541 v 589 z M 5450,2676 c -1376,0 -2504,1128 -2504,2504 v 4210 c 0,1376 1128,2504 2504,2504 h 4210 c 1376,0 2504,-1128 2504,-2504 V 5180 c 0,-1376 -1128,-2504 -2504,-2504 z"
|
||||
id="path9"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#003399" />
|
||||
<path
|
||||
class="fil2"
|
||||
d="m 5450,2676 c -1376,0 -2504,1128 -2504,2504 v 4210 c 0,1376 1128,2504 2504,2504 h 4210 c 1376,0 2504,-1128 2504,-2504 V 5180 c 0,-1376 -1128,-2504 -2504,-2504 z"
|
||||
id="path11"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
class="fil3"
|
||||
d="M 9839,9818 V 8415 h 331 v 515 h 541 v -515 h 329 v 1403 h -329 v -589 h -541 v 589 z m -261,-959 c -60,-63 -122,-109 -184,-139 -62,-30 -128,-45 -196,-45 -119,0 -216,41 -291,122 -76,82 -113,188 -113,316 0,128 37,232 112,312 75,79 172,119 292,119 71,0 142,-14 213,-44 70,-30 141,-74 211,-134 l -22,373 c -60,40 -125,71 -196,92 -72,22 -146,32 -223,32 -82,0 -161,-12 -237,-38 -76,-26 -146,-64 -209,-115 -91,-71 -160,-157 -208,-259 -48,-102 -72,-214 -72,-335 0,-104 18,-201 53,-292 36,-91 87,-171 155,-241 68,-70 147,-123 237,-160 90,-37 184,-55 283,-55 79,0 154,10 226,33 72,21 140,55 205,99 z M 7595,9818 V 8708 h -446 v -293 h 1225 v 293 h -444 v 1110 z m -989,0 V 8415 h 335 v 1403 z m -986,0 V 8708 h -445 v -293 h 1224 v 293 H 5955 V 9818 Z M 4180,9422 c 86,52 160,89 220,111 60,21 119,31 177,31 57,0 104,-13 139,-38 35,-26 53,-58 53,-98 0,-57 -63,-122 -188,-193 -20,-12 -36,-21 -46,-27 l -95,-54 c -92,-52 -161,-111 -205,-177 -45,-66 -67,-140 -67,-223 0,-113 43,-206 128,-278 85,-72 195,-108 330,-108 50,0 103,5 161,17 58,12 123,30 194,54 v 329 c -68,-43 -132,-75 -193,-98 -61,-23 -112,-35 -155,-35 -47,0 -84,10 -111,30 -27,21 -41,48 -41,83 0,24 8,47 25,68 16,22 40,41 72,58 l 165,91 c 137,76 230,147 277,211 48,65 72,141 72,230 0,136 -47,247 -140,331 -93,84 -217,126 -371,126 -52,0 -109,-5 -171,-16 -61,-11 -128,-28 -202,-51 z"
|
||||
id="path13"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<path
|
||||
class="fil3"
|
||||
d="M 8989,6641 V 4478 h 510 v 941 l 715,-941 h 614 l -816,1029 881,1134 h -624 l -770,-996 v 996 z m -2865,0 V 4407 h 50 L 7521,5670 V 4478 h 477 v 2246 h -45 L 6601,5461 v 1180 z m -1562,0 V 4478 h 516 v 2163 z"
|
||||
id="path15"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<path
|
||||
class="fil4"
|
||||
d="m 10886,7473 c -676,154 -776,166 -1566,74 l -1848,18 c -374,4 -659,116 -1029,116 H 4373 l -138,-75 v -302 l 138,-75 h 2070 c 370,0 655,111 1029,115 l 1848,19 c 790,-92 890,-80 1566,73 9,2 15,10 15,19 0,9 -6,16 -15,18 z m -1029,7 v -51 c 0,-15 12,-27 27,-27 h 295 c 15,0 27,12 27,27 v 51 c 0,15 -12,28 -27,28 h -295 c -15,0 -27,-13 -27,-28 z"
|
||||
id="path17"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#808080" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 7.4 KiB |
734
extensions/inkstitch/bin/print/resources/inkstitch.js
Normal file
734
extensions/inkstitch/bin/print/resources/inkstitch.js
Normal file
@ -0,0 +1,734 @@
|
||||
var electron = require('electron');
|
||||
|
||||
$.postJSON = function(url, data, success=null) {
|
||||
return $.ajax(url, {
|
||||
type: 'POST',
|
||||
data: JSON.stringify(data),
|
||||
contentType: 'application/json',
|
||||
success: success
|
||||
});
|
||||
};
|
||||
|
||||
var realistic_rendering = {};
|
||||
var realistic_cache = {};
|
||||
var normal_rendering = {};
|
||||
|
||||
//function to chunk opd view into pieces
|
||||
// source: https://stackoverflow.com/questions/3366529/wrap-every-3-divs-in-a-div
|
||||
$.fn.chunk = function(size) {
|
||||
var arr = [];
|
||||
for (var i = 0; i < this.length; i += size) {
|
||||
arr.push(this.slice(i, i + size));
|
||||
}
|
||||
return this.pushStack(arr, "chunk", size);
|
||||
}
|
||||
|
||||
// build operator detailed view (opd)
|
||||
function buildOpd(thumbnail_size = $('#operator-detailedview-thumbnail-size').val() ) {
|
||||
|
||||
var thumbnail_size = parseInt(thumbnail_size);
|
||||
var thumbnail_size_mm = thumbnail_size + 'mm';
|
||||
|
||||
var thumbnail_layout = (thumbnail_size >= 60) ? 'medium' : 'small';
|
||||
|
||||
// remove old settings
|
||||
$('div.page.operator-detailedview header').remove();
|
||||
$('div.page.operator-detailedview footer').remove();
|
||||
$('div.page.operator-detailedview .job-headline').remove();
|
||||
$('div.page.operator-detailedview .opd-color-block').parentsUntil('div.page.operator-detailedview').addBack().unwrap();
|
||||
$('.opd-color-block').removeClass('medium large');
|
||||
$('.opd-color-block').removeAttr('style');
|
||||
|
||||
// set thumbnail size
|
||||
$('.operator-svg.operator-preview').css({
|
||||
'width': thumbnail_size_mm,
|
||||
'height': thumbnail_size_mm,
|
||||
'max-width': thumbnail_size_mm
|
||||
});
|
||||
|
||||
// calculate number of blocks per page
|
||||
var num_blocks_per_page = 1;
|
||||
if(thumbnail_layout == 'medium') {
|
||||
$('.opd-color-block').addClass('medium');
|
||||
// set width to be able to calculate the height
|
||||
$('.opd-color-block').css({ 'width': thumbnail_size_mm });
|
||||
// calculate max height -> source: https://stackoverflow.com/questions/6060992/element-with-the-max-height-from-a-set-of-elements
|
||||
var color_box_height = Math.max.apply(null, $('.opd-color-block').map(function () { return $(this).height(); }).get());
|
||||
var container_height = $('#opd-info').height();
|
||||
var num_rows = Math.floor(container_height / color_box_height);
|
||||
var num_columns = Math.floor(175 / thumbnail_size);
|
||||
// if only two blocks fit into one row, use 50% of the space for each of them
|
||||
if(num_columns == 2) { $('.opd-color-block').css({ 'width': 'calc(50% - 2mm)' }); }
|
||||
// set equal height for all color blocks
|
||||
$('.opd-color-block').css({ 'height': color_box_height });
|
||||
// set number of color blocks per page for medium thumbnails
|
||||
num_blocks_per_page = num_columns * num_rows;
|
||||
// use layout for large thumbnails if only 2 or less color blocks fit on one page
|
||||
if(num_blocks_per_page <= 2) {
|
||||
$('.opd-color-block').removeClass('medium').removeAttr('style').addClass('large');
|
||||
thumbnail_layout = 'large';
|
||||
// set number of color blocks per page for large thumbnails
|
||||
num_blocks_per_page = 2;
|
||||
}
|
||||
} else {
|
||||
// set number of color blocks per page for small thumbnails
|
||||
num_blocks_per_page = Math.floor(220 / thumbnail_size);
|
||||
}
|
||||
// set number of color blocks per page to 1 if it defaults to zero
|
||||
// this should never happen, but we want to avoid the browser to crash
|
||||
num_blocks_per_page = (num_blocks_per_page <= 0) ? '1' : num_blocks_per_page;
|
||||
|
||||
// adjust to new settings
|
||||
var header = $('#opd-info header').prop('outerHTML');
|
||||
var footer = $('#opd-info footer').prop('outerHTML');
|
||||
var job_headline = $('#opd-info .job-headline').prop('outerHTML');
|
||||
var opd_visibility = ($('#operator-detailedview').is(':checked')) ? 'block' :'none';
|
||||
var paper_size = $('#printing-size').val();
|
||||
$('.opd-color-block').chunk(num_blocks_per_page).wrap('<div class="page operator-detailedview ' + paper_size + ' ' + thumbnail_layout +'" style="display:'+ opd_visibility +'"><main class="operator-detailedview"><div class="operator-job-info"></div></main></div>');
|
||||
$('div.operator-detailedview').prepend(header);
|
||||
$('.operator-job-info').prepend(job_headline);
|
||||
$('div.operator-detailedview').append(footer);
|
||||
// update page numbers
|
||||
setPageNumbers();
|
||||
}
|
||||
|
||||
// set pagenumbers
|
||||
function setPageNumbers() {
|
||||
var totalPageNum = $('body').find('.page:visible').length;
|
||||
$('span.total-page-num').text(totalPageNum);
|
||||
$('.page:visible span.page-num').each(function( index ) {
|
||||
$(this).text(index + 1);
|
||||
});
|
||||
}
|
||||
|
||||
// Calculate estimated time
|
||||
function setEstimatedTime() {
|
||||
var speed = Math.floor($('#machine-speed').val() / 60); // convert to seconds
|
||||
speed = (speed <= 0) ? 1 : speed;
|
||||
var timeTrim = ($('#time-trims').val() == '') ? 0 : parseInt($('#time-trims').val());
|
||||
var addToTotal = ($('#time-additional').val() == '') ? 0 : parseInt($('#time-additional').val());
|
||||
var timeColorChange = ($('#time-color-change').val() == '') ? 0 : parseInt($('#time-color-change').val());
|
||||
|
||||
// operator detailed view
|
||||
$('.estimated-time').each(function(index, item) {
|
||||
var selector = $(this);
|
||||
var stitchCount = parseInt($(selector).closest('p').find('.num-stitches').text().match(/\d+/));
|
||||
var numTrims = parseInt($( selector ).closest('div').find('p span.num-trims').text().match(/\d+/));
|
||||
var estimatedTime = stitchCount/speed + (timeTrim * numTrims);
|
||||
writeEstimatedTime( selector, estimatedTime );
|
||||
});
|
||||
|
||||
// client detailed view
|
||||
$('.cld-estimated-time').each(function(index, item) {
|
||||
var selector = $(this);
|
||||
var stitchCount = parseInt($(selector).closest('div.page').find('main .detailed .color-info span.num-stitches').text().match(/\d+/));
|
||||
var numTrims = parseInt($( selector ).closest('div.page').find('main .detailed .color-info span.num-trims').text().match(/\d+/));
|
||||
var estimatedTime = stitchCount/speed + (timeTrim * numTrims);
|
||||
writeEstimatedTime( selector, estimatedTime );
|
||||
});
|
||||
|
||||
var stitchCount = parseInt($('.total-num-stitches').first().text().match(/\d+/));
|
||||
var numTrims = parseInt($('.total-trims').first().text().match(/\d+/));
|
||||
var numColorBlocks = parseInt($('.num-color-blocks').first().text().match(/\d+/))-1; // the last color-block is not a color change
|
||||
var selector = '.total-estimated-time';
|
||||
var estimatedTime = stitchCount/speed + (timeTrim * numTrims) + (timeColorChange * numColorBlocks) + addToTotal;
|
||||
writeEstimatedTime( selector, estimatedTime );
|
||||
}
|
||||
|
||||
function attachLeadingZero(n) {
|
||||
return (n < 10) ? ("0" + n) : n;
|
||||
}
|
||||
|
||||
function writeEstimatedTime( selector, estimatedTime ) {
|
||||
var hours = attachLeadingZero(Math.floor(estimatedTime / 3600));
|
||||
var minutes = attachLeadingZero(Math.floor((estimatedTime - (hours*3600)) / 60));
|
||||
var seconds = attachLeadingZero(Math.floor(estimatedTime % 60));
|
||||
$(selector).text( hours + ':' + minutes + ':' + seconds );
|
||||
}
|
||||
|
||||
// Scale SVG (fit || full size)
|
||||
function scaleSVG(element, scale = 'fit') {
|
||||
|
||||
// always center svg
|
||||
transform = "translate(-50%, -50%)";
|
||||
|
||||
if(scale == 'fit') {
|
||||
var scale = Math.min(
|
||||
element.width() / element.find('svg').width(),
|
||||
element.height() / element.find('svg').height()
|
||||
);
|
||||
}
|
||||
|
||||
transform += " scale(" + scale + ")";
|
||||
var label = parseInt(scale*100);
|
||||
|
||||
element.find('svg').css({ transform: transform });
|
||||
element.find('.scale').text(label);
|
||||
}
|
||||
|
||||
// set preview svg scale to fit into its box if display block and transform is not set
|
||||
function scaleAllSvg() {
|
||||
$('.page').each(function() {
|
||||
if( $(this).css('display') == 'block' ) {
|
||||
if( $(this).find('.inksimulation svg').css('transform') == 'none') {
|
||||
scaleSVG($(this).find('.inksimulation'), 'fit');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var saveTimerHandles = {};
|
||||
|
||||
function setSVGTransform(figure, transform) {
|
||||
var field_name = $(figure).data('field-name');
|
||||
var scale = transform.match(/-?[\d\.]+/g)[0];
|
||||
figure.find('svg').css({ transform: transform });
|
||||
figure.find(".scale").text(parseInt(scale*100));
|
||||
|
||||
// avoid spamming updates
|
||||
if (saveTimerHandles[field_name] != null)
|
||||
clearTimeout(saveTimerHandles[field_name]);
|
||||
|
||||
saveTimerHandles[field_name] = setTimeout(function() {
|
||||
$.postJSON('/settings/' + field_name, {value: transform});
|
||||
}, 250);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
/* SCALING AND MOVING SVG */
|
||||
|
||||
/* Mousewheel scaling */
|
||||
$('figure.inksimulation').on( 'DOMMouseScroll mousewheel', function (e) {
|
||||
if(e.ctrlKey == true) {
|
||||
|
||||
var svg = $(this).find('svg');
|
||||
var transform = svg.css('transform').match(/-?[\d\.]+/g);
|
||||
var scale = parseFloat(transform[0]);
|
||||
|
||||
if (e.originalEvent.detail > 0 || e.originalEvent.wheelDelta < 0) {
|
||||
// scroll down = zoom out
|
||||
scale *= 0.97;
|
||||
if (scale < 0.01)
|
||||
scale = 0.01;
|
||||
} else {
|
||||
//scroll up
|
||||
scale *= 1.03;
|
||||
}
|
||||
|
||||
// set modified scale
|
||||
transform[0] = scale;
|
||||
transform[3] = scale;
|
||||
|
||||
setSVGTransform($(this), 'matrix(' + transform + ')');
|
||||
|
||||
//prevent page fom scrolling
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/* Fit SVG */
|
||||
$('button.svg-fit').click(function() {
|
||||
var svgfigure = $(this).closest('figure');
|
||||
scaleSVG(svgfigure, 'fit');
|
||||
});
|
||||
|
||||
/* Full Size SVG */
|
||||
$('button.svg-full').click(function() {
|
||||
var svgfigure = $(this).closest('figure');
|
||||
scaleSVG(svgfigure, '1');
|
||||
});
|
||||
|
||||
/* Drag SVG */
|
||||
$('figure.inksimulation').on('mousedown', function(e) {
|
||||
var p0 = { x: e.pageX, y: e.pageY };
|
||||
var start_transform = $(this).find('svg').css('transform').match(/-?[\d\.]+/g);
|
||||
var start_offset = { x: parseFloat(start_transform[4]), y: parseFloat(start_transform[5]) };
|
||||
|
||||
$(this).css({cursor: 'move'});
|
||||
$(this).on('mousemove', function(e) {
|
||||
var p1 = { x: e.pageX, y: e.pageY };
|
||||
// set modified translate
|
||||
var transform = $(this).find('svg').css('transform').match(/-?[\d\.]+/g);
|
||||
transform[4] = start_offset.x + (p1.x - p0.x);
|
||||
transform[5] = start_offset.y + (p1.y - p0.y);
|
||||
|
||||
// I'd ike to use setSVGTransform() here but this code runs many
|
||||
// times per second and it's just too CPU-intensive.
|
||||
$(this).find('svg').css({transform: 'matrix(' + transform + ')'});
|
||||
});
|
||||
}).on('mouseup', function(e) {
|
||||
$(this).css({cursor: 'auto'});
|
||||
$(this).data('p0', null);
|
||||
$(this).off('mousemove');
|
||||
|
||||
// set it using setSVGTransform() to ensure that it's saved to the server
|
||||
setSVGTransform($(this), $(this).find('svg').css('transform'));
|
||||
});
|
||||
|
||||
// ignore mouse events on the buttons (Fill, 100%, Apply to All)
|
||||
$('figure.inksimulation div').on('mousedown mouseup', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
/* Apply transforms to All */
|
||||
$('button.svg-apply').click(function() {
|
||||
var transform = $(this).parent().siblings('svg').css('transform');
|
||||
$('.inksimulation').each(function() {
|
||||
setSVGTransform($(this), transform);
|
||||
})
|
||||
});
|
||||
|
||||
/* Contendeditable Fields */
|
||||
|
||||
$('body').on('focusout', '[contenteditable="true"]:not(.info-text)', function() {
|
||||
/* change svg scale */
|
||||
var content = $(this).text();
|
||||
var field_name = $(this).attr('data-field-name');
|
||||
if(field_name == 'svg-scale') {
|
||||
var scale = parseInt(content);
|
||||
var svg = $(this).parent().siblings('svg');
|
||||
var transform = svg.css('transform').match(/-?[\d\.]+/g);
|
||||
|
||||
transform[0] = scale / 100;
|
||||
transform[3] = scale / 100;
|
||||
svg.css({ transform: 'matrix(' + transform + ')' });
|
||||
} else {
|
||||
/* When we focus out from a contenteditable field, we want to
|
||||
* set the same content to all fields with the same classname */
|
||||
$('[data-field-name="' + field_name + '"]').text(content);
|
||||
$.postJSON('/settings/' + field_name, {value: content});
|
||||
}
|
||||
});
|
||||
|
||||
// load up initial metadata values
|
||||
$.getJSON('/settings', function(settings) {
|
||||
$.each(settings, function(field_name, value) {
|
||||
$('[data-field-name="' + field_name + '"]').each(function(i, item) {
|
||||
var item = $(item);
|
||||
if (item.is(':checkbox')) {
|
||||
item.prop('checked', value).trigger('initialize');
|
||||
} else if (item.is('img')) {
|
||||
item.attr('src', value);
|
||||
} else if (item.is('select')) {
|
||||
item.val(value).trigger('initialize');
|
||||
} else if (item.is('input[type=range]')) {
|
||||
item.val(value).trigger('initialize');
|
||||
$('#display-thumbnail-size').text(value + 'mm');
|
||||
} else if (item.is('input[type=number]')) {
|
||||
item.val(value).trigger('initialize');
|
||||
} else if (item.is('figure.inksimulation')) {
|
||||
setSVGTransform(item, value);
|
||||
} else if (item.is('div.footer-info')) {
|
||||
$('#footer-info-text').html($.parseHTML(value));
|
||||
item.html($.parseHTML(value));
|
||||
} else if (item.is('#custom-page-content')) {
|
||||
$('#custom-page-content').html($.parseHTML(value));
|
||||
} else {
|
||||
item.text(value);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// wait until page size is set (if they've specified one) and then scale SVGs to fit and build operator detailed view
|
||||
setTimeout(function() {
|
||||
scaleAllSvg();
|
||||
buildOpd();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
$('body').on('keypress', '[contenteditable="true"]:not(.info-text)', function(e) {
|
||||
if (e.which == 13) {
|
||||
// pressing enter defocuses the element
|
||||
this.blur();
|
||||
// also suppress the enter keystroke to avoid adding a new line
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
$('#footer-info-text[contenteditable="true"]').keypress(function(e) {
|
||||
if (e.which == 13) {
|
||||
if($(this).find('div').length > 2) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.info-text[contenteditable="true"]').focusout(function() {
|
||||
updateEditableText($(this));
|
||||
});
|
||||
|
||||
/* Settings Bar */
|
||||
|
||||
$('button.close').click(function() {
|
||||
window.close();
|
||||
});
|
||||
|
||||
$('button.print').click(function() {
|
||||
var pageSize = $('select#printing-size').find(':selected').text();
|
||||
electron.ipcRenderer.send('open-pdf', pageSize)
|
||||
});
|
||||
|
||||
$('button.save-pdf').click(function() {
|
||||
var pageSize = $('select#printing-size').find(':selected').text();
|
||||
electron.ipcRenderer.send('save-pdf', pageSize)
|
||||
});
|
||||
|
||||
$('button.settings').click(function(){
|
||||
$('#settings-ui').show();
|
||||
});
|
||||
|
||||
$('#close-settings').click(function(){
|
||||
$('#settings-ui').hide();
|
||||
});
|
||||
|
||||
/* Settings */
|
||||
|
||||
// Settings Tabs
|
||||
$('#tabs button').click(function() {
|
||||
var active_fieldset_position = $(this).index() +1;
|
||||
$('#settings-ui #fieldsets-ui > fieldset').css({'display': 'none'});
|
||||
$('#settings-ui #fieldsets-ui > fieldset:nth-child('+active_fieldset_position+')').css({'display': 'block'});
|
||||
$('#tabs .tab.active').removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
|
||||
// Footer
|
||||
function getEditMode(element){
|
||||
return element.closest('fieldset').find('.switch-mode').prop('checked');
|
||||
}
|
||||
|
||||
$('.switch-mode').change(function() {
|
||||
var element = $(this);
|
||||
var info_text = element.closest('fieldset').find('.info-text');
|
||||
var editMode = getEditMode(element);
|
||||
if (editMode) {
|
||||
info_text.text( info_text.html() );
|
||||
element.closest('.tool-bar').find('.tb-button.edit-only').prop("disabled", true);
|
||||
} else {
|
||||
info_text.css('display', 'block');
|
||||
var sourceText = info_text.text();
|
||||
info_text.html( $.parseHTML(sourceText) );
|
||||
element.closest('.tool-bar').find('.tb-button.edit-only').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
function updateEditableText(element) {
|
||||
var editMode = getEditMode(element);
|
||||
var info_text = element.closest('fieldset').find('.info-text');
|
||||
var editableText = '';
|
||||
|
||||
if (editMode) {
|
||||
editableText = info_text.text();
|
||||
} else {
|
||||
editableText = info_text.html();
|
||||
}
|
||||
|
||||
if(info_text.is('#footer-info-text')) {
|
||||
$('div.footer-info').html($.parseHTML(editableText));
|
||||
$.postJSON('/settings/footer-info', {value: editableText});
|
||||
} else {
|
||||
$.postJSON('/settings/custom-page-content', {value: editableText});
|
||||
}
|
||||
}
|
||||
|
||||
function formatText(selection, value) {
|
||||
if(window.getSelection().toString()){
|
||||
document.execCommand(selection, false, value);
|
||||
}
|
||||
}
|
||||
|
||||
$('.tb-bold').click(function() {
|
||||
if(!getEditMode($(this))) {
|
||||
formatText('bold');
|
||||
updateEditableText($(this));
|
||||
}
|
||||
});
|
||||
|
||||
$('.tb-italic').click(function() {
|
||||
if(!getEditMode($(this))) {
|
||||
formatText('italic');
|
||||
updateEditableText($(this));
|
||||
}
|
||||
});
|
||||
|
||||
$('.tb-underline').click(function() {
|
||||
if(!getEditMode($(this))) {
|
||||
formatText('underline');
|
||||
updateEditableText($(this));
|
||||
}
|
||||
});
|
||||
|
||||
$('.tb-remove').click(function() {
|
||||
if(!getEditMode($(this))) {
|
||||
formatText('removeFormat');
|
||||
updateEditableText($(this));
|
||||
}
|
||||
});
|
||||
|
||||
$('.tb-hyperlink').click(function() {
|
||||
if(!getEditMode($(this))) {
|
||||
formatText('createlink', 'tempurl');
|
||||
updateEditableText($(this));
|
||||
$(this).closest('.tool-bar').children('.url-window').css('display', 'block');
|
||||
}
|
||||
});
|
||||
|
||||
$('.url-ok').click(function() {
|
||||
var link = $(this).closest('.tool-bar').find('.user-url').val();
|
||||
$(this).closest('fieldset').find('.info-text').find('a[href="tempurl"]').attr('href', link);
|
||||
$('.user-url').val('https://');
|
||||
$('.url-window').css('display', 'none');
|
||||
updateEditableText($(this));
|
||||
});
|
||||
|
||||
$('.url-cancel').click(function() {
|
||||
$(this).closest('fieldset').find('.info-text').find('a[href="tempurl"]').contents().unwrap();
|
||||
$('.user-url').val('https://');
|
||||
$('.url-window').css('display', 'none');
|
||||
updateEditableText($(this));
|
||||
});
|
||||
|
||||
$('.tb-mail').click(function() {
|
||||
if(!getEditMode($(this))) {
|
||||
formatText('createlink', 'tempurl');
|
||||
updateEditableText($(this));
|
||||
$(this).closest('.tool-bar').find('.mail-window').css('display', 'block');
|
||||
}
|
||||
});
|
||||
|
||||
$('.mail-ok').click(function() {
|
||||
var link = 'mailto:' + $(this).closest('.tool-bar').find('.user-mail').val();
|
||||
$(this).closest('fieldset').find('.info-text').find('a[href="tempurl"]').attr('href', link);
|
||||
$('.user-mail').val('@');
|
||||
$('.mail-window').css('display', 'none');
|
||||
updateEditableText($(this));
|
||||
});
|
||||
|
||||
$('.mail-cancel').click(function() {
|
||||
$(this).closest('fieldset').find('.info-text').find('a[href="tempurl"]').contents().unwrap();
|
||||
$('.user-mail').val('@');
|
||||
$('.mail-window').css('display', 'none');
|
||||
updateEditableText($(this));
|
||||
});
|
||||
|
||||
$('.tb-reset').click(function() {
|
||||
$(this).closest('.tool-bar').find('.reset-window').css('display', 'block');
|
||||
});
|
||||
|
||||
$('.reset-ok').click(function() {
|
||||
var htmlMode = getEditMode($(this));
|
||||
if(!htmlMode) {
|
||||
$(this).closest('fieldset').find('.info-text').html($(this).closest('.tool-bar').find('.original-info').html());
|
||||
} else {
|
||||
$(this).closest('fieldset').find('.info-text').text($(this).closest('.tool-bar').find('.original-info').html());
|
||||
}
|
||||
$('.reset-window').css('display', 'none');
|
||||
updateEditableText($(this));
|
||||
});
|
||||
|
||||
$('.reset-cancel').click(function() {
|
||||
$('.reset-window').css('display', 'none');
|
||||
});
|
||||
|
||||
$('body').on("click", ".edit-footer-link", function() {
|
||||
$("button.settings").trigger("click");
|
||||
$("#branding-tab").trigger("click");
|
||||
});
|
||||
|
||||
|
||||
// Paper Size
|
||||
$('select#printing-size').on('change initialize', function(){
|
||||
$('.page').toggleClass('a4', $(this).find(':selected').val() == 'a4');
|
||||
}).on('change', function() {
|
||||
$.postJSON('/settings/paper-size', {value: $(this).find(':selected').val()});
|
||||
});
|
||||
|
||||
// Operator detailed view: thumbnail size setting
|
||||
$(document).on('input', '#operator-detailedview-thumbnail-size', function() {
|
||||
var thumbnail_size_mm = $(this).val() + 'mm';
|
||||
$('#display-thumbnail-size').text( thumbnail_size_mm );
|
||||
});
|
||||
|
||||
// Operator detailed view: thumbnail size setting action
|
||||
$('#operator-detailedview-thumbnail-size').change(function() {
|
||||
// set thumbnail size
|
||||
var thumbnail_size = $(this).val();
|
||||
// set page break positions
|
||||
buildOpd(thumbnail_size);
|
||||
|
||||
$.postJSON('/settings/operator-detailedview-thumbnail-size', {value: thumbnail_size});
|
||||
});
|
||||
|
||||
// Thread Palette
|
||||
$('select#thread-palette').change(function(){
|
||||
$('.modal').show();
|
||||
}).on('update', function() {
|
||||
$(this).data('current-value', $(this).find(':selected').val());
|
||||
}).trigger('update');
|
||||
|
||||
$('#modal-yes').on('click', function(){
|
||||
$("select#thread-palette").trigger("update");
|
||||
$('.modal').hide();
|
||||
var body = {'name': $('select#thread-palette').find(':selected').val()};
|
||||
$.postJSON('/palette', body, function() {
|
||||
$.getJSON('/threads', function(threads) {
|
||||
console.log("threads: " + JSON.stringify(threads));
|
||||
$.each(threads, function(i, thread) {
|
||||
console.log("doing: " + JSON.stringify(thread));
|
||||
$('[data-field-name="color-' + thread.hex + '"]').text(thread.name);
|
||||
var thread_description = thread.manufacturer;
|
||||
if (thread.number) {
|
||||
thread_description += " #" + thread.number;
|
||||
}
|
||||
$('[data-field-name="thread-' + thread.hex + '"]').text(thread_description);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#modal-no').on('click', function(){
|
||||
var select = $("select#thread-palette");
|
||||
select.find('[value="' + select.data('current-value') + '"]').prop('selected', true);
|
||||
$('.modal').hide();
|
||||
});
|
||||
|
||||
// View selection checkboxes
|
||||
$(':checkbox.view').on('change initialize', function() {
|
||||
var field_name = $(this).attr('data-field-name');
|
||||
$('.' + field_name).toggle($(this).prop('checked'));
|
||||
scaleAllSvg();
|
||||
setPageNumbers();
|
||||
}).on('change', function() {
|
||||
var field_name = $(this).attr('data-field-name');
|
||||
$.postJSON('/settings/' + field_name, {value: $(this).prop('checked')});
|
||||
});
|
||||
|
||||
// Estimated Time
|
||||
$('#machine-speed, #time-additional, #time-color-change, #time-trims').on('input initialize', function() {
|
||||
setEstimatedTime();
|
||||
}).on('change', function() {
|
||||
var field_name = $(this).attr('data-field-name');
|
||||
$.postJSON('/settings/' + field_name, {value: $(this).val()});
|
||||
});
|
||||
|
||||
// Display Estimated Time checkboxes
|
||||
$(':checkbox.time-display').on('input initialize', function() {
|
||||
var field_name = $(this).attr('data-field-name');
|
||||
$('.' + field_name).toggle($(this).prop('checked'));
|
||||
}).on('change', function() {
|
||||
var field_name = $(this).attr('data-field-name');
|
||||
$.postJSON('/settings/' + field_name, {value: $(this).prop('checked')});
|
||||
});
|
||||
|
||||
// Realistic rendering checkboxes
|
||||
$(':checkbox.realistic').on('change', function(e) {
|
||||
console.log("realistic rendering checkbox");
|
||||
|
||||
var item = $(this).data('field-name');
|
||||
var figure = $(this).closest('figure');
|
||||
var svg = figure.find('svg');
|
||||
var transform = svg.css('transform');
|
||||
var checked = $(this).prop('checked');
|
||||
|
||||
console.log("" + item + " " + transform);
|
||||
|
||||
function finalize(svg_content) {
|
||||
svg[0].outerHTML = svg_content;
|
||||
// can't use the svg variable here because setting outerHTML created a new tag
|
||||
figure.find('svg').css({transform: transform});
|
||||
}
|
||||
|
||||
// do this later to allow this event handler to return now,
|
||||
// which will cause the checkbox to be checked or unchecked
|
||||
// immediately even if SVG rendering takes awhile
|
||||
setTimeout(function() {
|
||||
if (checked) {
|
||||
if (!(item in normal_rendering)) {
|
||||
normal_rendering[item] = svg[0].outerHTML;
|
||||
}
|
||||
|
||||
if (!(item in realistic_cache)) {
|
||||
// pre-render the realistic SVG to a raster image to spare the poor browser
|
||||
var image = document.createElement('img');
|
||||
image.onload = function() {
|
||||
console.log("rendering!");
|
||||
var canvas = document.createElement('canvas');
|
||||
|
||||
// maybe make DPI configurable? for now, use 600
|
||||
canvas.width = image.width / 96 * 600;
|
||||
canvas.height = image.height / 96 * 600;
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height);
|
||||
realistic_cache[item] = '<svg width=' + image.width + ' height=' + image.height + ' xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
||||
'<image x=0 y=0 width=' + image.width + ' height=' + image.height + ' xlink:href="' + canvas.toDataURL() + '" />' +
|
||||
'</svg>';
|
||||
finalize(realistic_cache[item]);
|
||||
};
|
||||
image.src = '/realistic/' + item;
|
||||
} else {
|
||||
finalize(realistic_cache[item]);
|
||||
}
|
||||
} else {
|
||||
finalize(normal_rendering[item]);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
e.stopPropagation();
|
||||
return true;
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
setEstimatedTime();
|
||||
}, 100);
|
||||
|
||||
$('button.svg-realistic').click(function(e){
|
||||
$(this).find('input').click();
|
||||
});
|
||||
|
||||
// Logo
|
||||
$(document).on("change", ".logo-picker", function(e) {
|
||||
var file = e.currentTarget.files[0];
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = function() {
|
||||
var data = reader.result;
|
||||
$('figure.brandlogo img').attr('src', data);
|
||||
$.postJSON('/settings/logo', {value: data});
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
|
||||
// "save as defaults" button
|
||||
$('button.save-settings').click(function(e) {
|
||||
var settings = {};
|
||||
settings["client-overview"] = $("[data-field-name='client-overview']").is(':checked');
|
||||
settings["client-detailedview"] = $("[data-field-name='client-detailedview']").is(':checked');
|
||||
settings["operator-overview"] = $("[data-field-name='operator-overview']").is(':checked');
|
||||
settings["operator-detailedview"] = $("[data-field-name='operator-detailedview']").is(':checked');
|
||||
settings["operator-detailedview-thumbnail-size"] = $("[data-field-name='operator-detailedview-thumbnail-size']").val();
|
||||
settings["custom-page"] = $("[data-field-name='custom-page']").is(':checked');
|
||||
settings["paper-size"] = $('select#printing-size').find(':selected').val();
|
||||
|
||||
var logo = $("figure.brandlogo img").attr('src');
|
||||
if (logo.startsWith("data:")) {
|
||||
settings["logo"] = logo;
|
||||
}
|
||||
settings["footer-info"] = $("[data-field-name='footer-info']").html();
|
||||
|
||||
settings["machine-speed"] = $("[data-field-name='machine-speed']").val();
|
||||
settings["time-additional"] = $("[data-field-name='time-additional']").val();
|
||||
settings["time-color-change"] = $("[data-field-name='time-color-change']").val();
|
||||
settings["time-trims"] = $("[data-field-name='time-trims']").val();
|
||||
|
||||
settings["time-clo"] = $("[data-field-name='time-clo']").val();
|
||||
settings["time-cld"] = $("[data-field-name='time-cld']").val();
|
||||
settings["time-opo"] = $("[data-field-name='time-opo']").val();
|
||||
settings["time-opd"] = $("[data-field-name='time-opd']").val();
|
||||
|
||||
$.postJSON('/defaults', {'value': settings});
|
||||
});
|
||||
});
|
2
extensions/inkstitch/bin/print/resources/jquery-3.3.1.min.js
vendored
Normal file
2
extensions/inkstitch/bin/print/resources/jquery-3.3.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1183
extensions/inkstitch/bin/print/resources/style.css
Normal file
1183
extensions/inkstitch/bin/print/resources/style.css
Normal file
File diff suppressed because it is too large
Load Diff
51
extensions/inkstitch/bin/print/templates/color_swatch.html
Normal file
51
extensions/inkstitch/bin/print/templates/color_swatch.html
Normal file
@ -0,0 +1,51 @@
|
||||
|
||||
{% if printview != 'detailedview' %}
|
||||
<div class="color-swatch">
|
||||
<div class="swatch-info">
|
||||
<svg width="100%" height="100%" class="color-swatch-svg" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect fill="rgb{{ color_block.color.rgb }}" stroke="rgb(192, 192, 192)" stroke-width="1px" width="100%" height="100%" />
|
||||
<text fill="rgb{{ color_block.color.font_color }}">
|
||||
<tspan dy="1.2em" x="2mm" y="2mm" class="color-name">{{ _('Color') }}: </tspan><tspan data-field-name="color-{{ color_block.color.hex_digits }}">{{ color_block.color.name }}</tspan>
|
||||
{# We don't want to see rgb if we have more than 7 colorSwatches #}
|
||||
{% if color_blocks|length < 7 %}
|
||||
<tspan dy="1.2em" x="2mm" class="color-rgb">{{ _('rgb') }}: {{ color_block.color.rgb }}</tspan>
|
||||
{% endif %}
|
||||
{# We don't want to see thread_used if we have more than 7 colorSwatches to show #}
|
||||
{% if color_blocks|length < 7 %}
|
||||
<tspan dy="1.2em" x="2mm" class="swatch-thread" data-field-name="thread-{{ color_block.color.hex_digits }}">{{ _('thread') }}: {{ color_block.color.manufacturer }} {{ "#" + color_block.color.number if color_block.color.number }}</tspan>
|
||||
{% endif %}
|
||||
{# We don't want to see num_stitch if we have more than 49 colorSwatches to show #}
|
||||
{% if color_blocks|length < 49 %}
|
||||
<tspan dy="1.2em" x="2mm" class="swatch-stitches">{{ _('# stitches') }}: {{ color_block.num_stitches }}</tspan>
|
||||
{% endif %}
|
||||
{# We don't want to see stops and trims if we have more than 13 colorSwatches to show #}
|
||||
{% if color_blocks|length < 13 %}
|
||||
<tspan dy="1.2em" x="2mm" class="swatch-trims">{{ _('# trims') }}: {{ color_block.num_trims }}</tspan>
|
||||
<tspan dy="1.2em" x="2mm" class="swatch-stops">{{ _('stop after?') }}: {{ _("yes") if color_block.stop_after else _("no") }}</tspan>
|
||||
{% endif %}
|
||||
</text>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="color-swatch">
|
||||
<div class="swatch-info">
|
||||
<svg width="100%" height="100%" class="colorSwatchSVG" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect fill="rgb{{ color_block.color.rgb }}" stroke="rgb(192, 192, 192)" width="40mm" height="100%" />
|
||||
</svg>
|
||||
<div class="color-info">
|
||||
<div>
|
||||
<p><span class="color-name">{{ _('Color') }}:</span><span data-field-name="color-{{ color_block.color.hex_digits }}" contenteditable="true" data-placeholder="{{ _('Enter thread name...') }}">{{ color_block.color.name }}</span></p>
|
||||
<p><span class="color-rgb">{{ _('rgb') }}:</span><span>{{ color_block.color.rgb }}</span></p>
|
||||
<p><span class="swatch-thread">{{ _('thread') }}:</span><span data-field-name="thread-{{ color_block.color.hex_digits }}" contenteditable="true">{{ color_block.color.manufacturer }} {{ "#" + color_block.color.number if color_block.color.number }}</span></p>
|
||||
<p><span class="swatch-stitches">{{ _('# stitches') }}:</span><span class="num-stitches">{{ color_block.num_stitches }}</span></p>
|
||||
<p><span class="swatch-trims">{{ _('# trims') }}:</span><span class="num-trims">{{ color_block.num_trims }}</span></p>
|
||||
<p><span class="swatch-stops">{{ _('stop after?') }}:</span><span>{{ _("yes") if color_block.stop_after else _("no") }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{%endif %}
|
40
extensions/inkstitch/bin/print/templates/custom-page.html
Normal file
40
extensions/inkstitch/bin/print/templates/custom-page.html
Normal file
@ -0,0 +1,40 @@
|
||||
<header>
|
||||
{% include 'headline.html' %}
|
||||
</header>
|
||||
<main>
|
||||
<fieldset id="edit-custom-page">
|
||||
<div id="custom-page-tool-bar" class="tool-bar">
|
||||
<button id="custom-page-bold" class="tb-button tb-bold ff-serif edit-only" title="Bold"><b>B</b></button>
|
||||
<button id="custom-page-italic" class="tb-button tb-italic ff-serif edit-only" title="Italic"><i>I</i></button>
|
||||
<button id="custom-page-underline" class="tb-button tb-underline ff-serif edit-only" title="Underline"><u>U</u></button>
|
||||
<button id="custom-page-remove" class="tb-button tb-remove ff-serif edit-only" title="Remove formatting">
|
||||
<u style="vertical-align: super; font-size: 60%;">A</u>
|
||||
<span style="vertical-align: sub; font-size: 80%;">A</span>
|
||||
</button>
|
||||
<button id="custom-page-hyperlink" class="tb-button tb-hyperlink edit-only" title="Hyperlink">☍</button>
|
||||
<button id="custom-page-mail" class="tb-button tb-mail edit-only" title="E-Mail">✉</button>
|
||||
<button id="custom-page-reset" class="tb-button tb-reset" title="Reset text">↺</button>
|
||||
<p id="custom-page-edit-mode" class="edit-mode">
|
||||
<input type="checkbox" id="custom-page-switch-mode" class="switch-mode" name="custom-page-switch-mode" />
|
||||
<label for="custom-page-switch-mode">{{ ('Show HTML') }}</label>
|
||||
</p>
|
||||
<div id="custom-page-url" class="tb-popup url-window">
|
||||
<p>{{ _("Enter URL") }}: <input type="text" id="custom-page-link" class="user-url" name="custom-page-link" value="https://" /></p>
|
||||
<p><button id="custom-page-url-ok" class="url-ok">{{ _("OK") }}</button> <button id="custom-page-url-cancel" class="url-cancel">{{ _("Cancel") }}</button></p>
|
||||
</div>
|
||||
<div id="custom-page-email" class="tb-popup mail-window">
|
||||
<p>{{ _("Enter E-Mail") }}: <input type="text" id="custom-page-mail" class="user-mail" name="custom-page-mail" value="@" /></p>
|
||||
<p><button id="custom-page-mail-ok" class="mail-ok">{{ _("OK") }}</button> <button id="custom-page-mail-cancel" class="mail-cancel">{{ _("Cancel") }}</button></p>
|
||||
</div>
|
||||
<div id="custom-page-info-original" class="original-info"><b>{{ _("Custom Information Sheet") }}</b></div>
|
||||
<div id="custom-page-reset" class="tb-popup reset-window">
|
||||
<p>{{ _("This will reset your custom text to the default.") }}</p>
|
||||
<p>{{ _("All changes will be lost.") }}</p>
|
||||
<p><button id="custom-page-reset-ok" class="reset-ok">{{ _("OK") }}</button> <button id="custom-page-reset-cancel" class="reset-cancel">{{ _("Cancel") }}</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="custom-page-content" class="info-text" contenteditable="true" data-field-name="custom-page-content">{{ _("Custom Information Sheet") }}</div>
|
||||
<p class="notice--warning"><b>Note</b>: If you are using Firefox, use visible URLs. Links will not be printed to PDF with this browser.</p>
|
||||
</fieldset>
|
||||
</main>
|
||||
{% include 'footer.html' %}
|
8
extensions/inkstitch/bin/print/templates/footer.html
Normal file
8
extensions/inkstitch/bin/print/templates/footer.html
Normal file
@ -0,0 +1,8 @@
|
||||
<footer>
|
||||
<p class="num_pages">{{ _('Page') }} <span class="page-num"></span>/<span class="total-page-num"></span></p>
|
||||
<div class="footer-info" data-field-name="footer-info">{{ _('Proudly generated with') }} <a href="http://inkstitch.org/" target="_blank">Ink/Stitch</a></div>
|
||||
<div class="edit-footer-link">✎</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
16
extensions/inkstitch/bin/print/templates/headline.html
Normal file
16
extensions/inkstitch/bin/print/templates/headline.html
Normal file
@ -0,0 +1,16 @@
|
||||
<figure class="brandlogo">
|
||||
<label class="logo-upload">
|
||||
<img src="{{ logo.src or "resources/inkstitch-logo.svg" }}" alt="{{ logo.title }}" title="{{ logo.title }}" data-field-name="logo">
|
||||
<input type=file class="logo-picker" />
|
||||
<span class="logo-instructions">{{ _("Click to choose another logo") }}</span>
|
||||
</label>
|
||||
</figure>
|
||||
<div class="headline">
|
||||
<div class="pageTitle">
|
||||
<h1><span class="jobtitle" contenteditable="true" data-placeholder="{{ _('Enter job title...') }}" data-field-name="title"></span></h1>
|
||||
<p class="header-field" data-label="{{ _('CLIENT') }}:" contenteditable="true" data-placeholder="{{ _('Enter client name...') }}" data-field-name="client-name"></p>
|
||||
<p class="header-field" data-label="{{ _('PURCHASE ORDER #:') }}" contenteditable="true" data-placeholder="{{ _('Enter purchase order number...') }}" data-field-name="purchase-order"></p>
|
||||
</div>
|
||||
|
||||
<div class="currentDate">{{ date|datetimeformat(_('%m/%d/%Y')) }}</div>
|
||||
</div>
|
33
extensions/inkstitch/bin/print/templates/index.html
Normal file
33
extensions/inkstitch/bin/print/templates/index.html
Normal file
@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ink/Stitch Print Preview</title>
|
||||
<!-- https://stackoverflow.com/a/37480521/4249120 -->
|
||||
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
|
||||
<script src="resources/jquery-3.3.1.min.js"></script>
|
||||
<script src="resources/inkstitch.js"></script>
|
||||
<link rel="stylesheet" href="resources/style.css" />
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
|
||||
</head>
|
||||
<body>
|
||||
{% include 'ui.html' %}
|
||||
{# client overview #}
|
||||
<div class="page client-overview" style="display: {{ 'block' if view.client_overview else 'none' }}">{% include 'print_overview.html' %}</div>
|
||||
|
||||
{# client detailedview #}
|
||||
{% set printview = 'detailedview' %}
|
||||
{% for color_block in color_blocks %}
|
||||
{% set outer_loop = loop %}
|
||||
<div class="page client-detailedview" style="display: {{ 'block' if view.client_detailedview else 'none' }}">{% include 'print_detail.html' %}</div>
|
||||
{% endfor %}
|
||||
|
||||
{# operator overview #}
|
||||
<div class="page operator-overview" style="display: {{ 'block' if view.operator_overview else 'none' }}">{% include 'operator_overview.html' %}</div>
|
||||
|
||||
{# operator detailed view #}
|
||||
{% include 'operator_detailedview.html' %}
|
||||
|
||||
{# custom pages #}
|
||||
<div class="page custom-page" style="display: {{ 'block' if view.custom_page else 'none' }}">{% include 'custom-page.html' %}</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,75 @@
|
||||
<div id="opd-info" style="display: none; height: 220mm; width: 175mm;">
|
||||
<header>
|
||||
{% include 'headline.html' %}
|
||||
</header>
|
||||
{% include 'footer.html' %}
|
||||
<div class="job-headline">
|
||||
<p class="operator-svg operator-colorswatch">{# svg color #}</p>
|
||||
<p>{# svg preview #}</p>
|
||||
<p>{{ _('Color') }}</p>
|
||||
<p>{{ _('Thread Consumption') }}</p>
|
||||
<p>{{ _('Stops and Trims') }}</p>
|
||||
<p>{{ _('Notes') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="opd-summary opd-color-block">
|
||||
<p class="operator-svg operator-colorswatch">
|
||||
<span>##</span>
|
||||
</p>
|
||||
<p class="operator-svg operator-preview">
|
||||
{{ svg_overview|replace("<li>", "")|replace("</li>", "")|safe }}
|
||||
</p>
|
||||
<p>
|
||||
<span>{{ _('Unique Colors') }}: {{ job.num_colors }}</span>
|
||||
<span class="num-color-blocks">{{ _('Color Blocks') }}: {{ job.num_color_blocks }}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>{{ _('Design box size') }}: {{ "%0.1fmm X %0.1fmm" | format(*job.dimensions) }}</span>
|
||||
<!-- <span>{{ _('Total thread used') }}: {{job.estimated_thread }}</span> -->
|
||||
<span class="total-num-stitches">{{ _('Total stitch count') }}: {{job.num_stitches }}</span>
|
||||
<span class="time-opd">{{ ('Estimated time') }}: <span class="total-estimated-time"></span></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="total-stops">{{ _('Total stops') }}: {{ job.num_stops }}</span>
|
||||
<span class="total-trims">{{ _('Total trims') }}: {{ job.num_trims }}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% for color_block in color_blocks %}
|
||||
|
||||
<div class="opd-color-block">
|
||||
<p class="operator-svg operator-colorswatch">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<rect fill="rgb{{ color_block.color.rgb }}" width="15mm" height="100%" />
|
||||
<text fill="rgb{{ color_block.color.font_color }}">
|
||||
<tspan x="2mm" y="5mm" class="color-index">#{{ loop.index }}</tspan>
|
||||
</text>
|
||||
</svg>
|
||||
</p>
|
||||
<p class="operator-svg operator-preview">
|
||||
{{ color_block.svg_preview|replace("<li>", "")|replace("</li>", "")|safe }}
|
||||
</p>
|
||||
<p>
|
||||
<span data-field-name="color-{{ color_block.color.hex_digits }}" contenteditable="true" data-placeholder="{{ _('Enter thread name...') }}">{{ color_block.color.name }}</span>
|
||||
<span>{{ color_block.color.rgb }}</span>
|
||||
<span data-field-name="thread-{{ color_block.color.hex_digits }}" contenteditable="true">{{ color_block.color.manufacturer }} {{ "#" + color_block.color.number if color_block.color.number }}</span>
|
||||
</p>
|
||||
<p>
|
||||
<!-- <span>{{ _('thread used') }}:</span> -->
|
||||
<span class="num-stitches">{{ _('# stitches') }}: {{ color_block.num_stitches }}</span>
|
||||
<span class="time-opd">{{ _('estimated time') }}: <span class="estimated-time"></span></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="num-trims">{{ _('trims') }}: {{ color_block.num_trims }}</span>
|
||||
<span>{{ _('stop after?') }}: {{ _("yes") if color_block.stop_after else _("no") }}</span>
|
||||
<input type="hidden" class="num-stops" value="{{ '1' if color_block.stop_after else '0' }}" />
|
||||
</p>
|
||||
<p>
|
||||
<span class="notes" contenteditable="true" data-field-name="operator-notes-block{{ loop.index }}" data-placeholder="{{ _('Enter operator notes...') }}"></span>
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
@ -0,0 +1,36 @@
|
||||
<header>
|
||||
{% include 'headline.html' %}
|
||||
<div class="job-details">
|
||||
<div>
|
||||
<div class="table">
|
||||
<p><span>{{ _('Unique Colors') }}:</span><span>{{ job.num_colors }}</span></p>
|
||||
<p><span>{{ _('Color Blocks') }}:</span><span>{{ job.num_color_blocks }}</span></p>
|
||||
<p><span>{{ _('Total stops') }}:</span><span>{{ job.num_stops }}</span></p>
|
||||
<p><span>{{ _('Total trims') }}:</span><span>{{ job.num_trims }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="table">
|
||||
<p><span>{{ _('Design box size') }}:</span><span>{{ "%0.1fmm X %0.1fmm" | format(*job.dimensions) }}</span></p>
|
||||
<p><span>{{ _('Total stitch count') }}:</span><span>{{job.num_stitches }}</span></p>
|
||||
<p><span>{{ _('Total thread used') }}:</span><span>{{job.total_thread_used }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="table time-opo">
|
||||
<p><span>{{ _('Job estimated time') }}:</span></p>
|
||||
<p><span class="total-estimated-time"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<figure class="inksimulation operator" data-field-name="operator-overview-transform" title="{{ _('Ctrl + Scroll to Zoom') }}">
|
||||
{{ svg_overview|replace("<li>", "")|replace("</li>", "")|safe }}
|
||||
{% with %}
|
||||
{% set realistic_id='realistic-operator-overview' %}
|
||||
{% include 'ui_svg_action_buttons.html' with context %}
|
||||
{% endwith %}
|
||||
</figure>
|
||||
</main>
|
||||
{% include 'footer.html' %}
|
30
extensions/inkstitch/bin/print/templates/print_detail.html
Normal file
30
extensions/inkstitch/bin/print/templates/print_detail.html
Normal file
@ -0,0 +1,30 @@
|
||||
<header>
|
||||
{% include 'headline.html' %}
|
||||
<div class="job-details">
|
||||
<div>
|
||||
<div class="table">
|
||||
<p><span>{{ _('COLOR') }}:</span><span data-field-name="color-{{ color_block.color.hex_digits }}" contenteditable="true" data-placeholder="{{ _('Enter thread name...') }}">{{ color_block.color.thread_name }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="table time-cld">
|
||||
<p><span>{{ _('Estimated time') }}:</span></p>
|
||||
<p><span class="cld-estimated-time"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<figure class="inksimulation" data-field-name="client-detail-transform-block{{ loop.index0 }}" title="{{ _('Ctrl + Scroll to Zoom') }}">
|
||||
{{color_block.svg_preview|replace("<li>", "")|replace("</li>", "")|safe}}
|
||||
{% with %}
|
||||
{% set loop_index=loop.index0 %}
|
||||
{% include 'ui_svg_action_buttons.html' with context %}
|
||||
{% endwith %}
|
||||
</figure>
|
||||
<div class="color-palette detailed">
|
||||
{% include 'color_swatch.html' %}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% include 'footer.html' %}
|
45
extensions/inkstitch/bin/print/templates/print_overview.html
Normal file
45
extensions/inkstitch/bin/print/templates/print_overview.html
Normal file
@ -0,0 +1,45 @@
|
||||
<header>
|
||||
{% include 'headline.html' %}
|
||||
<div class="job-details">
|
||||
<div>
|
||||
<div class="table">
|
||||
<p><span>{{ _('Unique Colors') }}:</span><span>{{ job.num_colors }}</span></p>
|
||||
<p><span>{{ _('Color Blocks') }}:</span><span>{{ job.num_color_blocks }}</span></p>
|
||||
<p><span>{{ _('Total stops') }}:</span><span>{{ job.num_stops }}</span></p>
|
||||
<p><span>{{ _('Total trims') }}:</span><span>{{ job.num_trims }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="table">
|
||||
<p><span>{{ _('Design box size') }}:</span><span>{{ "%0.1fmm X %0.1fmm" | format(*job.dimensions) }}</span></p>
|
||||
<p><span>{{ _('Total stitch count') }}:</span><span>{{job.num_stitches }}</span></p>
|
||||
<p><span>{{ _('Total thread used') }}:</span><span>{{job.estimated_thread }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="table time-clo">
|
||||
<p><span>{{ _('Job estimated time') }}:</span></p>
|
||||
<p><span class="total-estimated-time"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="client-overview-main">
|
||||
<figure class="inksimulation" data-field-name="client-overview-transform" title="{{ _('Ctrl + Scroll to Zoom') }}">
|
||||
{{ svg_overview|replace("<li>", "")|replace("</li>", "")|safe }}
|
||||
{% with %}
|
||||
{% set realistic_id='realistic-client-overview' %}
|
||||
{% include 'ui_svg_action_buttons.html' with context %}
|
||||
{% endwith %}
|
||||
</figure>
|
||||
|
||||
<div class="color-palette">
|
||||
{% for color_block in color_blocks %}
|
||||
{% include 'color_swatch.html' %}
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
<div class="signature">{{ _('Client Signature') }}</div>
|
||||
</main>
|
||||
|
||||
{% include 'footer.html' %}
|
172
extensions/inkstitch/bin/print/templates/ui.html
Normal file
172
extensions/inkstitch/bin/print/templates/ui.html
Normal file
@ -0,0 +1,172 @@
|
||||
<div class="ui">
|
||||
<p class="header">{{ _('Ink/Stitch Print Preview') }}</p>
|
||||
<div class="buttons">
|
||||
<button class="print">{{ _('Print') }}</button>
|
||||
<button class="save-pdf">{{ _('Save PDF') }}</button>
|
||||
<button class="settings">{{ _('Settings') }}</button>
|
||||
<button class="close">{{ _('Close') }}</button>
|
||||
</div>
|
||||
<div id="errors">
|
||||
{{ _('⚠ lost connection to Ink/Stitch') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="settings-ui">
|
||||
<p id="close-settings">X</p>
|
||||
<h1>{{ _('Settings') }}</h1>
|
||||
|
||||
<div id="tabs">
|
||||
<button class="tab active">{{ _('Page Setup') }}</button>
|
||||
<button class="tab" id="branding-tab">{{ _('Branding') }}</button>
|
||||
<button class="tab">{{ _('Estimated Time') }}</button>
|
||||
<button class="tab">{{ _('Design') }}</button>
|
||||
</div>
|
||||
|
||||
<div id="fieldsets-ui">
|
||||
|
||||
<fieldset id="ui-page-setup">
|
||||
<fieldset>
|
||||
<legend>{{ _('Page Setup') }}</legend>
|
||||
<p class="select-container">
|
||||
<label for="printing-size">{{ _('Printing Size') }}:</label>
|
||||
<select id="printing-size" data-field-name="paper-size">
|
||||
<option value="letter" selected="selected">Letter</option>
|
||||
<option value="a4">A4</option>
|
||||
</select>
|
||||
</p>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ _('Print Layouts') }}</legend>
|
||||
<p>
|
||||
<input type="checkbox" class="view" id="client-overview" data-field-name="client-overview" />
|
||||
<label for="client-overview">{{ _('Client Overview') }}</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" class="view" id="client-detailedview" data-field-name="client-detailedview" />
|
||||
<label for="client-detailedview">{{ _('Client Detailed View') }}</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" class="view" id="operator-overview" data-field-name="operator-overview" CHECKED />
|
||||
<label for="operator-overview">{{ _('Operator Overview') }}</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" class="view" id="operator-detailedview" data-field-name="operator-detailedview" CHECKED />
|
||||
<label for="operator-detailedview">{{ _('Operator Detailed View') }}</label>
|
||||
</p>
|
||||
<p style="text-indent: 1.5em;">{{ _('Thumbnail size') }}:
|
||||
<input type="range" min="15" max="110" value="15" step="5" id="operator-detailedview-thumbnail-size" data-field-name="operator-detailedview-thumbnail-size" style="vertical-align: middle;" />
|
||||
<span id="display-thumbnail-size">15mm</span>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" class="view" id="custom-page" data-field-name="custom-page" />
|
||||
<label for="custom-page">{{ _('Custom information sheet') }}</label>
|
||||
</p>
|
||||
</fieldset>
|
||||
<button class="save-settings" title="{{ _("Includes these Page Setup, estimated time settings and also the icon.") }}">{{ _("Save as defaults") }}</button>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="ui-branding" class="ui-tab">
|
||||
<fieldset>
|
||||
<legend>{{ _('Logo') }}</legend>
|
||||
<figure class="brandlogo brandlogo-ui">
|
||||
<label class="logo-legend">
|
||||
{{ ('Choose File') }}
|
||||
<img src="{{ logo.src or "resources/inkstitch-logo.svg" }}" alt="{{ logo.title }}" title="{{ logo.title }}" data-field-name="logo" class="logo-ui">
|
||||
<input type=file class="logo-picker" />
|
||||
</label>
|
||||
</figure>
|
||||
</fieldset>
|
||||
<fieldset id="edit-footer">
|
||||
<legend>{{ _('Footer: Operator contact information') }}</legend>
|
||||
<div id="tool-bar" class="tool-bar">
|
||||
<button id="tb-bold" class="tb-button tb-bold ff-serif edit-only" title="Bold"><b>B</b></button>
|
||||
<button id="tb-italic" class="tb-button tb-italic ff-serif edit-only" title="Italic"><i>I</i></button>
|
||||
<button id="tb-underline" class="tb-button tb-underline ff-serif edit-only" title="Underline"><u>U</u></button>
|
||||
<button id="tb-remove" class="tb-button tb-remove ff-serif edit-only" title="Remove formatting"><u style="vertical-align: super; font-size: 60%;">A</u><span style="vertical-align: sub; font-size: 80%;">A</span></button>
|
||||
<button id="tb-hyperlink" class="tb-button tb-hyperlink edit-only" title="Hyperlink">☍</button>
|
||||
<button id="tb-mail" class="tb-button tb-mail edit-only" title="E-Mail">✉</button>
|
||||
<button id="tb-reset" class="tb-button tb-reset" title="Reset text">↺</button>
|
||||
<p id="edit-mode" class="edit-mode"><input type="checkbox" id="switch-mode" class="switch-mode" name="switch-mode" /> <label for="switch-mode">{{ ('Show HTML') }}</label></p>
|
||||
<div id="footer-url" class="tb-popup url-window">
|
||||
<p>{{ _("Enter URL") }}: <input type="text" id="footer-link" class="user-url" name="footer-link" value="https://" /></p>
|
||||
<p><button id="url-ok" class="url-ok">{{ _("OK") }}</button> <button id="url-cancel" class="url-cancel">{{ _("Cancel") }}</button></p>
|
||||
</div>
|
||||
<div id="footer-email" class="tb-popup mail-window">
|
||||
<p>{{ _("Enter E-Mail") }}: <input type="text" id="footer-mail" class="user-mail" name="footer-mail" value="@" /></p>
|
||||
<p><button id="mail-ok" class="mail-ok">{{ _("OK") }}</button> <button id="mail-cancel" class="mail-cancel">{{ _("Cancel") }}</button></p>
|
||||
</div>
|
||||
<div id="footer-info-original" class="original-info">{{ _("Proudly generated with") }} <a href="http://inkstitch.org/" target="_blank">Ink/Stitch</a></div>
|
||||
<div id="footer-reset" class="tb-popup reset-window">
|
||||
<p>{{ _("This will reset your custom text to the default.") }}</p>
|
||||
<p>{{ _("All changes will be lost.") }}</p>
|
||||
<p><button id="reset-ok" class="reset-ok">{{ _("OK") }}</button> <button id="reset-cancel" class="reset-cancel">{{ _("Cancel") }}</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer-info-text" class="info-text" contenteditable="true"><div>{{ _("Proudly generated with") }} <a href="http://inkstitch.org/" target="_blank">Ink/Stitch</a></div></div>
|
||||
<p class="notice--warning"><b>Note</b>: If you are using Firefox, use visible URLs. Links will not be printed to PDF with this browser.</p>
|
||||
</fieldset>
|
||||
<button class="save-settings" title="{{ _('Includes these Page Setup, estimated time settings and also the icon.') }}">{{ _("Save as defaults") }}</button>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="ui-time" class="ui-tab">
|
||||
<legend>{{ _('Estimated Time') }}</legend>
|
||||
<fieldset>
|
||||
<legend>{{ _('Machine Settings') }}</legend>
|
||||
<p>
|
||||
<input class="view" type="number" id="machine-speed" data-field-name="machine-speed" min="0" value="700" title="{{ _('Average Machine Speed') }}" />
|
||||
<label for="machine-speed">{{ _('stitches per minute ') }}</label>
|
||||
</p>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ _('Time Factors') }}</legend>
|
||||
<p>
|
||||
<input type="number" id="time-additional" data-field-name="time-additional" min="0" value="0" />
|
||||
<label for="time-additional" title="{{ _('Includes average time for preparing the machine, thread breaks and/or bobbin changes, etc.') }}">{{ _('seconds to add to total time*') }}</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="number" id="time-color-change" data-field-name="time-color-change" min="0" value="10" />
|
||||
<label for="time-color-change" title="{{ _('This will be added to the total time.') }}">{{ _('seconds needed for a color change*') }}</label></p>
|
||||
<p>
|
||||
<input type="number" id="time-trims" data-field-name="time-trims" min="0" value="10" />
|
||||
<label for="time-trims">{{ _('seconds needed for trim') }}</label></p>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ _('Display Time On') }}</legend>
|
||||
<div>
|
||||
<p><input type="checkbox" class="time-display" id="time-clo" data-field-name="time-clo" /><label for="time-clo">{{ _('Client Overview') }}</label></p>
|
||||
<p><input type="checkbox" class="time-display" id="time-cld" data-field-name="time-cld" /><label for="time-cld">{{ _('Client Detailed View') }}</label></p>
|
||||
<p><input type="checkbox" class="time-display" id="time-opo" data-field-name="time-opo" CHECKED /><label for="time-opo">{{ _('Operator Overview') }}</label></p>
|
||||
<p><input type="checkbox" class="time-display" id="time-opd" data-field-name="time-opd" CHECKED /><label for="time-opd">{{ _('Operator Detailed View') }}</label></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<button class="save-settings" title="{{ _('Includes page setup, estimated time and also the branding.') }}">{{ _("Save as defaults") }}</button>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="ui-design" class="ui-tab">
|
||||
<legend>{{ _('Design') }}</legend>
|
||||
<p class="select-container"><label for="thread-palette">{{ _('Thread Palette') }}:</label>
|
||||
<select id="thread-palette" data-field-name="thread-palette">
|
||||
{% if selected_palette is none %}
|
||||
<option value="" selected>{{ _('None') }}</option>
|
||||
{% endif %}
|
||||
{% for palette in palettes %}
|
||||
<option value="{{ palette }}" {{ "selected" if palette == selected_palette.name else "" }}>{{ palette }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
</div><!-- END FIELDSETS-UI -->
|
||||
|
||||
</div><!-- END SETTINGS-UI-->
|
||||
|
||||
<div id="modal-background" class="modal"></div>
|
||||
<div id="modal-content" class="modal">
|
||||
<p>
|
||||
{{ _("Changing the thread palette will cause thread names and catalog numbers to be recalculated based on the new palette. Any changes you have made to color or thread names will be lost. Are you sure?") }}
|
||||
</p>
|
||||
<p>
|
||||
<button id="modal-yes">{{ _("Yes") }}</button>
|
||||
<button id="modal-no">{{ _("No") }}</button>
|
||||
</p>
|
||||
</div>
|
@ -0,0 +1,15 @@
|
||||
<figcaption>{{ _('Scale') }} <span class="scale" data-field-name="svg-scale" contenteditable="true" data-placeholder=""></span>%</figcaption>
|
||||
<div>
|
||||
<button class="svg-fit">{{ _('Fit') }}</button>
|
||||
<button class="svg-full">100%</button>
|
||||
<button class="svg-apply">{{ _('Apply to all') }}</button>
|
||||
<button class="svg-realistic">
|
||||
{% if loop_index is defined %}
|
||||
<input type="checkbox" id="realistic-color-block-{{ loop_index }}" data-field-name="block{{ loop_index }}" class="realistic" />
|
||||
<label for="realistic-color-block-{{ loop_index }}" class="realistic">{{ _('Realistic') }}</label>
|
||||
{% else %}
|
||||
<input type="checkbox" id="{{ realistic_id }}" data-field-name="overview" class="realistic" />
|
||||
<label for="{{ realistic_id }}" class="realistic">{{ _('Realistic') }}</label>
|
||||
{% endif %}
|
||||
</button>
|
||||
</div>
|
Reference in New Issue
Block a user