From 12fbe906f271f5dbceb703480ef7dc0f95ec6d55 Mon Sep 17 00:00:00 2001 From: Simon Walters Date: Fri, 22 Jul 2022 15:09:32 +0100 Subject: [PATCH 01/19] Update mqttExtension.js Remove unnecessary console logging --- libraries/mqttExtension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/mqttExtension.js b/libraries/mqttExtension.js index 7ed6665e..c2f15db1 100644 --- a/libraries/mqttExtension.js +++ b/libraries/mqttExtension.js @@ -216,7 +216,7 @@ SnapExtensions.primitives.set( // if (aTopic !== topic) { return; } if (!mqttWildcard(aTopic, topic)) {return;} let p = new Process(); - console.log(payload); + newPayload = payload.reduce( (res, val) => res+String.fromCharCode( val), "") try { p.initializeFor(callback, new List([newPayload, aTopic])); From e2a4743fa72c59b5f1010620ddb4a2eb35fe7287 Mon Sep 17 00:00:00 2001 From: HM The Mister Techno Date: Thu, 28 Jul 2022 01:36:27 +0300 Subject: [PATCH 02/19] Updating Greek Translation It was 2 years since I last added new strings for the Greek language. In 2022, several more have been added, to make it more complete. I tested them before making the PR All current blocks existed as well as several UI options have been translated into Greek --- locale/lang-el.js | 190 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 189 insertions(+), 1 deletion(-) diff --git a/locale/lang-el.js b/locale/lang-el.js index 3357cbec..395c4796 100644 --- a/locale/lang-el.js +++ b/locale/lang-el.js @@ -534,6 +534,8 @@ SnapTranslator.dict.el = { 'στείλε το %msg %receive και περίμενε', 'to': 'στο', + 'with data': + 'με δεδομένα', 'send %msg to %spr': 'αποστολή του %msg στο %spr', 'Message name': @@ -566,6 +568,8 @@ SnapTranslator.dict.el = { 'σταμάτα %stopChoices', 'all': 'τα πάντα', + 'all scenes': + 'όλες τις σκηνές', 'this script': 'αυτό το σενάριο', 'this block': @@ -600,6 +604,14 @@ SnapTranslator.dict.el = { 'ο εαυτός μου', 'delete this clone': 'κατάργησε αυτόν τον κλόνο', + 'switch to scene %scn %send': + 'αλλαγή στην σκηνή %scn %send', + 'and send': + 'και στείλε', + 'next': + 'επόμενη', + 'previous': + 'προηγούμενη', 'tell %spr to %cmdRing %inputs': 'πες το %spr να %cmdRing %inputs', 'ask %spr for %repRing %inputs': @@ -618,6 +630,8 @@ SnapTranslator.dict.el = { 'Ποιο είναι το όνομά σου;', 'answer': 'απάντηση', + 'mouse position': + 'θέση ποντικιού', 'mouse x': 'ποντίκι x-θέση', 'mouse y': @@ -708,6 +722,38 @@ SnapTranslator.dict.el = { 'κατοπτρισμός βίντεο', 'turbo mode': 'λειτουργεία τούρμπο', + '%block of block %repRing': + '%block του μπλοκ %repRing', + 'label': + 'ετικέτα', + 'definition': + 'ορισμός', + 'category': + 'κατηγορία', + 'custom?': + 'προσαρμοσμένο?', + 'global?': + 'καθολικό?', + 'type': + 'τύπος', + 'scope': + 'θέα', + 'slots': + 'θέσεις', + 'defaults': + 'προεπιλογές', + 'menus': + 'μενού', + 'editables': + 'επεξεργάσιμα', + 'set %byob of block %repRing to %s': + 'θέσε %byob της εντολής %repRing σε %s', + 'define %upvar %s %repRing': + 'ορισμός %upvar %s %repRing', + 'delete block %repRing': + 'διαγραφή μπλοκ %repRing', + 'block': + 'μπλοκ', // operators: '%n mod %n': @@ -782,12 +828,28 @@ SnapTranslator.dict.el = { // lists: 'list %exp': 'λίστα %exp', + 'numbers from %n to %n': + 'νούμερα από το %n εως το %n', '%s in front of %l': '%s μπροστά από το %l', 'item %idx of %l': 'στοιχείο %idx του %l', 'all but first of %l': 'όλα εκτός από το πρώτο του %l', + '%la of %l': + '%la του %l', + 'rank': + 'κατάταξη', + 'dimensions': + 'διαστάσεις', + 'flatten': + 'ισοπέδωση', + 'columns': + 'στείλες', + 'reverse': + 'αναστροφή', + 'lines': + 'γραμμές', 'length of %l': 'μήκος του %l', '%l contains %s': @@ -824,6 +886,10 @@ SnapTranslator.dict.el = { 'εύρος', 'append %lists': 'προσάρτηση %lists', + 'combinations %lists': + 'συνδιασμοί %lists', + 'reshape %l to %nums': + 'ανασχημάτιση του %l σε %nums', 'add %s to %l': 'πρόσθεσε το %s στο %l', 'delete %ida of %l': @@ -891,6 +957,18 @@ SnapTranslator.dict.el = { 'Αχρησιμοποίητα μπλοκ...', 'find unused global custom blocks\nand remove their definitions': 'βρείτε αχρησιμοποίητα καθολικά μπλοκ\nκαι αφαίρεσε τους ορισμούς τους', + 'Hide blocks...': + 'Απόκρυψη μπλοκ...', + 'New category...': + 'Νέα κατηγορία...', + 'Remove a category...': + 'Διαγραφή κατηγορίας...', + 'Scenes...': + 'Σκηνές...', + 'New scene': + 'Νέα σκηνή', + 'Add scene...': + 'Προσθήκη σκηνής...', 'Import tools': 'Εισαγωγή εργαλείων', 'load the official library of\npowerful blocks': @@ -948,6 +1026,8 @@ SnapTranslator.dict.el = { 'Ύψος σκηνής', 'Default': 'Προεπιλογή', + 'JavaScript extensions': + 'Επεκτάσεις JavaScript', 'Blurred shadows': 'Θολές σκιές', 'uncheck to use solid drop\nshadows and highlights': @@ -1006,6 +1086,8 @@ SnapTranslator.dict.el = { 'ενεργοποιήστε για να βάλετε σε\nπροτεραιότητα την εκτέλεση του κώδικα', 'uncheck to run scripts\nat normal speed': 'απενεργοποιήστε για να εκτελέσετε τον κώδικα\nμε κανονική ταχύτητα', + 'Flat design': + 'Επίπεδη σχεδίαση', 'check for alternative\nGUI design': 'ενεργοποιήστε για εναλακτική\nσχεδίαση GUI', 'uncheck for default\nGUI design': @@ -1030,6 +1112,26 @@ SnapTranslator.dict.el = { 'Γραμμές πίνακα', 'Visible stepping': 'Ορατός βηματισμός', + 'Single palette': + 'Μονή παλέτα', + 'check to show all blocks in a single palette': + 'ενεργοποιήστε για να εμφανίσετε όλα τα μπλοκ σε μονή παλέτα', + 'uncheck to show only the selected category\'s blocks': + 'απενεργοποιήστε για να εμφανίσετε μόνο τα μπλοκ τις επιλεγμένης κατηγορίας', + 'Show categories': + 'Εμφάνιση κατηγοριών', + 'uncheck to hide\ncategory names\nin the palette': + 'απενεργοποιήστε για να κρύψετε\nτα ονόματα κατηγοριών\nστην παλέτα', + 'check to show\ncategory names\nin the palette': + 'ενεργοποιήστε για να εμφανίσετε\nτα ονόματα κατηγοριών\nστην παλέτα', + 'Show buttons': + 'Εμφάνιση κουμιών', + 'uncheck to hide buttons\nin the palette': + 'απενεργοποιήστε για να κρύψετε τα κουμιά\nστην παλέτα', + 'check to show buttons\nin the palette': + 'ενεργοποιήστε για να εμφανίσετε τα κουμιά\nστην παλέτα', + 'HSL pen color model': + 'Χρωματικό μοντέλο στυλού HSL', // inputs @@ -1049,6 +1151,28 @@ SnapTranslator.dict.el = { // palette: 'find blocks': 'εύρεση μπλοκ', + 'hide blocks...': + 'απόκρυψη μπλοκ...', + 'Hide blocks in palette': + 'Απόκρυψη μπλοκ στην παλέτα', + 'unused': + 'αχρησιμοποίητα', + 'make a category...': + 'δημιουργία μιας κατηγορίας...', + 'New Category': + 'Νέα κατηγορία', + 'Blocks category name:': + 'Όνομα κατηγορίας μπλοκ:', + 'Category color': + 'Χρώμα κατηγορίας', + 'red': + 'κόκκινο', + 'green': + 'πράσινο', + 'blue': + 'μπλε', + 'delete a category...': + 'διαγραφή μιας κατηγορίας...', 'hide primitives': 'Απόκρυψη αρχέτυπων', 'show primitives': @@ -1059,6 +1183,10 @@ SnapTranslator.dict.el = { 'βοήθεια...', 'relabel...': 'μετονόμαση...', + 'compile': + 'μεταγλώτηση', + 'uncompile': + 'ξε-μεταγλώτηση', 'duplicate': 'διπλασίαση', 'make a copy\nand pick it up': @@ -1095,6 +1223,12 @@ SnapTranslator.dict.el = { 'εξαγωγή του προσαρμοσμένου μπλοκ', 'edit...': 'επεξεργασία...', + 'translations...': + 'μεταφράσεις...', + 'block variables...': + 'μεταβλητές μπλοκ...', + 'in palette': + 'στην παλέτα', // sprites: 'edit': @@ -1497,6 +1631,8 @@ SnapTranslator.dict.el = { // coments 'add comment here...': 'πρόσθεσε κάποιο σχόλιο εδώ...', + 'comment pic...': + 'εικόνα σχόλιου...', 'save a picture\nof this comment': 'αππθήκευση εικόνας\nαυτού του σχόλιου', @@ -1510,6 +1646,10 @@ SnapTranslator.dict.el = { '(0) πάνω', '(180) down': '(180) κάτω', + 'random': + 'τυχαία', + 'random position': + 'τυχαία θέση', // collision detection 'mouse-pointer': @@ -1526,6 +1666,8 @@ SnapTranslator.dict.el = { 'Χελώνα', 'Empty': 'Άδειο', + 'Paint a new costume': + 'Σχεδίαση νέου κοστουμιού', 'Camera': 'Κάμερα', @@ -1763,6 +1905,52 @@ SnapTranslator.dict.el = { 'top': 'επάνω', 'bottom': - 'κάτω' + 'κάτω', + 'position': + 'θέση', + 'costume name': + 'όνομα κοστουμιού', + 'categories': + 'κατηγορίες', + + // attributes in the SET block's dropdown + 'my anchor': + 'η άγκυρά μου', + 'my parent': + 'ο γονέας μου', + 'my name': + 'το ονομάμου', + 'my temporary?': + 'προσωρινός;', + 'my dangling?': + 'κουνιέμαι', + 'my draggable?': + 'συρόμενο', + 'my rotation style': + 'το στύλ περιστροφής μου', + 'my rotation x': + 'η x-περιστροφή μου', + 'my rotation y': + 'η y περιστροφή μου', + + // inheritance + 'inherited': + 'κληρονομημένο', + 'check to inherit\nfrom': + 'επιλογή για κληρονόμηση\naπό', + 'uncheck to\ndisinherit': + 'αποεπιλογή για \nκατάργηση κληρονόμησης', + + // editing slots inside variadic inputs + 'insert a slot': + 'εισαγωγή μιας θέσης', + 'delete slot': + 'διαγραφή θέσης', + 'insert a variable': + 'εισαγωγή μιας θέσης', + 'delete variable': + 'διαγραφή μεταβλητής', + 'variable': + 'μεταβλητή' }; From 873dc28f093b3adf1b67569a7b6e7ad4534cde16 Mon Sep 17 00:00:00 2001 From: HM The Mister Techno Date: Thu, 28 Jul 2022 01:41:27 +0300 Subject: [PATCH 03/19] patch --- locale/lang-el.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/lang-el.js b/locale/lang-el.js index 395c4796..487adc51 100644 --- a/locale/lang-el.js +++ b/locale/lang-el.js @@ -737,7 +737,7 @@ SnapTranslator.dict.el = { 'type': 'τύπος', 'scope': - 'θέα', + 'έκταση', 'slots': 'θέσεις', 'defaults': From 04fe903a2b62736f48dbfe440a794d7d8a15899d Mon Sep 17 00:00:00 2001 From: HM The Mister Techno Date: Fri, 29 Jul 2022 16:36:44 +0300 Subject: [PATCH 04/19] Patches to match english and german --- locale/lang-el.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/lang-el.js b/locale/lang-el.js index 487adc51..4af65796 100644 --- a/locale/lang-el.js +++ b/locale/lang-el.js @@ -1915,23 +1915,23 @@ SnapTranslator.dict.el = { // attributes in the SET block's dropdown 'my anchor': - 'η άγκυρά μου', + 'δικό μου άγκυρά', 'my parent': - 'ο γονέας μου', + 'δικό μου γονέας', 'my name': - 'το ονομάμου', + 'δικό μου ονομά', 'my temporary?': - 'προσωρινός;', + 'δικό μου προσωρινός;', 'my dangling?': - 'κουνιέμαι', + 'δικό μου κουνιέμαι;', 'my draggable?': - 'συρόμενο', + 'δικό μου συρόμενο;', 'my rotation style': - 'το στύλ περιστροφής μου', + 'δικό μου στύλ περιστροφής', 'my rotation x': - 'η x-περιστροφή μου', + 'δικό μου x-περιστροφή', 'my rotation y': - 'η y περιστροφή μου', + 'δικό μου y περιστροφή', // inheritance 'inherited': From 8275458d219db136e978edac823699a3f757582d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sat, 30 Jul 2022 10:41:04 +0200 Subject: [PATCH 05/19] updated history --- HISTORY.md | 4 ++++ locale/lang-el.js | 2 +- snap.html | 2 +- src/locale.js | 4 ++-- sw.js | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 17948b73..2d9b1c9b 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -60,6 +60,10 @@ * updated the API documentation for "setTranslation" * **Translation Updates:** * German + * Greek, thank you, HM100! + +### 2022-07-30 +* Greek translation update, thank you, HM100!! ### 2022-07-23 * throttle framerate to < 67 fps diff --git a/locale/lang-el.js b/locale/lang-el.js index 4af65796..d9a8d445 100644 --- a/locale/lang-el.js +++ b/locale/lang-el.js @@ -185,7 +185,7 @@ SnapTranslator.dict.el = { 'translator_e-mail': 'ino.samaras@berkeley.edu, aprekates@sch.gr' , // optional 'last_changed': - '2020-10-09', // this, too, will appear in the Translators tab + '2022-07-30', // this, too, will appear in the Translators tab // GUI // control bar: diff --git a/snap.html b/snap.html index 1a93e16c..36653686 100755 --- a/snap.html +++ b/snap.html @@ -31,7 +31,7 @@ - + diff --git a/src/locale.js b/src/locale.js index 2c1bac3f..282cade4 100644 --- a/src/locale.js +++ b/src/locale.js @@ -50,7 +50,7 @@ // Global stuff -modules.locale = '2022-July-18'; +modules.locale = '2022-July-30'; var Localizer; var SnapTranslator = new Localizer(); @@ -385,7 +385,7 @@ SnapTranslator.dict.el = { 'translator_e-mail': 'ino.samaras@berkeley.edu, aprekates@sch.gr', 'last_changed': - '2020-11-23' + '2022-07-30' }; SnapTranslator.dict.ca = { diff --git a/sw.js b/sw.js index 16afdc8c..97f9841f 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -var snapVersion = '8.0.0-rc-220724', +var snapVersion = '8.0.0-rc-220730', cacheName = 'snap-pwa', filesToCache = [ 'snap.html', From 567908dcf74432766ce83e6b094824035c69c57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sat, 30 Jul 2022 12:57:24 +0200 Subject: [PATCH 06/19] include custom block definition in the "scripts pic" of the block editor --- HISTORY.md | 1 + snap.html | 2 +- src/blocks.js | 46 ++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 2d9b1c9b..73734078 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -64,6 +64,7 @@ ### 2022-07-30 * Greek translation update, thank you, HM100!! +* blocks: include custom block definition in the "scripts pic" of the block editor ### 2022-07-23 * throttle framerate to < 67 fps diff --git a/snap.html b/snap.html index 36653686..f7871844 100755 --- a/snap.html +++ b/snap.html @@ -16,7 +16,7 @@ - + diff --git a/src/blocks.js b/src/blocks.js index 7c6abad4..e835641a 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -161,7 +161,7 @@ CostumeIconMorph, SoundIconMorph, SVG_Costume, embedMetadataPNG*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2022-July-19'; +modules.blocks = '2022-July-30'; var SyntaxElementMorph; var BlockMorph; @@ -3358,7 +3358,7 @@ BlockMorph.prototype.userMenu = function () { } menu.addLine(); menu.addItem( - "script pic...", + "script pic...", // +++ () => { var ide = this.parentThatIsA(IDE_Morph) || this.parentThatIsA(BlockEditorMorph).target.parentThatIsA( @@ -8094,15 +8094,25 @@ ScriptsMorph.prototype.cleanUp = function () { target.adjustBounds(); }; -ScriptsMorph.prototype.exportScriptsPicture = function () { +ScriptsMorph.prototype.exportScriptsPicture = function () { // +++ var pic = this.scriptsPicture(), - ide = this.world().children[0]; + ide = this.world().children[0], + xml = this.scriptsXML(); if (pic) { - ide.saveCanvasAs( - pic, - (ide.getProjectName() || localize('untitled')) + ' ' + - localize('script pic') + if (xml) { + ide.saveFileAs( + embedMetadataPNG(pic, xml), + 'image/png', + (ide.getProjectName() || localize('untitled')) + ' ' + + localize('script pic') ); + } else { + ide.saveCanvasAs( + pic, + (ide.getProjectName() || localize('untitled')) + ' ' + + localize('script pic') + ); + } } }; @@ -8131,6 +8141,26 @@ ScriptsMorph.prototype.scriptsPicture = function () { return pic; }; +ScriptsMorph.prototype.scriptsXML = function () { + // private - answer a container (usually sprite) for all scripts + var blockEditor = this.parentThatIsA(BlockEditorMorph), + ide = this.world().children[0]; + if (blockEditor) { + return ide.blocksLibraryXML( + [blockEditor.definition].concat( + blockEditor.definition.collectDependencies( + [], + [], + blockEditor.target + ) + ), + null, + true + ); + } + return null; // +++ for now +}; + ScriptsMorph.prototype.addComment = function () { var ide = this.parentThatIsA(IDE_Morph), blockEditor = this.parentThatIsA(BlockEditorMorph), From a8a349196e4fb6755bf1f25c7c2b9b59eac41dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sat, 30 Jul 2022 15:28:36 +0200 Subject: [PATCH 07/19] include blocks in the "scripts pic" export if it is a single one --- HISTORY.md | 1 + src/blocks.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 73734078..cd004a09 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -65,6 +65,7 @@ ### 2022-07-30 * Greek translation update, thank you, HM100!! * blocks: include custom block definition in the "scripts pic" of the block editor +* blocks: include script xml (blocks) in the "scripts pic" export if it is a single one ### 2022-07-23 * throttle framerate to < 67 fps diff --git a/src/blocks.js b/src/blocks.js index e835641a..8e78b15d 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -8144,7 +8144,8 @@ ScriptsMorph.prototype.scriptsPicture = function () { ScriptsMorph.prototype.scriptsXML = function () { // private - answer a container (usually sprite) for all scripts var blockEditor = this.parentThatIsA(BlockEditorMorph), - ide = this.world().children[0]; + ide = this.world().children[0], + scripts = this.children.filter(m => m instanceof BlockMorph); if (blockEditor) { return ide.blocksLibraryXML( [blockEditor.definition].concat( @@ -8158,6 +8159,9 @@ ScriptsMorph.prototype.scriptsXML = function () { true ); } + if (scripts.length === 1) { + return scripts[0].toXMLString(); + } return null; // +++ for now }; From 4c15b1215ce204ee68e22c8dda7cda090b1feb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sun, 31 Jul 2022 11:16:09 +0200 Subject: [PATCH 08/19] fixed #3085 (I hope ^^) --- HISTORY.md | 3 +++ snap.html | 2 +- src/threads.js | 10 +++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index cd004a09..673589c7 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -62,6 +62,9 @@ * German * Greek, thank you, HM100! +### 2022-07-31 +* threads: fixed #3085 (I hope ^^) + ### 2022-07-30 * Greek translation update, thank you, HM100!! * blocks: include custom block definition in the "scripts pic" of the block editor diff --git a/snap.html b/snap.html index f7871844..0c89b246 100755 --- a/snap.html +++ b/snap.html @@ -17,7 +17,7 @@ - + diff --git a/src/threads.js b/src/threads.js index 14dbafbc..5bd480d4 100644 --- a/src/threads.js +++ b/src/threads.js @@ -65,7 +65,7 @@ StagePickerMorph, CustomBlockDefinition*/ /*jshint esversion: 11, bitwise: false, evil: true*/ -modules.threads = '2022-July-19'; +modules.threads = '2022-July-31'; var ThreadManager; var Process; @@ -1646,7 +1646,8 @@ Process.prototype.evaluateCustomBlock = function () { exit, i, value, - outer; + outer, + self; if (!context) {return null; } this.procedureCount += 1; @@ -1677,6 +1678,9 @@ Process.prototype.evaluateCustomBlock = function () { runnable.isCustomBlock = true; this.context.parentContext = runnable; + // capture the runtime environment in "this script" + self = copy(runnable); + // passing parameters if any were passed if (parms.length > 0) { @@ -1733,7 +1737,7 @@ Process.prototype.evaluateCustomBlock = function () { this.readyToYield = true; } } - outer.variables.addVar(Symbol.for('self'), method.body || new Context()); + outer.variables.addVar(Symbol.for('self'), self); runnable.expression = runnable.expression.blockSequence(); }; From 81523f0c288ef36f563dd1ee66ca34942024de08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sun, 31 Jul 2022 12:29:38 +0200 Subject: [PATCH 09/19] fixed #3088 (I hope ^^) --- HISTORY.md | 1 + snap.html | 2 +- src/byob.js | 56 ++++++++++++++++++++++------------------------------- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 673589c7..99c23da7 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -64,6 +64,7 @@ ### 2022-07-31 * threads: fixed #3085 (I hope ^^) +* byob: fixed #3088 (I hope ^^) ### 2022-07-30 * Greek translation update, thank you, HM100!! diff --git a/snap.html b/snap.html index 0c89b246..44b99524 100755 --- a/snap.html +++ b/snap.html @@ -23,7 +23,7 @@ - + diff --git a/src/byob.js b/src/byob.js index fa2d1eea..429fbb1e 100644 --- a/src/byob.js +++ b/src/byob.js @@ -111,7 +111,7 @@ ArgLabelMorph, embedMetadataPNG*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2022-July-19'; +modules.byob = '2022-July-31'; // Declarations @@ -586,28 +586,23 @@ CustomBlockDefinition.prototype.setBlockLabel = function (abstractSpec) { // private - only to be called from a Process that also does housekeeping // abstract block specs replace the inputs with underscores, // e.g. "move _ steps", "say _", "_ + _" - var count = abstractSpec.split(' ').filter(word => word === '_').length, + var parts = abstractSpec.split(' ').filter(each => each.length && each !== ' '), + count = parts.filter(each => each === '_').length, inputNames = this.inputNames(), - parts = [], - spec = abstractSpec; + spec = '', + idx = 0; if (count !== inputNames.length) { throw new Error('expecting the number of inputs to match'); } - if (spec.startsWith('_ ')) { - parts.push(''); - spec = spec.slice(2); - } - if (spec.endsWith(' _')) { - spec = spec.slice(0, -2); - } - parts = parts.concat(spec.split(' _ ')); - spec = ''; - parts.forEach((part, i) => - spec += (part + ( - inputNames[i] ? ' %\'' + inputNames[i] + '\' ' : '') - ) - ); + parts.forEach(part => { + if (part === '_') { + spec += inputNames[idx] ? '%\'' + inputNames[idx] + '\' ' : ''; + idx += 1; + } else { + spec += (part + ' '); + } + }); this.spec = spec.trim(); }; @@ -617,8 +612,8 @@ CustomBlockDefinition.prototype.setBlockDefinition = function (aContext) { newInputs = aContext.inputs, declarations = this.declarations, parts = [], - suffix = [], body = aContext, + idx = 0, reportBlock, spec; @@ -628,21 +623,16 @@ CustomBlockDefinition.prototype.setBlockDefinition = function (aContext) { oldInputs = this.inputNames(); // change the input names in the spec to those of the given context - while (spec.startsWith('_ ')) { - parts.push(''); - spec = spec.slice(2); - } - while (spec.endsWith(' _')) { - spec = spec.slice(0, -2); - suffix.push(''); - } - parts = parts.concat(spec.split(' _ ')).concat(suffix); + parts = spec.split(' ').filter(each => each.length && each !== ' '); spec = ''; - parts.forEach((part, i) => - spec += (part + ( - newInputs[i] ? ' %\'' + newInputs[i] + '\' ' : '') - ) - ); + parts.forEach(part => { + if (part === '_') { + spec += newInputs[idx] ? '%\'' + newInputs[idx] + '\' ' : ''; + idx += 1; + } else { + spec += (part + ' '); + } + }); this.spec = spec.trim(); // change the input names in the slot declarations to those of the context From 77be4e9d634eb418d4ab5f05f9de0f5ddf0a2721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sun, 31 Jul 2022 12:44:54 +0200 Subject: [PATCH 10/19] include the (whole) current sprite in the "scripts pic" export if it is more than a single one --- HISTORY.md | 1 + snap.html | 2 +- src/blocks.js | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 99c23da7..ec8d25e1 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -65,6 +65,7 @@ ### 2022-07-31 * threads: fixed #3085 (I hope ^^) * byob: fixed #3088 (I hope ^^) +* blocks: include the (whole) current sprite in the "scripts pic" export if it is more than a single one ### 2022-07-30 * Greek translation update, thank you, HM100!! diff --git a/snap.html b/snap.html index 44b99524..b33e03bb 100755 --- a/snap.html +++ b/snap.html @@ -16,7 +16,7 @@ - + diff --git a/src/blocks.js b/src/blocks.js index 8e78b15d..f5c931e9 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -161,7 +161,7 @@ CostumeIconMorph, SoundIconMorph, SVG_Costume, embedMetadataPNG*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2022-July-30'; +modules.blocks = '2022-July-31'; var SyntaxElementMorph; var BlockMorph; @@ -8145,7 +8145,8 @@ ScriptsMorph.prototype.scriptsXML = function () { // private - answer a container (usually sprite) for all scripts var blockEditor = this.parentThatIsA(BlockEditorMorph), ide = this.world().children[0], - scripts = this.children.filter(m => m instanceof BlockMorph); + scripts = this.children.filter(m => m instanceof BlockMorph), + target; if (blockEditor) { return ide.blocksLibraryXML( [blockEditor.definition].concat( @@ -8162,6 +8163,10 @@ ScriptsMorph.prototype.scriptsXML = function () { if (scripts.length === 1) { return scripts[0].toXMLString(); } + target = this.scriptTarget(); + if (target instanceof SpriteMorph) { + return target.toXMLString(); + } return null; // +++ for now }; From 1eff3e795dc15c12c0d33b445678e81d36552412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sun, 31 Jul 2022 12:50:34 +0200 Subject: [PATCH 11/19] upport directly importing an embedded sprite inside a smart costume --- HISTORY.md | 1 + snap.html | 2 +- src/gui.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index ec8d25e1..50779876 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -66,6 +66,7 @@ * threads: fixed #3085 (I hope ^^) * byob: fixed #3088 (I hope ^^) * blocks: include the (whole) current sprite in the "scripts pic" export if it is more than a single one +* gui: support directly importing an embedded sprite inside a smart costume ### 2022-07-30 * Greek translation update, thank you, HM100!! diff --git a/snap.html b/snap.html index b33e03bb..7d3c1122 100755 --- a/snap.html +++ b/snap.html @@ -20,7 +20,7 @@ - + diff --git a/src/gui.js b/src/gui.js index e3f63da6..21258f87 100644 --- a/src/gui.js +++ b/src/gui.js @@ -86,11 +86,11 @@ BlockVisibilityDialogMorph, ThreadManager, isString*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2022-July-22'; +modules.gui = '2022-July-31'; // Declarations -var SnapVersion = '8.0.0-rc-220722'; +var SnapVersion = '8.0.0-rc-220731'; var IDE_Morph; var ProjectDialogMorph; @@ -2508,7 +2508,7 @@ IDE_Morph.prototype.droppedImage = function (aCanvas, name, embeddedData, src) { isString(embeddedData) && ['scripts', 'palette', 'categories'].includes(src) && embeddedData[0] === '<' && - ['blocks', 'block', 'script'].some(tag => + ['blocks', 'block', 'script', 'sprite'].some(tag => embeddedData.slice(1).startsWith(tag)) ) { this.isImportingLocalFile = false; From 3a2bc2cc1b43e604e048d6ce89a5257613ce3379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sun, 31 Jul 2022 12:52:30 +0200 Subject: [PATCH 12/19] Update sw.js --- sw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw.js b/sw.js index 97f9841f..d95418fd 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -var snapVersion = '8.0.0-rc-220730', +var snapVersion = '8.0.0-rc-220731', cacheName = 'snap-pwa', filesToCache = [ 'snap.html', From 9afe325dc280834124e628c770126ded33979b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sun, 31 Jul 2022 21:21:20 +0200 Subject: [PATCH 13/19] fix #3088 (this time for real?) --- src/threads.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/threads.js b/src/threads.js index 5bd480d4..0a0ac007 100644 --- a/src/threads.js +++ b/src/threads.js @@ -1679,7 +1679,8 @@ Process.prototype.evaluateCustomBlock = function () { this.context.parentContext = runnable; // capture the runtime environment in "this script" - self = copy(runnable); + self = copy(context); + self.outerContext = outer; // passing parameters if any were passed if (parms.length > 0) { From a17f104d4d7f35a642fb0dd8a06402d30ed6ab02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 1 Aug 2022 11:22:44 +0200 Subject: [PATCH 14/19] include a representation of the stage as sprite in the "scripts pic" export if it is more than a single one --- HISTORY.md | 3 +++ snap.html | 6 ++--- src/blocks.js | 6 ++--- src/objects.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++++- src/store.js | 44 ++++++++++++++++++++++++++++++- 5 files changed, 121 insertions(+), 8 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 50779876..f165b879 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -62,6 +62,9 @@ * German * Greek, thank you, HM100! +### 2022-08-01 +* blocks, objects, store: include a representation of the stage as sprite in the "scripts pic" export if it is more than a single one + ### 2022-07-31 * threads: fixed #3085 (I hope ^^) * byob: fixed #3088 (I hope ^^) diff --git a/snap.html b/snap.html index 7d3c1122..f00288f3 100755 --- a/snap.html +++ b/snap.html @@ -16,9 +16,9 @@ - + - + @@ -30,7 +30,7 @@ - + diff --git a/src/blocks.js b/src/blocks.js index f5c931e9..3945e3b0 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -161,7 +161,7 @@ CostumeIconMorph, SoundIconMorph, SVG_Costume, embedMetadataPNG*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2022-July-31'; +modules.blocks = '2022-August-01'; var SyntaxElementMorph; var BlockMorph; @@ -8164,10 +8164,10 @@ ScriptsMorph.prototype.scriptsXML = function () { return scripts[0].toXMLString(); } target = this.scriptTarget(); - if (target instanceof SpriteMorph) { + if (isSnapObject(target)) { return target.toXMLString(); } - return null; // +++ for now + return null; }; ScriptsMorph.prototype.addComment = function () { diff --git a/src/objects.js b/src/objects.js index 7c021c64..7ac75ee9 100644 --- a/src/objects.js +++ b/src/objects.js @@ -94,7 +94,7 @@ embedMetadataPNG*/ /*jshint esversion: 6*/ -modules.objects = '2022-July-19'; +modules.objects = '2022-August-01'; var SpriteMorph; var StageMorph; @@ -10231,6 +10231,74 @@ StageMorph.prototype.globalBlocksSending = function (message, receiverName) { return all; }; +// StageMorph serialization & exporting utils + +StageMorph.prototype.toXMLString = function () { + // answer an xml string representation of this sprite and all parts + // attached to it, including all dependencies (global custom blocks). + var ide = this.parentThatIsA(IDE_Morph), + dependencies = [], + categories = [], + blocksXML = '', + conversion, + xml; + + function collect(item, array) { + // only once + if (!contains(array, item)) { + array.push(item); + } + } + + function collectAll(items, array) { + items.forEach(item => collect(item, array)); + } + + // collect all dependencies and custom categories. + // only collect global custom block dependencies, because the locals + // will be included in each sprite's serialization code + + // global block definition in scripts + this.scripts.children.filter( + morph => morph instanceof BlockMorph + ).forEach(script => + collectAll( + script.dependencies(true), + dependencies + ) + ); + + // global block definitions referenced in local block definitions + this.customBlocks.forEach(def => { + collect(def.category, categories); + collectAll( + def.collectDependencies([], [], this) + .filter(each => each.isGlobal), + dependencies + ); + }); + + // encode both parts of the export-file: + // the blocks library and the sprites + + if (dependencies.length || categories.length) { + blocksXML = ide.blocksLibraryXML(dependencies, categories); + } + + conversion = this.toXML; + this.toXML = this.toSpriteXML; + xml = '' + + blocksXML + + ide.serializer.serialize([this]) + + ''; + this.toXML = conversion; + return xml; +}; + // SpriteBubbleMorph //////////////////////////////////////////////////////// /* diff --git a/src/store.js b/src/store.js index 16cd6768..51f6c2f1 100644 --- a/src/store.js +++ b/src/store.js @@ -63,7 +63,7 @@ Project*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2022-April-26'; +modules.store = '2022-August-01'; // XML_Serializer /////////////////////////////////////////////////////// /* @@ -1892,6 +1892,48 @@ StageMorph.prototype.toXML = function (serializer) { ); }; +StageMorph.prototype.toSpriteXML = function (serializer) { + // special case: export the stage as a sprite, so it can be + // imported into another project or scene + var costumeIdx = this.getCostumeIdx(); + + return serializer.format( + '' + + '%' + // current costume + '%' + + '%' + + '%' + + '%' + + '%' + + '', + this.name, + this.volume, + this.pan, + this.instrument ? + ' instrument="' + parseInt(this.instrument) + '" ' : '', + costumeIdx, + + // current costume, if it's not in the wardrobe + !costumeIdx && this.costume ? + '' + serializer.store(this.costume) + '' + : '', + + serializer.store(this.costumes, this.name + '_cst'), + serializer.store(this.sounds, this.name + '_snd'), + !this.customBlocks ? '' : serializer.store(this.customBlocks), + serializer.store(this.variables), + serializer.store(this.scripts) + ); +}; + SpriteMorph.prototype.toXML = function (serializer) { var idx = serializer.scene.sprites.asArray().indexOf(this) + 1, costumeIdx = this.getCostumeIdx(), From 12b3dfa14c6a77c7774e09d35f6727e413b2540a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 1 Aug 2022 11:24:51 +0200 Subject: [PATCH 15/19] Update HISTORY.md --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index f165b879..f8aacb71 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -12,6 +12,7 @@ * export block definitions from inside the block editor * embed blocks into costume metadata to be shared as image file * exported script pics now always include the actual blocks, which can be extracted from the image inside Snap! + * exported scripts (!) pics now also always include either the actual blocks (if it's a single script), the block definition (if it's a block editor), or a sprite-representation of the current object (sprite or stage) * added green flag symbol to "when I receive" dropdown menu, support when clicking the green flag button in the IDE * added "combinations" primitive to the palette * new POSITION primitive reporter in the MOTION category From 4010d5e6a54b92eb17c4f6f2a5e1818402c8cb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 1 Aug 2022 11:42:32 +0200 Subject: [PATCH 16/19] removed some "under construction" markers --- HISTORY.md | 1 + snap.html | 4 ++-- src/blocks.js | 4 ++-- src/byob.js | 4 ++-- src/widgets.js | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f8aacb71..11048958 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -65,6 +65,7 @@ ### 2022-08-01 * blocks, objects, store: include a representation of the stage as sprite in the "scripts pic" export if it is more than a single one +* removed some "under construction" markers ### 2022-07-31 * threads: fixed #3085 (I hope ^^) diff --git a/snap.html b/snap.html index f00288f3..3d78f744 100755 --- a/snap.html +++ b/snap.html @@ -15,7 +15,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/src/blocks.js b/src/blocks.js index 3945e3b0..ee44f8f0 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -3358,7 +3358,7 @@ BlockMorph.prototype.userMenu = function () { } menu.addLine(); menu.addItem( - "script pic...", // +++ + "script pic...", () => { var ide = this.parentThatIsA(IDE_Morph) || this.parentThatIsA(BlockEditorMorph).target.parentThatIsA( @@ -8094,7 +8094,7 @@ ScriptsMorph.prototype.cleanUp = function () { target.adjustBounds(); }; -ScriptsMorph.prototype.exportScriptsPicture = function () { // +++ +ScriptsMorph.prototype.exportScriptsPicture = function () { var pic = this.scriptsPicture(), ide = this.world().children[0], xml = this.scriptsXML(); diff --git a/src/byob.js b/src/byob.js index 429fbb1e..5f1a015e 100644 --- a/src/byob.js +++ b/src/byob.js @@ -111,7 +111,7 @@ ArgLabelMorph, embedMetadataPNG*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2022-July-31'; +modules.byob = '2022-August-01'; // Declarations @@ -1352,7 +1352,7 @@ CustomCommandBlockMorph.prototype.userMenu = function () { if (this.isPrototype) { menu = new MenuMorph(this); menu.addItem( - "script pic...", // +++ + "script pic...", function () { var ide = this.world().children[0], top = this.topBlock(), diff --git a/src/widgets.js b/src/widgets.js index 99350d41..df7d7879 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -87,7 +87,7 @@ ScrollFrameMorph, MenuItemMorph, useBlurredShadows, getDocumentPositionOf*/ /*jshint esversion: 6*/ -modules.widgets = '2021-November-09'; +modules.widgets = '2022-August-01'; var PushButtonMorph; var ToggleButtonMorph; @@ -1909,7 +1909,7 @@ DialogBoxMorph.prototype.promptRGB = function ( rInp = new InputFieldMorph(color.r.toString(), true), gInp = new InputFieldMorph(color.g.toString(), true), bInp = new InputFieldMorph(color.b.toString(), true), - rCol = new AlignmentMorph('column', 2),// +++ + rCol = new AlignmentMorph('column', 2), gCol = new AlignmentMorph('column', 2), bCol = new AlignmentMorph('column', 2), inp = new AlignmentMorph('column', 2), @@ -1956,7 +1956,7 @@ DialogBoxMorph.prototype.promptRGB = function ( gCol.add(labelText('green')); gCol.add(gInp); bCol.add(labelText('blue')); - bCol.add(bInp); // +++ + bCol.add(bInp); clr.add(rCol); clr.add(gCol); clr.add(bCol); From f916c30f02f51dee83ec7bf9c06096724a6986bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 1 Aug 2022 11:46:06 +0200 Subject: [PATCH 17/19] new release candidate version --- HISTORY.md | 1 + snap.html | 2 +- src/gui.js | 4 ++-- sw.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 11048958..daa92392 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -66,6 +66,7 @@ ### 2022-08-01 * blocks, objects, store: include a representation of the stage as sprite in the "scripts pic" export if it is more than a single one * removed some "under construction" markers +* new release candidate version ### 2022-07-31 * threads: fixed #3085 (I hope ^^) diff --git a/snap.html b/snap.html index 3d78f744..5b9d9ab2 100755 --- a/snap.html +++ b/snap.html @@ -20,7 +20,7 @@ - + diff --git a/src/gui.js b/src/gui.js index 21258f87..007ecae4 100644 --- a/src/gui.js +++ b/src/gui.js @@ -86,11 +86,11 @@ BlockVisibilityDialogMorph, ThreadManager, isString*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2022-July-31'; +modules.gui = '2022-August-01'; // Declarations -var SnapVersion = '8.0.0-rc-220731'; +var SnapVersion = '8.0.0-rc-220801'; var IDE_Morph; var ProjectDialogMorph; diff --git a/sw.js b/sw.js index d95418fd..039babbf 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -var snapVersion = '8.0.0-rc-220731', +var snapVersion = '8.0.0-rc-220801', cacheName = 'snap-pwa', filesToCache = [ 'snap.html', From 9c0d797582e2845d407dd718153876a34aca9f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 1 Aug 2022 12:08:08 +0200 Subject: [PATCH 18/19] fixed an error display glitch --- HISTORY.md | 1 + src/threads.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index daa92392..f77551be 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -67,6 +67,7 @@ * blocks, objects, store: include a representation of the stage as sprite in the "scripts pic" export if it is more than a single one * removed some "under construction" markers * new release candidate version +* threads: fixed an error display glitch ### 2022-07-31 * threads: fixed #3085 (I hope ^^) diff --git a/src/threads.js b/src/threads.js index 0a0ac007..538e61af 100644 --- a/src/threads.js +++ b/src/threads.js @@ -65,7 +65,7 @@ StagePickerMorph, CustomBlockDefinition*/ /*jshint esversion: 11, bitwise: false, evil: true*/ -modules.threads = '2022-July-31'; +modules.threads = '2022-August-01'; var ThreadManager; var Process; @@ -1242,7 +1242,7 @@ Process.prototype.errorBubble = function (error, element) { if (errorIsNested && error.cause !== 'user') { if (blockToShow.selector === 'reportGetVar') { // if I am a single variable, show my caller in the output. - blockToShow = blockToShow.parent; + blockToShow = blockToShow.parent || blockToShow; } errorMorph.children[0].text += `\n${localize('The question came up at')}`; errorMorph.children[0].fixLayout(); From 97c3e8ee39bc49d40e5fb1a644bf8b99971e7f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 1 Aug 2022 12:15:26 +0200 Subject: [PATCH 19/19] new release candidate version --- HISTORY.md | 1 + snap.html | 2 +- src/gui.js | 2 +- sw.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f77551be..4039bad1 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -68,6 +68,7 @@ * removed some "under construction" markers * new release candidate version * threads: fixed an error display glitch +* new release candidate version ### 2022-07-31 * threads: fixed #3085 (I hope ^^) diff --git a/snap.html b/snap.html index 5b9d9ab2..d64488c8 100755 --- a/snap.html +++ b/snap.html @@ -17,7 +17,7 @@ - + diff --git a/src/gui.js b/src/gui.js index 007ecae4..3a4581de 100644 --- a/src/gui.js +++ b/src/gui.js @@ -90,7 +90,7 @@ modules.gui = '2022-August-01'; // Declarations -var SnapVersion = '8.0.0-rc-220801'; +var SnapVersion = '8.0.0-rc-220801-2'; var IDE_Morph; var ProjectDialogMorph; diff --git a/sw.js b/sw.js index 039babbf..3da9d756 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -var snapVersion = '8.0.0-rc-220801', +var snapVersion = '8.0.0-rc-220801-2', cacheName = 'snap-pwa', filesToCache = [ 'snap.html',