dima 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rspec +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +36 -0
- data/dima.gemspec +26 -0
- data/examples/shop/forms.rb +58 -0
- data/examples/shop/models.rb +35 -0
- data/examples/shop/public/css/bootstrap.min.css +9 -0
- data/examples/shop/public/css/dima.css +201 -0
- data/examples/shop/public/img/.DS_Store +0 -0
- data/examples/shop/public/img/fff/.DS_Store +0 -0
- data/examples/shop/public/img/fff/accept.png +0 -0
- data/examples/shop/public/img/fff/add.png +0 -0
- data/examples/shop/public/img/fff/anchor.png +0 -0
- data/examples/shop/public/img/fff/application.png +0 -0
- data/examples/shop/public/img/fff/application_add.png +0 -0
- data/examples/shop/public/img/fff/application_cascade.png +0 -0
- data/examples/shop/public/img/fff/application_delete.png +0 -0
- data/examples/shop/public/img/fff/application_double.png +0 -0
- data/examples/shop/public/img/fff/application_edit.png +0 -0
- data/examples/shop/public/img/fff/application_error.png +0 -0
- data/examples/shop/public/img/fff/application_form.png +0 -0
- data/examples/shop/public/img/fff/application_form_add.png +0 -0
- data/examples/shop/public/img/fff/application_form_delete.png +0 -0
- data/examples/shop/public/img/fff/application_form_edit.png +0 -0
- data/examples/shop/public/img/fff/application_form_magnify.png +0 -0
- data/examples/shop/public/img/fff/application_get.png +0 -0
- data/examples/shop/public/img/fff/application_go.png +0 -0
- data/examples/shop/public/img/fff/application_home.png +0 -0
- data/examples/shop/public/img/fff/application_key.png +0 -0
- data/examples/shop/public/img/fff/application_lightning.png +0 -0
- data/examples/shop/public/img/fff/application_link.png +0 -0
- data/examples/shop/public/img/fff/application_osx.png +0 -0
- data/examples/shop/public/img/fff/application_osx_terminal.png +0 -0
- data/examples/shop/public/img/fff/application_put.png +0 -0
- data/examples/shop/public/img/fff/application_side_boxes.png +0 -0
- data/examples/shop/public/img/fff/application_side_contract.png +0 -0
- data/examples/shop/public/img/fff/application_side_expand.png +0 -0
- data/examples/shop/public/img/fff/application_side_list.png +0 -0
- data/examples/shop/public/img/fff/application_side_tree.png +0 -0
- data/examples/shop/public/img/fff/application_split.png +0 -0
- data/examples/shop/public/img/fff/application_tile_horizontal.png +0 -0
- data/examples/shop/public/img/fff/application_tile_vertical.png +0 -0
- data/examples/shop/public/img/fff/application_view_columns.png +0 -0
- data/examples/shop/public/img/fff/application_view_detail.png +0 -0
- data/examples/shop/public/img/fff/application_view_gallery.png +0 -0
- data/examples/shop/public/img/fff/application_view_icons.png +0 -0
- data/examples/shop/public/img/fff/application_view_list.png +0 -0
- data/examples/shop/public/img/fff/application_view_tile.png +0 -0
- data/examples/shop/public/img/fff/application_xp.png +0 -0
- data/examples/shop/public/img/fff/application_xp_terminal.png +0 -0
- data/examples/shop/public/img/fff/arrow_branch.png +0 -0
- data/examples/shop/public/img/fff/arrow_divide.png +0 -0
- data/examples/shop/public/img/fff/arrow_down.png +0 -0
- data/examples/shop/public/img/fff/arrow_in.png +0 -0
- data/examples/shop/public/img/fff/arrow_inout.png +0 -0
- data/examples/shop/public/img/fff/arrow_join.png +0 -0
- data/examples/shop/public/img/fff/arrow_left.png +0 -0
- data/examples/shop/public/img/fff/arrow_merge.png +0 -0
- data/examples/shop/public/img/fff/arrow_out.png +0 -0
- data/examples/shop/public/img/fff/arrow_redo.png +0 -0
- data/examples/shop/public/img/fff/arrow_refresh.png +0 -0
- data/examples/shop/public/img/fff/arrow_refresh_small.png +0 -0
- data/examples/shop/public/img/fff/arrow_right.png +0 -0
- data/examples/shop/public/img/fff/arrow_rotate_anticlockwise.png +0 -0
- data/examples/shop/public/img/fff/arrow_rotate_clockwise.png +0 -0
- data/examples/shop/public/img/fff/arrow_switch.png +0 -0
- data/examples/shop/public/img/fff/arrow_turn_left.png +0 -0
- data/examples/shop/public/img/fff/arrow_turn_right.png +0 -0
- data/examples/shop/public/img/fff/arrow_undo.png +0 -0
- data/examples/shop/public/img/fff/arrow_up.png +0 -0
- data/examples/shop/public/img/fff/asterisk_orange.png +0 -0
- data/examples/shop/public/img/fff/asterisk_yellow.png +0 -0
- data/examples/shop/public/img/fff/attach.png +0 -0
- data/examples/shop/public/img/fff/award_star_add.png +0 -0
- data/examples/shop/public/img/fff/award_star_bronze_1.png +0 -0
- data/examples/shop/public/img/fff/award_star_bronze_2.png +0 -0
- data/examples/shop/public/img/fff/award_star_bronze_3.png +0 -0
- data/examples/shop/public/img/fff/award_star_delete.png +0 -0
- data/examples/shop/public/img/fff/award_star_gold_1.png +0 -0
- data/examples/shop/public/img/fff/award_star_gold_2.png +0 -0
- data/examples/shop/public/img/fff/award_star_gold_3.png +0 -0
- data/examples/shop/public/img/fff/award_star_silver_1.png +0 -0
- data/examples/shop/public/img/fff/award_star_silver_2.png +0 -0
- data/examples/shop/public/img/fff/award_star_silver_3.png +0 -0
- data/examples/shop/public/img/fff/basket.png +0 -0
- data/examples/shop/public/img/fff/basket_add.png +0 -0
- data/examples/shop/public/img/fff/basket_delete.png +0 -0
- data/examples/shop/public/img/fff/basket_edit.png +0 -0
- data/examples/shop/public/img/fff/basket_error.png +0 -0
- data/examples/shop/public/img/fff/basket_go.png +0 -0
- data/examples/shop/public/img/fff/basket_put.png +0 -0
- data/examples/shop/public/img/fff/basket_remove.png +0 -0
- data/examples/shop/public/img/fff/bell.png +0 -0
- data/examples/shop/public/img/fff/bell_add.png +0 -0
- data/examples/shop/public/img/fff/bell_delete.png +0 -0
- data/examples/shop/public/img/fff/bell_error.png +0 -0
- data/examples/shop/public/img/fff/bell_go.png +0 -0
- data/examples/shop/public/img/fff/bell_link.png +0 -0
- data/examples/shop/public/img/fff/bin.png +0 -0
- data/examples/shop/public/img/fff/bin_closed.png +0 -0
- data/examples/shop/public/img/fff/bin_empty.png +0 -0
- data/examples/shop/public/img/fff/bomb.png +0 -0
- data/examples/shop/public/img/fff/book.png +0 -0
- data/examples/shop/public/img/fff/book_add.png +0 -0
- data/examples/shop/public/img/fff/book_addresses.png +0 -0
- data/examples/shop/public/img/fff/book_delete.png +0 -0
- data/examples/shop/public/img/fff/book_edit.png +0 -0
- data/examples/shop/public/img/fff/book_error.png +0 -0
- data/examples/shop/public/img/fff/book_go.png +0 -0
- data/examples/shop/public/img/fff/book_key.png +0 -0
- data/examples/shop/public/img/fff/book_link.png +0 -0
- data/examples/shop/public/img/fff/book_next.png +0 -0
- data/examples/shop/public/img/fff/book_open.png +0 -0
- data/examples/shop/public/img/fff/book_previous.png +0 -0
- data/examples/shop/public/img/fff/box.png +0 -0
- data/examples/shop/public/img/fff/brick.png +0 -0
- data/examples/shop/public/img/fff/brick_add.png +0 -0
- data/examples/shop/public/img/fff/brick_delete.png +0 -0
- data/examples/shop/public/img/fff/brick_edit.png +0 -0
- data/examples/shop/public/img/fff/brick_error.png +0 -0
- data/examples/shop/public/img/fff/brick_go.png +0 -0
- data/examples/shop/public/img/fff/brick_link.png +0 -0
- data/examples/shop/public/img/fff/bricks.png +0 -0
- data/examples/shop/public/img/fff/briefcase.png +0 -0
- data/examples/shop/public/img/fff/bug.png +0 -0
- data/examples/shop/public/img/fff/bug_add.png +0 -0
- data/examples/shop/public/img/fff/bug_delete.png +0 -0
- data/examples/shop/public/img/fff/bug_edit.png +0 -0
- data/examples/shop/public/img/fff/bug_error.png +0 -0
- data/examples/shop/public/img/fff/bug_go.png +0 -0
- data/examples/shop/public/img/fff/bug_link.png +0 -0
- data/examples/shop/public/img/fff/building.png +0 -0
- data/examples/shop/public/img/fff/building_add.png +0 -0
- data/examples/shop/public/img/fff/building_delete.png +0 -0
- data/examples/shop/public/img/fff/building_edit.png +0 -0
- data/examples/shop/public/img/fff/building_error.png +0 -0
- data/examples/shop/public/img/fff/building_go.png +0 -0
- data/examples/shop/public/img/fff/building_key.png +0 -0
- data/examples/shop/public/img/fff/building_link.png +0 -0
- data/examples/shop/public/img/fff/bullet_add.png +0 -0
- data/examples/shop/public/img/fff/bullet_arrow_bottom.png +0 -0
- data/examples/shop/public/img/fff/bullet_arrow_down.png +0 -0
- data/examples/shop/public/img/fff/bullet_arrow_top.png +0 -0
- data/examples/shop/public/img/fff/bullet_arrow_up.png +0 -0
- data/examples/shop/public/img/fff/bullet_black.png +0 -0
- data/examples/shop/public/img/fff/bullet_blue.png +0 -0
- data/examples/shop/public/img/fff/bullet_delete.png +0 -0
- data/examples/shop/public/img/fff/bullet_disk.png +0 -0
- data/examples/shop/public/img/fff/bullet_error.png +0 -0
- data/examples/shop/public/img/fff/bullet_feed.png +0 -0
- data/examples/shop/public/img/fff/bullet_go.png +0 -0
- data/examples/shop/public/img/fff/bullet_green.png +0 -0
- data/examples/shop/public/img/fff/bullet_key.png +0 -0
- data/examples/shop/public/img/fff/bullet_orange.png +0 -0
- data/examples/shop/public/img/fff/bullet_picture.png +0 -0
- data/examples/shop/public/img/fff/bullet_pink.png +0 -0
- data/examples/shop/public/img/fff/bullet_purple.png +0 -0
- data/examples/shop/public/img/fff/bullet_red.png +0 -0
- data/examples/shop/public/img/fff/bullet_star.png +0 -0
- data/examples/shop/public/img/fff/bullet_toggle_minus.png +0 -0
- data/examples/shop/public/img/fff/bullet_toggle_plus.png +0 -0
- data/examples/shop/public/img/fff/bullet_white.png +0 -0
- data/examples/shop/public/img/fff/bullet_wrench.png +0 -0
- data/examples/shop/public/img/fff/bullet_yellow.png +0 -0
- data/examples/shop/public/img/fff/cake.png +0 -0
- data/examples/shop/public/img/fff/calculator.png +0 -0
- data/examples/shop/public/img/fff/calculator_add.png +0 -0
- data/examples/shop/public/img/fff/calculator_delete.png +0 -0
- data/examples/shop/public/img/fff/calculator_edit.png +0 -0
- data/examples/shop/public/img/fff/calculator_error.png +0 -0
- data/examples/shop/public/img/fff/calculator_link.png +0 -0
- data/examples/shop/public/img/fff/calendar.png +0 -0
- data/examples/shop/public/img/fff/calendar_add.png +0 -0
- data/examples/shop/public/img/fff/calendar_delete.png +0 -0
- data/examples/shop/public/img/fff/calendar_edit.png +0 -0
- data/examples/shop/public/img/fff/calendar_link.png +0 -0
- data/examples/shop/public/img/fff/calendar_view_day.png +0 -0
- data/examples/shop/public/img/fff/calendar_view_month.png +0 -0
- data/examples/shop/public/img/fff/calendar_view_week.png +0 -0
- data/examples/shop/public/img/fff/camera.png +0 -0
- data/examples/shop/public/img/fff/camera_add.png +0 -0
- data/examples/shop/public/img/fff/camera_delete.png +0 -0
- data/examples/shop/public/img/fff/camera_edit.png +0 -0
- data/examples/shop/public/img/fff/camera_error.png +0 -0
- data/examples/shop/public/img/fff/camera_go.png +0 -0
- data/examples/shop/public/img/fff/camera_link.png +0 -0
- data/examples/shop/public/img/fff/camera_small.png +0 -0
- data/examples/shop/public/img/fff/cancel.png +0 -0
- data/examples/shop/public/img/fff/car.png +0 -0
- data/examples/shop/public/img/fff/car_add.png +0 -0
- data/examples/shop/public/img/fff/car_delete.png +0 -0
- data/examples/shop/public/img/fff/cart.png +0 -0
- data/examples/shop/public/img/fff/cart_add.png +0 -0
- data/examples/shop/public/img/fff/cart_delete.png +0 -0
- data/examples/shop/public/img/fff/cart_edit.png +0 -0
- data/examples/shop/public/img/fff/cart_error.png +0 -0
- data/examples/shop/public/img/fff/cart_go.png +0 -0
- data/examples/shop/public/img/fff/cart_put.png +0 -0
- data/examples/shop/public/img/fff/cart_remove.png +0 -0
- data/examples/shop/public/img/fff/cd.png +0 -0
- data/examples/shop/public/img/fff/cd_add.png +0 -0
- data/examples/shop/public/img/fff/cd_burn.png +0 -0
- data/examples/shop/public/img/fff/cd_delete.png +0 -0
- data/examples/shop/public/img/fff/cd_edit.png +0 -0
- data/examples/shop/public/img/fff/cd_eject.png +0 -0
- data/examples/shop/public/img/fff/cd_go.png +0 -0
- data/examples/shop/public/img/fff/chart_bar.png +0 -0
- data/examples/shop/public/img/fff/chart_bar_add.png +0 -0
- data/examples/shop/public/img/fff/chart_bar_delete.png +0 -0
- data/examples/shop/public/img/fff/chart_bar_edit.png +0 -0
- data/examples/shop/public/img/fff/chart_bar_error.png +0 -0
- data/examples/shop/public/img/fff/chart_bar_link.png +0 -0
- data/examples/shop/public/img/fff/chart_curve.png +0 -0
- data/examples/shop/public/img/fff/chart_curve_add.png +0 -0
- data/examples/shop/public/img/fff/chart_curve_delete.png +0 -0
- data/examples/shop/public/img/fff/chart_curve_edit.png +0 -0
- data/examples/shop/public/img/fff/chart_curve_error.png +0 -0
- data/examples/shop/public/img/fff/chart_curve_go.png +0 -0
- data/examples/shop/public/img/fff/chart_curve_link.png +0 -0
- data/examples/shop/public/img/fff/chart_line.png +0 -0
- data/examples/shop/public/img/fff/chart_line_add.png +0 -0
- data/examples/shop/public/img/fff/chart_line_delete.png +0 -0
- data/examples/shop/public/img/fff/chart_line_edit.png +0 -0
- data/examples/shop/public/img/fff/chart_line_error.png +0 -0
- data/examples/shop/public/img/fff/chart_line_link.png +0 -0
- data/examples/shop/public/img/fff/chart_organisation.png +0 -0
- data/examples/shop/public/img/fff/chart_organisation_add.png +0 -0
- data/examples/shop/public/img/fff/chart_organisation_delete.png +0 -0
- data/examples/shop/public/img/fff/chart_pie.png +0 -0
- data/examples/shop/public/img/fff/chart_pie_add.png +0 -0
- data/examples/shop/public/img/fff/chart_pie_delete.png +0 -0
- data/examples/shop/public/img/fff/chart_pie_edit.png +0 -0
- data/examples/shop/public/img/fff/chart_pie_error.png +0 -0
- data/examples/shop/public/img/fff/chart_pie_link.png +0 -0
- data/examples/shop/public/img/fff/clock.png +0 -0
- data/examples/shop/public/img/fff/clock_add.png +0 -0
- data/examples/shop/public/img/fff/clock_delete.png +0 -0
- data/examples/shop/public/img/fff/clock_edit.png +0 -0
- data/examples/shop/public/img/fff/clock_error.png +0 -0
- data/examples/shop/public/img/fff/clock_go.png +0 -0
- data/examples/shop/public/img/fff/clock_link.png +0 -0
- data/examples/shop/public/img/fff/clock_pause.png +0 -0
- data/examples/shop/public/img/fff/clock_play.png +0 -0
- data/examples/shop/public/img/fff/clock_red.png +0 -0
- data/examples/shop/public/img/fff/clock_stop.png +0 -0
- data/examples/shop/public/img/fff/cog.png +0 -0
- data/examples/shop/public/img/fff/cog_add.png +0 -0
- data/examples/shop/public/img/fff/cog_delete.png +0 -0
- data/examples/shop/public/img/fff/cog_edit.png +0 -0
- data/examples/shop/public/img/fff/cog_error.png +0 -0
- data/examples/shop/public/img/fff/cog_go.png +0 -0
- data/examples/shop/public/img/fff/coins.png +0 -0
- data/examples/shop/public/img/fff/coins_add.png +0 -0
- data/examples/shop/public/img/fff/coins_delete.png +0 -0
- data/examples/shop/public/img/fff/color_swatch.png +0 -0
- data/examples/shop/public/img/fff/color_wheel.png +0 -0
- data/examples/shop/public/img/fff/comment.png +0 -0
- data/examples/shop/public/img/fff/comment_add.png +0 -0
- data/examples/shop/public/img/fff/comment_delete.png +0 -0
- data/examples/shop/public/img/fff/comment_edit.png +0 -0
- data/examples/shop/public/img/fff/comments.png +0 -0
- data/examples/shop/public/img/fff/comments_add.png +0 -0
- data/examples/shop/public/img/fff/comments_delete.png +0 -0
- data/examples/shop/public/img/fff/compress.png +0 -0
- data/examples/shop/public/img/fff/computer.png +0 -0
- data/examples/shop/public/img/fff/computer_add.png +0 -0
- data/examples/shop/public/img/fff/computer_delete.png +0 -0
- data/examples/shop/public/img/fff/computer_edit.png +0 -0
- data/examples/shop/public/img/fff/computer_error.png +0 -0
- data/examples/shop/public/img/fff/computer_go.png +0 -0
- data/examples/shop/public/img/fff/computer_key.png +0 -0
- data/examples/shop/public/img/fff/computer_link.png +0 -0
- data/examples/shop/public/img/fff/connect.png +0 -0
- data/examples/shop/public/img/fff/contrast.png +0 -0
- data/examples/shop/public/img/fff/contrast_decrease.png +0 -0
- data/examples/shop/public/img/fff/contrast_high.png +0 -0
- data/examples/shop/public/img/fff/contrast_increase.png +0 -0
- data/examples/shop/public/img/fff/contrast_low.png +0 -0
- data/examples/shop/public/img/fff/control_eject.png +0 -0
- data/examples/shop/public/img/fff/control_eject_blue.png +0 -0
- data/examples/shop/public/img/fff/control_end.png +0 -0
- data/examples/shop/public/img/fff/control_end_blue.png +0 -0
- data/examples/shop/public/img/fff/control_equalizer.png +0 -0
- data/examples/shop/public/img/fff/control_equalizer_blue.png +0 -0
- data/examples/shop/public/img/fff/control_fastforward.png +0 -0
- data/examples/shop/public/img/fff/control_fastforward_blue.png +0 -0
- data/examples/shop/public/img/fff/control_pause.png +0 -0
- data/examples/shop/public/img/fff/control_pause_blue.png +0 -0
- data/examples/shop/public/img/fff/control_play.png +0 -0
- data/examples/shop/public/img/fff/control_play_blue.png +0 -0
- data/examples/shop/public/img/fff/control_repeat.png +0 -0
- data/examples/shop/public/img/fff/control_repeat_blue.png +0 -0
- data/examples/shop/public/img/fff/control_rewind.png +0 -0
- data/examples/shop/public/img/fff/control_rewind_blue.png +0 -0
- data/examples/shop/public/img/fff/control_start.png +0 -0
- data/examples/shop/public/img/fff/control_start_blue.png +0 -0
- data/examples/shop/public/img/fff/control_stop.png +0 -0
- data/examples/shop/public/img/fff/control_stop_blue.png +0 -0
- data/examples/shop/public/img/fff/controller.png +0 -0
- data/examples/shop/public/img/fff/controller_add.png +0 -0
- data/examples/shop/public/img/fff/controller_delete.png +0 -0
- data/examples/shop/public/img/fff/controller_error.png +0 -0
- data/examples/shop/public/img/fff/creditcards.png +0 -0
- data/examples/shop/public/img/fff/cross.png +0 -0
- data/examples/shop/public/img/fff/css.png +0 -0
- data/examples/shop/public/img/fff/css_add.png +0 -0
- data/examples/shop/public/img/fff/css_delete.png +0 -0
- data/examples/shop/public/img/fff/css_go.png +0 -0
- data/examples/shop/public/img/fff/css_valid.png +0 -0
- data/examples/shop/public/img/fff/cup.png +0 -0
- data/examples/shop/public/img/fff/cup_add.png +0 -0
- data/examples/shop/public/img/fff/cup_delete.png +0 -0
- data/examples/shop/public/img/fff/cup_edit.png +0 -0
- data/examples/shop/public/img/fff/cup_error.png +0 -0
- data/examples/shop/public/img/fff/cup_go.png +0 -0
- data/examples/shop/public/img/fff/cup_key.png +0 -0
- data/examples/shop/public/img/fff/cup_link.png +0 -0
- data/examples/shop/public/img/fff/cursor.png +0 -0
- data/examples/shop/public/img/fff/cut.png +0 -0
- data/examples/shop/public/img/fff/cut_red.png +0 -0
- data/examples/shop/public/img/fff/database.png +0 -0
- data/examples/shop/public/img/fff/database_add.png +0 -0
- data/examples/shop/public/img/fff/database_connect.png +0 -0
- data/examples/shop/public/img/fff/database_delete.png +0 -0
- data/examples/shop/public/img/fff/database_edit.png +0 -0
- data/examples/shop/public/img/fff/database_error.png +0 -0
- data/examples/shop/public/img/fff/database_gear.png +0 -0
- data/examples/shop/public/img/fff/database_go.png +0 -0
- data/examples/shop/public/img/fff/database_key.png +0 -0
- data/examples/shop/public/img/fff/database_lightning.png +0 -0
- data/examples/shop/public/img/fff/database_link.png +0 -0
- data/examples/shop/public/img/fff/database_refresh.png +0 -0
- data/examples/shop/public/img/fff/database_save.png +0 -0
- data/examples/shop/public/img/fff/database_table.png +0 -0
- data/examples/shop/public/img/fff/date.png +0 -0
- data/examples/shop/public/img/fff/date_add.png +0 -0
- data/examples/shop/public/img/fff/date_delete.png +0 -0
- data/examples/shop/public/img/fff/date_edit.png +0 -0
- data/examples/shop/public/img/fff/date_error.png +0 -0
- data/examples/shop/public/img/fff/date_go.png +0 -0
- data/examples/shop/public/img/fff/date_link.png +0 -0
- data/examples/shop/public/img/fff/date_magnify.png +0 -0
- data/examples/shop/public/img/fff/date_next.png +0 -0
- data/examples/shop/public/img/fff/date_previous.png +0 -0
- data/examples/shop/public/img/fff/delete.png +0 -0
- data/examples/shop/public/img/fff/disconnect.png +0 -0
- data/examples/shop/public/img/fff/disk.png +0 -0
- data/examples/shop/public/img/fff/disk_multiple.png +0 -0
- data/examples/shop/public/img/fff/door.png +0 -0
- data/examples/shop/public/img/fff/door_in.png +0 -0
- data/examples/shop/public/img/fff/door_open.png +0 -0
- data/examples/shop/public/img/fff/door_out.png +0 -0
- data/examples/shop/public/img/fff/drink.png +0 -0
- data/examples/shop/public/img/fff/drink_empty.png +0 -0
- data/examples/shop/public/img/fff/drive.png +0 -0
- data/examples/shop/public/img/fff/drive_add.png +0 -0
- data/examples/shop/public/img/fff/drive_burn.png +0 -0
- data/examples/shop/public/img/fff/drive_cd.png +0 -0
- data/examples/shop/public/img/fff/drive_cd_empty.png +0 -0
- data/examples/shop/public/img/fff/drive_delete.png +0 -0
- data/examples/shop/public/img/fff/drive_disk.png +0 -0
- data/examples/shop/public/img/fff/drive_edit.png +0 -0
- data/examples/shop/public/img/fff/drive_error.png +0 -0
- data/examples/shop/public/img/fff/drive_go.png +0 -0
- data/examples/shop/public/img/fff/drive_key.png +0 -0
- data/examples/shop/public/img/fff/drive_link.png +0 -0
- data/examples/shop/public/img/fff/drive_magnify.png +0 -0
- data/examples/shop/public/img/fff/drive_network.png +0 -0
- data/examples/shop/public/img/fff/drive_rename.png +0 -0
- data/examples/shop/public/img/fff/drive_user.png +0 -0
- data/examples/shop/public/img/fff/drive_web.png +0 -0
- data/examples/shop/public/img/fff/dvd.png +0 -0
- data/examples/shop/public/img/fff/dvd_add.png +0 -0
- data/examples/shop/public/img/fff/dvd_delete.png +0 -0
- data/examples/shop/public/img/fff/dvd_edit.png +0 -0
- data/examples/shop/public/img/fff/dvd_error.png +0 -0
- data/examples/shop/public/img/fff/dvd_go.png +0 -0
- data/examples/shop/public/img/fff/dvd_key.png +0 -0
- data/examples/shop/public/img/fff/dvd_link.png +0 -0
- data/examples/shop/public/img/fff/email.png +0 -0
- data/examples/shop/public/img/fff/email_add.png +0 -0
- data/examples/shop/public/img/fff/email_attach.png +0 -0
- data/examples/shop/public/img/fff/email_delete.png +0 -0
- data/examples/shop/public/img/fff/email_edit.png +0 -0
- data/examples/shop/public/img/fff/email_error.png +0 -0
- data/examples/shop/public/img/fff/email_go.png +0 -0
- data/examples/shop/public/img/fff/email_link.png +0 -0
- data/examples/shop/public/img/fff/email_open.png +0 -0
- data/examples/shop/public/img/fff/email_open_image.png +0 -0
- data/examples/shop/public/img/fff/emoticon_evilgrin.png +0 -0
- data/examples/shop/public/img/fff/emoticon_grin.png +0 -0
- data/examples/shop/public/img/fff/emoticon_happy.png +0 -0
- data/examples/shop/public/img/fff/emoticon_smile.png +0 -0
- data/examples/shop/public/img/fff/emoticon_surprised.png +0 -0
- data/examples/shop/public/img/fff/emoticon_tongue.png +0 -0
- data/examples/shop/public/img/fff/emoticon_unhappy.png +0 -0
- data/examples/shop/public/img/fff/emoticon_waii.png +0 -0
- data/examples/shop/public/img/fff/emoticon_wink.png +0 -0
- data/examples/shop/public/img/fff/error.png +0 -0
- data/examples/shop/public/img/fff/error_add.png +0 -0
- data/examples/shop/public/img/fff/error_delete.png +0 -0
- data/examples/shop/public/img/fff/error_go.png +0 -0
- data/examples/shop/public/img/fff/exclamation.png +0 -0
- data/examples/shop/public/img/fff/eye.png +0 -0
- data/examples/shop/public/img/fff/feed.png +0 -0
- data/examples/shop/public/img/fff/feed_add.png +0 -0
- data/examples/shop/public/img/fff/feed_delete.png +0 -0
- data/examples/shop/public/img/fff/feed_disk.png +0 -0
- data/examples/shop/public/img/fff/feed_edit.png +0 -0
- data/examples/shop/public/img/fff/feed_error.png +0 -0
- data/examples/shop/public/img/fff/feed_go.png +0 -0
- data/examples/shop/public/img/fff/feed_key.png +0 -0
- data/examples/shop/public/img/fff/feed_link.png +0 -0
- data/examples/shop/public/img/fff/feed_magnify.png +0 -0
- data/examples/shop/public/img/fff/female.png +0 -0
- data/examples/shop/public/img/fff/film.png +0 -0
- data/examples/shop/public/img/fff/film_add.png +0 -0
- data/examples/shop/public/img/fff/film_delete.png +0 -0
- data/examples/shop/public/img/fff/film_edit.png +0 -0
- data/examples/shop/public/img/fff/film_error.png +0 -0
- data/examples/shop/public/img/fff/film_go.png +0 -0
- data/examples/shop/public/img/fff/film_key.png +0 -0
- data/examples/shop/public/img/fff/film_link.png +0 -0
- data/examples/shop/public/img/fff/film_save.png +0 -0
- data/examples/shop/public/img/fff/find.png +0 -0
- data/examples/shop/public/img/fff/flag_blue.png +0 -0
- data/examples/shop/public/img/fff/flag_green.png +0 -0
- data/examples/shop/public/img/fff/flag_orange.png +0 -0
- data/examples/shop/public/img/fff/flag_pink.png +0 -0
- data/examples/shop/public/img/fff/flag_purple.png +0 -0
- data/examples/shop/public/img/fff/flag_red.png +0 -0
- data/examples/shop/public/img/fff/flag_yellow.png +0 -0
- data/examples/shop/public/img/fff/folder.png +0 -0
- data/examples/shop/public/img/fff/folder_add.png +0 -0
- data/examples/shop/public/img/fff/folder_bell.png +0 -0
- data/examples/shop/public/img/fff/folder_brick.png +0 -0
- data/examples/shop/public/img/fff/folder_bug.png +0 -0
- data/examples/shop/public/img/fff/folder_camera.png +0 -0
- data/examples/shop/public/img/fff/folder_database.png +0 -0
- data/examples/shop/public/img/fff/folder_delete.png +0 -0
- data/examples/shop/public/img/fff/folder_edit.png +0 -0
- data/examples/shop/public/img/fff/folder_error.png +0 -0
- data/examples/shop/public/img/fff/folder_explore.png +0 -0
- data/examples/shop/public/img/fff/folder_feed.png +0 -0
- data/examples/shop/public/img/fff/folder_find.png +0 -0
- data/examples/shop/public/img/fff/folder_go.png +0 -0
- data/examples/shop/public/img/fff/folder_heart.png +0 -0
- data/examples/shop/public/img/fff/folder_image.png +0 -0
- data/examples/shop/public/img/fff/folder_key.png +0 -0
- data/examples/shop/public/img/fff/folder_lightbulb.png +0 -0
- data/examples/shop/public/img/fff/folder_link.png +0 -0
- data/examples/shop/public/img/fff/folder_magnify.png +0 -0
- data/examples/shop/public/img/fff/folder_page.png +0 -0
- data/examples/shop/public/img/fff/folder_page_white.png +0 -0
- data/examples/shop/public/img/fff/folder_palette.png +0 -0
- data/examples/shop/public/img/fff/folder_picture.png +0 -0
- data/examples/shop/public/img/fff/folder_star.png +0 -0
- data/examples/shop/public/img/fff/folder_table.png +0 -0
- data/examples/shop/public/img/fff/folder_user.png +0 -0
- data/examples/shop/public/img/fff/folder_wrench.png +0 -0
- data/examples/shop/public/img/fff/font.png +0 -0
- data/examples/shop/public/img/fff/font_add.png +0 -0
- data/examples/shop/public/img/fff/font_delete.png +0 -0
- data/examples/shop/public/img/fff/font_go.png +0 -0
- data/examples/shop/public/img/fff/group.png +0 -0
- data/examples/shop/public/img/fff/group_add.png +0 -0
- data/examples/shop/public/img/fff/group_delete.png +0 -0
- data/examples/shop/public/img/fff/group_edit.png +0 -0
- data/examples/shop/public/img/fff/group_error.png +0 -0
- data/examples/shop/public/img/fff/group_gear.png +0 -0
- data/examples/shop/public/img/fff/group_go.png +0 -0
- data/examples/shop/public/img/fff/group_key.png +0 -0
- data/examples/shop/public/img/fff/group_link.png +0 -0
- data/examples/shop/public/img/fff/heart.png +0 -0
- data/examples/shop/public/img/fff/heart_add.png +0 -0
- data/examples/shop/public/img/fff/heart_delete.png +0 -0
- data/examples/shop/public/img/fff/help.png +0 -0
- data/examples/shop/public/img/fff/hourglass.png +0 -0
- data/examples/shop/public/img/fff/hourglass_add.png +0 -0
- data/examples/shop/public/img/fff/hourglass_delete.png +0 -0
- data/examples/shop/public/img/fff/hourglass_go.png +0 -0
- data/examples/shop/public/img/fff/hourglass_link.png +0 -0
- data/examples/shop/public/img/fff/house.png +0 -0
- data/examples/shop/public/img/fff/house_go.png +0 -0
- data/examples/shop/public/img/fff/house_link.png +0 -0
- data/examples/shop/public/img/fff/html.png +0 -0
- data/examples/shop/public/img/fff/html_add.png +0 -0
- data/examples/shop/public/img/fff/html_delete.png +0 -0
- data/examples/shop/public/img/fff/html_go.png +0 -0
- data/examples/shop/public/img/fff/html_valid.png +0 -0
- data/examples/shop/public/img/fff/image.png +0 -0
- data/examples/shop/public/img/fff/image_add.png +0 -0
- data/examples/shop/public/img/fff/image_delete.png +0 -0
- data/examples/shop/public/img/fff/image_edit.png +0 -0
- data/examples/shop/public/img/fff/image_link.png +0 -0
- data/examples/shop/public/img/fff/images.png +0 -0
- data/examples/shop/public/img/fff/information.png +0 -0
- data/examples/shop/public/img/fff/ipod.png +0 -0
- data/examples/shop/public/img/fff/ipod_cast.png +0 -0
- data/examples/shop/public/img/fff/ipod_cast_add.png +0 -0
- data/examples/shop/public/img/fff/ipod_cast_delete.png +0 -0
- data/examples/shop/public/img/fff/ipod_sound.png +0 -0
- data/examples/shop/public/img/fff/joystick.png +0 -0
- data/examples/shop/public/img/fff/joystick_add.png +0 -0
- data/examples/shop/public/img/fff/joystick_delete.png +0 -0
- data/examples/shop/public/img/fff/joystick_error.png +0 -0
- data/examples/shop/public/img/fff/key.png +0 -0
- data/examples/shop/public/img/fff/key_add.png +0 -0
- data/examples/shop/public/img/fff/key_delete.png +0 -0
- data/examples/shop/public/img/fff/key_go.png +0 -0
- data/examples/shop/public/img/fff/keyboard.png +0 -0
- data/examples/shop/public/img/fff/keyboard_add.png +0 -0
- data/examples/shop/public/img/fff/keyboard_delete.png +0 -0
- data/examples/shop/public/img/fff/keyboard_magnify.png +0 -0
- data/examples/shop/public/img/fff/layers.png +0 -0
- data/examples/shop/public/img/fff/layout.png +0 -0
- data/examples/shop/public/img/fff/layout_add.png +0 -0
- data/examples/shop/public/img/fff/layout_content.png +0 -0
- data/examples/shop/public/img/fff/layout_delete.png +0 -0
- data/examples/shop/public/img/fff/layout_edit.png +0 -0
- data/examples/shop/public/img/fff/layout_error.png +0 -0
- data/examples/shop/public/img/fff/layout_header.png +0 -0
- data/examples/shop/public/img/fff/layout_link.png +0 -0
- data/examples/shop/public/img/fff/layout_sidebar.png +0 -0
- data/examples/shop/public/img/fff/lightbulb.png +0 -0
- data/examples/shop/public/img/fff/lightbulb_add.png +0 -0
- data/examples/shop/public/img/fff/lightbulb_delete.png +0 -0
- data/examples/shop/public/img/fff/lightbulb_off.png +0 -0
- data/examples/shop/public/img/fff/lightning.png +0 -0
- data/examples/shop/public/img/fff/lightning_add.png +0 -0
- data/examples/shop/public/img/fff/lightning_delete.png +0 -0
- data/examples/shop/public/img/fff/lightning_go.png +0 -0
- data/examples/shop/public/img/fff/link.png +0 -0
- data/examples/shop/public/img/fff/link_add.png +0 -0
- data/examples/shop/public/img/fff/link_break.png +0 -0
- data/examples/shop/public/img/fff/link_delete.png +0 -0
- data/examples/shop/public/img/fff/link_edit.png +0 -0
- data/examples/shop/public/img/fff/link_error.png +0 -0
- data/examples/shop/public/img/fff/link_go.png +0 -0
- data/examples/shop/public/img/fff/lock.png +0 -0
- data/examples/shop/public/img/fff/lock_add.png +0 -0
- data/examples/shop/public/img/fff/lock_break.png +0 -0
- data/examples/shop/public/img/fff/lock_delete.png +0 -0
- data/examples/shop/public/img/fff/lock_edit.png +0 -0
- data/examples/shop/public/img/fff/lock_go.png +0 -0
- data/examples/shop/public/img/fff/lock_open.png +0 -0
- data/examples/shop/public/img/fff/lorry.png +0 -0
- data/examples/shop/public/img/fff/lorry_add.png +0 -0
- data/examples/shop/public/img/fff/lorry_delete.png +0 -0
- data/examples/shop/public/img/fff/lorry_error.png +0 -0
- data/examples/shop/public/img/fff/lorry_flatbed.png +0 -0
- data/examples/shop/public/img/fff/lorry_go.png +0 -0
- data/examples/shop/public/img/fff/lorry_link.png +0 -0
- data/examples/shop/public/img/fff/magifier_zoom_out.png +0 -0
- data/examples/shop/public/img/fff/magnifier.png +0 -0
- data/examples/shop/public/img/fff/magnifier_zoom_in.png +0 -0
- data/examples/shop/public/img/fff/male.png +0 -0
- data/examples/shop/public/img/fff/map.png +0 -0
- data/examples/shop/public/img/fff/map_add.png +0 -0
- data/examples/shop/public/img/fff/map_delete.png +0 -0
- data/examples/shop/public/img/fff/map_edit.png +0 -0
- data/examples/shop/public/img/fff/map_go.png +0 -0
- data/examples/shop/public/img/fff/map_magnify.png +0 -0
- data/examples/shop/public/img/fff/medal_bronze_1.png +0 -0
- data/examples/shop/public/img/fff/medal_bronze_2.png +0 -0
- data/examples/shop/public/img/fff/medal_bronze_3.png +0 -0
- data/examples/shop/public/img/fff/medal_bronze_add.png +0 -0
- data/examples/shop/public/img/fff/medal_bronze_delete.png +0 -0
- data/examples/shop/public/img/fff/medal_gold_1.png +0 -0
- data/examples/shop/public/img/fff/medal_gold_2.png +0 -0
- data/examples/shop/public/img/fff/medal_gold_3.png +0 -0
- data/examples/shop/public/img/fff/medal_gold_add.png +0 -0
- data/examples/shop/public/img/fff/medal_gold_delete.png +0 -0
- data/examples/shop/public/img/fff/medal_silver_1.png +0 -0
- data/examples/shop/public/img/fff/medal_silver_2.png +0 -0
- data/examples/shop/public/img/fff/medal_silver_3.png +0 -0
- data/examples/shop/public/img/fff/medal_silver_add.png +0 -0
- data/examples/shop/public/img/fff/medal_silver_delete.png +0 -0
- data/examples/shop/public/img/fff/money.png +0 -0
- data/examples/shop/public/img/fff/money_add.png +0 -0
- data/examples/shop/public/img/fff/money_delete.png +0 -0
- data/examples/shop/public/img/fff/money_dollar.png +0 -0
- data/examples/shop/public/img/fff/money_euro.png +0 -0
- data/examples/shop/public/img/fff/money_pound.png +0 -0
- data/examples/shop/public/img/fff/money_yen.png +0 -0
- data/examples/shop/public/img/fff/monitor.png +0 -0
- data/examples/shop/public/img/fff/monitor_add.png +0 -0
- data/examples/shop/public/img/fff/monitor_delete.png +0 -0
- data/examples/shop/public/img/fff/monitor_edit.png +0 -0
- data/examples/shop/public/img/fff/monitor_error.png +0 -0
- data/examples/shop/public/img/fff/monitor_go.png +0 -0
- data/examples/shop/public/img/fff/monitor_lightning.png +0 -0
- data/examples/shop/public/img/fff/monitor_link.png +0 -0
- data/examples/shop/public/img/fff/mouse.png +0 -0
- data/examples/shop/public/img/fff/mouse_add.png +0 -0
- data/examples/shop/public/img/fff/mouse_delete.png +0 -0
- data/examples/shop/public/img/fff/mouse_error.png +0 -0
- data/examples/shop/public/img/fff/music.png +0 -0
- data/examples/shop/public/img/fff/new.png +0 -0
- data/examples/shop/public/img/fff/newspaper.png +0 -0
- data/examples/shop/public/img/fff/newspaper_add.png +0 -0
- data/examples/shop/public/img/fff/newspaper_delete.png +0 -0
- data/examples/shop/public/img/fff/newspaper_go.png +0 -0
- data/examples/shop/public/img/fff/newspaper_link.png +0 -0
- data/examples/shop/public/img/fff/note.png +0 -0
- data/examples/shop/public/img/fff/note_add.png +0 -0
- data/examples/shop/public/img/fff/note_delete.png +0 -0
- data/examples/shop/public/img/fff/note_edit.png +0 -0
- data/examples/shop/public/img/fff/note_error.png +0 -0
- data/examples/shop/public/img/fff/note_go.png +0 -0
- data/examples/shop/public/img/fff/overlays.png +0 -0
- data/examples/shop/public/img/fff/package.png +0 -0
- data/examples/shop/public/img/fff/package_add.png +0 -0
- data/examples/shop/public/img/fff/package_delete.png +0 -0
- data/examples/shop/public/img/fff/package_go.png +0 -0
- data/examples/shop/public/img/fff/package_green.png +0 -0
- data/examples/shop/public/img/fff/package_link.png +0 -0
- data/examples/shop/public/img/fff/page.png +0 -0
- data/examples/shop/public/img/fff/page_add.png +0 -0
- data/examples/shop/public/img/fff/page_attach.png +0 -0
- data/examples/shop/public/img/fff/page_code.png +0 -0
- data/examples/shop/public/img/fff/page_copy.png +0 -0
- data/examples/shop/public/img/fff/page_delete.png +0 -0
- data/examples/shop/public/img/fff/page_edit.png +0 -0
- data/examples/shop/public/img/fff/page_error.png +0 -0
- data/examples/shop/public/img/fff/page_excel.png +0 -0
- data/examples/shop/public/img/fff/page_find.png +0 -0
- data/examples/shop/public/img/fff/page_gear.png +0 -0
- data/examples/shop/public/img/fff/page_go.png +0 -0
- data/examples/shop/public/img/fff/page_green.png +0 -0
- data/examples/shop/public/img/fff/page_key.png +0 -0
- data/examples/shop/public/img/fff/page_lightning.png +0 -0
- data/examples/shop/public/img/fff/page_link.png +0 -0
- data/examples/shop/public/img/fff/page_paintbrush.png +0 -0
- data/examples/shop/public/img/fff/page_paste.png +0 -0
- data/examples/shop/public/img/fff/page_red.png +0 -0
- data/examples/shop/public/img/fff/page_refresh.png +0 -0
- data/examples/shop/public/img/fff/page_save.png +0 -0
- data/examples/shop/public/img/fff/page_white.png +0 -0
- data/examples/shop/public/img/fff/page_white_acrobat.png +0 -0
- data/examples/shop/public/img/fff/page_white_actionscript.png +0 -0
- data/examples/shop/public/img/fff/page_white_add.png +0 -0
- data/examples/shop/public/img/fff/page_white_c.png +0 -0
- data/examples/shop/public/img/fff/page_white_camera.png +0 -0
- data/examples/shop/public/img/fff/page_white_cd.png +0 -0
- data/examples/shop/public/img/fff/page_white_code.png +0 -0
- data/examples/shop/public/img/fff/page_white_code_red.png +0 -0
- data/examples/shop/public/img/fff/page_white_coldfusion.png +0 -0
- data/examples/shop/public/img/fff/page_white_compressed.png +0 -0
- data/examples/shop/public/img/fff/page_white_copy.png +0 -0
- data/examples/shop/public/img/fff/page_white_cplusplus.png +0 -0
- data/examples/shop/public/img/fff/page_white_csharp.png +0 -0
- data/examples/shop/public/img/fff/page_white_cup.png +0 -0
- data/examples/shop/public/img/fff/page_white_database.png +0 -0
- data/examples/shop/public/img/fff/page_white_delete.png +0 -0
- data/examples/shop/public/img/fff/page_white_dvd.png +0 -0
- data/examples/shop/public/img/fff/page_white_edit.png +0 -0
- data/examples/shop/public/img/fff/page_white_error.png +0 -0
- data/examples/shop/public/img/fff/page_white_excel.png +0 -0
- data/examples/shop/public/img/fff/page_white_find.png +0 -0
- data/examples/shop/public/img/fff/page_white_flash.png +0 -0
- data/examples/shop/public/img/fff/page_white_freehand.png +0 -0
- data/examples/shop/public/img/fff/page_white_gear.png +0 -0
- data/examples/shop/public/img/fff/page_white_get.png +0 -0
- data/examples/shop/public/img/fff/page_white_go.png +0 -0
- data/examples/shop/public/img/fff/page_white_h.png +0 -0
- data/examples/shop/public/img/fff/page_white_horizontal.png +0 -0
- data/examples/shop/public/img/fff/page_white_key.png +0 -0
- data/examples/shop/public/img/fff/page_white_lightning.png +0 -0
- data/examples/shop/public/img/fff/page_white_link.png +0 -0
- data/examples/shop/public/img/fff/page_white_magnify.png +0 -0
- data/examples/shop/public/img/fff/page_white_medal.png +0 -0
- data/examples/shop/public/img/fff/page_white_office.png +0 -0
- data/examples/shop/public/img/fff/page_white_paint.png +0 -0
- data/examples/shop/public/img/fff/page_white_paintbrush.png +0 -0
- data/examples/shop/public/img/fff/page_white_paste.png +0 -0
- data/examples/shop/public/img/fff/page_white_php.png +0 -0
- data/examples/shop/public/img/fff/page_white_picture.png +0 -0
- data/examples/shop/public/img/fff/page_white_powerpoint.png +0 -0
- data/examples/shop/public/img/fff/page_white_put.png +0 -0
- data/examples/shop/public/img/fff/page_white_ruby.png +0 -0
- data/examples/shop/public/img/fff/page_white_stack.png +0 -0
- data/examples/shop/public/img/fff/page_white_star.png +0 -0
- data/examples/shop/public/img/fff/page_white_swoosh.png +0 -0
- data/examples/shop/public/img/fff/page_white_text.png +0 -0
- data/examples/shop/public/img/fff/page_white_text_width.png +0 -0
- data/examples/shop/public/img/fff/page_white_tux.png +0 -0
- data/examples/shop/public/img/fff/page_white_vector.png +0 -0
- data/examples/shop/public/img/fff/page_white_visualstudio.png +0 -0
- data/examples/shop/public/img/fff/page_white_width.png +0 -0
- data/examples/shop/public/img/fff/page_white_word.png +0 -0
- data/examples/shop/public/img/fff/page_white_world.png +0 -0
- data/examples/shop/public/img/fff/page_white_wrench.png +0 -0
- data/examples/shop/public/img/fff/page_white_zip.png +0 -0
- data/examples/shop/public/img/fff/page_word.png +0 -0
- data/examples/shop/public/img/fff/page_world.png +0 -0
- data/examples/shop/public/img/fff/paintbrush.png +0 -0
- data/examples/shop/public/img/fff/paintcan.png +0 -0
- data/examples/shop/public/img/fff/palette.png +0 -0
- data/examples/shop/public/img/fff/paste_plain.png +0 -0
- data/examples/shop/public/img/fff/paste_word.png +0 -0
- data/examples/shop/public/img/fff/pencil.png +0 -0
- data/examples/shop/public/img/fff/pencil_add.png +0 -0
- data/examples/shop/public/img/fff/pencil_delete.png +0 -0
- data/examples/shop/public/img/fff/pencil_go.png +0 -0
- data/examples/shop/public/img/fff/phone.png +0 -0
- data/examples/shop/public/img/fff/phone_add.png +0 -0
- data/examples/shop/public/img/fff/phone_delete.png +0 -0
- data/examples/shop/public/img/fff/phone_sound.png +0 -0
- data/examples/shop/public/img/fff/photo.png +0 -0
- data/examples/shop/public/img/fff/photo_add.png +0 -0
- data/examples/shop/public/img/fff/photo_delete.png +0 -0
- data/examples/shop/public/img/fff/photo_link.png +0 -0
- data/examples/shop/public/img/fff/photos.png +0 -0
- data/examples/shop/public/img/fff/picture.png +0 -0
- data/examples/shop/public/img/fff/picture_add.png +0 -0
- data/examples/shop/public/img/fff/picture_delete.png +0 -0
- data/examples/shop/public/img/fff/picture_edit.png +0 -0
- data/examples/shop/public/img/fff/picture_empty.png +0 -0
- data/examples/shop/public/img/fff/picture_error.png +0 -0
- data/examples/shop/public/img/fff/picture_go.png +0 -0
- data/examples/shop/public/img/fff/picture_key.png +0 -0
- data/examples/shop/public/img/fff/picture_link.png +0 -0
- data/examples/shop/public/img/fff/picture_save.png +0 -0
- data/examples/shop/public/img/fff/pictures.png +0 -0
- data/examples/shop/public/img/fff/pilcrow.png +0 -0
- data/examples/shop/public/img/fff/pill.png +0 -0
- data/examples/shop/public/img/fff/pill_add.png +0 -0
- data/examples/shop/public/img/fff/pill_delete.png +0 -0
- data/examples/shop/public/img/fff/pill_go.png +0 -0
- data/examples/shop/public/img/fff/plugin.png +0 -0
- data/examples/shop/public/img/fff/plugin_add.png +0 -0
- data/examples/shop/public/img/fff/plugin_delete.png +0 -0
- data/examples/shop/public/img/fff/plugin_disabled.png +0 -0
- data/examples/shop/public/img/fff/plugin_edit.png +0 -0
- data/examples/shop/public/img/fff/plugin_error.png +0 -0
- data/examples/shop/public/img/fff/plugin_go.png +0 -0
- data/examples/shop/public/img/fff/plugin_link.png +0 -0
- data/examples/shop/public/img/fff/printer.png +0 -0
- data/examples/shop/public/img/fff/printer_add.png +0 -0
- data/examples/shop/public/img/fff/printer_delete.png +0 -0
- data/examples/shop/public/img/fff/printer_empty.png +0 -0
- data/examples/shop/public/img/fff/printer_error.png +0 -0
- data/examples/shop/public/img/fff/rainbow.png +0 -0
- data/examples/shop/public/img/fff/report.png +0 -0
- data/examples/shop/public/img/fff/report_add.png +0 -0
- data/examples/shop/public/img/fff/report_delete.png +0 -0
- data/examples/shop/public/img/fff/report_disk.png +0 -0
- data/examples/shop/public/img/fff/report_edit.png +0 -0
- data/examples/shop/public/img/fff/report_go.png +0 -0
- data/examples/shop/public/img/fff/report_key.png +0 -0
- data/examples/shop/public/img/fff/report_link.png +0 -0
- data/examples/shop/public/img/fff/report_magnify.png +0 -0
- data/examples/shop/public/img/fff/report_picture.png +0 -0
- data/examples/shop/public/img/fff/report_user.png +0 -0
- data/examples/shop/public/img/fff/report_word.png +0 -0
- data/examples/shop/public/img/fff/resultset_first.png +0 -0
- data/examples/shop/public/img/fff/resultset_last.png +0 -0
- data/examples/shop/public/img/fff/resultset_next.png +0 -0
- data/examples/shop/public/img/fff/resultset_previous.png +0 -0
- data/examples/shop/public/img/fff/rosette.png +0 -0
- data/examples/shop/public/img/fff/rss.png +0 -0
- data/examples/shop/public/img/fff/rss_add.png +0 -0
- data/examples/shop/public/img/fff/rss_delete.png +0 -0
- data/examples/shop/public/img/fff/rss_go.png +0 -0
- data/examples/shop/public/img/fff/rss_valid.png +0 -0
- data/examples/shop/public/img/fff/ruby.png +0 -0
- data/examples/shop/public/img/fff/ruby_add.png +0 -0
- data/examples/shop/public/img/fff/ruby_delete.png +0 -0
- data/examples/shop/public/img/fff/ruby_gear.png +0 -0
- data/examples/shop/public/img/fff/ruby_get.png +0 -0
- data/examples/shop/public/img/fff/ruby_go.png +0 -0
- data/examples/shop/public/img/fff/ruby_key.png +0 -0
- data/examples/shop/public/img/fff/ruby_link.png +0 -0
- data/examples/shop/public/img/fff/ruby_put.png +0 -0
- data/examples/shop/public/img/fff/script.png +0 -0
- data/examples/shop/public/img/fff/script_add.png +0 -0
- data/examples/shop/public/img/fff/script_code.png +0 -0
- data/examples/shop/public/img/fff/script_code_red.png +0 -0
- data/examples/shop/public/img/fff/script_delete.png +0 -0
- data/examples/shop/public/img/fff/script_edit.png +0 -0
- data/examples/shop/public/img/fff/script_error.png +0 -0
- data/examples/shop/public/img/fff/script_gear.png +0 -0
- data/examples/shop/public/img/fff/script_go.png +0 -0
- data/examples/shop/public/img/fff/script_key.png +0 -0
- data/examples/shop/public/img/fff/script_lightning.png +0 -0
- data/examples/shop/public/img/fff/script_link.png +0 -0
- data/examples/shop/public/img/fff/script_palette.png +0 -0
- data/examples/shop/public/img/fff/script_save.png +0 -0
- data/examples/shop/public/img/fff/server.png +0 -0
- data/examples/shop/public/img/fff/server_add.png +0 -0
- data/examples/shop/public/img/fff/server_chart.png +0 -0
- data/examples/shop/public/img/fff/server_compressed.png +0 -0
- data/examples/shop/public/img/fff/server_connect.png +0 -0
- data/examples/shop/public/img/fff/server_database.png +0 -0
- data/examples/shop/public/img/fff/server_delete.png +0 -0
- data/examples/shop/public/img/fff/server_edit.png +0 -0
- data/examples/shop/public/img/fff/server_error.png +0 -0
- data/examples/shop/public/img/fff/server_go.png +0 -0
- data/examples/shop/public/img/fff/server_key.png +0 -0
- data/examples/shop/public/img/fff/server_lightning.png +0 -0
- data/examples/shop/public/img/fff/server_link.png +0 -0
- data/examples/shop/public/img/fff/server_uncompressed.png +0 -0
- data/examples/shop/public/img/fff/shading.png +0 -0
- data/examples/shop/public/img/fff/shape_align_bottom.png +0 -0
- data/examples/shop/public/img/fff/shape_align_center.png +0 -0
- data/examples/shop/public/img/fff/shape_align_left.png +0 -0
- data/examples/shop/public/img/fff/shape_align_middle.png +0 -0
- data/examples/shop/public/img/fff/shape_align_right.png +0 -0
- data/examples/shop/public/img/fff/shape_align_top.png +0 -0
- data/examples/shop/public/img/fff/shape_flip_horizontal.png +0 -0
- data/examples/shop/public/img/fff/shape_flip_vertical.png +0 -0
- data/examples/shop/public/img/fff/shape_group.png +0 -0
- data/examples/shop/public/img/fff/shape_handles.png +0 -0
- data/examples/shop/public/img/fff/shape_move_back.png +0 -0
- data/examples/shop/public/img/fff/shape_move_backwards.png +0 -0
- data/examples/shop/public/img/fff/shape_move_forwards.png +0 -0
- data/examples/shop/public/img/fff/shape_move_front.png +0 -0
- data/examples/shop/public/img/fff/shape_rotate_anticlockwise.png +0 -0
- data/examples/shop/public/img/fff/shape_rotate_clockwise.png +0 -0
- data/examples/shop/public/img/fff/shape_square.png +0 -0
- data/examples/shop/public/img/fff/shape_square_add.png +0 -0
- data/examples/shop/public/img/fff/shape_square_delete.png +0 -0
- data/examples/shop/public/img/fff/shape_square_edit.png +0 -0
- data/examples/shop/public/img/fff/shape_square_error.png +0 -0
- data/examples/shop/public/img/fff/shape_square_go.png +0 -0
- data/examples/shop/public/img/fff/shape_square_key.png +0 -0
- data/examples/shop/public/img/fff/shape_square_link.png +0 -0
- data/examples/shop/public/img/fff/shape_ungroup.png +0 -0
- data/examples/shop/public/img/fff/shield.png +0 -0
- data/examples/shop/public/img/fff/shield_add.png +0 -0
- data/examples/shop/public/img/fff/shield_delete.png +0 -0
- data/examples/shop/public/img/fff/shield_go.png +0 -0
- data/examples/shop/public/img/fff/sitemap.png +0 -0
- data/examples/shop/public/img/fff/sitemap_color.png +0 -0
- data/examples/shop/public/img/fff/sound.png +0 -0
- data/examples/shop/public/img/fff/sound_add.png +0 -0
- data/examples/shop/public/img/fff/sound_delete.png +0 -0
- data/examples/shop/public/img/fff/sound_low.png +0 -0
- data/examples/shop/public/img/fff/sound_mute.png +0 -0
- data/examples/shop/public/img/fff/sound_none.png +0 -0
- data/examples/shop/public/img/fff/spellcheck.png +0 -0
- data/examples/shop/public/img/fff/sport_8ball.png +0 -0
- data/examples/shop/public/img/fff/sport_basketball.png +0 -0
- data/examples/shop/public/img/fff/sport_football.png +0 -0
- data/examples/shop/public/img/fff/sport_golf.png +0 -0
- data/examples/shop/public/img/fff/sport_raquet.png +0 -0
- data/examples/shop/public/img/fff/sport_shuttlecock.png +0 -0
- data/examples/shop/public/img/fff/sport_soccer.png +0 -0
- data/examples/shop/public/img/fff/sport_tennis.png +0 -0
- data/examples/shop/public/img/fff/star.png +0 -0
- data/examples/shop/public/img/fff/status_away.png +0 -0
- data/examples/shop/public/img/fff/status_busy.png +0 -0
- data/examples/shop/public/img/fff/status_offline.png +0 -0
- data/examples/shop/public/img/fff/status_online.png +0 -0
- data/examples/shop/public/img/fff/stop.png +0 -0
- data/examples/shop/public/img/fff/style.png +0 -0
- data/examples/shop/public/img/fff/style_add.png +0 -0
- data/examples/shop/public/img/fff/style_delete.png +0 -0
- data/examples/shop/public/img/fff/style_edit.png +0 -0
- data/examples/shop/public/img/fff/style_go.png +0 -0
- data/examples/shop/public/img/fff/sum.png +0 -0
- data/examples/shop/public/img/fff/tab.png +0 -0
- data/examples/shop/public/img/fff/tab_add.png +0 -0
- data/examples/shop/public/img/fff/tab_delete.png +0 -0
- data/examples/shop/public/img/fff/tab_edit.png +0 -0
- data/examples/shop/public/img/fff/tab_go.png +0 -0
- data/examples/shop/public/img/fff/table.png +0 -0
- data/examples/shop/public/img/fff/table_add.png +0 -0
- data/examples/shop/public/img/fff/table_delete.png +0 -0
- data/examples/shop/public/img/fff/table_edit.png +0 -0
- data/examples/shop/public/img/fff/table_error.png +0 -0
- data/examples/shop/public/img/fff/table_gear.png +0 -0
- data/examples/shop/public/img/fff/table_go.png +0 -0
- data/examples/shop/public/img/fff/table_key.png +0 -0
- data/examples/shop/public/img/fff/table_lightning.png +0 -0
- data/examples/shop/public/img/fff/table_link.png +0 -0
- data/examples/shop/public/img/fff/table_multiple.png +0 -0
- data/examples/shop/public/img/fff/table_refresh.png +0 -0
- data/examples/shop/public/img/fff/table_relationship.png +0 -0
- data/examples/shop/public/img/fff/table_row_delete.png +0 -0
- data/examples/shop/public/img/fff/table_row_insert.png +0 -0
- data/examples/shop/public/img/fff/table_save.png +0 -0
- data/examples/shop/public/img/fff/table_sort.png +0 -0
- data/examples/shop/public/img/fff/tag.png +0 -0
- data/examples/shop/public/img/fff/tag_blue.png +0 -0
- data/examples/shop/public/img/fff/tag_blue_add.png +0 -0
- data/examples/shop/public/img/fff/tag_blue_delete.png +0 -0
- data/examples/shop/public/img/fff/tag_blue_edit.png +0 -0
- data/examples/shop/public/img/fff/tag_green.png +0 -0
- data/examples/shop/public/img/fff/tag_orange.png +0 -0
- data/examples/shop/public/img/fff/tag_pink.png +0 -0
- data/examples/shop/public/img/fff/tag_purple.png +0 -0
- data/examples/shop/public/img/fff/tag_red.png +0 -0
- data/examples/shop/public/img/fff/tag_yellow.png +0 -0
- data/examples/shop/public/img/fff/telephone.png +0 -0
- data/examples/shop/public/img/fff/telephone_add.png +0 -0
- data/examples/shop/public/img/fff/telephone_delete.png +0 -0
- data/examples/shop/public/img/fff/telephone_edit.png +0 -0
- data/examples/shop/public/img/fff/telephone_error.png +0 -0
- data/examples/shop/public/img/fff/telephone_go.png +0 -0
- data/examples/shop/public/img/fff/telephone_key.png +0 -0
- data/examples/shop/public/img/fff/telephone_link.png +0 -0
- data/examples/shop/public/img/fff/television.png +0 -0
- data/examples/shop/public/img/fff/television_add.png +0 -0
- data/examples/shop/public/img/fff/television_delete.png +0 -0
- data/examples/shop/public/img/fff/text_align_center.png +0 -0
- data/examples/shop/public/img/fff/text_align_justify.png +0 -0
- data/examples/shop/public/img/fff/text_align_left.png +0 -0
- data/examples/shop/public/img/fff/text_align_right.png +0 -0
- data/examples/shop/public/img/fff/text_allcaps.png +0 -0
- data/examples/shop/public/img/fff/text_bold.png +0 -0
- data/examples/shop/public/img/fff/text_columns.png +0 -0
- data/examples/shop/public/img/fff/text_dropcaps.png +0 -0
- data/examples/shop/public/img/fff/text_heading_1.png +0 -0
- data/examples/shop/public/img/fff/text_heading_2.png +0 -0
- data/examples/shop/public/img/fff/text_heading_3.png +0 -0
- data/examples/shop/public/img/fff/text_heading_4.png +0 -0
- data/examples/shop/public/img/fff/text_heading_5.png +0 -0
- data/examples/shop/public/img/fff/text_heading_6.png +0 -0
- data/examples/shop/public/img/fff/text_horizontalrule.png +0 -0
- data/examples/shop/public/img/fff/text_indent.png +0 -0
- data/examples/shop/public/img/fff/text_indent_remove.png +0 -0
- data/examples/shop/public/img/fff/text_italic.png +0 -0
- data/examples/shop/public/img/fff/text_kerning.png +0 -0
- data/examples/shop/public/img/fff/text_letter_omega.png +0 -0
- data/examples/shop/public/img/fff/text_letterspacing.png +0 -0
- data/examples/shop/public/img/fff/text_linespacing.png +0 -0
- data/examples/shop/public/img/fff/text_list_bullets.png +0 -0
- data/examples/shop/public/img/fff/text_list_numbers.png +0 -0
- data/examples/shop/public/img/fff/text_lowercase.png +0 -0
- data/examples/shop/public/img/fff/text_padding_bottom.png +0 -0
- data/examples/shop/public/img/fff/text_padding_left.png +0 -0
- data/examples/shop/public/img/fff/text_padding_right.png +0 -0
- data/examples/shop/public/img/fff/text_padding_top.png +0 -0
- data/examples/shop/public/img/fff/text_replace.png +0 -0
- data/examples/shop/public/img/fff/text_signature.png +0 -0
- data/examples/shop/public/img/fff/text_smallcaps.png +0 -0
- data/examples/shop/public/img/fff/text_strikethrough.png +0 -0
- data/examples/shop/public/img/fff/text_subscript.png +0 -0
- data/examples/shop/public/img/fff/text_superscript.png +0 -0
- data/examples/shop/public/img/fff/text_underline.png +0 -0
- data/examples/shop/public/img/fff/text_uppercase.png +0 -0
- data/examples/shop/public/img/fff/textfield.png +0 -0
- data/examples/shop/public/img/fff/textfield_add.png +0 -0
- data/examples/shop/public/img/fff/textfield_delete.png +0 -0
- data/examples/shop/public/img/fff/textfield_key.png +0 -0
- data/examples/shop/public/img/fff/textfield_rename.png +0 -0
- data/examples/shop/public/img/fff/thumb_down.png +0 -0
- data/examples/shop/public/img/fff/thumb_up.png +0 -0
- data/examples/shop/public/img/fff/tick.png +0 -0
- data/examples/shop/public/img/fff/time.png +0 -0
- data/examples/shop/public/img/fff/time_add.png +0 -0
- data/examples/shop/public/img/fff/time_delete.png +0 -0
- data/examples/shop/public/img/fff/time_go.png +0 -0
- data/examples/shop/public/img/fff/timeline_marker.png +0 -0
- data/examples/shop/public/img/fff/transmit.png +0 -0
- data/examples/shop/public/img/fff/transmit_add.png +0 -0
- data/examples/shop/public/img/fff/transmit_blue.png +0 -0
- data/examples/shop/public/img/fff/transmit_delete.png +0 -0
- data/examples/shop/public/img/fff/transmit_edit.png +0 -0
- data/examples/shop/public/img/fff/transmit_error.png +0 -0
- data/examples/shop/public/img/fff/transmit_go.png +0 -0
- data/examples/shop/public/img/fff/tux.png +0 -0
- data/examples/shop/public/img/fff/user.png +0 -0
- data/examples/shop/public/img/fff/user_add.png +0 -0
- data/examples/shop/public/img/fff/user_comment.png +0 -0
- data/examples/shop/public/img/fff/user_delete.png +0 -0
- data/examples/shop/public/img/fff/user_edit.png +0 -0
- data/examples/shop/public/img/fff/user_female.png +0 -0
- data/examples/shop/public/img/fff/user_go.png +0 -0
- data/examples/shop/public/img/fff/user_gray.png +0 -0
- data/examples/shop/public/img/fff/user_green.png +0 -0
- data/examples/shop/public/img/fff/user_orange.png +0 -0
- data/examples/shop/public/img/fff/user_red.png +0 -0
- data/examples/shop/public/img/fff/user_suit.png +0 -0
- data/examples/shop/public/img/fff/vcard.png +0 -0
- data/examples/shop/public/img/fff/vcard_add.png +0 -0
- data/examples/shop/public/img/fff/vcard_delete.png +0 -0
- data/examples/shop/public/img/fff/vcard_edit.png +0 -0
- data/examples/shop/public/img/fff/vector.png +0 -0
- data/examples/shop/public/img/fff/vector_add.png +0 -0
- data/examples/shop/public/img/fff/vector_delete.png +0 -0
- data/examples/shop/public/img/fff/wand.png +0 -0
- data/examples/shop/public/img/fff/weather_clouds.png +0 -0
- data/examples/shop/public/img/fff/weather_cloudy.png +0 -0
- data/examples/shop/public/img/fff/weather_lightning.png +0 -0
- data/examples/shop/public/img/fff/weather_rain.png +0 -0
- data/examples/shop/public/img/fff/weather_snow.png +0 -0
- data/examples/shop/public/img/fff/weather_sun.png +0 -0
- data/examples/shop/public/img/fff/webcam.png +0 -0
- data/examples/shop/public/img/fff/webcam_add.png +0 -0
- data/examples/shop/public/img/fff/webcam_delete.png +0 -0
- data/examples/shop/public/img/fff/webcam_error.png +0 -0
- data/examples/shop/public/img/fff/world.png +0 -0
- data/examples/shop/public/img/fff/world_add.png +0 -0
- data/examples/shop/public/img/fff/world_delete.png +0 -0
- data/examples/shop/public/img/fff/world_edit.png +0 -0
- data/examples/shop/public/img/fff/world_go.png +0 -0
- data/examples/shop/public/img/fff/world_link.png +0 -0
- data/examples/shop/public/img/fff/wrench.png +0 -0
- data/examples/shop/public/img/fff/wrench_orange.png +0 -0
- data/examples/shop/public/img/fff/xhtml.png +0 -0
- data/examples/shop/public/img/fff/xhtml_add.png +0 -0
- data/examples/shop/public/img/fff/xhtml_delete.png +0 -0
- data/examples/shop/public/img/fff/xhtml_go.png +0 -0
- data/examples/shop/public/img/fff/xhtml_valid.png +0 -0
- data/examples/shop/public/img/fff/zoom.png +0 -0
- data/examples/shop/public/img/fff/zoom_in.png +0 -0
- data/examples/shop/public/img/fff/zoom_out.png +0 -0
- data/examples/shop/public/img/glyphicons-halflings-white.png +0 -0
- data/examples/shop/public/img/glyphicons-halflings.png +0 -0
- data/examples/shop/public/js/jquery-1.9.1.min.js +5 -0
- data/examples/shop/public/js/jquery-ujs.js +400 -0
- data/examples/shop/server.rb +43 -0
- data/examples/shop/views/edit.erb +2 -0
- data/examples/shop/views/index.erb +2 -0
- data/examples/shop/views/layout.erb +13 -0
- data/examples/shop/views/show.erb +2 -0
- data/lib/dima/config.rb +35 -0
- data/lib/dima/engine.rb +5 -0
- data/lib/dima/html/action.rb +21 -0
- data/lib/dima/html/element.rb +18 -0
- data/lib/dima/html/field.rb +367 -0
- data/lib/dima/html/form.rb +305 -0
- data/lib/dima/html/node.rb +58 -0
- data/lib/dima/utils.rb +47 -0
- data/lib/dima/version.rb +4 -0
- data/lib/dima.rb +22 -0
- data/spec/config_spec.rb +11 -0
- data/spec/helpers/models.rb +9 -0
- data/spec/html/field_spec.rb +103 -0
- data/spec/html/form_spec.rb +60 -0
- data/spec/html/node_spec.rb +42 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/utils_spec.rb +54 -0
- data/vendor/assets/stylesheets/dima-min.css +24 -0
- data/vendor/assets/stylesheets/dima.css +201 -0
- data/vendor/less/dima.less +187 -0
- metadata +1156 -0
@@ -0,0 +1,367 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
module Dima::Html
|
5
|
+
|
6
|
+
# Text editor support.
|
7
|
+
module TextEditor
|
8
|
+
def editor(opts)
|
9
|
+
if opts[:textarea]
|
10
|
+
editor = Node.new(tag: 'textarea', text: opts[:val])
|
11
|
+
else
|
12
|
+
editor = Node.new(tag: 'input', attributes: { type: 'text', value: opts[:val] })
|
13
|
+
end
|
14
|
+
editor[:name] = "dim[#{name}]"
|
15
|
+
editor.add_class('dim-main-content')
|
16
|
+
editor.add_class("#{opts[:type]}")
|
17
|
+
style = ''
|
18
|
+
style += "width: #{opts[:width]}px;" if opts[:width]
|
19
|
+
style += "height: #{opts[:height]}px;" if opts[:height]
|
20
|
+
editor.attributes[:style] = style unless Dima::Utils.empty?(style)
|
21
|
+
editor
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Field is used in a form.
|
26
|
+
class Field < Dima::Html::Element
|
27
|
+
include Dima::Init
|
28
|
+
|
29
|
+
# form holding this field
|
30
|
+
attr_accessor :form
|
31
|
+
# label describes this field
|
32
|
+
attr_accessor :label
|
33
|
+
# tooltip
|
34
|
+
attr_accessor :tooltip
|
35
|
+
# hint message
|
36
|
+
attr_accessor :hint
|
37
|
+
# is this field required?
|
38
|
+
attr_accessor :required
|
39
|
+
# element to be placed BEFORE the field content
|
40
|
+
attr_accessor :before
|
41
|
+
# element to be placed AFTER the field content
|
42
|
+
attr_accessor :after
|
43
|
+
# url property
|
44
|
+
attr_accessor :url
|
45
|
+
# text align: used for correct display in tables
|
46
|
+
attr_accessor :align
|
47
|
+
# edit mode switch
|
48
|
+
attr_accessor :edit
|
49
|
+
|
50
|
+
attr_accessor :has_errors
|
51
|
+
|
52
|
+
def validate
|
53
|
+
self.has_errors = false
|
54
|
+
self.has_errors = true if self.required and Dima::Utils.empty?(@val)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Get current value of the field.
|
58
|
+
def val
|
59
|
+
@val
|
60
|
+
end
|
61
|
+
|
62
|
+
# Set the value of the field.
|
63
|
+
def val=(v)
|
64
|
+
@val = v
|
65
|
+
end
|
66
|
+
|
67
|
+
# Additional properties.
|
68
|
+
def options
|
69
|
+
@options ||= {}
|
70
|
+
end
|
71
|
+
|
72
|
+
def edit?
|
73
|
+
self.edit and not self.readonly
|
74
|
+
end
|
75
|
+
|
76
|
+
# Create html node for the field.
|
77
|
+
def to_n
|
78
|
+
field = Node.new(tag: 'div', attributes: { id: self.id, class: 'dim-field' })
|
79
|
+
field.add_class('dim-required') if required
|
80
|
+
field.add_class('dim-error') if has_errors
|
81
|
+
field << label_node
|
82
|
+
field << value_node
|
83
|
+
field
|
84
|
+
end
|
85
|
+
|
86
|
+
# Prepare content node.
|
87
|
+
def value_node
|
88
|
+
content = Node.new(tag: 'div', attributes: { class: 'dim-value' })
|
89
|
+
if empty? and not self.edit?
|
90
|
+
content << empty_node
|
91
|
+
else
|
92
|
+
content.add_class(align.to_s) if align
|
93
|
+
content << before_node
|
94
|
+
## content + link node
|
95
|
+
link_node = url_node
|
96
|
+
if link_node and not self.edit
|
97
|
+
link_node << main_content_node
|
98
|
+
content << link_node
|
99
|
+
else
|
100
|
+
content << main_content_node
|
101
|
+
end
|
102
|
+
##
|
103
|
+
content << after_node
|
104
|
+
content
|
105
|
+
end
|
106
|
+
content
|
107
|
+
end
|
108
|
+
|
109
|
+
# Empty node.
|
110
|
+
def empty_node
|
111
|
+
Node.new(tag: 'span', attributes: { class: 'dim-empty' }, text: '(empty)')
|
112
|
+
end
|
113
|
+
|
114
|
+
# Prepare label node for this field.
|
115
|
+
def label_node
|
116
|
+
unless @label == false
|
117
|
+
Node.new(tag: 'div', attributes: { class: 'dim-label' }, text: @label)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
# Before node.
|
122
|
+
def before_node
|
123
|
+
Node.new(tag: 'span', attributes: { class: 'dim-before' }, text: self.before) if self.before
|
124
|
+
end
|
125
|
+
|
126
|
+
# After node.
|
127
|
+
def after_node
|
128
|
+
Node.new(tag: 'span', attributes: { class: 'dim-after' }, text: self.after) if self.after
|
129
|
+
end
|
130
|
+
|
131
|
+
# Url node.
|
132
|
+
def url_node
|
133
|
+
if self.url
|
134
|
+
if self.url.is_a?(Proc) and self.model
|
135
|
+
Node.new(tag: 'a', attributes: {href: self.url.call(self.model)})
|
136
|
+
else
|
137
|
+
Node.new(tag: 'a', attributes: {href: self.url.to_s})
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
# Simple field has a name associated with it.
|
145
|
+
# Using this name we can associate values from a model.
|
146
|
+
class SimpleField < Field
|
147
|
+
attr_accessor :name
|
148
|
+
attr_accessor :lambda
|
149
|
+
attr_accessor :width, :height
|
150
|
+
attr_accessor :readonly
|
151
|
+
attr_accessor :model
|
152
|
+
|
153
|
+
# Initialize this field from a model.
|
154
|
+
#
|
155
|
+
# The field can be initialized from a hash too.
|
156
|
+
def << (v)
|
157
|
+
if v and v.is_a?(Hash)
|
158
|
+
update_from_hash(v)
|
159
|
+
else
|
160
|
+
self.model = v
|
161
|
+
if self.lambda
|
162
|
+
self.val = self.lambda.call(v)
|
163
|
+
elsif self.name
|
164
|
+
self.val = Dima::Utils.get(v, self.name)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
def >> (v)
|
170
|
+
Dima::Utils.set(v, self.name, self.val) if self.name and not self.readonly?
|
171
|
+
end
|
172
|
+
|
173
|
+
def main_content_node
|
174
|
+
simple_value_node
|
175
|
+
end
|
176
|
+
|
177
|
+
def empty?
|
178
|
+
Dima::Utils.empty?(self.val)
|
179
|
+
end
|
180
|
+
|
181
|
+
def readonly?
|
182
|
+
self.readonly
|
183
|
+
end
|
184
|
+
|
185
|
+
private
|
186
|
+
|
187
|
+
def update_from_hash(hash)
|
188
|
+
txt = hash[self.name.to_s]
|
189
|
+
txt = hash[self.name.to_sym] if txt.nil?
|
190
|
+
value_from_text(txt)
|
191
|
+
end
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
# Complex field.
|
196
|
+
class ComplexField < Field
|
197
|
+
attr_accessor :model
|
198
|
+
|
199
|
+
# fields for this component.
|
200
|
+
def fields
|
201
|
+
@fields ||= []
|
202
|
+
end
|
203
|
+
|
204
|
+
# Initialize this field from a model.
|
205
|
+
def << (v)
|
206
|
+
self.model = v
|
207
|
+
fields.each do |f|
|
208
|
+
f << v
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
def >> (v)
|
213
|
+
fields.each { |f| f >> v }
|
214
|
+
end
|
215
|
+
|
216
|
+
def empty?
|
217
|
+
fields.each do |f|
|
218
|
+
return false unless f.empty?
|
219
|
+
end
|
220
|
+
true
|
221
|
+
end
|
222
|
+
|
223
|
+
def main_content_node
|
224
|
+
cmplx = Node.new(tag: 'div', attributes: { class: 'dim-complex' })
|
225
|
+
fields.each do |f|
|
226
|
+
f.edit = self.edit
|
227
|
+
cmplx << f.main_content_node unless f.empty?
|
228
|
+
end
|
229
|
+
cmplx
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
# Text field.
|
235
|
+
class TextField < SimpleField
|
236
|
+
include Dima::Html::TextEditor
|
237
|
+
attr_accessor :textarea
|
238
|
+
|
239
|
+
def simple_value_node
|
240
|
+
if self.edit?
|
241
|
+
editor(val: self.val.to_s, type: 'dim-text', width: width, height: height, textarea: self.textarea)
|
242
|
+
else
|
243
|
+
Node.new(tag: 'span', attributes: { class: 'dim-main-content dim-text' }, text: self.val.to_s)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
def value_from_text(val)
|
248
|
+
self.val = val
|
249
|
+
end
|
250
|
+
|
251
|
+
end
|
252
|
+
|
253
|
+
# Display email.
|
254
|
+
class EmailField < SimpleField
|
255
|
+
include Dima::Html::TextEditor
|
256
|
+
|
257
|
+
def simple_value_node
|
258
|
+
if self.edit?
|
259
|
+
editor(val: self.val.to_s, type: 'dim-email', width: width)
|
260
|
+
else
|
261
|
+
node = Node.new(tag: 'span', attributes: { class: 'dim-main-content dim-email' })
|
262
|
+
node << Node.new(tag: 'a', attributes: { href: 'mailto:' + self.val.to_s }, text: self.val.to_s)
|
263
|
+
node
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
def value_from_text(val)
|
268
|
+
self.val = val
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
272
|
+
|
273
|
+
# Display web-address.
|
274
|
+
class WebField < SimpleField
|
275
|
+
include Dima::Html::TextEditor
|
276
|
+
|
277
|
+
def simple_value_node
|
278
|
+
if self.edit?
|
279
|
+
editor(val: self.val.to_s, type: 'dim-web', width: width)
|
280
|
+
else
|
281
|
+
node = Node.new(tag: 'span', attributes: { class: 'dim-main-content dim-web' })
|
282
|
+
node << Node.new(tag: 'a', attributes: { href: self.val.to_s }, text: self.val.to_s)
|
283
|
+
node
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
def value_from_text(val)
|
288
|
+
self.val = val
|
289
|
+
end
|
290
|
+
|
291
|
+
end
|
292
|
+
|
293
|
+
# Display number.
|
294
|
+
class NumberField < SimpleField
|
295
|
+
include Dima::Html::TextEditor
|
296
|
+
attr_accessor :precision
|
297
|
+
attr_accessor :delimiter
|
298
|
+
attr_accessor :separator
|
299
|
+
|
300
|
+
def initialize(h = {})
|
301
|
+
super(h)
|
302
|
+
self.align = 'right' unless self.align
|
303
|
+
end
|
304
|
+
|
305
|
+
def simple_value_node
|
306
|
+
if self.edit?
|
307
|
+
editor(val: self.val.to_s, type: 'dim-number', width: width)
|
308
|
+
else
|
309
|
+
frmtValue = Dima::Utils.number_format(self.val, precision: self.precision, delimiter: self.delimiter, separator: self.separator)
|
310
|
+
node = Node.new(tag: 'span', attributes: { class: 'dim-main-content dim-number' })
|
311
|
+
node << Node.new(tag: 'code', text: frmtValue)
|
312
|
+
node
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
def value_from_text(val)
|
317
|
+
if precision == 0
|
318
|
+
self.val = val.to_i
|
319
|
+
else
|
320
|
+
self.val = val.to_f
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
end
|
325
|
+
|
326
|
+
# Display date.
|
327
|
+
class DateField < SimpleField
|
328
|
+
include Dima::Html::TextEditor
|
329
|
+
attr_accessor :formatter
|
330
|
+
|
331
|
+
def simple_value_node
|
332
|
+
frmtValue = self.val.strftime(self.formatter || Dima.config.date.formatter) if self.val
|
333
|
+
if self.edit?
|
334
|
+
editor(val: frmtValue, type: 'dim-date', width: width)
|
335
|
+
else
|
336
|
+
Node.new(tag: 'span', attributes: { class: 'dim-main-content dim-date' }, text: frmtValue)
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
def value_from_text(val)
|
341
|
+
self.val = Date.strptime(val, (self.formatter || Dima.config.date.formatter)) rescue nil
|
342
|
+
end
|
343
|
+
|
344
|
+
end
|
345
|
+
|
346
|
+
# Boolean field.
|
347
|
+
class BooleanField < SimpleField
|
348
|
+
|
349
|
+
def simple_value_node
|
350
|
+
if self.edit?
|
351
|
+
Node.new(tag: 'input', attributes: { name: "dim[#{name}]", class: 'dim-main-content dim-boolean', type: 'checkbox', checked: self.val })
|
352
|
+
else
|
353
|
+
Node.new(tag: 'input', attributes: { class: 'dim-main-content dim-boolean', type: 'checkbox', checked: self.val, disabled: true })
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
def value_from_text(val)
|
358
|
+
if Dima::Utils.empty?(val) || val.strip.downcase == 'false'
|
359
|
+
self.val = false
|
360
|
+
else
|
361
|
+
self.val = true
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
end
|
366
|
+
|
367
|
+
end
|
@@ -0,0 +1,305 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
module Dima::Html
|
3
|
+
|
4
|
+
## forms
|
5
|
+
|
6
|
+
# Abstract form.
|
7
|
+
class AbstractForm < Dima::Html::Element
|
8
|
+
include Dima::Init
|
9
|
+
# Title for this form.
|
10
|
+
attr_accessor :title
|
11
|
+
# Title icon.
|
12
|
+
attr_accessor :icon
|
13
|
+
# Help text for this form.
|
14
|
+
attr_accessor :help
|
15
|
+
# Whether the form is collapsed?
|
16
|
+
attr_accessor :collapsed
|
17
|
+
# Submit button text.
|
18
|
+
attr_accessor :submit
|
19
|
+
# Form method.
|
20
|
+
attr_accessor :method
|
21
|
+
|
22
|
+
# Get form's actions.
|
23
|
+
def actions
|
24
|
+
@actions ||= []
|
25
|
+
end
|
26
|
+
|
27
|
+
def html
|
28
|
+
if defined?(Rails)
|
29
|
+
to_n.html.html_safe
|
30
|
+
else
|
31
|
+
to_n.html
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_n
|
36
|
+
node = Node.new(tag: 'div', attributes: { id: self.id, class: 'dim-form' })
|
37
|
+
node << generate_title
|
38
|
+
content = Node.new(tag: 'div', attributes: { class: 'dim-form-content' })
|
39
|
+
content[:style] = 'display: none;' if self.collapsed
|
40
|
+
content << generate_content
|
41
|
+
node << content
|
42
|
+
node
|
43
|
+
end
|
44
|
+
|
45
|
+
protected
|
46
|
+
|
47
|
+
def generate_title
|
48
|
+
if self.title
|
49
|
+
ttl = Node.new(tag: 'div', attributes: { class: 'dim-form-title' })
|
50
|
+
ttl << generate_actions
|
51
|
+
active_title = Node.new(tag: 'span', attributes: { class: 'dim-active-title' })
|
52
|
+
collapse_node = Node.new(tag: 'i', attributes: { class: 'dim-collapse' })
|
53
|
+
collapse_node.add_class(self.collapsed ? 'icon-chevron-right' : 'icon-chevron-down')
|
54
|
+
active_title << collapse_node
|
55
|
+
active_title << Node.new(tag: 'img', attributes: { src: self.icon, class: 'dim-title-image' }) if self.icon
|
56
|
+
active_title << Node.new(tag: 'span', attributes: { class: 'dim-title-text' }, text: title)
|
57
|
+
active_title << Node.new(tag: 'script', attributes: { type: 'text/javascript' }, text: collapse_script)
|
58
|
+
ttl << active_title
|
59
|
+
ttl
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def collapse_script
|
64
|
+
%Q{
|
65
|
+
$('##{id} .dim-active-title').click(function() {
|
66
|
+
var contentElement = $('##{id} .dim-form-content');
|
67
|
+
var collapseElement = $('##{id} .dim-collapse');
|
68
|
+
var is_collapsed = collapseElement.hasClass('icon-chevron-right');
|
69
|
+
if (is_collapsed) {
|
70
|
+
collapseElement.removeClass('icon-chevron-right');
|
71
|
+
collapseElement.addClass('icon-chevron-down');
|
72
|
+
contentElement.show();
|
73
|
+
} else {
|
74
|
+
collapseElement.removeClass('icon-chevron-down');
|
75
|
+
collapseElement.addClass('icon-chevron-right');
|
76
|
+
contentElement.hide();
|
77
|
+
}
|
78
|
+
});
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
def generate_actions
|
83
|
+
v = val if respond_to?(:val)
|
84
|
+
unless actions.empty?
|
85
|
+
acts = Node.new(tag: 'div', attributes: { class: 'dim-form-actions' })
|
86
|
+
actions.each { |a| acts << a.to_n(v) }
|
87
|
+
acts
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
# Form.
|
94
|
+
class Form < Dima::Html::AbstractForm
|
95
|
+
attr_accessor :edit
|
96
|
+
attr_accessor :error_fields
|
97
|
+
attr_accessor :auth_token
|
98
|
+
|
99
|
+
def validate
|
100
|
+
self.error_fields = []
|
101
|
+
(col1.fields + col2.fields).each do |f|
|
102
|
+
f.validate
|
103
|
+
self.error_fields << f if f.has_errors
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def valid?
|
108
|
+
validate
|
109
|
+
self.error_fields.empty?
|
110
|
+
end
|
111
|
+
|
112
|
+
# assign model value for this form
|
113
|
+
def val=(v)
|
114
|
+
@val = v
|
115
|
+
col1.fields.each { |f| f << v }
|
116
|
+
col2.fields.each { |f| f << v }
|
117
|
+
end
|
118
|
+
|
119
|
+
def val
|
120
|
+
@val
|
121
|
+
end
|
122
|
+
|
123
|
+
def << (v)
|
124
|
+
self.val = v
|
125
|
+
end
|
126
|
+
|
127
|
+
def >> (v)
|
128
|
+
col1.fields.each { |f| f >> v }
|
129
|
+
col2.fields.each { |f| f >> v }
|
130
|
+
end
|
131
|
+
|
132
|
+
# First column.
|
133
|
+
def col1
|
134
|
+
@col1 ||= FormFields.new
|
135
|
+
end
|
136
|
+
|
137
|
+
# Second column.
|
138
|
+
def col2
|
139
|
+
@col2 ||= FormFields.new
|
140
|
+
end
|
141
|
+
|
142
|
+
def generate_content
|
143
|
+
if edit
|
144
|
+
form = Node.new(tag: 'form', attributes: { method: (self.method || 'post'), 'accept-charset' => 'UTF-8' })
|
145
|
+
if self.auth_token
|
146
|
+
flds = Node.new(tag: 'div', attributes: { style: 'padding: 0; margin: 0; height: 0; width: 0; display: inline;' })
|
147
|
+
flds << Node.new(tag: 'input', attributes: { name: 'authenticity_token', type: 'hidden', value: self.auth_token } )
|
148
|
+
form << flds
|
149
|
+
end
|
150
|
+
else
|
151
|
+
form = Node.new(tag: 'div')
|
152
|
+
end
|
153
|
+
form << generate_cols
|
154
|
+
form << generate_submit if edit
|
155
|
+
form
|
156
|
+
end
|
157
|
+
|
158
|
+
# Update with request parameters.
|
159
|
+
def update(params)
|
160
|
+
col1.fields.each { |f| f >> @val }
|
161
|
+
col2.fields.each { |f| f >> @val }
|
162
|
+
end
|
163
|
+
|
164
|
+
protected
|
165
|
+
|
166
|
+
def generate_cols
|
167
|
+
col1.edit = col2.edit = self.edit
|
168
|
+
c1 = col1.to_n
|
169
|
+
if c1
|
170
|
+
c2 = col2.to_n
|
171
|
+
c1[:class] = 'dim-column dim-col100' unless c2
|
172
|
+
cont = Node.new(tag: 'div', attributes: { class: 'dim-form-content' })
|
173
|
+
cont << c1
|
174
|
+
cont << c2
|
175
|
+
cont << Node.new(tag: 'div', attributes: { style: 'padding:0;margin:0;clear:both;' })
|
176
|
+
cont
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def generate_submit
|
181
|
+
div = Node.new(tag: 'div', attributes: { class: 'dim-form-buttom-actions'})
|
182
|
+
div << Node.new(tag: 'input', attributes: { type: 'submit', value: (self.submit || 'Submit') })
|
183
|
+
div
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
# Table.
|
189
|
+
class Table < Dima::Html::AbstractForm
|
190
|
+
attr_accessor :vals
|
191
|
+
attr_accessor :actions_width
|
192
|
+
|
193
|
+
# Get form's actions.
|
194
|
+
def item_actions
|
195
|
+
@item_actions ||= []
|
196
|
+
end
|
197
|
+
|
198
|
+
#
|
199
|
+
def cols
|
200
|
+
@cols ||= FormFields.new
|
201
|
+
end
|
202
|
+
|
203
|
+
# Getting html node for this form.
|
204
|
+
def generate_content
|
205
|
+
generate_table
|
206
|
+
|
207
|
+
end
|
208
|
+
|
209
|
+
def generate_table
|
210
|
+
tbl = Node.new(tag: 'table', attributes: { class: 'dim-table' })
|
211
|
+
tbl << generate_header
|
212
|
+
tbl << generate_body
|
213
|
+
tbl
|
214
|
+
end
|
215
|
+
|
216
|
+
def generate_header
|
217
|
+
thead = Node.new(tag: 'thead')
|
218
|
+
tr = Node.new(tag: 'tr')
|
219
|
+
cols.fields.each do |f|
|
220
|
+
if f.options[:col_width]
|
221
|
+
tr << Node.new(tag: 'th', text: f.label, attributes: { width: f.options[:col_width] })
|
222
|
+
else
|
223
|
+
tr << Node.new(tag: 'th', text: f.label)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
tr << Node.new(tag: 'th', text: '', attributes: { width: actions_width || 100 }) unless item_actions.empty?
|
227
|
+
thead << tr
|
228
|
+
thead
|
229
|
+
end
|
230
|
+
|
231
|
+
def generate_body
|
232
|
+
tbody = Node.new(tag: 'tbody')
|
233
|
+
if vals and vals.any?
|
234
|
+
vals.each do |val|
|
235
|
+
tbody << generate_row(val)
|
236
|
+
end
|
237
|
+
else
|
238
|
+
tr = Node.new(tag: 'tr')
|
239
|
+
size = item_actions.empty? ? cols.size : cols.size + 1
|
240
|
+
td = Node.new(tag: 'td', attributes: { colspan: cols.size + 1, class: 'dim-empty' }, text: '(no data)')
|
241
|
+
tr << td
|
242
|
+
tbody << tr
|
243
|
+
end
|
244
|
+
tbody
|
245
|
+
end
|
246
|
+
|
247
|
+
def generate_row(val)
|
248
|
+
tr = Node.new(tag: 'tr')
|
249
|
+
cols.fields.each do |f|
|
250
|
+
f << val
|
251
|
+
td = Node.new(tag: 'td', attributes: { class: 'dim-field' })
|
252
|
+
td.add_class(f.align) if f.align
|
253
|
+
td << f.value_node
|
254
|
+
tr << td
|
255
|
+
end
|
256
|
+
unless item_actions.empty?
|
257
|
+
td = Node.new(tag: 'td', attributes: { class: 'dim-table-actions' })
|
258
|
+
item_actions.each do |a|
|
259
|
+
td << a.to_n(val)
|
260
|
+
end
|
261
|
+
tr << td
|
262
|
+
end
|
263
|
+
tr
|
264
|
+
end
|
265
|
+
|
266
|
+
end
|
267
|
+
|
268
|
+
private
|
269
|
+
|
270
|
+
# Form fields.
|
271
|
+
class FormFields
|
272
|
+
attr_accessor :edit
|
273
|
+
|
274
|
+
def fields
|
275
|
+
@fields ||= []
|
276
|
+
end
|
277
|
+
|
278
|
+
def << (field)
|
279
|
+
fields << field
|
280
|
+
end
|
281
|
+
|
282
|
+
def size
|
283
|
+
self.fields.size
|
284
|
+
end
|
285
|
+
|
286
|
+
def empty?
|
287
|
+
fields.empty?
|
288
|
+
end
|
289
|
+
|
290
|
+
def to_n
|
291
|
+
unless empty?
|
292
|
+
node = Node.new(tag: 'div', attributes: { class: 'dim-column dim-col50'})
|
293
|
+
fields.each do |f|
|
294
|
+
old_edit = f.edit
|
295
|
+
f.edit = self.edit
|
296
|
+
node << f.to_n
|
297
|
+
f.edit = old_edit
|
298
|
+
end
|
299
|
+
node
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
end
|
304
|
+
|
305
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
module Dima::Html
|
3
|
+
|
4
|
+
class Node
|
5
|
+
include Dima::Init
|
6
|
+
attr_accessor :tag, :attributes, :text
|
7
|
+
attr_accessor :children
|
8
|
+
|
9
|
+
# Generate HTML for this node.
|
10
|
+
def html
|
11
|
+
h = ''
|
12
|
+
h << '<' << self.tag.to_s << generate_attributes << '>'
|
13
|
+
h << self.text.to_s if self.text
|
14
|
+
self.children.each { |c| h << c.html } if self.children
|
15
|
+
h << '</' << self.tag << '>'
|
16
|
+
h
|
17
|
+
end
|
18
|
+
|
19
|
+
# Add child to the node.
|
20
|
+
def << (node)
|
21
|
+
@children ||= []
|
22
|
+
@children << node if node
|
23
|
+
end
|
24
|
+
|
25
|
+
# Set attribute for the node.
|
26
|
+
def []= (k, v)
|
27
|
+
@attributes ||= {}
|
28
|
+
@attributes[k] = v
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get attribute value for the node.
|
32
|
+
def [] (k)
|
33
|
+
@attributes[k] if @attributes
|
34
|
+
end
|
35
|
+
|
36
|
+
def add_class(k)
|
37
|
+
clazz = self[:class] || ''
|
38
|
+
clazz += ' ' + k
|
39
|
+
self[:class] = clazz.strip
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def generate_attributes
|
45
|
+
props = ''
|
46
|
+
self.attributes.each do |k, v|
|
47
|
+
if v.is_a?(TrueClass) or v.is_a?(FalseClass)
|
48
|
+
props << ' ' << k.to_s if v
|
49
|
+
else
|
50
|
+
props << ' ' << k.to_s << '="' << v.to_s << '"'
|
51
|
+
end
|
52
|
+
end if self.attributes
|
53
|
+
props
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|