mumuki-gobstones-runner 1.7.3 → 1.7.4

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: 20ebcdc1768b7637653dcc5389cd32c6a15f1e608b508a19206f6aa0dbed5115
4
- data.tar.gz: 796c9c8c3ac26a32215f75060bea63a524654a4a6f7976cfb1ffe803a7d2250f
3
+ metadata.gz: 6a364d5ccef801cb9c9b312637ade4d4614b5bed27bad9cc5ba230daa4ce1dfb
4
+ data.tar.gz: 91aaeaaf2909a98d7f4ab1ab763d8fb18dcfb02ab8b987da9627677d1bc6bae6
5
5
  SHA512:
6
- metadata.gz: 5ae12ef6f0cfd131d606e972fd641ae590d69bfbee21f4226a795eb93397cd8528266801f66725b2ca02d7cee439a53819049a293ba39f1f571fca6016da59c5
7
- data.tar.gz: 4901d5dac291ed3df0f9722d6deea4820d19d0ad7d6d32e7565d4bfb221a8a4310056c944e3f548eea0207fe66ff90da33a3a5c3c3c2edfc4c7307650b276d10
6
+ metadata.gz: d793873934b907142bd8cf0e4603956bffcb839f15f29930250aa303b6df5b6be9abf715614700914fc0865c1dac668b0f0b08d37a1ecd11561a4573a3d8dd52
7
+ data.tar.gz: 8411ce985b334a186e5eb46324f4a825336d62ed5ddae2fe05caabdbbe4fe396fc37082627ffd4e174f6b5ca8da6dbdd43adf6d0626046e8edc2248f849e54a6
@@ -17,7 +17,7 @@
17
17
  type: Boolean,
18
18
  value: false
19
19
  },
20
- startEmpty: {
20
+ teacherMode: {
21
21
  type: Boolean,
22
22
  default: false
23
23
  }
@@ -67,10 +67,19 @@
67
67
 
68
68
  const updateFields = () => {
69
69
  const blockly = this.getBlockly();
70
+
70
71
  const editorValue = $("#mu-custom-editor-value")[0];
71
72
  if (editorValue) {
72
73
  editorValue.value = blockly.workspaceXml;
73
74
  }
75
+
76
+ if (this.teacherMode) {
77
+ const editorExtra = $("#mu-custom-editor-extra")[0];
78
+ if (editorExtra) {
79
+ editorExtra.value = blockly.workspaceXml;
80
+ }
81
+ }
82
+
74
83
  if (typeof angular !== 'undefined') {
75
84
  angular.element(editorValue).triggerHandler("change");
76
85
  }
@@ -122,10 +131,9 @@
122
131
  this._initializeWorkspace(blockly);
123
132
 
124
133
  localOnResize();
125
-
126
134
  blockly._onresize();
127
- blockly.workspace.addChangeListener(updateFields);
128
- updateFields();
135
+
136
+ this._subscribeToWorkspace(blockly, updateFields);
129
137
  }, 50);
130
138
  };
131
139
 
@@ -176,14 +184,21 @@
176
184
 
177
185
  _initializeWorkspace: function(blockly) {
178
186
  setTimeout(() => {
179
- var value = $("#mu-custom-editor-value")[0].value;
180
- if (value) {
181
- blockly.workspaceXml = value;
182
- } else {
183
- if (this.startEmpty) {
184
- blockly.workspaceXml = "<xml></xml>";
185
- }
186
- }
187
+ const value = $("#mu-custom-editor-value")[0].value;
188
+
189
+ blockly.workspaceXml = value || (
190
+ this.teacherMode
191
+ ? "<xml></xml>"
192
+ : blockly.initialXml
193
+ );
194
+ blockly.scrollToBlock();
195
+ });
196
+ },
197
+
198
+ _subscribeToWorkspace: function(blockly, action) {
199
+ setTimeout(() => {
200
+ blockly.workspace.addChangeListener(action);
201
+ action();
187
202
  });
188
203
  }
189
204
  });
@@ -273,6 +288,7 @@
273
288
  _onButtonClick: function () {
274
289
  const blockly = this._getBlockly();
275
290
  blockly.workspaceXml = blockly.initialXml;
291
+ blockly.scrollToBlock();
276
292
  },
277
293
 
278
294
  _getBlockly: function () {
@@ -1,3 +1,3 @@
1
1
  module GobstonesVersionHook
2
- VERSION = '1.7.3'
2
+ VERSION = '1.7.4'
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.3
4
+ version: 1.7.4
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-05-23 00:00:00.000000000 Z
11
+ date: 2018-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.14'
61
+ version: '0.16'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.14'
68
+ version: '0.16'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: gobstones-code-runner
71
71
  requirement: !ruby/object:Gem::Requirement