From f308c23824fcb48e25d2296ddc44a3ab4bcbef64 Mon Sep 17 00:00:00 2001 From: tonychenr Date: Tue, 7 Oct 2014 19:15:08 -0700 Subject: Fixed range 1 slider bug issue # 301 --- morphic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morphic.js b/morphic.js index 4e18482..b19d390 100644 --- a/morphic.js +++ b/morphic.js @@ -5754,7 +5754,7 @@ SliderMorph.prototype.rangeSize = function () { }; SliderMorph.prototype.ratio = function () { - return this.size / this.rangeSize(); + return this.size / (this.rangeSize() + 1); }; SliderMorph.prototype.unitSize = function () { -- cgit v1.3.1 From dda2d48f16ae56a139cad8feeb8172c3a54b182f Mon Sep 17 00:00:00 2001 From: Manuel Menezes de Sequeira Date: Tue, 14 Oct 2014 17:58:57 +0100 Subject: add localization to unknown variable error --- threads.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/threads.js b/threads.js index 6a59f3c..086ffcb 100644 --- a/threads.js +++ b/threads.js @@ -3003,9 +3003,9 @@ VariableFrame.prototype.find = function (name) { var frame = this.silentFind(name); if (frame) {return frame; } throw new Error( - 'a variable of name \'' + localize('a variable of name \'') + name - + '\'\ndoes not exist in this context' + + localize('\'\ndoes not exist in this context') ); }; @@ -3070,9 +3070,9 @@ VariableFrame.prototype.getVar = function (name) { return ''; } throw new Error( - 'a variable of name \'' + localize('a variable of name \'') + name - + '\'\ndoes not exist in this context' + + localize('\'\ndoes not exist in this context') ); }; -- cgit v1.3.1 From dc805a9012d66cc906301ae5c63fc96b15e6dd12 Mon Sep 17 00:00:00 2001 From: Manuel Menezes de Sequeira Date: Tue, 14 Oct 2014 18:00:35 +0100 Subject: correct translation of 'unshare'; add new translations --- lang-pt.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lang-pt.js b/lang-pt.js index cd3b5fe..79303a7 100755 --- a/lang-pt.js +++ b/lang-pt.js @@ -1616,7 +1616,7 @@ SnapTranslator.dict.pt = { 'unshared.': 'deixado de partilhar.', 'Unshare': - 'Deixar de Partilhar', + 'Não Partilhar', 'password has been changed.': 'a sua palavra-passe foi alterada.', 'SVG costumes are\nnot yet fully supported\nin every browser': @@ -1641,6 +1641,12 @@ SnapTranslator.dict.pt = { 'Seleccionar um traje da biblioteca de média.', 'edit rotation point only...': 'editar apenas ponto de rotação…', + 'Export Project As...': + 'Exportar Projecto Como…', + 'a variable of name \'': + 'não existe uma variável «', + '\'\ndoes not exist in this context': + '»\nneste contexto', // produção de código 'map %cmdRing to %codeKind %code': -- cgit v1.3.1 From 413e6a0e6a884ef9811221a3f92353f1d3fa6544 Mon Sep 17 00:00:00 2001 From: natashasandy Date: Tue, 21 Oct 2014 18:03:15 -0700 Subject: Fixed percent symbols in custom blocks This fixes issue #476 --- byob.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/byob.js b/byob.js index 1277bb6..71b3298 100644 --- a/byob.js +++ b/byob.js @@ -688,7 +688,8 @@ CustomCommandBlockMorph.prototype.labelPart = function (spec) { return CustomCommandBlockMorph.uber.labelPart.call(this, spec); } if ((spec[0] === '%') && (spec.length > 1)) { - part = new BlockInputFragmentMorph(spec.slice(1)); + var label = spec.replace(/%/g, ''); + part = new BlockInputFragmentMorph(label); } else { part = new BlockLabelFragmentMorph(spec); part.fontSize = this.fontSize; -- cgit v1.3.1 From 0dcca0606c3ae570110614d0dd94d6a38255100f Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 27 Oct 2014 18:19:29 -0700 Subject: Set Default Save location to Cloud on Snap! load When Snap! is loaded, Snap! will now check whether a user is logged in (via the presence of `SnapCloud.username`) and if so, the default save location will be the cloud. --- gui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui.js b/gui.js index 04481cc..bb440b1 100644 --- a/gui.js +++ b/gui.js @@ -190,7 +190,7 @@ IDE_Morph.prototype.init = function (isAutoFill) { // additional properties: this.cloudMsg = null; - this.source = 'local'; + this.source = SnapCloud.username ? 'cloud' : 'local'; this.serializer = new SnapSerializer(); this.globalVariables = new VariableFrame(); -- cgit v1.3.1 From 7b96be6c40fac46bb53752531f24878425eb9330 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 6 Nov 2014 17:03:51 +0100 Subject: enable mouseMove events with right button pressed to support user interactions in 3D environments, such as CAD systems or Beetleblocks --- morphic.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/morphic.js b/morphic.js index 4e18482..0115c82 100644 --- a/morphic.js +++ b/morphic.js @@ -464,9 +464,15 @@ MyMorph.prototype.mouseMove = function(pos) {}; - The only optional parameter of such a method is a Point object + All of these methods have as optional parameter a Point object indicating the current position of the Hand inside the World's - coordinate system. + coordinate system. The + + mouseMove(pos, button) + + event method has an additional optional parameter indicating the + currently pressed mouse button, which is either 'left' or 'right'. + You can use this to let users interact with 3D environments. Events may be "bubbled" up a morph's owner chain by calling @@ -1035,7 +1041,7 @@ /*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio, FileList, getBlurredShadowSupport*/ -var morphicVersion = '2014-September-30'; +var morphicVersion = '2014-November-06'; var modules = {}; // keep track of additional loaded modules var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug @@ -9346,11 +9352,11 @@ HandMorph.prototype.init = function (aWorld) { this.world = aWorld; this.mouseButton = null; this.mouseOverList = []; - this.mouseDownMorph = null; this.morphToGrab = null; this.grabOrigin = null; this.temporaries = []; this.touchHoldTimeout = null; + this.contextMenuEnabled = false; }; HandMorph.prototype.changed = function () { @@ -9494,9 +9500,10 @@ HandMorph.prototype.drop = function () { */ HandMorph.prototype.processMouseDown = function (event) { - var morph, expectedClick, actualClick; + var morph, actualClick; this.destroyTemporaries(); + this.contextMenuEnabled = true; this.morphToGrab = null; if (this.children.length !== 0) { this.drop(); @@ -9529,15 +9536,9 @@ HandMorph.prototype.processMouseDown = function (event) { if (event.button === 2 || event.ctrlKey) { this.mouseButton = 'right'; actualClick = 'mouseDownRight'; - expectedClick = 'mouseClickRight'; } else { this.mouseButton = 'left'; actualClick = 'mouseDownLeft'; - expectedClick = 'mouseClickLeft'; - } - this.mouseDownMorph = morph; - while (!this.mouseDownMorph[expectedClick]) { - this.mouseDownMorph = this.mouseDownMorph.parent; } while (!morph[actualClick]) { morph = morph.parent; @@ -9596,7 +9597,7 @@ HandMorph.prototype.processMouseUp = function () { expectedClick = 'mouseClickLeft'; } else { expectedClick = 'mouseClickRight'; - if (this.mouseButton) { + if (this.mouseButton && this.contextMenuEnabled) { context = morph; contextMenu = context.contextMenu(); while ((!contextMenu) && @@ -9654,16 +9655,18 @@ HandMorph.prototype.processMouseMove = function (event) { // mouseOverNew = this.allMorphsAtPointer(); mouseOverNew = this.morphAtPointer().allParents(); - if ((this.children.length === 0) && - (this.mouseButton === 'left')) { + if (!this.children.length && this.mouseButton) { topMorph = this.morphAtPointer(); morph = topMorph.rootForGrab(); if (topMorph.mouseMove) { - topMorph.mouseMove(pos); + topMorph.mouseMove(pos, this.mouseButton); + if (this.mouseButton === 'right') { + this.contextMenuEnabled = false; + } } // if a morph is marked for grabbing, just grab it - if (this.morphToGrab) { + if (this.mouseButton === 'left' && this.morphToGrab) { if (this.morphToGrab.isDraggable) { morph = this.morphToGrab; this.grab(morph); -- cgit v1.3.1 From b36a358173fcf4f2a4a77a9c202d6dc0d6c1a7b8 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Fri, 14 Nov 2014 12:49:01 +0100 Subject: Fix reporting out of nested custom C-shaped blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit REPORT now reports to the nearest lexical element expecting an input (which may not be the block holding the REPORT statement, this lets you REPORT out of nested FOR loops). STOP THIS BLOCK behaves as it used to. If you’ve been using REPORT instead of STOP THIS BLOCK, you should migrate. --- history.txt | 8 +++ store.js | 5 +- threads.js | 170 ++++++++++++++++++++++++------------------------------------ 3 files changed, 77 insertions(+), 106 deletions(-) diff --git a/history.txt b/history.txt index 28116b9..b3bc7da 100755 --- a/history.txt +++ b/history.txt @@ -2309,3 +2309,11 @@ ______ 141008 ------ * Objects: fixed #608, #610 + +141106 +------ +* Morphic: Enable mouseMove events with right button pressed + +141114 +------ +* Threads, Store: Fix reporting out of nested custom C-shaped blocks diff --git a/store.js b/store.js index cb91139..bc24849 100644 --- a/store.js +++ b/store.js @@ -61,7 +61,7 @@ SyntaxElementMorph, Variable*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2014-October-01'; +modules.store = '2014-November-14'; // XML_Serializer /////////////////////////////////////////////////////// @@ -1824,9 +1824,8 @@ Context.prototype.toXML = function (serializer) { return ''; } return serializer.format( - '%%' + + '%%' + '%%%', - this.isLambda ? ' lambda="lambda"' : '', this.inputs.reduce( function (xml, input) { return xml + serializer.format('$', input); diff --git a/threads.js b/threads.js index 6a59f3c..dfa335e 100644 --- a/threads.js +++ b/threads.js @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-October-01'; +modules.threads = '2014-November-15'; var ThreadManager; var Process; @@ -586,7 +586,6 @@ Process.prototype.evaluateInput = function (input) { ) || (input instanceof CSlotMorph && !input.isStatic)) { // I know, this still needs yet to be done right.... ans = this.reify(ans, new List()); - ans.isImplicitLambda = true; } } } @@ -597,8 +596,6 @@ Process.prototype.evaluateInput = function (input) { Process.prototype.evaluateSequence = function (arr) { var pc = this.context.pc, outer = this.context.outerContext, - isLambda = this.context.isLambda, - isImplicitLambda = this.context.isImplicitLambda, isCustomBlock = this.context.isCustomBlock; if (pc === (arr.length - 1)) { // tail call elimination this.context = new Context( @@ -607,8 +604,6 @@ Process.prototype.evaluateSequence = function (arr) { this.context.outerContext, this.context.receiver ); - this.context.isLambda = isLambda; - this.context.isImplicitLambda = isImplicitLambda; this.context.isCustomBlock = isCustomBlock; } else { if (pc >= arr.length) { @@ -626,8 +621,8 @@ Process.prototype.evaluateSequence = function (arr) { Caution: we cannot just revert to this version of the method, because to make tail call elimination work many tweaks had to be done to various primitives. For the most part these tweaks are about schlepping the outer context (for -the variable bindings) and the isLambda flag along, and are indicated by a -short comment in the code. But to really revert would take a good measure +the variable bindings) and the isCustomBlock flag along, and are indicated +by a short comment in the code. But to really revert would take a good measure of trial and error as well as debugging. In the developers file archive there is a version of threads.js dated 120119(2) which basically resembles the last version before introducing tail call optimization on 120123. @@ -679,6 +674,11 @@ Process.prototype.doYield = function () { } }; +Process.prototype.exitReporter = function () { + // catch-tag for REPORT and STOP BLOCK primitives + this.popContext(); +}; + // Process Exception Handling Process.prototype.handleError = function (error, element) { @@ -757,9 +757,15 @@ Process.prototype.reportJSFunction = function (parmNames, body) { ); }; +/* Process.prototype.doRun = function (context, args, isCustomBlock) { return this.evaluate(context, args, true, isCustomBlock); }; +*/ + +Process.prototype.doRun = function (context, args) { + return this.evaluate(context, args, true); +}; Process.prototype.evaluate = function ( context, @@ -783,6 +789,7 @@ Process.prototype.evaluate = function ( var outer = new Context(null, null, context.outerContext), runnable, extra, + exit, parms = args.asArray(), i, value; @@ -798,23 +805,17 @@ Process.prototype.evaluate = function ( ); extra = new Context(runnable, 'doYield'); - /* - Note: if the context's expression is a ReporterBlockMorph, - the extra context gets popped off immediately without taking - effect (i.e. it doesn't yield within evaluating a stack of - nested reporters) - */ + // Note: if the context's expression is a ReporterBlockMorph, + // the extra context gets popped off immediately without taking + // effect (i.e. it doesn't yield within evaluating a stack of + // nested reporters) - if (isCommand || (context.expression instanceof ReporterBlockMorph)) { + if (context.expression instanceof ReporterBlockMorph) { this.context.parentContext = extra; } else { this.context.parentContext = runnable; } - runnable.isLambda = true; - runnable.isImplicitLambda = context.isImplicitLambda; - runnable.isCustomBlock = false; - // assign parameters if any were passed if (parms.length > 0) { @@ -858,6 +859,18 @@ Process.prototype.evaluate = function ( if (runnable.expression instanceof CommandBlockMorph) { runnable.expression = runnable.expression.blockSequence(); + + // insert a reporter exit tag for the + // CALL SCRIPT primitive variant + if (!isCommand) { + exit = new Context( + runnable.parentContext, + 'exitReporter', + outer, + outer.receiver + ); + runnable.parentContext = exit; + } } }; @@ -879,8 +892,6 @@ Process.prototype.fork = function (context, args) { stage = this.homeContext.receiver.parentThatIsA(StageMorph), proc = new Process(); - runnable.isLambda = true; - // assign parameters if any were passed if (parms.length > 0) { @@ -933,68 +944,39 @@ Process.prototype.fork = function (context, args) { stage.threads.processes.push(proc); }; -Process.prototype.doReport = function (value, isCSlot) { - while (this.context && !this.context.isLambda) { +Process.prototype.doReport = function (value) { + while (this.context && this.context.expression !== 'exitReporter') { if (this.context.expression === 'doStopWarping') { this.doStopWarping(); } else { this.popContext(); } } - if (this.context && this.context.isImplicitLambda) { + return value; +}; + +Process.prototype.doStopBlock = function () { + while (this.context && !this.context.isCustomBlock) { if (this.context.expression === 'doStopWarping') { this.doStopWarping(); } else { this.popContext(); } - return this.doReport(value, true); - } - if (this.context && this.context.isCustomBlock) { - // now I'm back at the custom block sequence. - // advance my pc to my expression's length - this.context.pc = this.context.expression.length - 1; - } - if (isCSlot) { - if (this.context && - this.context.parentContext && - this.context.parentContext.expression instanceof Array) { - this.popContext(); - } } - return value; -}; - -Process.prototype.doStopBlock = function () { - this.doReport(); }; -// Process evaluation variants, commented out for now (redundant) - -/* -Process.prototype.doRunWithInputList = function (context, args) { - // provide an extra selector for the palette - return this.doRun(context, args); -}; - -Process.prototype.evaluateWithInputList = function (context, args) { - // provide an extra selector for the palette - return this.evaluate(context, args); -}; - -Process.prototype.forkWithInputList = function (context, args) { - // provide an extra selector for the palette - return this.fork(context, args); -}; -*/ - // Process continuations primitives -Process.prototype.doCallCC = function (aContext) { - this.evaluate(aContext, new List([this.context.continuation()])); +Process.prototype.doCallCC = function (aContext, isReporter) { + this.evaluate( + aContext, + new List([this.context.continuation()]), + !isReporter + ); }; Process.prototype.reportCallCC = function (aContext) { - this.doCallCC(aContext); + this.doCallCC(aContext, true); }; Process.prototype.runContinuation = function (aContext, args) { @@ -1017,6 +999,7 @@ Process.prototype.evaluateCustomBlock = function () { args = new List(this.context.inputs), parms = args.asArray(), runnable, + exit, extra, i, value, @@ -1024,7 +1007,7 @@ Process.prototype.evaluateCustomBlock = function () { if (!context) {return null; } outer = new Context(); - outer.receiver = this.context.receiver; // || this.homeContext.receiver; + outer.receiver = this.context.receiver; outer.variables.parentFrame = outer.receiver ? outer.receiver.variables : null; @@ -1032,16 +1015,12 @@ Process.prototype.evaluateCustomBlock = function () { this.context.parentContext, context.expression, outer, - outer.receiver, - true // is custom block + outer.receiver ); + runnable.isCustomBlock = true; extra = new Context(runnable, 'doYield'); - this.context.parentContext = extra; - runnable.isLambda = true; - runnable.isCustomBlock = true; - // passing parameters if any were passed if (parms.length > 0) { @@ -1064,6 +1043,18 @@ Process.prototype.evaluateCustomBlock = function () { if (runnable.expression instanceof CommandBlockMorph) { runnable.expression = runnable.expression.blockSequence(); + + // insert a reporter exit tag for the + // CALL SCRIPT primitive variant + if (this.context.expression.definition.type !== 'command') { + exit = new Context( + runnable.parentContext, + 'exitReporter', + outer, + outer.receiver + ); + runnable.parentContext = exit; + } } }; @@ -1308,16 +1299,12 @@ Process.prototype.reportListContainsItem = function (list, element) { Process.prototype.doIf = function () { var args = this.context.inputs, outer = this.context.outerContext, // for tail call elimination - isLambda = this.context.isLambda, - isImplicitLambda = this.context.isImplicitLambda, isCustomBlock = this.context.isCustomBlock; this.popContext(); if (args[0]) { if (args[1]) { this.pushContext(args[1].blockSequence(), outer); - this.context.isLambda = isLambda; - this.context.isImplicitLambda = isImplicitLambda; this.context.isCustomBlock = isCustomBlock; } } @@ -1327,8 +1314,6 @@ Process.prototype.doIf = function () { Process.prototype.doIfElse = function () { var args = this.context.inputs, outer = this.context.outerContext, // for tail call elimination - isLambda = this.context.isLambda, - isImplicitLambda = this.context.isImplicitLambda, isCustomBlock = this.context.isCustomBlock; this.popContext(); @@ -1344,8 +1329,6 @@ Process.prototype.doIfElse = function () { } } if (this.context) { - this.context.isLambda = isLambda; - this.context.isImplicitLambda = isImplicitLambda; this.context.isCustomBlock = isCustomBlock; } @@ -1420,8 +1403,6 @@ Process.prototype.doStopOthers = function (choice) { Process.prototype.doWarp = function (body) { // execute my contents block atomically (more or less) var outer = this.context.outerContext, // for tail call elimination - isLambda = this.context.isLambda, - isImplicitLambda = this.context.isImplicitLambda, isCustomBlock = this.context.isCustomBlock, stage; @@ -1438,13 +1419,8 @@ Process.prototype.doWarp = function (body) { stage.fps = 0; // variable frame rate } } - this.pushContext('doYield'); - - this.context.isLambda = isLambda; - this.context.isImplicitLambda = isImplicitLambda; this.context.isCustomBlock = isCustomBlock; - if (!this.isAtomic) { this.pushContext('doStopWarping'); } @@ -1523,28 +1499,19 @@ Process.prototype.doForever = function (body) { Process.prototype.doRepeat = function (counter, body) { var block = this.context.expression, outer = this.context.outerContext, // for tail call elimination - isLambda = this.context.isLambda, - isImplicitLambda = this.context.isImplicitLambda, isCustomBlock = this.context.isCustomBlock; if (counter < 1) { // was '=== 0', which caused infinite loops on non-ints return null; } this.popContext(); - this.pushContext(block, outer); - - this.context.isLambda = isLambda; - this.context.isImplicitLambda = isImplicitLambda; this.context.isCustomBlock = isCustomBlock; - this.context.addInput(counter - 1); - this.pushContext('doYield'); if (body) { this.pushContext(body.blockSequence()); } - this.pushContext(); }; @@ -2775,8 +2742,6 @@ Process.prototype.reportFrameCount = function () { startValue initial value for interpolated operations activeAudio audio buffer for interpolated operations, don't persist activeNote audio oscillator for interpolated ops, don't persist - isLambda marker for return ops - isImplicitLambda marker for return ops isCustomBlock marker for return ops emptySlots caches the number of empty slots for reification */ @@ -2801,22 +2766,18 @@ function Context( this.startTime = null; this.activeAudio = null; this.activeNote = null; - this.isLambda = false; // marks the end of a lambda - this.isImplicitLambda = false; // marks the end of a C-shaped slot this.isCustomBlock = false; // marks the end of a custom block's stack this.emptySlots = 0; // used for block reification } Context.prototype.toString = function () { - var pref = this.isLambda ? '\u03BB-' : '', - expr = this.expression; - + var expr = this.expression; if (expr instanceof Array) { if (expr.length > 0) { expr = '[' + expr[0] + ']'; } } - return pref + 'Context >> ' + expr + ' ' + this.variables; + return 'Context >> ' + expr + ' ' + this.variables; }; Context.prototype.image = function () { @@ -2872,6 +2833,9 @@ Context.prototype.continuation = function () { } else { return new Context(null, 'doStop'); } + if (cont.expression === 'exitReporter') { + return cont.continuation(); + } cont = cont.copyForContinuation(); cont.isContinuation = true; return cont; -- cgit v1.3.1 From ea05f7859fe5a042f0c0dd49b189c594b9a798d3 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 17 Nov 2014 10:22:39 +0100 Subject: Treat REPORT blocks inside custom command definitions as STOP THIS BLOCK / IGNORE INPUTS this also enables all existing FINCH blocks and other hardware extensions again, which used the REPORT (HTTP://) pattern --- blocks.js | 33 +++++++++++++++++++++++++-------- history.txt | 4 ++++ threads.js | 12 +++++++++--- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/blocks.js b/blocks.js index 73ef884..82ef601 100644 --- a/blocks.js +++ b/blocks.js @@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2014-October-01'; +modules.blocks = '2014-November-17'; var SyntaxElementMorph; @@ -394,10 +394,8 @@ SyntaxElementMorph.prototype.allInputs = function () { }; SyntaxElementMorph.prototype.allEmptySlots = function () { -/* - answer empty input slots of all children excluding myself, - but omit those in nested rings (lambdas) and JS-Function primitives -*/ + // answer empty input slots of all children excluding myself, + // but omit those in nested rings (lambdas) and JS-Function primitives var empty = []; if (!(this instanceof RingMorph) && (this.selector !== 'reportJSFunction')) { @@ -412,6 +410,21 @@ SyntaxElementMorph.prototype.allEmptySlots = function () { return empty; }; +SyntaxElementMorph.prototype.allReportBlocks = function () { + // answer report blocks of all children including myself, + // but omit those in nested rings (lambdas) + if (this.selector === 'doReport') {return [this]; } + var reports = []; + if (!(this instanceof RingMorph)) { + this.children.forEach(function (morph) { + if (morph.allReportBlocks) { + reports = reports.concat(morph.allReportBlocks()); + } + }); + } + return reports; +}; + SyntaxElementMorph.prototype.replaceInput = function (oldArg, newArg) { var scripts = this.parentThatIsA(ScriptsMorph), replacement = newArg, @@ -3169,9 +3182,13 @@ BlockMorph.prototype.snap = function () { I inherit from BlockMorph adding the following most important public accessors: - nextBlock() - set / get the block attached to my bottom - bottomBlock() - answer the bottom block of my stack - blockSequence() - answer an array of blocks starting with myself + nextBlock() - set / get the block attached to my bottom + bottomBlock() - answer the bottom block of my stack + blockSequence() - answer an array of blocks starting with myself + + and the following "lexical awareness" indicator: + + partOfCustomCommand - temporary bool set by the evaluator */ // CommandBlockMorph inherits from BlockMorph: diff --git a/history.txt b/history.txt index b3bc7da..88d7ca4 100755 --- a/history.txt +++ b/history.txt @@ -2317,3 +2317,7 @@ ______ 141114 ------ * Threads, Store: Fix reporting out of nested custom C-shaped blocks + +141117 +------ +* Threads, Blocks: Treat REPORT blocks inside custom command definitions as STOP THIS BLOCK / IGNORE INPUTS diff --git a/threads.js b/threads.js index dfa335e..cf97362 100644 --- a/threads.js +++ b/threads.js @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-November-15'; +modules.threads = '2014-November-17'; var ThreadManager; var Process; @@ -945,6 +945,9 @@ Process.prototype.fork = function (context, args) { }; Process.prototype.doReport = function (value) { + if (this.context.expression.partOfCustomCommand) { + return this.doStopBlock(); + } while (this.context && this.context.expression !== 'exitReporter') { if (this.context.expression === 'doStopWarping') { this.doStopWarping(); @@ -1042,8 +1045,6 @@ Process.prototype.evaluateCustomBlock = function () { } if (runnable.expression instanceof CommandBlockMorph) { - runnable.expression = runnable.expression.blockSequence(); - // insert a reporter exit tag for the // CALL SCRIPT primitive variant if (this.context.expression.definition.type !== 'command') { @@ -1054,7 +1055,12 @@ Process.prototype.evaluateCustomBlock = function () { outer.receiver ); runnable.parentContext = exit; + } else { // mark all REPORT blocks as being part of a custom command + runnable.expression.allReportBlocks().forEach(function (rb) { + rb.partOfCustomCommand = true; + }); } + runnable.expression = runnable.expression.blockSequence(); } }; -- cgit v1.3.1 From f537f62ace4092e1f46d0ca54577ea8810e7510a Mon Sep 17 00:00:00 2001 From: Bernat Romagosa Date: Mon, 17 Nov 2014 14:05:13 +0100 Subject: Added callback to Process --- threads.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/threads.js b/threads.js index cf97362..4592e92 100644 --- a/threads.js +++ b/threads.js @@ -136,7 +136,8 @@ ThreadManager.prototype.toggleProcess = function (block) { ThreadManager.prototype.startProcess = function ( block, isThreadSafe, - exportResult + exportResult, + callback ) { var active = this.findProcess(block), top = block.topBlock(), @@ -149,7 +150,7 @@ ThreadManager.prototype.startProcess = function ( this.removeTerminatedProcesses(); } top.addHighlight(); - newProc = new Process(block.topBlock()); + newProc = new Process(block.topBlock(), callback); newProc.exportResult = exportResult; this.processes.push(newProc); return newProc; @@ -314,6 +315,7 @@ ThreadManager.prototype.findProcess = function (block) { and when the process was paused exportResult boolean flag indicating whether a picture of the top block along with the result bubble shoud be exported + callback a function to be executed when the process is done */ Process.prototype = {}; @@ -321,7 +323,7 @@ Process.prototype.contructor = Process; Process.prototype.timeout = 500; // msecs after which to force yield Process.prototype.isCatchingErrors = true; -function Process(topBlock) { +function Process(topBlock, callback) { this.topBlock = topBlock || null; this.readyToYield = false; @@ -338,6 +340,7 @@ function Process(topBlock) { this.pauseOffset = null; this.frameCount = 0; this.exportResult = false; + this.callback = callback; if (topBlock) { this.homeContext.receiver = topBlock.receiver(); @@ -435,8 +438,8 @@ Process.prototype.pauseStep = function () { Process.prototype.evaluateContext = function () { var exp = this.context.expression; - this.frameCount += 1; + if (exp instanceof Array) { return this.evaluateSequence(exp); } @@ -476,9 +479,9 @@ Process.prototype.evaluateBlock = function (block, argCount) { } if (this.isCatchingErrors) { try { - this.returnValueToParentContext( - rcvr[block.selector].apply(rcvr, inputs) - ); + var result = rcvr[block.selector].apply(rcvr, inputs); + if (this.callback) { this.callback(result) }; + this.returnValueToParentContext(result); this.popContext(); } catch (error) { this.handleError(error, block); -- cgit v1.3.1 From 8e992dcaa877044a2b2f15edf86c003f4df7253c Mon Sep 17 00:00:00 2001 From: Manuel Menezes de Sequeira Date: Tue, 18 Nov 2014 18:11:14 +0000 Subject: Add localization to number of arguments error and temporary watchers --- threads.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/threads.js b/threads.js index 086ffcb..d194220 100644 --- a/threads.js +++ b/threads.js @@ -849,8 +849,8 @@ Process.prototype.evaluate = function ( } else if (context.emptySlots !== 1) { throw new Error( - 'expecting ' + context.emptySlots + ' input(s), ' - + 'but getting ' + parms.length + localize('expecting') + ' ' + context.emptySlots + ' ' + + localize('input(s), but getting') + ' ' + parms.length ); } } @@ -915,8 +915,8 @@ Process.prototype.fork = function (context, args) { } else if (context.emptySlots !== 1) { throw new Error( - 'expecting ' + context.emptySlots + ' input(s), ' - + 'but getting ' + parms.length + localize('expecting') + ' ' + context.emptySlots + ' ' + + localize('input(s), but getting') + ' ' + parms.length ); } } @@ -1148,7 +1148,7 @@ Process.prototype.doShowVar = function (varName) { if (isGlobal || target.owner) { label = name; } else { - label = name + ' (temporary)'; + label = name + ' ' + localize('(temporary)'); } watcher = new WatcherMorph( label, -- cgit v1.3.1 From 522dfba12fd609e708cb568c6d0cc918169affb1 Mon Sep 17 00:00:00 2001 From: Manuel Menezes de Sequeira Date: Tue, 18 Nov 2014 18:12:43 +0000 Subject: Correct import translation and add a few missing translations. --- lang-pt.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lang-pt.js b/lang-pt.js index 79303a7..2d3804a 100755 --- a/lang-pt.js +++ b/lang-pt.js @@ -650,11 +650,12 @@ SnapTranslator.dict.pt = { 'Save As...': 'Guardar este projecto como…', 'Import...': - 'Importar para este projecto…', + 'Importar…', 'file menu import hint': - 'Importar para este projecto\num projecto exportado,\n' - + 'uma biblioteca de blocos,\n' - + 'um traje ou um som.', + 'Abrir um projecto exportado,\n' + + 'substitundo o projecto corrente, ou\n' + + 'importar uma biblioteca de blocos, um\n' + + 'traje ou um som para o projecto corrente.', 'Export project as plain text...': 'Exportar este projecto como texto simples…', 'Export project...': @@ -1647,6 +1648,12 @@ SnapTranslator.dict.pt = { 'não existe uma variável «', '\'\ndoes not exist in this context': '»\nneste contexto', + '(temporary)': + '(temporária)', + 'expecting': + 'esperavam-se', + 'input(s), but getting': + 'argumento(s), mas foram passados', // produção de código 'map %cmdRing to %codeKind %code': -- cgit v1.3.1 From 51ee69b7df3f27e69fdf98545d57a5fa67c1ec27 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Tue, 18 Nov 2014 17:30:41 -0800 Subject: update tools with Brain's ignore block --- tools.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools.xml b/tools.xml index 25336c9..e05d7bb 100644 --- a/tools.xml +++ b/tools.xml @@ -1 +1 @@ -
1datamapmany1data lists
1
1
110i
1
cont
catchtag
cont
catchtag
\ No newline at end of file +
1datamapmany1data lists
1
1
110i
1
cont
catchtag
cont
catchtag
\ No newline at end of file -- cgit v1.3.1 From 91690adb29633368ec458ca510086c3b17e0490f Mon Sep 17 00:00:00 2001 From: Bernat Romagosa Date: Wed, 19 Nov 2014 09:34:59 +0100 Subject: callback is only executed when the outmost block returns a value --- threads.js | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/threads.js b/threads.js index 4592e92..4522d35 100644 --- a/threads.js +++ b/threads.js @@ -137,7 +137,7 @@ ThreadManager.prototype.startProcess = function ( block, isThreadSafe, exportResult, - callback + callback ) { var active = this.findProcess(block), top = block.topBlock(), @@ -236,18 +236,22 @@ ThreadManager.prototype.removeTerminatedProcesses = function () { } if (proc.topBlock instanceof ReporterBlockMorph) { - if (proc.homeContext.inputs[0] instanceof List) { - proc.topBlock.showBubble( - new ListWatcherMorph( - proc.homeContext.inputs[0] - ), - proc.exportResult - ); + if (proc.callback) { + proc.callback(proc.homeContext.inputs[0]) } else { - proc.topBlock.showBubble( - proc.homeContext.inputs[0], - proc.exportResult - ); + if (proc.homeContext.inputs[0] instanceof List) { + proc.topBlock.showBubble( + new ListWatcherMorph( + proc.homeContext.inputs[0] + ), + proc.exportResult + ); + } else { + proc.topBlock.showBubble( + proc.homeContext.inputs[0], + proc.exportResult + ); + } } } } else { @@ -315,7 +319,7 @@ ThreadManager.prototype.findProcess = function (block) { and when the process was paused exportResult boolean flag indicating whether a picture of the top block along with the result bubble shoud be exported - callback a function to be executed when the process is done + callback a function to be executed when the process is done */ Process.prototype = {}; @@ -340,7 +344,7 @@ function Process(topBlock, callback) { this.pauseOffset = null; this.frameCount = 0; this.exportResult = false; - this.callback = callback; + this.callback = callback; if (topBlock) { this.homeContext.receiver = topBlock.receiver(); @@ -439,7 +443,7 @@ Process.prototype.pauseStep = function () { Process.prototype.evaluateContext = function () { var exp = this.context.expression; this.frameCount += 1; - + if (exp instanceof Array) { return this.evaluateSequence(exp); } @@ -479,9 +483,7 @@ Process.prototype.evaluateBlock = function (block, argCount) { } if (this.isCatchingErrors) { try { - var result = rcvr[block.selector].apply(rcvr, inputs); - if (this.callback) { this.callback(result) }; - this.returnValueToParentContext(result); + this.returnValueToParentContext(rcvr[block.selector].apply(rcvr, inputs)); this.popContext(); } catch (error) { this.handleError(error, block); -- cgit v1.3.1 From 89c2835130e5f77e92c35c52b26d58370be07a7c Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 14:17:06 +0100 Subject: Fixed #642, avoid “freezing” when calling CONS on non-list/null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit thanks, @brianharvey ! --- history.txt | 4 ++++ lists.js | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/history.txt b/history.txt index 88d7ca4..53bd4a6 100755 --- a/history.txt +++ b/history.txt @@ -2321,3 +2321,7 @@ ______ 141117 ------ * Threads, Blocks: Treat REPORT blocks inside custom command definitions as STOP THIS BLOCK / IGNORE INPUTS + +141120 +------ +* Lists: Fixed #642, avoid “freezing” when calling CONS on non-list/null diff --git a/lists.js b/lists.js index a4aff6c..bd856fe 100644 --- a/lists.js +++ b/lists.js @@ -61,7 +61,7 @@ PushButtonMorph, SyntaxElementMorph, Color, Point, WatcherMorph, StringMorph, SpriteMorph, ScrollFrameMorph, CellMorph, ArrowMorph, MenuMorph, snapEquals, Morph, isNil, localize, MorphicPreferences*/ -modules.lists = '2014-July-28'; +modules.lists = '2014-November-20'; var List; var ListWatcherMorph; @@ -125,6 +125,9 @@ List.prototype.changed = function () { List.prototype.cons = function (car, cdr) { var answer = new List(); + if (!(cdr instanceof List || isNil(cdr))) { + throw new Error("cdr isn't a list: " + cdr); + } answer.first = isNil(car) ? null : car; answer.rest = cdr || null; answer.isLinked = true; -- cgit v1.3.1 From 5771e93fa150c9a39e84bd9fad0e8a0bd2d61085 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 14:21:56 +0100 Subject: Fixed #364 avoid “freezing” when calling LAUNCH on empty ring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- history.txt | 3 ++- threads.js | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/history.txt b/history.txt index 53bd4a6..c26599c 100755 --- a/history.txt +++ b/history.txt @@ -2324,4 +2324,5 @@ ______ 141120 ------ -* Lists: Fixed #642, avoid “freezing” when calling CONS on non-list/null +* Lists: Fixed #642 avoid “freezing” when calling CONS on non-list/null +* Threads: Fixed #364 avoid “freezing” when calling LAUNCH on empty ring diff --git a/threads.js b/threads.js index cf97362..c6b0fde 100644 --- a/threads.js +++ b/threads.js @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-November-17'; +modules.threads = '2014-November-20'; var ThreadManager; var Process; @@ -225,8 +225,9 @@ ThreadManager.prototype.removeTerminatedProcesses = function () { var remaining = []; this.processes.forEach(function (proc) { if (!proc.isRunning() && !proc.errorFlag && !proc.isDead) { - proc.topBlock.removeHighlight(); - + if (proc.topBlock instanceof BlockMorph) { + proc.topBlock.removeHighlight(); + } if (proc.prompter) { proc.prompter.destroy(); if (proc.homeContext.receiver.stopTalking) { @@ -880,6 +881,9 @@ Process.prototype.fork = function (context, args) { 'continuations cannot be forked' ); } + if (!(context instanceof Context)) { + throw new Error('expecting a ring but getting ' + context); + } var outer = new Context(null, null, context.outerContext), runnable = new Context(null, -- cgit v1.3.1 From f37e90436a21a906d3cef536871c3e1913a4a2b7 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 14:40:13 +0100 Subject: renamed Process::callback to "onComplete" --- history.txt | 1 + threads.js | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/history.txt b/history.txt index c26599c..bb6eac8 100755 --- a/history.txt +++ b/history.txt @@ -2326,3 +2326,4 @@ ______ ------ * Lists: Fixed #642 avoid “freezing” when calling CONS on non-list/null * Threads: Fixed #364 avoid “freezing” when calling LAUNCH on empty ring +* Threads: Added optional “onComplete” callback to Process, thanks, @bromagosa! diff --git a/threads.js b/threads.js index d1209bf..f210380 100644 --- a/threads.js +++ b/threads.js @@ -237,8 +237,8 @@ ThreadManager.prototype.removeTerminatedProcesses = function () { } if (proc.topBlock instanceof ReporterBlockMorph) { - if (proc.callback) { - proc.callback(proc.homeContext.inputs[0]) + if (proc.onComplete instanceof Function) { + proc.onComplete(proc.homeContext.inputs[0]); } else { if (proc.homeContext.inputs[0] instanceof List) { proc.topBlock.showBubble( @@ -301,9 +301,9 @@ ThreadManager.prototype.findProcess = function (block) { are children receiver object (sprite) to which the process applies, cached from the top block - context the Context describing the current state + context the Context describing the current state of this process - homeContext stores information relevant to the whole process, + homeContext stores information relevant to the whole process, i.e. its receiver, result etc. isPaused boolean indicating whether to pause readyToYield boolean indicating whether to yield control to @@ -311,16 +311,17 @@ ThreadManager.prototype.findProcess = function (block) { readyToTerminate boolean indicating whether the stop method has been called isDead boolean indicating a terminated clone process - timeout msecs after which to force yield - lastYield msecs when the process last yielded - errorFlag boolean indicating whether an error was encountered + timeout msecs after which to force yield + lastYield msecs when the process last yielded + errorFlag boolean indicating whether an error was encountered prompter active instance of StagePrompterMorph httpRequest active instance of an HttpRequest or null pauseOffset msecs between the start of an interpolated operation and when the process was paused exportResult boolean flag indicating whether a picture of the top block along with the result bubble shoud be exported - callback a function to be executed when the process is done + onComplete an optional callback function to be executed when + the process is done */ Process.prototype = {}; @@ -328,7 +329,7 @@ Process.prototype.contructor = Process; Process.prototype.timeout = 500; // msecs after which to force yield Process.prototype.isCatchingErrors = true; -function Process(topBlock, callback) { +function Process(topBlock, onComplete) { this.topBlock = topBlock || null; this.readyToYield = false; @@ -345,7 +346,7 @@ function Process(topBlock, callback) { this.pauseOffset = null; this.frameCount = 0; this.exportResult = false; - this.callback = callback; + this.onComplete = onComplete || null; if (topBlock) { this.homeContext.receiver = topBlock.receiver(); @@ -444,7 +445,6 @@ Process.prototype.pauseStep = function () { Process.prototype.evaluateContext = function () { var exp = this.context.expression; this.frameCount += 1; - if (exp instanceof Array) { return this.evaluateSequence(exp); } @@ -484,7 +484,9 @@ Process.prototype.evaluateBlock = function (block, argCount) { } if (this.isCatchingErrors) { try { - this.returnValueToParentContext(rcvr[block.selector].apply(rcvr, inputs)); + this.returnValueToParentContext( + rcvr[block.selector].apply(rcvr, inputs) + ); this.popContext(); } catch (error) { this.handleError(error, block); -- cgit v1.3.1 From cbe3d6fe185531758397bc44a38a2817aed885e6 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 14:55:31 +0100 Subject: Updated the “About” Dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with a mention of support from CDG (SAP Labs) --- gui.js | 7 ++++--- history.txt | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gui.js b/gui.js index bb440b1..f01f19d 100644 --- a/gui.js +++ b/gui.js @@ -69,7 +69,7 @@ SpeechBubbleMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2014-October-06'; +modules.gui = '2014-November-20'; // Declarations @@ -2511,8 +2511,9 @@ IDE_Morph.prototype.aboutSnap = function () { + 'jens@moenig.org, bh@cs.berkeley.edu\n\n' + 'Snap! is developed by the University of California, Berkeley\n' - + ' with support from the National Science Foundation ' - + 'and MioSoft. \n' + + ' with support from the National Science Foundation, ' + + 'MioSoft, \n' + + 'and the Communications Design Group at SAP Labs. \n' + 'The design of Snap! is influenced and inspired by Scratch,\n' + 'from the Lifelong Kindergarten group at the MIT Media Lab\n\n' diff --git a/history.txt b/history.txt index bb6eac8..8cf87e7 100755 --- a/history.txt +++ b/history.txt @@ -2327,3 +2327,5 @@ ______ * Lists: Fixed #642 avoid “freezing” when calling CONS on non-list/null * Threads: Fixed #364 avoid “freezing” when calling LAUNCH on empty ring * Threads: Added optional “onComplete” callback to Process, thanks, @bromagosa! +* GUI: Set Default Save location to Cloud on load, thanks, @cycomachead! +* GUI: Updated the “About” Dialog with a mention of support from CDG (SAP Labs) -- cgit v1.3.1 From 4768102b098281d4f2462d4c4b0fe8b5cf228ef6 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 15:13:21 +0100 Subject: integrate percent sign fix for JSLint --- byob.js | 6 +++--- history.txt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/byob.js b/byob.js index 71b3298..b5905ce 100644 --- a/byob.js +++ b/byob.js @@ -106,7 +106,7 @@ SymbolMorph, isNil*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2014-September-30'; +modules.byob = '2014-November-20'; // Declarations @@ -688,8 +688,8 @@ CustomCommandBlockMorph.prototype.labelPart = function (spec) { return CustomCommandBlockMorph.uber.labelPart.call(this, spec); } if ((spec[0] === '%') && (spec.length > 1)) { - var label = spec.replace(/%/g, ''); - part = new BlockInputFragmentMorph(label); + // part = new BlockInputFragmentMorph(spec.slice(1)); + part = new BlockInputFragmentMorph(spec.replace(/%/g, '')); } else { part = new BlockLabelFragmentMorph(spec); part.fontSize = this.fontSize; diff --git a/history.txt b/history.txt index 8cf87e7..b022790 100755 --- a/history.txt +++ b/history.txt @@ -2328,4 +2328,5 @@ ______ * Threads: Fixed #364 avoid “freezing” when calling LAUNCH on empty ring * Threads: Added optional “onComplete” callback to Process, thanks, @bromagosa! * GUI: Set Default Save location to Cloud on load, thanks, @cycomachead! -* GUI: Updated the “About” Dialog with a mention of support from CDG (SAP Labs) +* GUI: Updated the “About” Dialog with a mention of support from CDG (SAP Labs) +* BYOB: Percent sign fix for block labels, thanks, @natashasandy! -- cgit v1.3.1 From ce93fe8da73738e67683fa9cbfe7741de62f5336 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 15:16:12 +0100 Subject: fix ‘line’ option in ‘split’ block for Windows files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit thanks, @brianharvey! --- history.txt | 1 + threads.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/history.txt b/history.txt index b022790..c44a57b 100755 --- a/history.txt +++ b/history.txt @@ -2330,3 +2330,4 @@ ______ * GUI: Set Default Save location to Cloud on load, thanks, @cycomachead! * GUI: Updated the “About” Dialog with a mention of support from CDG (SAP Labs) * BYOB: Percent sign fix for block labels, thanks, @natashasandy! +* Threads: fix ‘line’ option in ‘split’ block for Windows files, thanks, @brianharvey! diff --git a/threads.js b/threads.js index f210380..11b72dc 100644 --- a/threads.js +++ b/threads.js @@ -2126,7 +2126,7 @@ Process.prototype.reportTextSplit = function (string, delimiter) { str = (string || '').toString(); switch (this.inputOption(delimiter)) { case 'line': - del = '\n'; + del = '\r?\n'; break; case 'tab': del = '\t'; -- cgit v1.3.1 From 3cc28b1f1ce44f053399686e58be860f9c4a7018 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 15:40:20 +0100 Subject: push morphic.js version date --- history.txt | 1 + morphic.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/history.txt b/history.txt index c44a57b..110ea89 100755 --- a/history.txt +++ b/history.txt @@ -2331,3 +2331,4 @@ ______ * GUI: Updated the “About” Dialog with a mention of support from CDG (SAP Labs) * BYOB: Percent sign fix for block labels, thanks, @natashasandy! * Threads: fix ‘line’ option in ‘split’ block for Windows files, thanks, @brianharvey! +* Morphic: fix slider range 1, thanks, @tonychenr ! diff --git a/morphic.js b/morphic.js index b9d834f..763a196 100644 --- a/morphic.js +++ b/morphic.js @@ -1041,7 +1041,7 @@ /*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio, FileList, getBlurredShadowSupport*/ -var morphicVersion = '2014-November-06'; +var morphicVersion = '2014-November-20'; var modules = {}; // keep track of additional loaded modules var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug -- cgit v1.3.1 From f2d0c2eba5d6b012fc3fb1167c82b64b2f8ed447 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 15:53:14 +0100 Subject: integrate translation update --- history.txt | 1 + threads.js | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/history.txt b/history.txt index 110ea89..0faac6b 100755 --- a/history.txt +++ b/history.txt @@ -2332,3 +2332,4 @@ ______ * BYOB: Percent sign fix for block labels, thanks, @natashasandy! * Threads: fix ‘line’ option in ‘split’ block for Windows files, thanks, @brianharvey! * Morphic: fix slider range 1, thanks, @tonychenr ! +* translation update, thanks, Manuel! diff --git a/threads.js b/threads.js index ea563f1..7d656c4 100644 --- a/threads.js +++ b/threads.js @@ -858,8 +858,9 @@ Process.prototype.evaluate = function ( } else if (context.emptySlots !== 1) { throw new Error( - localize('expecting') + ' ' + context.emptySlots + ' ' - + localize('input(s), but getting') + ' ' + parms.length + localize('expecting') + ' ' + context.emptySlots + ' ' + + localize('input(s), but getting') + ' ' + + parms.length ); } } @@ -937,8 +938,9 @@ Process.prototype.fork = function (context, args) { } else if (context.emptySlots !== 1) { throw new Error( - localize('expecting') + ' ' + context.emptySlots + ' ' - + localize('input(s), but getting') + ' ' + parms.length + localize('expecting') + ' ' + context.emptySlots + ' ' + + localize('input(s), but getting') + ' ' + + parms.length ); } } @@ -2986,7 +2988,7 @@ VariableFrame.prototype.find = function (name) { throw new Error( localize('a variable of name \'') + name - + localize('\'\ndoes not exist in this context') + + localize('\'\ndoes not exist in this context') ); }; -- cgit v1.3.1