smalruby-editor 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of smalruby-editor might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/application.js +1 -1
- data/app/assets/javascripts/blocks/control.js.coffee.erb +14 -4
- data/app/assets/javascripts/blocks/events.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +24 -18
- data/app/assets/javascripts/blocks/looks.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/motion.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/operators.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/sensing.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/sound.js.coffee.erb +1 -1
- data/app/assets/javascripts/fix_blockly.js +12 -0
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +1 -1
- data/app/assets/javascripts/smalruby.js.coffee +12 -0
- data/app/assets/javascripts/views/main_menu_view.js.coffee +5 -1
- data/app/assets/javascripts/views/reset_modal_view.js.coffee +11 -0
- data/app/assets/stylesheets/toolbox.css.scss.erb +29 -19
- data/app/controllers/source_codes_controller.rb +26 -20
- data/app/helpers/application_helper.rb +3 -0
- data/app/models/concerns/ruby_to_block/block/motion_turn_xy.rb +2 -1
- data/app/views/editor/_block_tab.html.haml +0 -1
- data/app/views/editor/_character_modal.html.haml +1 -1
- data/app/views/editor/_load_modal.html.haml +1 -1
- data/app/views/editor/_reset_modal.html.haml +15 -0
- data/app/views/editor/_signin_modal.html.haml +1 -1
- data/app/views/editor/_toolbox.html.haml +264 -257
- data/app/views/editor/index.html.haml +4 -2
- data/lib/smalruby_editor/version.rb +3 -3
- data/public/assets/{application-acf953339e4b5c31b5d6060375b13a44.js → application-c8991557a0789ac1bc9220f409e7f1c1.js} +175 -110
- data/public/assets/{application-acf953339e4b5c31b5d6060375b13a44.js.gz → application-c8991557a0789ac1bc9220f409e7f1c1.js.gz} +0 -0
- data/public/assets/{application-e9d089df8f23954c49647ab7af8481dc.css → application-d4fe6c0f970efe8eab9267fd08718d96.css} +182 -104
- data/public/assets/application-d4fe6c0f970efe8eab9267fd08718d96.css.gz +0 -0
- data/public/assets/manifest-332a5a1668194028b55103e0ea45c054.json +1 -1
- data/smalruby-editor.gemspec +1 -1
- data/spec/acceptance/base.feature +59 -0
- data/spec/acceptance/block_mode/blocks/control/await.feature +49 -2
- data/spec/acceptance/block_mode/blocks/control/await_until.feature +67 -6
- data/spec/acceptance/block_mode/blocks/control/break.feature +0 -3
- data/spec/acceptance/block_mode/blocks/control/next.feature +0 -3
- data/spec/acceptance/block_mode/blocks/control/redo.feature +0 -3
- data/spec/acceptance/standalone/signin.feature +12 -10
- data/spec/steps/base_steps.rb +13 -0
- data/spec/steps/global_variable.rb +11 -0
- metadata +10 -8
- data/public/assets/application-e9d089df8f23954c49647ab7af8481dc.css.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ec9963fe6c59d88b5083a8dc61c2c44ef6ce6b9
|
4
|
+
data.tar.gz: fd979fa5452fedb4a8510610cd2e826f5fe42b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff0fb931c40fc501d0c84c28d520e538cb4f7ecb06e9d55a7d1f065ff8f25a23847da67f1390b8f14bbbdef7c3f7b1524cd94b0dd58b90d450d4802719526f6b
|
7
|
+
data.tar.gz: 6b1c3860b0ef8da51c38438a2ff9c6976ce32cb15da264e953083648deadd24e917beb3716d6788a55032c4bfea7a90b8ba78303733bbef3d38d39431e97b66a
|
@@ -22,9 +22,9 @@
|
|
22
22
|
//= require bootstrap.js
|
23
23
|
//= require jquery-fileupload/basic
|
24
24
|
//= require blockly/blockly_compressed
|
25
|
-
//= require fix_blockly.js
|
26
25
|
//= require blockly/blocks_compressed
|
27
26
|
//= require blockly/msg/js/ja
|
27
|
+
//= require fix_blockly.js
|
28
28
|
//= require underscore
|
29
29
|
//= require backbone
|
30
30
|
//= require smalruby
|
@@ -62,7 +62,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
62
62
|
@setTooltip('')
|
63
63
|
|
64
64
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
65
|
-
|
65
|
+
if Blockly.Ruby.receiver() == 'main'
|
66
|
+
''
|
67
|
+
else
|
68
|
+
'<%= suffix %>\n'
|
66
69
|
<% end %>
|
67
70
|
|
68
71
|
# もし< >なら
|
@@ -141,8 +144,12 @@ Blockly.Blocks['<%= n %>'] =
|
|
141
144
|
@setTooltip('')
|
142
145
|
|
143
146
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
144
|
-
|
145
|
-
|
147
|
+
if Blockly.Ruby.receiver() == 'main'
|
148
|
+
''
|
149
|
+
else
|
150
|
+
await = Blockly.Ruby.characterMethodCallInput_('await')[0]
|
151
|
+
cond = Blockly.Ruby.valueToCode(@, 'COND', Blockly.Ruby.ORDER_CONDITIONAL) || 'true'
|
152
|
+
"#{await} until #{cond}\n"
|
146
153
|
|
147
154
|
# < >まで繰り返す
|
148
155
|
<% n = "#{category}_until" %>
|
@@ -180,4 +187,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
180
187
|
@setTooltip('')
|
181
188
|
|
182
189
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
183
|
-
'
|
190
|
+
if Blockly.Ruby.receiver() == 'main'
|
191
|
+
''
|
192
|
+
else
|
193
|
+
Blockly.Ruby.characterMethodCall_('await')
|
@@ -2,7 +2,13 @@
|
|
2
2
|
|
3
3
|
<%
|
4
4
|
category = 'hardware'
|
5
|
-
|
5
|
+
colors = {
|
6
|
+
motion: 208,
|
7
|
+
looks: 270,
|
8
|
+
events: 33,
|
9
|
+
sensing: 190,
|
10
|
+
etc: 340,
|
11
|
+
}
|
6
12
|
%>
|
7
13
|
|
8
14
|
# ハードウェアの環境設定
|
@@ -36,7 +42,7 @@ twoWDPinDropdown = (["D#{n}", "D#{n}"] for n in [2..10])
|
|
36
42
|
Blockly.Blocks['<%= n %>'] =
|
37
43
|
init: ()->
|
38
44
|
@setHelpUrl('')
|
39
|
-
@setColour(<%=
|
45
|
+
@setColour(<%= colors[:etc] %>)
|
40
46
|
@appendDummyInput().appendField('ハードウェアを準備する')
|
41
47
|
@setTooltip('')
|
42
48
|
|
@@ -59,7 +65,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
59
65
|
Blockly.Blocks['<%= n %>'] =
|
60
66
|
init: ()->
|
61
67
|
@setHelpUrl('')
|
62
|
-
@setColour(<%=
|
68
|
+
@setColour(<%= colors[:looks] %>)
|
63
69
|
@appendDummyInput()
|
64
70
|
.appendField('LED')
|
65
71
|
.appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN')
|
@@ -82,7 +88,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
82
88
|
Blockly.Blocks['<%= n %>'] =
|
83
89
|
init: ()->
|
84
90
|
@setHelpUrl('')
|
85
|
-
@setColour(<%=
|
91
|
+
@setColour(<%= colors[:looks] %>)
|
86
92
|
@appendDummyInput()
|
87
93
|
.appendField('RGB LED')
|
88
94
|
.appendField(new Blockly.FieldDropdown(acDropdown), 'AC')
|
@@ -110,7 +116,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
110
116
|
Blockly.Blocks['<%= n %>'] =
|
111
117
|
init: ()->
|
112
118
|
@setHelpUrl('')
|
113
|
-
@setColour(<%=
|
119
|
+
@setColour(<%= colors[:looks] %>)
|
114
120
|
@appendDummyInput()
|
115
121
|
.appendField('RGB LED')
|
116
122
|
.appendField(new Blockly.FieldDropdown(acDropdown), 'AC')
|
@@ -135,7 +141,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
135
141
|
dropdown = ([String(n), String(n)] for n in [0..9])
|
136
142
|
|
137
143
|
@setHelpUrl('')
|
138
|
-
@setColour(<%=
|
144
|
+
@setColour(<%= colors[:looks] %>)
|
139
145
|
@appendDummyInput()
|
140
146
|
.appendField('7セグディスプレイに')
|
141
147
|
.appendField(new Blockly.FieldDropdown(dropdown), 'NUM')
|
@@ -153,7 +159,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
153
159
|
Blockly.Blocks['<%= n %>'] =
|
154
160
|
init: ()->
|
155
161
|
@setHelpUrl('')
|
156
|
-
@setColour(<%=
|
162
|
+
@setColour(<%= colors[:looks] %>)
|
157
163
|
@appendDummyInput()
|
158
164
|
.appendField('7セグディスプレイをオフにする')
|
159
165
|
@setPreviousStatement(true)
|
@@ -170,7 +176,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
170
176
|
Blockly.Blocks['<%= n %>'] =
|
171
177
|
init: ()->
|
172
178
|
@setHelpUrl('')
|
173
|
-
@setColour(<%=
|
179
|
+
@setColour(<%= colors[:looks] %>)
|
174
180
|
@appendValueInput('TEXT')
|
175
181
|
.appendField('LCDに')
|
176
182
|
.setCheck('String')
|
@@ -190,7 +196,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
190
196
|
Blockly.Blocks['<%= n %>'] =
|
191
197
|
init: ()->
|
192
198
|
@setHelpUrl('')
|
193
|
-
@setColour(<%=
|
199
|
+
@setColour(<%= colors[:looks] %>)
|
194
200
|
@appendDummyInput()
|
195
201
|
.appendField('LCDをクリアする')
|
196
202
|
@setPreviousStatement(true)
|
@@ -205,7 +211,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
205
211
|
Blockly.Blocks['<%= n %>'] =
|
206
212
|
init: ()->
|
207
213
|
@setHelpUrl('')
|
208
|
-
@setColour(<%=
|
214
|
+
@setColour(<%= colors[:looks] %>)
|
209
215
|
@appendDummyInput()
|
210
216
|
.appendField('7セグディスプレイをオフにする')
|
211
217
|
@setPreviousStatement(true)
|
@@ -222,7 +228,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
222
228
|
Blockly.Blocks['<%= n %>'] =
|
223
229
|
init: ()->
|
224
230
|
@setHelpUrl('')
|
225
|
-
@setColour(<%=
|
231
|
+
@setColour(<%= colors[:motion] %>)
|
226
232
|
@appendDummyInput()
|
227
233
|
.appendField('サーボ')
|
228
234
|
.appendField(new Blockly.FieldDropdown(pwmPinDropdown), 'PIN')
|
@@ -266,7 +272,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
266
272
|
dropdown = (["D#{n}", "D#{n}"] for n in [2..10])
|
267
273
|
|
268
274
|
@setHelpUrl('')
|
269
|
-
@setColour(<%=
|
275
|
+
@setColour(<%= colors[:motion] %>)
|
270
276
|
@appendDummyInput()
|
271
277
|
.appendField('2WD車')
|
272
278
|
.appendField(new Blockly.FieldDropdown(twoWDPinDropdown), 'PIN')
|
@@ -287,7 +293,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
287
293
|
Blockly.Blocks['<%= n %>'] =
|
288
294
|
init: ()->
|
289
295
|
@setHelpUrl('')
|
290
|
-
@setColour(<%=
|
296
|
+
@setColour(<%= colors[:motion] %>)
|
291
297
|
@appendDummyInput()
|
292
298
|
.appendField('2WD車')
|
293
299
|
.appendField(new Blockly.FieldDropdown(twoWDPinDropdown), 'PIN')
|
@@ -321,7 +327,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
321
327
|
['止める', 'stop'],
|
322
328
|
]
|
323
329
|
@setHelpUrl('')
|
324
|
-
@setColour(<%=
|
330
|
+
@setColour(<%= colors[:motion] %>)
|
325
331
|
@appendDummyInput()
|
326
332
|
.appendField(new Blockly.FieldDropdown(commands), 'COMMAND')
|
327
333
|
@setOutput(true, 'String')
|
@@ -346,7 +352,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
346
352
|
Blockly.Blocks['<%= n %>'] =
|
347
353
|
init: ()->
|
348
354
|
@setHelpUrl('')
|
349
|
-
@setColour(<%=
|
355
|
+
@setColour(<%= colors[:sensing] %>)
|
350
356
|
@appendDummyInput()
|
351
357
|
.appendField('ボタン')
|
352
358
|
.appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN')
|
@@ -372,7 +378,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
372
378
|
Blockly.Blocks['<%= n %>'] =
|
373
379
|
init: ()->
|
374
380
|
@setHelpUrl('')
|
375
|
-
@setColour(<%=
|
381
|
+
@setColour(<%= colors[:events] %>)
|
376
382
|
@appendDummyInput()
|
377
383
|
.appendField('ボタン')
|
378
384
|
.appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN')
|
@@ -404,7 +410,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
404
410
|
Blockly.Blocks['<%= n %>'] =
|
405
411
|
init: ()->
|
406
412
|
@setHelpUrl('')
|
407
|
-
@setColour(<%=
|
413
|
+
@setColour(<%= colors[:sensing] %>)
|
408
414
|
@appendDummyInput()
|
409
415
|
.appendField('センサー')
|
410
416
|
.appendField(new Blockly.FieldDropdown(aiPinDropdown), 'PIN')
|
@@ -420,7 +426,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
420
426
|
Blockly.Blocks['<%= n %>'] =
|
421
427
|
init: ()->
|
422
428
|
@setHelpUrl('')
|
423
|
-
@setColour(<%=
|
429
|
+
@setColour(<%= colors[:events] %>)
|
424
430
|
@appendDummyInput()
|
425
431
|
.appendField('センサー')
|
426
432
|
.appendField(new Blockly.FieldDropdown(aiPinDropdown), 'PIN')
|
@@ -14,3 +14,15 @@ Blockly.Names.prototype.safeName_ = function(name) {
|
|
14
14
|
}
|
15
15
|
return name;
|
16
16
|
};
|
17
|
+
|
18
|
+
var originalBlocksMathNumberInit = Blockly.Blocks['math_number'].init;
|
19
|
+
Blockly.Blocks['math_number'].init = function() {
|
20
|
+
originalBlocksMathNumberInit.call(this);
|
21
|
+
this.setColour(100);
|
22
|
+
};
|
23
|
+
|
24
|
+
var originalBlocksTextInit = Blockly.Blocks['text'].init;
|
25
|
+
Blockly.Blocks['text'].init = function() {
|
26
|
+
originalBlocksTextInit.call(this);
|
27
|
+
this.setColour(100);
|
28
|
+
};
|
@@ -108,7 +108,7 @@ Blockly.Ruby.characterMethodCallInput_ = (method, args, options = {}) ->
|
|
108
108
|
|
109
109
|
Blockly.Ruby.characterSetVariable_ = (name, val, operator = '=') ->
|
110
110
|
if @c_()
|
111
|
-
"#{@rn_({ dropSelf: false})}#{name} #{operator} #{val}\n"
|
111
|
+
"#{@rn_({ dropSelf: false })}#{name} #{operator} #{val}\n"
|
112
112
|
else
|
113
113
|
''
|
114
114
|
|
@@ -66,6 +66,8 @@ window.Smalruby =
|
|
66
66
|
el: $('#character-modal')
|
67
67
|
@Views.LoadModalView = new Smalruby.LoadModalView
|
68
68
|
el: $('#load-modal')
|
69
|
+
@Views.ResetModalView = new Smalruby.ResetModalView
|
70
|
+
el: $('#reset-modal')
|
69
71
|
|
70
72
|
Smalruby.downloading = false
|
71
73
|
window.onbeforeunload = (event) ->
|
@@ -162,5 +164,15 @@ window.Smalruby =
|
|
162
164
|
else
|
163
165
|
true
|
164
166
|
|
167
|
+
# リセットする
|
168
|
+
reset: ->
|
169
|
+
@blocklyLoading = true
|
170
|
+
Blockly.mainWorkspace.clear()
|
171
|
+
@Collections.CharacterSet.reset()
|
172
|
+
$('#filename').val('')
|
173
|
+
window.textEditor.getSession().getDocument().setValue('')
|
174
|
+
window.textEditor.moveCursorTo(0, 0)
|
175
|
+
window.changed = false
|
176
|
+
|
165
177
|
$(document).ready ->
|
166
178
|
Smalruby.initialize()
|
@@ -272,7 +272,11 @@ Smalruby.MainMenuView = Backbone.View.extend
|
|
272
272
|
onReset: (e) ->
|
273
273
|
e.preventDefault()
|
274
274
|
|
275
|
-
|
275
|
+
if window.changed
|
276
|
+
Smalruby.Views.ResetModalView.render()
|
277
|
+
else
|
278
|
+
Smalruby.reset()
|
279
|
+
true
|
276
280
|
|
277
281
|
onSignin: (e) ->
|
278
282
|
e.preventDefault()
|
@@ -24,27 +24,28 @@
|
|
24
24
|
end
|
25
25
|
|
26
26
|
hues = %w(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
208
|
28
|
+
208
|
29
|
+
208
|
30
|
+
208
|
31
|
+
270
|
32
|
+
300
|
31
33
|
160
|
34
|
+
330
|
35
|
+
330
|
32
36
|
33
|
33
37
|
43
|
34
38
|
43
|
35
39
|
43
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
43
|
41
|
+
190
|
42
|
+
100
|
43
|
+
100
|
44
|
+
100
|
45
|
+
100
|
46
|
+
340
|
47
|
+
340
|
41
48
|
340
|
42
|
-
208
|
43
|
-
208
|
44
|
-
208
|
45
|
-
208
|
46
|
-
208
|
47
|
-
208
|
48
49
|
).map(&:to_i)
|
49
50
|
|
50
51
|
colors = hues.map { |h|
|
@@ -57,16 +58,25 @@
|
|
57
58
|
|
58
59
|
#\:<%= ids[index] %> {
|
59
60
|
.blocklyTreeRow {
|
60
|
-
|
61
|
-
padding-
|
62
|
-
|
61
|
+
margin-bottom: 1px;
|
62
|
+
padding-top: 1px;
|
63
|
+
padding-bottom: 1px;
|
64
|
+
color: white;
|
65
|
+
background-color: #<%= color %> !important;
|
66
|
+
|
67
|
+
span.blocklyTreeIcon, span.blocklyTreeLabel {
|
68
|
+
font-size: 14px;
|
69
|
+
}
|
63
70
|
}
|
64
71
|
|
65
72
|
.blocklyTreeRow.blocklyTreeSelected {
|
66
|
-
color: white;
|
67
73
|
font-weight: bold;
|
68
74
|
background-color: #<%= active_color %> !important;
|
69
75
|
}
|
70
76
|
}
|
71
77
|
|
72
78
|
<% end %>
|
79
|
+
|
80
|
+
div.blocklyTreeRoot {
|
81
|
+
padding: 0;
|
82
|
+
}
|
@@ -4,6 +4,31 @@ require 'nkf'
|
|
4
4
|
class SourceCodesController < ApplicationController
|
5
5
|
before_filter :check_whether_standalone, only: [:write, :run, :load_local]
|
6
6
|
|
7
|
+
# デモプログラム
|
8
|
+
DEMO_PROGRAMS =
|
9
|
+
[
|
10
|
+
{
|
11
|
+
title: '車のおいかけっこ',
|
12
|
+
filename: 'car_chase.rb',
|
13
|
+
imageUrl: '/smalruby/assets/car2.png',
|
14
|
+
},
|
15
|
+
{
|
16
|
+
title: 'クリックスターだにゃ~',
|
17
|
+
filename: 'star.rb',
|
18
|
+
imageUrl: '/smalruby/assets/cat1.png',
|
19
|
+
},
|
20
|
+
{
|
21
|
+
title: 'ピンポンゲーム',
|
22
|
+
filename: 'pong.rb',
|
23
|
+
imageUrl: '/smalruby/assets/cat2.png',
|
24
|
+
},
|
25
|
+
{
|
26
|
+
title: 'ライトをぴかっとさせるでよ',
|
27
|
+
filename: 'hardware_led.rb',
|
28
|
+
imageUrl: '/smalruby/assets/frog1.png',
|
29
|
+
},
|
30
|
+
]
|
31
|
+
|
7
32
|
def index
|
8
33
|
res = {
|
9
34
|
localPrograms: [],
|
@@ -22,26 +47,7 @@ class SourceCodesController < ApplicationController
|
|
22
47
|
end
|
23
48
|
|
24
49
|
# TODO: XMLから情報を抽出する
|
25
|
-
res[:demoPrograms]
|
26
|
-
title: '車のおいかけっこ',
|
27
|
-
filename: 'car_chase.rb',
|
28
|
-
imageUrl: '/smalruby/assets/car2.png',
|
29
|
-
}
|
30
|
-
res[:demoPrograms] << {
|
31
|
-
title: 'クリックスターだにゃ~',
|
32
|
-
filename: 'star.rb',
|
33
|
-
imageUrl: '/smalruby/assets/cat1.png',
|
34
|
-
}
|
35
|
-
res[:demoPrograms] << {
|
36
|
-
title: 'ピンポンゲーム',
|
37
|
-
filename: 'pong.rb',
|
38
|
-
imageUrl: '/smalruby/assets/cat2.png',
|
39
|
-
}
|
40
|
-
res[:demoPrograms] << {
|
41
|
-
title: 'ライトをぴかっとさせるでよ',
|
42
|
-
filename: 'hardware_led.rb',
|
43
|
-
imageUrl: '/smalruby/assets/frog1.png',
|
44
|
-
}
|
50
|
+
res[:demoPrograms] = DEMO_PROGRAMS
|
45
51
|
|
46
52
|
render json: res
|
47
53
|
end
|
@@ -6,7 +6,8 @@ module RubyToBlock
|
|
6
6
|
|
7
7
|
def self.process_match_data(md, context)
|
8
8
|
md2 = regexp.match(md[type])
|
9
|
-
add_character_method_call_block(context, md2[1],
|
9
|
+
add_character_method_call_block(context, md2[1],
|
10
|
+
new(fields: { XY: md2[2] }))
|
10
11
|
true
|
11
12
|
end
|
12
13
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#reset-modal{class: "#{modal_css_class}", tabindex: "-1",
|
2
|
+
role: "dialog", :"aria-hidden" => "true"}
|
3
|
+
.modal-header
|
4
|
+
%h3
|
5
|
+
本当にリセットしますか?
|
6
|
+
.modal-body
|
7
|
+
%p
|
8
|
+
作成中のプログラムが消えてしまうよ!
|
9
|
+
.modal-footer
|
10
|
+
%button#reset-modal-cancel-button.btn{:"data-dismiss" => "modal", :"aria-hidden" => "true"}<
|
11
|
+
%i.icon-remove
|
12
|
+
やめる
|
13
|
+
%button#reset-modal-ok-button.btn{class: "btn-primary"}<
|
14
|
+
%i.icon-off
|
15
|
+
リセット
|