smalruby-editor 0.3.5 → 0.4.0

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.

Files changed (366) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.rspec +0 -0
  4. data/.rubocop.yml +1 -0
  5. data/.simplecov +7 -7
  6. data/.travis.yml +0 -0
  7. data/Guardfile +1 -1
  8. data/LICENSE +0 -0
  9. data/Procfile +1 -1
  10. data/Rakefile +0 -0
  11. data/app/assets/images/.keep +0 -0
  12. data/app/assets/images/favicon.ico +0 -0
  13. data/app/assets/javascripts/blocks/blockly.js.coffee.erb +0 -0
  14. data/app/assets/javascripts/blocks/character.js.coffee.erb +3 -0
  15. data/app/assets/javascripts/blocks/data.js.coffee.erb +0 -0
  16. data/app/assets/javascripts/blocks/etc.js.coffee.erb +0 -0
  17. data/app/assets/javascripts/blocks/field_character.js.coffee.erb +13 -1
  18. data/app/assets/javascripts/blocks/field_costume.js.coffee.erb +84 -0
  19. data/app/assets/javascripts/blocks/hardware.js.coffee.erb +26 -0
  20. data/app/assets/javascripts/blocks/looks.js.coffee.erb +32 -0
  21. data/app/assets/javascripts/collections/.keep +0 -0
  22. data/app/assets/javascripts/collections/character_set.js.coffee +0 -0
  23. data/app/assets/javascripts/generators/ruby.js.coffee.erb +10 -1
  24. data/app/assets/javascripts/models/.keep +0 -0
  25. data/app/assets/javascripts/models/character.js.coffee +45 -6
  26. data/app/assets/javascripts/models/scene.js.coffee +0 -0
  27. data/app/assets/javascripts/msg/en_us.js +4 -0
  28. data/app/assets/javascripts/msg/ja.js +4 -0
  29. data/app/assets/javascripts/routers/.keep +0 -0
  30. data/app/assets/javascripts/smalruby.js.coffee.erb +5 -1
  31. data/app/assets/javascripts/views/.keep +0 -0
  32. data/app/assets/javascripts/views/character_modal_view.js.coffee.erb +357 -0
  33. data/app/assets/javascripts/views/character_selector_view.js.coffee +2 -0
  34. data/app/assets/stylesheets/editor.css.scss +201 -16
  35. data/app/assets/stylesheets/flatstrap-custom.css.scss +0 -0
  36. data/app/assets/stylesheets/load-modal.css.scss +0 -0
  37. data/app/assets/templates/.keep +0 -0
  38. data/app/controllers/application_controller.rb +8 -2
  39. data/app/controllers/concerns/.keep +0 -0
  40. data/app/controllers/costumes_controller.rb +58 -0
  41. data/app/controllers/editor_controller.rb +2 -0
  42. data/app/helpers/costumes_helper.rb +2 -0
  43. data/app/helpers/editor_helper.rb +0 -0
  44. data/app/helpers/sessions_helper.rb +0 -4
  45. data/app/mailers/.keep +0 -0
  46. data/app/models/.keep +0 -0
  47. data/app/models/concerns/.keep +0 -0
  48. data/app/models/concerns/ruby_to_block.rb +0 -0
  49. data/app/models/concerns/ruby_to_block/block.rb +0 -0
  50. data/app/models/concerns/ruby_to_block/block/base.rb +2 -0
  51. data/app/models/concerns/ruby_to_block/block/character.rb +32 -11
  52. data/app/models/concerns/ruby_to_block/block/character_event.rb +0 -0
  53. data/app/models/concerns/ruby_to_block/block/character_method_call.rb +0 -0
  54. data/app/models/concerns/ruby_to_block/block/character_new.rb +0 -0
  55. data/app/models/concerns/ruby_to_block/block/character_operation.rb +0 -0
  56. data/app/models/concerns/ruby_to_block/block/control_beark.rb +0 -0
  57. data/app/models/concerns/ruby_to_block/block/control_if.rb +0 -0
  58. data/app/models/concerns/ruby_to_block/block/control_loop.rb +0 -0
  59. data/app/models/concerns/ruby_to_block/block/control_sleep.rb +0 -0
  60. data/app/models/concerns/ruby_to_block/block/do.rb +0 -0
  61. data/app/models/concerns/ruby_to_block/block/else.rb +0 -0
  62. data/app/models/concerns/ruby_to_block/block/end.rb +0 -0
  63. data/app/models/concerns/ruby_to_block/block/events_on_click.rb +0 -0
  64. data/app/models/concerns/ruby_to_block/block/events_on_key_push_or_down.rb +0 -0
  65. data/app/models/concerns/ruby_to_block/block/events_on_start.rb +0 -0
  66. data/app/models/concerns/ruby_to_block/block/hardware_button_pressed_or_released.rb +0 -0
  67. data/app/models/concerns/ruby_to_block/block/hardware_init_hardware.rb +0 -0
  68. data/app/models/concerns/ruby_to_block/block/hardware_led_turn_off.rb +0 -0
  69. data/app/models/concerns/ruby_to_block/block/hardware_led_turn_on.rb +0 -0
  70. data/app/models/concerns/ruby_to_block/block/hardware_motor_driver.rb +0 -0
  71. data/app/models/concerns/ruby_to_block/block/hardware_motor_driver_set_speed.rb +0 -0
  72. data/app/models/concerns/ruby_to_block/block/hardware_motor_driver_speed.rb +0 -0
  73. data/app/models/concerns/ruby_to_block/block/hardware_neo_pixel_set_rgb.rb +31 -0
  74. data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_set_color.rb +0 -0
  75. data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_turn_off.rb +0 -0
  76. data/app/models/concerns/ruby_to_block/block/hardware_sensor_value.rb +0 -0
  77. data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car.rb +0 -0
  78. data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_commands.rb +0 -0
  79. data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_run.rb +0 -0
  80. data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_set_speed.rb +0 -0
  81. data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_speed.rb +0 -0
  82. data/app/models/concerns/ruby_to_block/block/looks_hide.rb +0 -0
  83. data/app/models/concerns/ruby_to_block/block/looks_next_costume.rb +12 -0
  84. data/app/models/concerns/ruby_to_block/block/looks_say.rb +0 -0
  85. data/app/models/concerns/ruby_to_block/block/looks_show.rb +0 -0
  86. data/app/models/concerns/ruby_to_block/block/looks_switch_costume.rb +22 -0
  87. data/app/models/concerns/ruby_to_block/block/looks_vanish.rb +0 -0
  88. data/app/models/concerns/ruby_to_block/block/math_number.rb +0 -0
  89. data/app/models/concerns/ruby_to_block/block/motion_change_x_by.rb +0 -0
  90. data/app/models/concerns/ruby_to_block/block/motion_change_y_by.rb +0 -0
  91. data/app/models/concerns/ruby_to_block/block/motion_go_to_character.rb +0 -0
  92. data/app/models/concerns/ruby_to_block/block/motion_go_to_mouse.rb +0 -0
  93. data/app/models/concerns/ruby_to_block/block/motion_move.rb +0 -0
  94. data/app/models/concerns/ruby_to_block/block/motion_point_towards_character.rb +0 -0
  95. data/app/models/concerns/ruby_to_block/block/motion_point_towards_mouse.rb +0 -0
  96. data/app/models/concerns/ruby_to_block/block/motion_rotate_left.rb +0 -0
  97. data/app/models/concerns/ruby_to_block/block/motion_rotate_right.rb +0 -0
  98. data/app/models/concerns/ruby_to_block/block/motion_self_angle.rb +0 -0
  99. data/app/models/concerns/ruby_to_block/block/motion_self_x.rb +0 -0
  100. data/app/models/concerns/ruby_to_block/block/motion_self_y.rb +0 -0
  101. data/app/models/concerns/ruby_to_block/block/motion_set_angle.rb +0 -0
  102. data/app/models/concerns/ruby_to_block/block/motion_set_x.rb +0 -0
  103. data/app/models/concerns/ruby_to_block/block/motion_set_x_y.rb +0 -0
  104. data/app/models/concerns/ruby_to_block/block/motion_set_y.rb +0 -0
  105. data/app/models/concerns/ruby_to_block/block/motion_turn.rb +0 -0
  106. data/app/models/concerns/ruby_to_block/block/motion_turn_if_reach_wall.rb +0 -0
  107. data/app/models/concerns/ruby_to_block/block/motion_turn_xy.rb +0 -0
  108. data/app/models/concerns/ruby_to_block/block/null.rb +0 -0
  109. data/app/models/concerns/ruby_to_block/block/operators_compare.rb +0 -0
  110. data/app/models/concerns/ruby_to_block/block/operators_false.rb +0 -0
  111. data/app/models/concerns/ruby_to_block/block/operators_true.rb +0 -0
  112. data/app/models/concerns/ruby_to_block/block/require_smalruby.rb +0 -0
  113. data/app/models/concerns/ruby_to_block/block/ruby_comment.rb +0 -0
  114. data/app/models/concerns/ruby_to_block/block/ruby_expression.rb +0 -0
  115. data/app/models/concerns/ruby_to_block/block/ruby_p.rb +0 -0
  116. data/app/models/concerns/ruby_to_block/block/ruby_statement.rb +0 -0
  117. data/app/models/concerns/ruby_to_block/block/sensing_hit.rb +0 -0
  118. data/app/models/concerns/ruby_to_block/block/sensing_reach_wall.rb +0 -0
  119. data/app/models/concerns/ruby_to_block/block/sound_play.rb +0 -0
  120. data/app/models/concerns/ruby_to_block/block/sound_preset_sounds.rb +0 -0
  121. data/app/models/concerns/ruby_to_block/block/text.rb +0 -0
  122. data/app/models/concerns/ruby_to_block/block/value.rb +0 -0
  123. data/app/models/concerns/ruby_to_block/context.rb +0 -0
  124. data/app/models/concerns/ruby_to_block/formatter.rb +0 -0
  125. data/app/models/costume.rb +67 -0
  126. data/app/models/source_code.rb +9 -1
  127. data/app/models/user.rb +7 -0
  128. data/app/views/costumes/index.html.haml +19 -0
  129. data/app/views/editor/_character_modal.html.haml +35 -7
  130. data/app/views/editor/_toolbox_default.html.haml +9 -0
  131. data/app/views/editor/demo.html.erb +0 -0
  132. data/app/views/editor/index.html.haml +1 -0
  133. data/bin/smalruby-editor +1 -0
  134. data/bin/spring +7 -9
  135. data/config.ru +0 -0
  136. data/config/boot.rb +0 -0
  137. data/config/database.yml.mysql2 +0 -0
  138. data/config/database.yml.sqlite3 +0 -0
  139. data/config/database.yml.travis +0 -0
  140. data/config/environment.rb +0 -0
  141. data/config/environments/development.rb +0 -0
  142. data/config/environments/production.rb +0 -0
  143. data/config/environments/standalone.rb +0 -0
  144. data/config/environments/test.rb +0 -0
  145. data/config/initializers/backtrace_silencers.rb +0 -0
  146. data/config/initializers/filter_parameter_logging.rb +0 -0
  147. data/config/initializers/inflections.rb +0 -0
  148. data/config/initializers/mime_types.rb +0 -0
  149. data/config/initializers/secret_token.rb +0 -0
  150. data/config/initializers/session_store.rb +0 -0
  151. data/config/initializers/teaspoon.rb +0 -0
  152. data/config/initializers/wrap_parameters.rb +0 -0
  153. data/config/locales/en.yml +10 -1
  154. data/config/locales/ja.yml +10 -0
  155. data/config/routes.rb +2 -0
  156. data/config/unicorn.rb +23 -23
  157. data/db/migrate/20131216121603_create_source_codes.rb +0 -0
  158. data/db/migrate/20131219045113_add_filename_to_source_code.rb +0 -0
  159. data/db/migrate/20150513061250_add_index_name_on_users.rb +1 -1
  160. data/db/migrate/20150607012053_create_costumes.rb +12 -0
  161. data/db/migrate/20150607012707_add_indexes_on_costumes.rb +13 -0
  162. data/db/migrate/20150607034013_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
  163. data/db/migrate/20150607034014_add_missing_unique_indices.acts_as_taggable_on_engine.rb +21 -0
  164. data/db/migrate/20150607034015_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
  165. data/db/migrate/20150607034016_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
  166. data/db/migrate/20150607034017_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +12 -0
  167. data/db/migrate/20150607034018_insert_preset_costumes.rb +9 -0
  168. data/db/schema.rb +35 -2
  169. data/db/seeds.rb +2 -0
  170. data/demos/car_chase.rb.xml +128 -128
  171. data/demos/pong.rb.xml +379 -379
  172. data/demos/star.rb.xml +115 -115
  173. data/lib/assets/.keep +0 -0
  174. data/lib/smalruby_editor/version.rb +1 -1
  175. data/lib/tasks/.keep +0 -0
  176. data/lib/tasks/gem.rake +0 -0
  177. data/lib/tasks/rspec.rake +0 -0
  178. data/lib/tasks/rubocop.rake +0 -0
  179. data/log/.keep +0 -0
  180. data/public/404.html +0 -0
  181. data/public/422.html +0 -0
  182. data/public/500.html +0 -0
  183. data/public/apple-touch-icon.png +0 -0
  184. data/public/blockly/media/1x1.gif +0 -0
  185. data/public/blockly/media/click.mp3 +0 -0
  186. data/public/blockly/media/click.ogg +0 -0
  187. data/public/blockly/media/click.wav +0 -0
  188. data/public/blockly/media/delete.mp3 +0 -0
  189. data/public/blockly/media/delete.ogg +0 -0
  190. data/public/blockly/media/delete.wav +0 -0
  191. data/public/blockly/media/handopen.cur +0 -0
  192. data/public/blockly/media/quote0.png +0 -0
  193. data/public/blockly/media/quote1.png +0 -0
  194. data/public/browserconfig.xml +0 -0
  195. data/public/fonts/FontAwesome.otf +0 -0
  196. data/public/fonts/fontawesome-webfont.eot +0 -0
  197. data/public/fonts/fontawesome-webfont.ttf +0 -0
  198. data/public/fonts/fontawesome-webfont.woff +0 -0
  199. data/public/large.png +0 -0
  200. data/public/robots.txt +0 -0
  201. data/public/smalruby/assets/ball1.png +0 -0
  202. data/public/smalruby/assets/ball2.png +0 -0
  203. data/public/smalruby/assets/ball3.png +0 -0
  204. data/public/smalruby/assets/ball4.png +0 -0
  205. data/public/smalruby/assets/ball5.png +0 -0
  206. data/public/smalruby/assets/ball6.png +0 -0
  207. data/public/smalruby/assets/car1.png +0 -0
  208. data/public/smalruby/assets/car2.png +0 -0
  209. data/public/smalruby/assets/car3.png +0 -0
  210. data/public/smalruby/assets/car4.png +0 -0
  211. data/public/smalruby/assets/cat1.png +0 -0
  212. data/public/smalruby/assets/cat2.png +0 -0
  213. data/public/smalruby/assets/cat3.png +0 -0
  214. data/public/smalruby/assets/frog1.png +0 -0
  215. data/public/smalruby/assets/piano_do.wav +0 -0
  216. data/public/smalruby/assets/piano_do_2.wav +0 -0
  217. data/public/smalruby/assets/piano_fa.wav +0 -0
  218. data/public/smalruby/assets/piano_mi.wav +0 -0
  219. data/public/smalruby/assets/piano_ra.wav +0 -0
  220. data/public/smalruby/assets/piano_re.wav +0 -0
  221. data/public/smalruby/assets/piano_si.wav +0 -0
  222. data/public/smalruby/assets/piano_so.wav +0 -0
  223. data/public/smalruby/assets/ryu1.png +0 -0
  224. data/public/smalruby/assets/ryu2.png +0 -0
  225. data/public/smalruby/assets/taichi1.png +0 -0
  226. data/public/smalruby/assets/taichi2.png +0 -0
  227. data/public/square.png +0 -0
  228. data/public/tiny.png +0 -0
  229. data/public/wide.png +0 -0
  230. data/smalruby-editor.gemspec +2 -1
  231. data/spec/acceptance/block_mode/blocks/character/new.feature +5 -5
  232. data/spec/acceptance/block_mode/blocks/control/await.feature +2 -2
  233. data/spec/acceptance/block_mode/blocks/control/await_until.feature +3 -3
  234. data/spec/acceptance/block_mode/blocks/control/break.feature +0 -0
  235. data/spec/acceptance/block_mode/blocks/control/if.feature +0 -0
  236. data/spec/acceptance/block_mode/blocks/control/if_else.feature +0 -0
  237. data/spec/acceptance/block_mode/blocks/control/loop.feature +0 -0
  238. data/spec/acceptance/block_mode/blocks/control/next.feature +0 -0
  239. data/spec/acceptance/block_mode/blocks/control/redo.feature +0 -0
  240. data/spec/acceptance/block_mode/blocks/control/sleep.feature +0 -0
  241. data/spec/acceptance/block_mode/blocks/control/times.feature +0 -0
  242. data/spec/acceptance/block_mode/blocks/control/until.feature +0 -0
  243. data/spec/acceptance/block_mode/blocks/events/on_click.feature +2 -2
  244. data/spec/acceptance/block_mode/blocks/events/on_hit.feature +4 -4
  245. data/spec/acceptance/block_mode/blocks/events/on_key_push_or_down.feature +4 -4
  246. data/spec/acceptance/block_mode/blocks/events/on_start.feature +2 -2
  247. data/spec/acceptance/block_mode/blocks/hardware/init_hardware.feature +1 -1
  248. data/spec/acceptance/block_mode/blocks/hardware/led_turn_off.feature +2 -2
  249. data/spec/acceptance/block_mode/blocks/hardware/led_turn_on.feature +2 -2
  250. data/spec/acceptance/block_mode/blocks/hardware/motor_driver.feature +0 -0
  251. data/spec/acceptance/block_mode/blocks/hardware/motor_driver_speed.feature +0 -0
  252. data/spec/acceptance/block_mode/blocks/hardware/neo_pixel_set_rgb.feature +100 -0
  253. data/spec/acceptance/block_mode/blocks/hardware/rgb_led_set_color.feature +0 -0
  254. data/spec/acceptance/block_mode/blocks/hardware/rgb_led_turn_off.feature +0 -0
  255. data/spec/acceptance/block_mode/blocks/hardware/sensor_value.feature +0 -0
  256. data/spec/acceptance/block_mode/blocks/hardware/servo_set_position.feature +0 -0
  257. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_action_with_sec.feature +1 -1
  258. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_led_turn_on_or_off.feature +1 -1
  259. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_action_with_sec.feature +1 -1
  260. data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature +0 -0
  261. data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car_speed.feature +0 -0
  262. data/spec/acceptance/block_mode/blocks/looks/hide.feature +2 -2
  263. data/spec/acceptance/block_mode/blocks/looks/next_costume.feature +56 -0
  264. data/spec/acceptance/block_mode/blocks/looks/say.feature +3 -3
  265. data/spec/acceptance/block_mode/blocks/looks/show.feature +2 -2
  266. data/spec/acceptance/block_mode/blocks/looks/vanish.feature +2 -2
  267. data/spec/acceptance/block_mode/blocks/motion/change_x_by.feature +2 -2
  268. data/spec/acceptance/block_mode/blocks/motion/change_y_by.feature +2 -2
  269. data/spec/acceptance/block_mode/blocks/motion/move.feature +2 -2
  270. data/spec/acceptance/block_mode/blocks/motion/reach_wall.feature +2 -2
  271. data/spec/acceptance/block_mode/blocks/motion/rotate_left.feature +2 -2
  272. data/spec/acceptance/block_mode/blocks/motion/rotate_right.feature +2 -2
  273. data/spec/acceptance/block_mode/blocks/motion/self_angle.feature +2 -2
  274. data/spec/acceptance/block_mode/blocks/motion/self_x.feature +2 -2
  275. data/spec/acceptance/block_mode/blocks/motion/self_y.feature +2 -2
  276. data/spec/acceptance/block_mode/blocks/motion/set_angle.feature +2 -2
  277. data/spec/acceptance/block_mode/blocks/motion/set_x.feature +2 -2
  278. data/spec/acceptance/block_mode/blocks/motion/set_x_y.feature +2 -2
  279. data/spec/acceptance/block_mode/blocks/motion/set_y.feature +2 -2
  280. data/spec/acceptance/block_mode/blocks/motion/turn.feature +2 -2
  281. data/spec/acceptance/block_mode/blocks/motion/turn_if_reach_wall.feature +2 -2
  282. data/spec/acceptance/block_mode/blocks/operators/and_or.feature +0 -0
  283. data/spec/acceptance/block_mode/blocks/operators/four_arithmetic_and_compares.feature +0 -0
  284. data/spec/acceptance/block_mode/blocks/operators/index_of.feature +0 -0
  285. data/spec/acceptance/block_mode/blocks/operators/length.feature +0 -0
  286. data/spec/acceptance/block_mode/blocks/operators/math_method.feature +0 -0
  287. data/spec/acceptance/block_mode/blocks/operators/negate.feature +0 -0
  288. data/spec/acceptance/block_mode/blocks/operators/rand.feature +0 -0
  289. data/spec/acceptance/block_mode/blocks/operators/round.feature +0 -0
  290. data/spec/acceptance/block_mode/blocks/operators/text.feature +0 -0
  291. data/spec/acceptance/block_mode/blocks/operators/true_false.feature +0 -0
  292. data/spec/acceptance/block_mode/blocks/ruby/expression.feature +0 -0
  293. data/spec/acceptance/block_mode/blocks/ruby/p.feature +0 -0
  294. data/spec/acceptance/block_mode/blocks/ruby/statement_comment.feature +0 -0
  295. data/spec/acceptance/block_mode/blocks/sensing/character_property.feature +2 -2
  296. data/spec/acceptance/block_mode/blocks/sensing/hit.feature +6 -6
  297. data/spec/acceptance/block_mode/blocks/sensing/input_key_push_or_down.feature +0 -0
  298. data/spec/acceptance/block_mode/blocks/sensing/input_mouse_pos_x.feature +0 -0
  299. data/spec/acceptance/block_mode/blocks/sensing/input_mouse_pos_y.feature +0 -0
  300. data/spec/acceptance/block_mode/blocks/sensing/input_mouse_push_or_down.feature +0 -0
  301. data/spec/acceptance/block_mode/blocks/sensing/reach_wall.feature +2 -2
  302. data/spec/acceptance/block_mode/blocks/sensing/time_now.feature +0 -0
  303. data/spec/acceptance/block_mode/blocks/sound/play.feature +2 -2
  304. data/spec/acceptance/block_mode/character_modal_view.feature +164 -0
  305. data/spec/acceptance/block_mode/demo.feature +2 -2
  306. data/spec/acceptance/block_mode/translate.feature +0 -0
  307. data/spec/acceptance/readme.md +0 -0
  308. data/spec/acceptance/ruby_mode/check.feature +0 -0
  309. data/spec/acceptance/ruby_mode/load.feature +0 -0
  310. data/spec/acceptance/ruby_mode/translate.feature +2 -2
  311. data/spec/acceptance/standalone/preference.feature +8 -8
  312. data/spec/acceptance/standalone/run.feature +0 -0
  313. data/spec/acceptance/standalone/save.feature +1 -1
  314. data/spec/acceptance/standalone/signin.feature +1 -1
  315. data/spec/controllers/source_codes_controller_spec.rb +0 -0
  316. data/spec/fixtures/files/01.rb +0 -0
  317. data/spec/fixtures/files/01.rb.xml +0 -0
  318. data/spec/fixtures/files/01_remix.rb +0 -0
  319. data/spec/fixtures/files/01_remix02.rb +0 -0
  320. data/spec/fixtures/files/01_remix10.rb.xml +0 -0
  321. data/spec/fixtures/files/extra_car.png +0 -0
  322. data/spec/fixtures/files/favicon.ico +0 -0
  323. data/spec/helpers/editor_helper_spec.rb +0 -0
  324. data/spec/javascripts/collections/character_set_spec.coffee +0 -0
  325. data/spec/javascripts/models/character_spec.coffee +2 -14
  326. data/spec/javascripts/models/scene_spec.coffee +0 -0
  327. data/spec/javascripts/spec_helper.js +0 -0
  328. data/spec/lib/smalruby_editor_spec.rb +0 -0
  329. data/spec/models/concerns/ruby_to_block/block/character_method_call_spec.rb +0 -0
  330. data/spec/models/concerns/ruby_to_block/block/character_spec.rb +71 -0
  331. data/spec/models/concerns/ruby_to_block/block/control_if_spec.rb +0 -0
  332. data/spec/models/concerns/ruby_to_block/block/control_loop_spec.rb +0 -0
  333. data/spec/models/concerns/ruby_to_block/block/events_on_start_spec.rb +6 -6
  334. data/spec/models/concerns/ruby_to_block/block/hardware__neo_pixel_spec.rb +77 -0
  335. data/spec/models/concerns/ruby_to_block/block/looks_say_spec.rb +0 -0
  336. data/spec/models/concerns/ruby_to_block/block/looks_spec.rb +26 -2
  337. data/spec/models/concerns/ruby_to_block/block/motion_move_spec.rb +0 -0
  338. data/spec/models/concerns/ruby_to_block/block/motion_spec.rb +0 -0
  339. data/spec/models/concerns/ruby_to_block/block/motion_turn_spec.rb +0 -0
  340. data/spec/models/concerns/ruby_to_block/block/motion_turn_xy_spec.rb +0 -0
  341. data/spec/models/concerns/ruby_to_block/block/require_smalruby_spec.rb +0 -0
  342. data/spec/models/concerns/ruby_to_block/block/ruby_comment_spec.rb +0 -0
  343. data/spec/models/concerns/ruby_to_block/block/ruby_statement_spec.rb +0 -0
  344. data/spec/models/concerns/ruby_to_block/block/sensing_reach_wall_spec.rb +0 -0
  345. data/spec/models/concerns/ruby_to_block/block/shared/block_examples.rb +2 -2
  346. data/spec/models/concerns/ruby_to_block/block/sound_spec.rb +0 -0
  347. data/spec/models/concerns/ruby_to_block/block/text_spec.rb +0 -0
  348. data/spec/models/concerns/ruby_to_block/block_spec.rb +0 -0
  349. data/spec/models/concerns/ruby_to_block_spec.rb +0 -0
  350. data/spec/spec_helper.rb +21 -10
  351. data/spec/steps/block_mode_steps.rb +0 -0
  352. data/spec/steps/fix_turnip.rb +0 -0
  353. data/spec/steps/global_variable.rb +0 -0
  354. data/spec/steps/standalone_steps.rb +3 -3
  355. data/spec/steps/then_steps.rb +28 -0
  356. data/spec/steps/when_steps.rb +15 -18
  357. data/spec/support/capybara.rb +0 -0
  358. data/spec/support/env.rb +0 -0
  359. data/spec/support/ruby_to_block.rb +0 -0
  360. data/spec/teaspoon_env.rb +0 -0
  361. data/spec/turnip_helper.rb +0 -0
  362. data/vendor/assets/javascripts/.keep +0 -0
  363. data/vendor/assets/javascripts/jquery.blockUI.js +0 -0
  364. data/vendor/assets/stylesheets/.keep +0 -0
  365. metadata +56 -14
  366. data/app/assets/javascripts/views/character_modal_view.js.coffee +0 -194
