mumuki-gobstones-runner 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aca6ccc3335d87362e7bf2204846dfd086474a6bb5f708b6b47c6466a37987fb
4
- data.tar.gz: efd23f7ec87fdd5f4aa4f5ef575df5e4efeff94f16b1a73a3b6a9afa18dec6d9
3
+ metadata.gz: e636bf209c1610db7c33590395cd659f44514fad3ef09f3970e7c95303b656c4
4
+ data.tar.gz: 6505fe8fd10c6857ddd3cb1e850430f7ef816c279fdb4d2bc5c19fbe0bb8a8cb
5
5
  SHA512:
6
- metadata.gz: 96924002bb61f819b2c64c78e458118096e1c2bc3a0bc7e3c114cba3f6ccd547eddf3dd69459017193d012bbc543d74930d9c6683ad64b623da3185cb5f1a79b
7
- data.tar.gz: 7d2629f4763d1427a3436eb4a2905310fb492a0dcfff9bedfbe79ec8c6aca1f2a218323f77f6ac39bf861487280bcaaa23a7750a00b5db05c8d3165231008037
6
+ metadata.gz: 6df98b05d79e18a87ea582b14eda33b09a2705323595b69004b096ed78b75def738dc9b2aa178486d3f0aa1b60e75f64df2375e165eba99fc98c9b158ae2a108
7
+ data.tar.gz: 6621bc4550120cbd0d0989725f5b339f5ae84a547efabde7e6e3e5456892ed986ff61567a1149d1266f9cf5ae193c9a0966f17ac38ed2f037924fc81872fed76
@@ -112,25 +112,9 @@
112
112
 
113
113
  relocateTrash(blockly);
114
114
 
115
- const teacherCode = this.getTeacherCode();
116
- if (teacherCode) {
117
- setTimeout(() => {
118
- const actions = new Parser().getActionsFromSource(teacherCode);
119
- blockly.primitiveProcedures = actions.procedureDeclarations;
120
- blockly.primitiveFunctions = actions.functionDeclarations;
121
- });
122
- }
123
-
115
+ this.setTeacherActions(blockly);
124
116
  this._setInitialXml(blockly);
125
-
126
- var value = $("#mu-custom-editor-value")[0].value;
127
- if (value) {
128
- blockly.workspaceXml = value;
129
- } else {
130
- if (this.startEmpty) {
131
- blockly.workspaceXml = "<xml></xml>";
132
- }
133
- }
117
+ this._initializeWorkspace(blockly);
134
118
 
135
119
  localOnResize();
136
120
 
@@ -144,6 +128,17 @@
144
128
  initialize();
145
129
  },
146
130
 
131
+ setTeacherActions(blockly) {
132
+ const teacherCode = this.getTeacherCode();
133
+ if (teacherCode) {
134
+ setTimeout(() => {
135
+ const actions = new Parser().getActionsFromSource(teacherCode);
136
+ blockly.primitiveProcedures = actions.procedureDeclarations;
137
+ blockly.primitiveFunctions = actions.functionDeclarations;
138
+ });
139
+ }
140
+ },
141
+
147
142
  getBlockly: function () {
148
143
  return this.$.blocklyElement;
149
144
  },
@@ -172,8 +167,20 @@
172
167
  } else {
173
168
  blockly.initialXml = blockly.workspaceXml;
174
169
  }
175
- }
170
+ },
176
171
 
172
+ _initializeWorkspace: function(blockly) {
173
+ setTimeout(() => {
174
+ var value = $("#mu-custom-editor-value")[0].value;
175
+ if (value) {
176
+ blockly.workspaceXml = value;
177
+ } else {
178
+ if (this.startEmpty) {
179
+ blockly.workspaceXml = "<xml></xml>";
180
+ }
181
+ }
182
+ });
183
+ }
177
184
  });
178
185
  </script>
179
186
  </dom-module>
@@ -535,8 +542,10 @@
535
542
  },
536
543
  _setToolbox: function () {
537
544
  $.get(this.toolboxUrl, function (toolboxXml) {
538
- const blockly = $("mu-gobstones-custom-editor")[0].getBlockly();
545
+ const editor = $("mu-gobstones-custom-editor")[0];
546
+ const blockly = editor.getBlockly();
539
547
  blockly.setDefaultToolbox(toolboxXml);
548
+ editor.setTeacherActions(blockly);
540
549
  });
541
550
  }
542
551
  });
data/lib/version_hook.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GobstonesVersionHook
2
- VERSION = '1.7.1'
2
+ VERSION = '1.7.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-gobstones-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Alfonso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-27 00:00:00.000000000 Z
11
+ date: 2018-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.7.6
206
+ rubygems_version: 2.7.7
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Gobstones Runner for Mumuki