{ "variables": { "_text": [ "_text", "" ], "_replacers": [ "_replacers", "[]" ], "_replacer": [ "_replacer", 1 ], "_rep": [ "_rep", "" ] }, "blocks": { "setReplacerToDefinition": { "opcode": "procedures_definition", "next": "setReplacersVarToReplacerJson", "parent": null, "inputs": { "custom_block": [ 1, "setReplacerToDisplay" ] }, "fields": {}, "shadow": false, "topLevel": true, "x": 48, "y": 64 }, "setReplacerToDisplay": { "opcode": "procedures_prototype", "next": null, "parent": "setReplacerToDefinition", "inputs": { "REPLACER": [ 1, "setReplacerArgumentREPLACER" ], "VALUE": [ 1, "setReplacerArgumentVALUE" ] }, "fields": {}, "shadow": true, "topLevel": false, "mutation": { "tagName": "mutation", "children": [], "proccode": "replacer %s to %s", "argumentids": "[\"REPLACER\",\"VALUE\"]", "argumentnames": "[\"REPLACER\",\"VALUE\"]", "argumentdefaults": "[\"\",\"\",\"\"]", "warp": "true", "returns": "false", "edited": "true" } }, "setReplacerArgumentREPLACER": { "opcode": "argument_reporter_string_number", "next": null, "parent": "REPLACER", "inputs": {}, "fields": { "VALUE": [ "REPLACER", "REPLACER" ] }, "shadow": true, "topLevel": false }, "setReplacerArgumentVALUE": { "opcode": "argument_reporter_string_number", "next": null, "parent": "VALUE", "inputs": {}, "fields": { "VALUE": [ "VALUE", "VALUE" ] }, "shadow": true, "topLevel": false }, "setReplacersVarToReplacerJson": { "opcode": "data_setvariableto", "next": null, "parent": "setReplacerToDefinition", "inputs": { "VALUE": [ 3, "setReplacerValueTo", [ 10, "0" ] ] }, "fields": { "VARIABLE": [ "replacers", "replacers" ] }, "shadow": false, "topLevel": false }, "setReplacerValueTo": { "opcode": "jgJSON_setValueToKeyInJSON", "next": null, "parent": "setReplacersVarToReplacerJson", "inputs": { "KEY": [ 3, "leftAndMidleHalf", [ 10, "key" ] ], "VALUE": [ 3, "VALUE", [ 10, "value" ] ], "JSON": [ 3, [ 12, "replacers", "replacers" ], [ 10, "{}" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "REPLACER": { "opcode": "argument_reporter_string_number", "next": null, "parent": "rightHalf", "inputs": {}, "fields": { "VALUE": [ "REPLACER", "REPLACER" ] }, "shadow": false, "topLevel": false }, "VALUE": { "opcode": "argument_reporter_string_number", "next": null, "parent": "setReplacerValueTo", "inputs": {}, "fields": { "VALUE": [ "VALUE", "VALUE" ] }, "shadow": false, "topLevel": false }, "replaceWithReplacersDefinition": { "opcode": "procedures_definition_return", "next": "defineTempReplacersList", "parent": null, "inputs": { "custom_block": [ 1, "replaceWithReplacersDisplay" ] }, "fields": {}, "shadow": false, "topLevel": true, "x": 48, "y": 280 }, "replaceWithReplacersDisplay": { "opcode": "procedures_prototype", "next": null, "parent": "replaceWithReplacersDefinition", "inputs": { "STRING": [ 1, "STRING" ] }, "fields": {}, "shadow": true, "topLevel": false, "mutation": { "tagName": "mutation", "children": [], "proccode": "replace %s with replacers", "argumentids": "[\"STRING\"]", "argumentnames": "[\"STRING\"]", "argumentdefaults": "[\"\"]", "warp": "false", "returns": "true", "edited": "true" } }, "STRING": { "opcode": "argument_reporter_string_number", "next": null, "parent": "replaceWithReplacersDisplay", "inputs": {}, "fields": { "VALUE": [ "STRING", "STRING" ] }, "shadow": true, "topLevel": false }, "runThroughEachReplacer": { "opcode": "control_for_each", "next": "returnTheFinnalText", "parent": "defineTempText", "inputs": { "VALUE": [ 3, "theNumberOfReplacers", [ 6, "10" ] ], "SUBSTACK": [ 2, "defineTempReplacerName" ] }, "fields": { "VARIABLE": [ "_replacer", "_replacer" ] }, "shadow": false, "topLevel": false }, "defineTempReplacersList": { "opcode": "data_setvariableto", "next": "defineTempText", "parent": "replaceWithReplacersDefinition", "inputs": { "VALUE": [ 3, "getAllReplacers", [ 10, "0" ] ] }, "fields": { "VARIABLE": [ "_replacers", "_replacers" ] }, "shadow": false, "topLevel": false }, "getAllReplacers": { "opcode": "jgJSON_json_keys", "next": null, "parent": "defineTempReplacersList", "inputs": { "json": [ 3, [ 12, "replacers", "replacers" ], [ 10, "{}" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "rightHalf": { "opcode": "operator_join", "next": null, "parent": "leftAndMidleHalf", "inputs": { "STRING1": [ 1, [ 10, "{" ] ], "STRING2": [ 3, "REPLACER", [ 10, "banana" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "leftAndMidleHalf": { "opcode": "operator_join", "next": null, "parent": "setReplacerValueTo", "inputs": { "STRING1": [ 3, "rightHalf", [ 10, "foo" ] ], "STRING2": [ 1, [ 10, "}" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "theNumberOfReplacers": { "opcode": "jgJSON_json_array_length", "next": null, "parent": "runThroughEachReplacer", "inputs": { "array": [ 3, [ 12, "_replacers", "_replacers" ], [ 10, "[]" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "getCurrentReplacer": { "opcode": "jgJSON_json_array_get", "next": null, "parent": "defineTempReplacerName", "inputs": { "array": [ 3, [ 12, "_replacers", "_replacers" ], [ 10, "[\"A\", \"B\", \"C\"]" ] ], "index": [ 3, "offsetIndexBy", [ 4, "2" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "replaceAllReplacersWithValue": { "opcode": "operator_replaceAll", "next": null, "parent": "replaceTextWithThisReplacer", "inputs": { "text": [ 3, [ 12, "_text", "_text" ], [ 10, "foo bar" ] ], "term": [ 3, [ 12, "_rep", "_rep" ], [ 10, "foo" ] ], "res": [ 3, "getReplacerValueFromReplacerList", [ 10, "bar" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "defineTempReplacerName": { "opcode": "data_setvariableto", "next": "replaceTextWithThisReplacer", "parent": "runThroughEachReplacer", "inputs": { "VALUE": [ 3, "getCurrentReplacer", [ 10, "0" ] ] }, "fields": { "VARIABLE": [ "_rep", "_rep" ] }, "shadow": false, "topLevel": false }, "getReplacerValueFromReplacerList": { "opcode": "jgJSON_getValueFromJSON", "next": null, "parent": "replaceAllReplacersWithValue", "inputs": { "VALUE": [ 3, [ 12, "_rep", "_rep" ], [ 10, "key" ] ], "JSON": [ 3, [ 12, "replacers", "replacers" ], [ 10, "{\"key\": \"value\"}" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "defineTempText": { "opcode": "data_setvariableto", "next": "runThroughEachReplacer", "parent": "defineTempReplacersList", "inputs": { "VALUE": [ 3, "STRINGargument", [ 10, "0" ] ] }, "fields": { "VARIABLE": [ "_text", "_text" ] }, "shadow": false, "topLevel": false }, "STRINGargument": { "opcode": "argument_reporter_string_number", "next": null, "parent": "defineTempText", "inputs": {}, "fields": { "VALUE": [ "STRING", "STRING" ] }, "shadow": false, "topLevel": false }, "replaceTextWithThisReplacer": { "opcode": "data_setvariableto", "next": null, "parent": "defineTempReplacerName", "inputs": { "VALUE": [ 3, "replaceAllReplacersWithValue", [ 10, "0" ] ] }, "fields": { "VARIABLE": [ "_text", "_text" ] }, "shadow": false, "topLevel": false }, "returnTheFinnalText": { "opcode": "procedures_return", "next": null, "parent": "runThroughEachReplacer", "inputs": { "return": [ 3, [ 12, "_text", "_text" ], [ 10, "1" ] ] }, "fields": {}, "shadow": false, "topLevel": false }, "offsetIndexBy": { "opcode": "operator_subtract", "next": null, "parent": "getCurrentReplacer", "inputs": { "NUM1": [ 3, [ 12, "_replacer", "_replacer" ], [ 4, "" ] ], "NUM2": [ 1, [ 4, "1" ] ] }, "fields": {}, "shadow": false, "topLevel": false } } }