File without changes
@@ -0,0 +1,357 @@
1
+ <%
2
+ require 'smalruby_editor'
3
+ require 'smalruby_editor/blockly_message_helper'
4
+ %>
5
+
6
+ # キャラクター設定ダイアログを表現するビュー
7
+ Smalruby.CharacterModalView = Backbone.View.extend
8
+ model: new Smalruby.Character()
9
+
10
+ events:
11
+ 'click #character-modal-costume-selector a.thumbnail': 'onSelectCostume'
12
+ 'click #character-modal-costume-selector a#character-modal-upload-costume': 'onUploadCostume'
13
+ 'click #character_rotation_style_free': 'onRotationStyleFree'
14
+ 'click #character_rotation_style_left_right': 'onRotationStyleLeftRight'
15
+ 'click #character_rotation_style_none': 'onRotationStyleNone'
16
+ 'click #character-modal-ok-button': 'onOk'
17
+
18
+ previewZoomLevel: 0.5
19
+
20
+ initialize: ->
21
+ Smalruby.removeBackdropOnHidden(@$el)
22
+
23
+ @target = null
24
+
25
+ $('#character-modal-costume-selector img').on 'dragstart', (e) ->
26
+ e.preventDefault()
27
+
28
+ setPosition = (pos) =>
29
+ @model.set
30
+ x: parseInt(pos.left / @previewZoomLevel)
31
+ y: parseInt(pos.top / @previewZoomLevel)
32
+
33
+ $('#character-modal-character').draggable
34
+ containment: '#character-modal-preview'
35
+ cursor: 'move'
36
+ drag: (event, ui) ->
37
+ setPosition(ui.position)
38
+
39
+ $('#character-modal-preview').droppable
40
+ drop: (event, ui) ->
41
+ setPosition(ui.draggable.position())
42
+
43
+ Smalruby.ignoreEnterKey(@$el)
44
+
45
+ @templateText = $('#character-modal-costume-template').text()
46
+
47
+ $('#character-modal-add-costume-button').click (e) =>
48
+ e.preventDefault()
49
+
50
+ costumes = @model.get('costumes').slice(0)
51
+ costumes.push(@model.costume())
52
+ costumeNames = @model.get('costumeNames').slice(0)
53
+ costumeNames.push("costume#{costumes.length}")
54
+ @model.set
55
+ costumes: costumes
56
+ costumeNames: costumeNames
57
+ costumeIndex: costumes.length - 1
58
+
59
+ self = @
60
+ changeNameFunc = (e) ->
61
+ self.model.set({ name: $(@).val() })
62
+ self.nameChanged = true
63
+ @$el.find('input[name="character[name]"]').change(changeNameFunc)
64
+ @$el.find('input[name="character[name]"]').keyup(changeNameFunc)
65
+
66
+ @$el.find('input[name="character[x]"]').change (e) ->
67
+ self.model.set({ x: $(@).val() })
68
+
69
+ @$el.find('input[name="character[y]"]').change (e) ->
70
+ self.model.set({ y: $(@).val() })
71
+
72
+ @$el.find('input[name="character[angle]"]').change (e) ->
73
+ self.model.set({ angle: $(@).val() })
74
+
75
+ changeCostumeNameFunc = (e) ->
76
+ val = $(@).val()
77
+ costumeNames = _.clone(self.model.get('costumeNames'))
78
+ costumeNames[self.model.get('costumeIndex')] = val
79
+ self.model.set({ costumeNames: costumeNames })
80
+ @$el.find('input[name="costume[name]"]').change(changeCostumeNameFunc)
81
+ @$el.find('input[name="costume[name]"]').keyup(changeCostumeNameFunc)
82
+
83
+ @listenTo(@model, 'change:name', @onChangeName)
84
+ @listenTo(@model, 'change:x', @onChangeX)
85
+ @listenTo(@model, 'change:y', @onChangeY)
86
+ @listenTo(@model, 'change:angle', @onChangeAngle)
87
+ @listenTo(@model, 'change:costumes', @onChangeCostumes)
88
+ @listenTo(@model, 'change:costumeNames', @onChangeCostumeNames)
89
+ @listenTo(@model, 'change:costumeIndex', @onChangeCostumeIndex)
90
+ @listenTo(@model, 'change:rotationStyle', @onChangeRotationStyle)
91
+ @listenTo(@model, 'change', @onChange)
92
+
93
+ @callAllOnChangeAttributes_()
94
+
95
+ render: ->
96
+ @onChange(@model)
97
+
98
+ @$el.find('.modal-body').block
99
+ message: null
100
+
101
+ unblock = =>
102
+ @$el.find('.modal-body').unblock()
103
+ null # HACK: if return unblock(), does not call fail().
104
+
105
+ @$el.modal
106
+ backdrop: 'static'
107
+ @$el.modal('show')
108
+
109
+ dfr = $.Deferred()
110
+ $.ajax
111
+ url: '/costumes/'
112
+ type: 'GET'
113
+ cache: false
114
+ success: (data, textStatus, jqXHR) -> dfr.resolve(data)
115
+ error: dfr.reject
116
+ dfr.promise()
117
+ .then (data) =>
118
+ @replaceCostumeSelectorHtml_(data)
119
+ .then(unblock, unblock)
120
+ .fail =>
121
+ @$el.modal('hide')
122
+ errorMessage(<%= bm('.error') %>)
123
+
124
+ replaceCostumeSelectorHtml_: (html) ->
125
+ @$el.find('#character-modal-costume-selector').replaceWith(html)
126
+
127
+ self = @
128
+ @$el.find('#character-modal-costume-selector a.remove-button').click (e) ->
129
+ e.preventDefault()
130
+
131
+ link = $(@)
132
+ if confirm(link.attr("data-message"))
133
+ dfr = $.Deferred()
134
+ $.ajax
135
+ url: link.attr("data-url")
136
+ type: "DELETE"
137
+ cache: false
138
+ data: { "_method": "DELETE" },
139
+ success: (data, textStatus, jqXHR) -> dfr.resolve(data)
140
+ error: dfr.reject
141
+ dfr.promise()
142
+ .then (data) ->
143
+ self.replaceCostumeSelectorHtml_(data)
144
+ .fail ->
145
+ errorMessage(<%= bm('.error_remove_costume') %>)
146
+
147
+ @$el.find('#character-modal-upload-costume-form').fileupload
148
+ dataType: "html"
149
+ done: (e, data) =>
150
+ @replaceCostumeSelectorHtml_(data.result)
151
+
152
+ @setActiveCostume_()
153
+ @renderCostumeSet_()
154
+
155
+ # HACK: ダイアログを表示して50ms程度待たないと画像のサイズが取得できなかった
156
+ f = ->
157
+ if @readImageSizeflag
158
+ img = $('#character-modal-costume-selector .active img')
159
+ if img.width() > 0
160
+ $('#character-modal-character').css
161
+ width: "#{img.width() / 2}px"
162
+ height: "#{img.height() / 2}px"
163
+ @readImageSizeflag = false
164
+ else
165
+ setTimeout(_.bind(f, @), 50)
166
+ if @readImageSizeflag
167
+ setTimeout(_.bind(f, @), 1)
168
+
169
+ setActiveCostume_: ->
170
+ @$el.find('#character-modal-costume-selector a.thumbnail').removeClass('active')
171
+ thumb = @$el.find("#character-modal-costume-selector img[alt=\"#{@model.costume()}\"]")
172
+ thumb.parent().addClass('active')
173
+ if thumb.width() > 0
174
+ $('#character-modal-character').css
175
+ width: "#{thumb.width() / 2}px"
176
+ height: "#{thumb.height() / 2}px"
177
+ else
178
+ @readImageSizeflag = true
179
+
180
+ renderCostumeSet_: ->
181
+ costumesEl = @$el.find('#character-modal-costume-set')
182
+ costumesEl.children().remove()
183
+
184
+ costumes = @model.get('costumes')
185
+ $.each costumes, (i, name) =>
186
+ costume =
187
+ name: @model.costumeName(i)
188
+ basename: name
189
+ path: @model.costumeUrl(i)
190
+ index: i + 1
191
+
192
+ html = $(_.template(@templateText, costume))
193
+ costumesEl.append(html)
194
+
195
+ html.find('a.costume').click (e) =>
196
+ e.preventDefault()
197
+ @model.set({ costumeIndex: i })
198
+
199
+ removeButton = html.find('a.remove-button')
200
+ if costumes.length <= 1
201
+ removeButton.hide()
202
+ else
203
+ removeButton.click (e) =>
204
+ e.preventDefault()
205
+ @removeCostume_(i)
206
+
207
+ @renderActiveCostume_()
208
+
209
+ removeCostume_: (i) ->
210
+ costumes = @model.get('costumes').slice(0)
211
+ costumes.splice(i, 1)
212
+ costumeNames = @model.get('costumeNames').slice(0)
213
+ costumeNames.splice(i, 1)
214
+ costumeIndex = @model.get('costumeIndex')
215
+ if costumeIndex >= costumes.length
216
+ costumeIndex = costumes.length - 1
217
+ @model.set
218
+ costumes: costumes
219
+ costumeNames: costumeNames
220
+ costumeIndex: costumeIndex
221
+
222
+ renderActiveCostume_: ->
223
+ costumesEl = @$el.find('#character-modal-costume-set')
224
+ costumesEl.find('.item').removeClass('active')
225
+ costumeIndex = @model.get('costumeIndex')
226
+ costumesEl.find(".item:nth-child(#{costumeIndex + 1})").addClass('active')
227
+
228
+ callAllOnChangeAttributes_: ->
229
+ @onChangeName(@model, @model.get('name'))
230
+ @onChangeX(@model, @model.get('x'))
231
+ @onChangeY(@model, @model.get('y'))
232
+ @onChangeAngle(@model, @model.get('angle'))
233
+ @onChangeCostumes(@model, @model.get('costumes'))
234
+ @onChangeRotationStyle(@model, @model.get('rotationStyle'))
235
+
236
+ onChangeName: (model, value, options) ->
237
+ @$el.find('input[name="character[name]"]').val(value)
238
+
239
+ onChangeX: (model, value, options) ->
240
+ @$el.find('input[name="character[x]"]').val(value)
241
+ $('#character_x_value').text(value)
242
+ $('#character-modal-character').css('left', parseInt(value * @previewZoomLevel))
243
+
244
+ onChangeY: (model, value, options) ->
245
+ @$el.find('input[name="character[y]"]').val(value)
246
+ $('#character_y_value').text(value)
247
+ $('#character-modal-character').css('top', parseInt(value * @previewZoomLevel))
248
+
249
+ onChangeAngle: (model, value, options) ->
250
+ @$el.find('input[name="character[angle]"]').val(value)
251
+ $('#character_angle_value').text("#{value}°")
252
+ rotate = "rotate(#{value}deg)"
253
+ $('#character_angle_vector').css
254
+ '-moz-transform': rotate
255
+ '-webkit-transform': rotate
256
+ transform: rotate
257
+
258
+ @model.rotateImage('#character-modal-character')
259
+
260
+ onChangeCostumes: (model, value, options) ->
261
+ @renderCostumeSet_()
262
+ @onChangeCostumeIndex(model, model.get('costumeIndex'))
263
+
264
+ onChangeCostumeNames: (model, value, options) ->
265
+ $.each value, (i, costumeName) =>
266
+ @$el.find("#character-modal-costume-set .item:nth-child(#{i + 1}) .name").text(costumeName)
267
+
268
+ onChangeCostumeIndex: (model, value, options) ->
269
+ img = $('<img>').attr
270
+ src: model.costumeUrl()
271
+ alt: model.costume()
272
+ $('#character-modal-character img').replaceWith(img)
273
+ $('#character-modal input[name="costume[name]"]').val(model.costumeName())
274
+
275
+ @setActiveCostume_()
276
+ @renderActiveCostume_()
277
+
278
+ onChangeRotationStyle: (model, value, options) ->
279
+ $('#character_rotation_style button.btn').removeClass('btn-primary')
280
+ $("#character_rotation_style_#{value}").addClass('btn-primary')
281
+ @onChangeAngle(@model, @model.get('angle'))
282
+
283
+ onChange: (model, options) ->
284
+ @validate_()
285
+
286
+ validate_: ->
287
+ return unless @target
288
+
289
+ valid = true
290
+
291
+ @$el.find('.control-group').removeClass('error')
292
+ @$el.find('#character-modal-costume-set .item').removeClass('error')
293
+
294
+ unless @model.isValid()
295
+ valid = false
296
+ $.each @model.validationError, (i, error) =>
297
+ if error.attr == 'name'
298
+ @$el.find('.control-group[for="character[name]"]').addClass('error')
299
+ if error.attr == 'costumeNames'
300
+ if error.index == @model.get('costumeIndex')
301
+ @$el.find('.control-group[for="costume[name]"]').addClass('error')
302
+ @$el.find("#character-modal-costume-set .item:nth-child(#{error.index + 1})").addClass('error')
303
+
304
+ name = @model.get('name')
305
+ if @target.get('name') != name &&
306
+ Smalruby.Collections.CharacterSet.findWhere({ name: name })
307
+ valid = false
308
+ @$el.find('.control-group[for="character[name]"]').addClass('error')
309
+
310
+ valid
311
+
312
+ onSelectCostume: (e) ->
313
+ e.preventDefault()
314
+
315
+ attrs = {}
316
+
317
+ costume = $(e.target).attr('alt') || $(e.target).find('img').attr('alt')
318
+ if @model.costume() != costume
319
+ costumes = @model.get('costumes').slice(0)
320
+ costumes[@model.get('costumeIndex')] = costume
321
+ attrs['costumes'] = costumes
322
+
323
+ unless @nameChanged
324
+ prefix = Smalruby.Character.costumeToNamePrefix(costume)
325
+ if prefix != @model.namePrefix()
326
+ if prefix == @target.namePrefix()
327
+ attrs['name'] = @target.get('name')
328
+ else
329
+ attrs['name'] = Smalruby.Collections.CharacterSet.uniqueName(costume)
330
+
331
+ @model.set(attrs)
332
+
333
+ onUploadCostume: (e) ->
334
+ e.preventDefault()
335
+
336
+ @$el.find('input[name="costume[file]"]').click()
337
+
338
+ onRotationStyleFree: ->
339
+ @model.set({ rotationStyle: 'free' })
340
+
341
+ onRotationStyleLeftRight: ->
342
+ @model.set({ rotationStyle: 'left_right' })
343
+
344
+ onRotationStyleNone: ->
345
+ @model.set({ rotationStyle: 'none' })
346
+
347
+ onOk: ->
348
+ if @validate_()
349
+ @$el.modal('hide')
350
+ if @target
351
+ @target.set(_.clone(@model.attributes))
352
+
353
+ setCharacter: (character)->
354
+ @target = character
355
+ @model.set(_.clone(@target.attributes))
356
+ @nameChanged = false
357
+ @
@@ -17,6 +17,8 @@ Smalruby.CharacterSelectorView = Backbone.View.extend({
17
17
  if (last = _.last(charSet.models))
18
18
  name: charSet.uniqueName(last.costume())
19
19
  costumes: _.clone(last.get('costumes'))
20
+ costumeNames: _.clone(last.get('costumeNames'))
21
+ costumeIndex: _.clone(last.get('costumeIndex'))
20
22
  else
21
23
  name: charSet.uniqueName()
22
24
  c = new Smalruby.Character(attrs)
@@ -5,6 +5,9 @@
5
5
  $margin: 20px;
6
6
  $character-size: 32px * 5;
7
7
  $left-pane-width: $character-size + $margin * 2;
8
+ $border-size: 5px;
9
+ $border-color: #0088cc;
10
+ $scrollbar-width: 20px;
8
11
 
9
12
  html {
10
13
  -ms-touch-action: manipulation;
@@ -84,9 +87,6 @@ html {
84
87
  }
85
88
 
86
89
  #selectors-tab-content {
87
- $border-size: 5px;
88
- $border-color: #0088cc;
89
-
90
90
  position: absolute;
91
91
  width: $character-size + $margin * 3;
92
92
  top: 32px;
@@ -246,10 +246,10 @@ html {
246
246
  $preview-width: 320px;
247
247
  $preview-height: 240px;
248
248
 
249
- $attributes-height: 160px;
249
+ $attributes-height: 260px;
250
250
 
251
251
  $left-pane-width: $preview-width + 2px;
252
- $right-pane-width: $character-size * 3 + $modal-body-margin;
252
+ $right-pane-width: $character-size * 4 + $scrollbar-width * 2 + $modal-body-margin;
253
253
 
254
254
  $modal-width: $left-pane-width + $right-pane-width + $modal-margin * 2;
255
255
  $modal-height: $preview-height + 2px + $attributes-height + $modal-margin * 2;
@@ -328,25 +328,210 @@ html {
328
328
 
329
329
  overflow: hidden;
330
330
 
331
- #character-modal-costume-selector {
332
- margin-left: $left-pane-width;
331
+ #character-modal-right-pane-inner {
332
+ $inner-left-pane-width: $character-size + $scrollbar-width;
333
+
334
+ margin-left: $left-pane-width + $modal-body-margin;
333
335
  position: absolute;
334
336
  left: 0;
335
337
  top: 0;
336
338
  right: 0;
337
339
  bottom: 0;
338
- width: $right-pane-width + $modal-body-margin * 2;
339
- overflow-y: scroll;
340
+ width: $right-pane-width;
341
+ height: $modal-height - $modal-body-margin * 2;
340
342
 
341
- ul.thumbnails {
342
- margin: 0 0 10px 0;
343
+ #character-modal-right-pane-inner-left-pane {
344
+ width: $inner-left-pane-width;
345
+ height: $modal-height - $modal-body-margin * 2;
343
346
 
344
- li {
345
- margin-left: $modal-body-margin;
346
- margin-bottom: $modal-body-margin;
347
+ margin-left: 0;
348
+
349
+ overflow: hidden;
350
+
351
+ #character-modal-costume-set-header {
352
+ width: $inner-left-pane-width;
353
+ }
354
+
355
+ #character-modal-costume-set-container {
356
+ overflow-y: scroll;
357
+ width: $inner-left-pane-width;
358
+ height: 504px - 20px;
359
+
360
+ .item {
361
+ position: relative;
362
+ width: $character-size;
363
+ height: $character-size;
364
+
365
+ a {
366
+ text-decoration: none;
367
+ cursor: pointer;
368
+ font-size: 1.5em;
369
+ vertical-align: middle;
370
+ display: table-cell;
371
+ }
372
+
373
+ .item-info {
374
+ position: absolute;
375
+ left: 0;
376
+ top: 0;
377
+ right: 0;
378
+ bottom: 0;
379
+ width: $character-size;
380
+ height: $character-size;
381
+
382
+ color: gray;
383
+
384
+ .name {
385
+ position: absolute;
386
+ left: $border-size * 2;
387
+ top: $border-size * 2;
388
+
389
+ font-size: 1.5em;
390
+ }
391
+
392
+ .attributes {
393
+ position: absolute;
394
+ left: $border-size * 2;
395
+ bottom: $border-size * 2;
396
+
397
+ font-size: 0.8em;
398
+ line-height: 1.1em;
399
+ text-align: left;
400
+ }
401
+
402
+ a.remove-button {
403
+ position: absolute;
404
+ right: $border-size * 2;
405
+ top: $border-size * 2;
406
+ padding-left: 0.5em;
407
+ padding-bottom: 0.5em;
408
+
409
+ z-index: 1;
410
+ }
411
+ }
412
+ }
413
+
414
+ .item.active, .item.active.error {
415
+ a.costume {
416
+ border: $border-size solid $border-color;
417
+ }
418
+ }
419
+
420
+ .item.error {
421
+ a.costume {
422
+ border: $border-size solid #b94a48;
423
+ }
424
+ }
425
+
426
+ a.costume {
427
+ position: relative;
428
+ overflow: hidden;
429
+ display: table-cell;
430
+ text-align: center;
431
+ vertical-align: middle;
432
+
433
+ width: $character-size - $border-size * 2;
434
+ height: $character-size - $border-size * 2;
435
+
436
+ border: $border-size solid white;
437
+
438
+ img, div {
439
+ margin: -$border-size;
440
+ }
441
+
442
+ img {
443
+ max-width: $character-size;
444
+ max-height: $character-size;
445
+ }
446
+ }
447
+
448
+ a.costume:hover {
449
+ border: $border-size solid $border-color;
450
+ }
451
+
452
+ a#character-modal-add-costume-button {
453
+ text-align: center;
454
+ vertical-align: middle;
455
+ font-size: 1em;
456
+
457
+ border: $border-size dashed lightgray;
458
+
459
+ i {
460
+ font-size: 2em;
461
+ }
462
+ }
463
+
464
+ a#character-modal-add-costume-button:hover {
465
+ border: $border-size dashed $border-color;
466
+ }
467
+ }
468
+ }
347
469
 
348
- a.active {
349
- background-color: #0088cc;
470
+ #character-modal-right-pane-inner-right-pane {
471
+ margin-left: $inner-left-pane-width;
472
+ position: absolute;
473
+ left: 0;
474
+ top: 0;
475
+ right: 0;
476
+ bottom: 0;
477
+ width: $character-size * 3 + $scrollbar-width;
478
+ height: 100%;
479
+
480
+ overflow: hidden;
481
+
482
+ #character-modal-costume-selector {
483
+ overflow-y: scroll;
484
+ height: 504px - 30px - $scrollbar-width;
485
+
486
+ ul.thumbnails {
487
+ margin: 0 0 $modal-body-margin 0;
488
+
489
+ li {
490
+ margin-left: $modal-body-margin;
491
+ margin-bottom: $modal-body-margin;
492
+ position: relative;
493
+
494
+ a {
495
+ text-decoration: none;
496
+ cursor: pointer;
497
+ }
498
+
499
+ a#character-modal-upload-costume {
500
+ width: $character-size;
501
+ height: $character-size;
502
+
503
+ vertical-align: middle;
504
+ display: table-cell;
505
+ text-align: center;
506
+ font-size: 1em;
507
+
508
+ border: $border-size dashed lightgray;
509
+
510
+ i {
511
+ font-size: 2em;
512
+ }
513
+ }
514
+
515
+ a#character-modal-upload-costume:hover {
516
+ border: $border-size dashed $border-color;
517
+ }
518
+
519
+ a.active {
520
+ background-color: #0088cc;
521
+ }
522
+
523
+ a.remove-button {
524
+ font-size: 1.5em;
525
+ position: absolute;
526
+ right: 0;
527
+ top: 0;
528
+ padding-left: 0.5em;
529
+ padding-bottom: 0.5em;
530
+ color: #b94a48;
531
+
532
+ z-index: 1;
533
+ }
534
+ }
350
535
  }
351
536
  }
352
537
  }