remove order button to menu, add debug mode, translations

upd4.1
Michael Aschauer 2017-11-06 11:01:40 +01:00
rodzic a4fb82b6a7
commit aaabf734fc
2 zmienionych plików z 39 dodań i 66 usunięć

Wyświetl plik

@ -1,3 +1,7 @@
// get debug mode
url = new URL(window.location.href);
searchParams = new URLSearchParams(url.search);
var DEBUG = (searchParams.get("debug") == "true")
// Force flat design // Force flat design
IDE_Morph.prototype.setDefaultDesign = IDE_Morph.prototype.setFlatDesign; IDE_Morph.prototype.setDefaultDesign = IDE_Morph.prototype.setFlatDesign;
@ -7,12 +11,10 @@ IDE_Morph.prototype.originalInit = IDE_Morph.prototype.init;
IDE_Morph.prototype.init = function(isAutoFill) { IDE_Morph.prototype.init = function(isAutoFill) {
this.originalInit(); this.originalInit();
this.padding = 1; this.padding = 1;
this.droppedText( this.droppedText(
this.getURL(this.resourceURL('stitchcode/embroidery-library.xml')), this.getURL(this.resourceURL('stitchcode/embroidery-library.xml')),
'Embroidery tools' 'Embroidery tools'
); );
// this.isAnimating = false; // this.isAnimating = false;
}; };
@ -279,7 +281,6 @@ IDE_Morph.prototype.createControlBar = function () {
this.controlBar.add(appModeButton); this.controlBar.add(appModeButton);
this.controlBar.appModeButton = appModeButton; // for refreshing this.controlBar.appModeButton = appModeButton; // for refreshing
//steppingButton //steppingButton
button = new ToggleButtonMorph( button = new ToggleButtonMorph(
null, //colors, null, //colors,
@ -293,7 +294,7 @@ IDE_Morph.prototype.createControlBar = function () {
return Process.prototype.enableSingleStepping; return Process.prototype.enableSingleStepping;
} }
); );
button.corner = 12; button.corner = 12;
button.color = colors[0]; button.color = colors[0];
button.highlightColor = colors[1]; button.highlightColor = colors[1];
@ -312,31 +313,7 @@ IDE_Morph.prototype.createControlBar = function () {
steppingButton = button; steppingButton = button;
this.controlBar.add(steppingButton); this.controlBar.add(steppingButton);
this.controlBar.steppingButton = steppingButton; // for refreshing this.controlBar.steppingButton = steppingButton; // for refreshing
/*
// upload StitchButton
button = new PushButtonMorph(
this,
'uploadMe',
new SymbolMorph('arrowUp', 14)
);
button.corner = 12;
button.color = colors[0];
button.highlightColor = colors[1];
button.pressColor = colors[2];
button.labelMinExtent = new Point(36, 18);
button.padding = 0;
button.labelShadowOffset = new Point(-1, -1);
button.labelShadowColor = colors[1];
button.labelColor = this.buttonLabelColor;
button.contrast = this.buttonContrast;
button.drawNew();
// button.hint = 'stop\nevery-\nthing';
button.fixLayout();
upstitchButton = button;
this.controlBar.add(upstitchButton);
*/
// stopButton // stopButton
button = new ToggleButtonMorph( button = new ToggleButtonMorph(
null, // colors null, // colors
@ -522,7 +499,7 @@ IDE_Morph.prototype.createControlBar = function () {
steppingButton.setCenter(myself.controlBar.center()); steppingButton.setCenter(myself.controlBar.center());
steppingButton.setRight(slider.left() - padding); steppingButton.setRight(slider.left() - padding);
settingsButton.setCenter(myself.controlBar.center()); settingsButton.setCenter(myself.controlBar.center());
settingsButton.setLeft(this.left()); settingsButton.setLeft(this.left());
@ -989,29 +966,22 @@ IDE_Morph.prototype.createStatusDisplay = function () {
downloadDSTButton.newLines = 2.7; downloadDSTButton.newLines = 2.7;
elements.push(downloadDSTButton); elements.push(downloadDSTButton);
if (DEBUG) {
elements.push(' DEBUG MODE: true');
element = new StringMorph("");
var uploadOrderButton = new PushButtonMorph( element.newLines = 1.2;
null, elements.push(element);
function () { myself.uploadOrder(); }, elements.push(' RENDERER: ');
'Upload and Order!' element = new StringMorph();
); element.update = function () {
this.text = stage.renderer_status_msg;
host = window.location.hostname; };
if (host.endsWith("localhost") || host.endsWith("m.ash.to") || host.endsWith("turtlestitch.org")) { element.newLines = 1;
uploadOrderButton.newLines = 2.7; elements.push(element);
elements.push(uploadOrderButton); elements.push(' ');
} }
/*
elements.push(' RENDERER: ');
element = new StringMorph();
element.update = function () {
this.text = stage.renderer_status_msg;
};
elements.push(element);
elements.push(' ');
*/
elements.forEach(function(each) { myself.statusDisplay.addElement(each); }); elements.forEach(function(each) { myself.statusDisplay.addElement(each); });
}; };
@ -1519,12 +1489,14 @@ IDE_Morph.prototype.projectMenu = function () {
function() { myself.downloadDST(); }, function() { myself.downloadDST(); },
'Export current drawing as DST/Tajima Embroidery file' 'Export current drawing as DST/Tajima Embroidery file'
); );
/*
menu.addLine();
menu.addItem('Upload stitch file', 'uploadMe','Export stage drawing to stitch file (EXP)..');
menu.addLine();
*/ if (DEBUG) {
menu.addItem(
'Export to Embroidery service',
function() { myself.uploadOrder(); },
'Export to stitchcode.com\'s embroidery service'
);
}
menu.addLine(); menu.addLine();
if (shiftClicked) { if (shiftClicked) {
@ -2097,9 +2069,8 @@ DialogBoxMorph.prototype.promptOrder = function (
IDE_Morph.prototype.uploadOrder = function () { IDE_Morph.prototype.uploadOrder = function () {
var myself = this, var myself = this,
world = this.world(); world = this.world();
if (window.location.hostname.endsWith("localhost")) {
if (host.endsWith("localhost")) {
SHOP_URL = 'http://shop.stitchcode.localhost/ext.php'; SHOP_URL = 'http://shop.stitchcode.localhost/ext.php';
} else { } else {
SHOP_URL = 'http://shop.stitchcode.com/ext.php'; SHOP_URL = 'http://shop.stitchcode.com/ext.php';
@ -2170,8 +2141,8 @@ IDE_Morph.prototype.uploadOrder = function () {
'Upload Order', 'Upload Order',
'http://snap.berkeley.edu/tos.html', 'http://snap.berkeley.edu/tos.html',
'Terms of Service...', 'Terms of Service...',
'http://snap.berkeley.edu/privacy.html', '',
'Privacy...', '',
'Upload project as public (domain)', 'Upload project as public (domain)',
'I have read and agree\nto the Terms of Service', 'I have read and agree\nto the Terms of Service',
world, world,

Wyświetl plik

@ -12,7 +12,6 @@ tempDict = {
// UI // UI
'Save to Disk': 'Save to Disk':
'Sichern auf Festplatte', 'Sichern auf Festplatte',
' Stitches : ': ' Stitches : ':
' Stiche : ', ' Stiche : ',
'Jumps': 'Jumps':
@ -39,8 +38,6 @@ tempDict = {
'Benutzerkonto anlegen', 'Benutzerkonto anlegen',
'Reset Password...': 'Reset Password...':
'Passwort zur\u00fccksetzen', 'Passwort zur\u00fccksetzen',
'Export as SVG': 'Export as SVG':
'Exportieren als SVG Vektorgrafik', 'Exportieren als SVG Vektorgrafik',
'Export as Melco/EXP': 'Export as Melco/EXP':
@ -53,15 +50,20 @@ tempDict = {
'Exportiert die aktuelle Zeichnung als Stickmuster im EXP/Melco Format', 'Exportiert die aktuelle Zeichnung als Stickmuster im EXP/Melco Format',
'Export current drawing as DST/Tajima Embroidery file': 'Export current drawing as DST/Tajima Embroidery file':
'Exportiert die aktuelle Zeichnung als Stickmuster im Tajima/DST Format', 'Exportiert die aktuelle Zeichnung als Stickmuster im Tajima/DST Format',
'Export to Embroidery service':
'Exportieren zum Ausstickservice',
'Export to stitchcode.com\'s embroidery service':
'Exportiert die aktuelle Zeichnung zum stitchcode.com Ausstickservice',
'move %n steps by %n steps': 'move %n steps by %n steps':
'gehe %n Schritte in %n er Schritten', 'gehe %n Schritte in %n er Schritten',
'move %n steps in %n': 'move %n steps in %n':
'gehe %n Schritte in %n Stichen', 'gehe %n Schritte in %n Stichen',
'Upload and Order!': ' are too long! (will get clamped)':
'Bestellen', 'sind zu lang! (werden geklammert)',
' is too long! (will get clamped)':
'Stich ist zu lang! (wird geklammert)',
}; };
// Add attributes to original SnapTranslator.dict.de // Add attributes to original SnapTranslator.dict.de