spontaneous 0.2.0.alpha2 → 0.2.0.alpha3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -40
- data/Rakefile +29 -41
- data/Readme.markdown +21 -8
- data/application/css/add_alias_dialogue.css.scss +79 -0
- data/application/css/{v2.scss → core.css.scss} +537 -550
- data/application/css/{definitions.scss → definitions.css.scss} +121 -33
- data/application/css/dialogue.css.scss +409 -0
- data/application/css/{editing.scss → editing.css.scss} +25 -262
- data/application/css/font.css.scss +8 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_222222_256x240.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_228ef1_256x240.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_ef8c08_256x240.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_ffd27a_256x240.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_ffffff_256x240.png +0 -0
- data/application/css/jquery-ui-1.8.21.custom/ui-lightness.css.scss +565 -0
- data/application/css/{login.scss → login.css.scss} +4 -4
- data/application/css/meta.css.scss +331 -0
- data/application/css/{popover.scss → popover.css.scss} +9 -8
- data/application/css/{schema_error.scss → schema_error.css.scss} +4 -4
- data/application/css/spontaneous.css +5 -0
- data/application/css/unsupported.css.scss +42 -0
- data/application/js/add_alias_dialogue.js +72 -10
- data/application/js/ajax.js +50 -16
- data/application/js/compatibility.js +19 -15
- data/application/js/content.js +39 -36
- data/application/js/content_area.js +53 -5
- data/application/js/dialogue.js +17 -0
- data/application/js/dom.js +1 -1
- data/application/js/edit_panel.js +23 -8
- data/application/js/extensions.js +7 -2
- data/application/js/field_preview.js +2 -1
- data/application/js/field_types/date_field.js +11 -8
- data/application/js/field_types/file_field.js +188 -9
- data/application/js/field_types/image_field.js +46 -29
- data/application/js/field_types/markdown_field.js +57 -14
- data/application/js/field_types/select_field.js +72 -0
- data/application/js/field_types/string_field.js +8 -0
- data/application/js/field_types/webvideo_field.js +8 -0
- data/application/js/init.js +1 -7
- data/application/js/location.js +41 -13
- data/application/js/login.js +3 -0
- data/application/js/meta_view/user_admin.js +543 -0
- data/application/js/meta_view.js +1 -0
- data/application/js/metadata.js +20 -0
- data/application/js/page.js +17 -3
- data/application/js/page_browser.js +40 -30
- data/application/js/page_entry.js +4 -0
- data/application/js/panel/root_menu.js +66 -0
- data/application/js/popover.js +2 -2
- data/application/js/preview.js +1 -1
- data/application/js/publish.js +138 -30
- data/application/js/services.js +43 -0
- data/application/js/sharded_upload.js +2 -2
- data/application/js/spontaneous.js +64 -5
- data/application/js/state.js +20 -9
- data/application/js/top_bar.js +273 -150
- data/application/js/types.js +20 -15
- data/application/js/upload.js +1 -2
- data/application/js/user.js +18 -4
- data/application/js/vendor/date.js +104 -0
- data/application/js/vendor/jquery-ui-1.8.18.custom.min.js +356 -0
- data/application/js/views/box_view.js +15 -8
- data/application/js/views/page_piece_view.js +11 -8
- data/application/js/views/page_view.js +21 -3
- data/application/js/views/piece_view.js +19 -10
- data/application/js/views.js +3 -0
- data/application/static/chromelogo-200x52-45c7cbc93be080bea342df5fcda2ef8b.png +0 -0
- data/application/static/dot-texture-9eea29e4ac7ad9a772285252078ec127.png +0 -0
- data/application/static/editing-textarea-resize-s-b5af62365eb7e19ea4beccf7242d508e.png +0 -0
- data/application/static/editing-texture-1-42b06a3439752490988f30f2a06d5e7c.png +0 -0
- data/application/static/font/fontawesome-webfont-5c5c21100a346972a82c34c5e96ffcfe.ttf +0 -0
- data/application/static/loop_alt1-white-7894b458528e92216196cae26b4c2c96.svg +12 -0
- data/application/static/spontaneous-states-e91ec89db525c62da0105b97cdd781ce.png +0 -0
- data/application/views/index.erb +2 -2
- data/application/views/login.erb +4 -8
- data/application/views/schema_modification_error.html.erb +1 -4
- data/application/views/unsupported.erb +9 -7
- data/bin/spot +1 -1
- data/db/migrations/20110209152710_users_and_groups.rb +10 -10
- data/db/migrations/20120305112647_site_modification_time.rb +11 -0
- data/db/migrations/20120418153903_add_ownership_of_content.rb +14 -0
- data/db/migrations/20120423175416_add_pending_modifications.rb +21 -0
- data/db/migrations/20120525164947_add_field_versions.rb +27 -0
- data/lib/sequel/plugins/scoped_table_name.rb +10 -1
- data/lib/spontaneous/asset/file.rb +25 -0
- data/lib/spontaneous/asset/source.rb +28 -0
- data/lib/spontaneous/asset.rb +75 -0
- data/lib/spontaneous/box.rb +6 -4
- data/lib/spontaneous/capistrano/deploy.rb +47 -0
- data/lib/spontaneous/capistrano/sync.rb +81 -0
- data/lib/spontaneous/capistrano.rb +13 -0
- data/lib/spontaneous/change.rb +60 -68
- data/lib/spontaneous/cli/assets.rb +29 -0
- data/lib/spontaneous/cli/base.rb +0 -48
- data/lib/spontaneous/cli/console.rb +1 -1
- data/lib/spontaneous/cli/server.rb +6 -4
- data/lib/spontaneous/cli/site.rb +28 -17
- data/lib/spontaneous/cli/user.rb +107 -0
- data/lib/spontaneous/cli.rb +100 -4
- data/lib/spontaneous/collections/entry_set.rb +2 -2
- data/lib/spontaneous/collections/field_set.rb +48 -22
- data/lib/spontaneous/collections/prototype_set.rb +20 -13
- data/lib/spontaneous/constants.rb +3 -0
- data/lib/spontaneous/content.rb +22 -5
- data/lib/spontaneous/errors.rb +3 -3
- data/lib/spontaneous/extensions/array.rb +12 -0
- data/lib/spontaneous/extensions/enumerable.rb +30 -0
- data/lib/spontaneous/extensions/nil.rb +3 -1
- data/lib/spontaneous/extensions/string.rb +16 -0
- data/lib/spontaneous/field_types/date_field.rb +45 -2
- data/lib/spontaneous/field_types/field.rb +42 -9
- data/lib/spontaneous/field_types/file_field.rb +68 -0
- data/lib/spontaneous/field_types/image_field.rb +63 -0
- data/lib/spontaneous/field_types/select_field.rb +109 -0
- data/lib/spontaneous/field_types/string_field.rb +6 -1
- data/lib/spontaneous/field_types/webvideo_field.rb +85 -27
- data/lib/spontaneous/field_types.rb +1 -1
- data/lib/spontaneous/field_version.rb +8 -0
- data/lib/spontaneous/generators/page.rb +1 -1
- data/lib/spontaneous/generators/site/Capfile.tt +1 -4
- data/lib/spontaneous/generators/site/Gemfile.tt +13 -6
- data/lib/spontaneous/generators/site/config/deploy.rb.tt +28 -0
- data/lib/spontaneous/generators/site/config/environments/production.rb.tt +7 -2
- data/lib/spontaneous/generators/site.rb +1 -0
- data/lib/spontaneous/json.rb +34 -11
- data/lib/spontaneous/layout.rb +22 -0
- data/lib/spontaneous/media/file.rb +4 -0
- data/lib/spontaneous/output/assets/compression.rb +58 -0
- data/lib/spontaneous/output/assets.rb +32 -0
- data/lib/spontaneous/output/context.rb +179 -0
- data/lib/spontaneous/output/format/html.rb +5 -0
- data/lib/spontaneous/output/format/plain.rb +5 -0
- data/lib/spontaneous/output/format.rb +180 -0
- data/lib/spontaneous/output/helpers/classes_helper.rb +18 -0
- data/lib/spontaneous/{render/helpers/html_helper.rb → output/helpers/conditional_comment_helper.rb} +3 -12
- data/lib/spontaneous/output/helpers/script_helper.rb +73 -0
- data/lib/spontaneous/output/helpers/stylesheet_helper.rb +61 -0
- data/lib/spontaneous/output/helpers.rb +28 -0
- data/lib/spontaneous/output/template/engine.rb +59 -0
- data/lib/spontaneous/output/template/renderer.rb +153 -0
- data/lib/spontaneous/output/template.rb +21 -0
- data/lib/spontaneous/output.rb +163 -0
- data/lib/spontaneous/page.rb +2 -1
- data/lib/spontaneous/paths.rb +6 -1
- data/lib/spontaneous/permissions/access_key.rb +5 -5
- data/lib/spontaneous/permissions/user.rb +81 -35
- data/lib/spontaneous/permissions/user_level.rb +26 -22
- data/lib/spontaneous/plugins/aliases.rb +76 -12
- data/lib/spontaneous/plugins/allowed_types.rb +60 -18
- data/lib/spontaneous/plugins/application/paths.rb +0 -28
- data/lib/spontaneous/plugins/application/system.rb +35 -0
- data/lib/spontaneous/plugins/boxes.rb +4 -0
- data/lib/spontaneous/plugins/content_groups.rb +16 -0
- data/lib/spontaneous/plugins/entries.rb +50 -30
- data/lib/spontaneous/plugins/fields.rb +15 -0
- data/lib/spontaneous/plugins/layouts.rb +8 -2
- data/lib/spontaneous/plugins/modifications.rb +228 -0
- data/lib/spontaneous/plugins/page/formats.rb +67 -42
- data/lib/spontaneous/plugins/page/request.rb +10 -0
- data/lib/spontaneous/plugins/page/site_timestamps.rb +28 -0
- data/lib/spontaneous/plugins/paths.rb +15 -3
- data/lib/spontaneous/plugins/publishing.rb +124 -45
- data/lib/spontaneous/plugins/render.rb +13 -8
- data/lib/spontaneous/plugins/schema_hierarchy.rb +18 -6
- data/lib/spontaneous/plugins/site/helpers.rb +53 -0
- data/lib/spontaneous/plugins/site/hooks.rb +50 -0
- data/lib/spontaneous/plugins/site/map.rb +1 -1
- data/lib/spontaneous/plugins/site/paths.rb +13 -0
- data/lib/spontaneous/plugins/site/publishing.rb +6 -2
- data/lib/spontaneous/plugins/site/{revisions.rb → state.rb} +5 -1
- data/lib/spontaneous/plugins/site/storage.rb +4 -0
- data/lib/spontaneous/plugins/site/url.rb +15 -0
- data/lib/spontaneous/plugins/site_map.rb +13 -3
- data/lib/spontaneous/plugins/styles.rb +5 -1
- data/lib/spontaneous/plugins/visibility.rb +39 -12
- data/lib/spontaneous/prototypes/box_prototype.rb +4 -0
- data/lib/spontaneous/prototypes/field_prototype.rb +15 -10
- data/lib/spontaneous/publishing/event_client.rb +46 -0
- data/lib/spontaneous/publishing/immediate.rb +81 -44
- data/lib/spontaneous/publishing/simultaneous.rb +23 -6
- data/lib/spontaneous/publishing.rb +4 -3
- data/lib/spontaneous/rack/around_back.rb +1 -5
- data/lib/spontaneous/rack/around_front.rb +4 -4
- data/lib/spontaneous/rack/around_preview.rb +4 -3
- data/lib/spontaneous/rack/assets.rb +81 -54
- data/lib/spontaneous/rack/authentication.rb +0 -1
- data/lib/spontaneous/rack/back.rb +160 -72
- data/lib/spontaneous/rack/cookie_authentication.rb +2 -2
- data/lib/spontaneous/rack/css.rb +18 -15
- data/lib/spontaneous/rack/event_source.rb +9 -21
- data/lib/spontaneous/rack/fiber_pool.rb +26 -0
- data/lib/spontaneous/rack/front.rb +12 -4
- data/lib/spontaneous/rack/helpers.rb +35 -13
- data/lib/spontaneous/rack/js.rb +41 -0
- data/lib/spontaneous/rack/public.rb +34 -44
- data/lib/spontaneous/rack/sse.rb +18 -0
- data/lib/spontaneous/rack/static.rb +3 -0
- data/lib/spontaneous/rack/user_admin.rb +100 -0
- data/lib/spontaneous/rack/user_helpers.rb +1 -1
- data/lib/spontaneous/rack.rb +6 -2
- data/lib/spontaneous/schema.rb +31 -4
- data/lib/spontaneous/search/index.rb +19 -3
- data/lib/spontaneous/search/results.rb +1 -1
- data/lib/spontaneous/sequel.rb +17 -0
- data/lib/spontaneous/site.rb +11 -4
- data/lib/spontaneous/state.rb +11 -0
- data/lib/spontaneous/storage/cloud.rb +4 -0
- data/lib/spontaneous/storage/local.rb +11 -0
- data/lib/spontaneous/style.rb +2 -2
- data/lib/spontaneous/tasks/database.rake +21 -22
- data/lib/spontaneous/utils/database/mysql_dumper.rb +4 -0
- data/lib/spontaneous/utils/database/postgres_dumper.rb +78 -0
- data/lib/spontaneous/utils/database.rb +6 -3
- data/lib/spontaneous/utils/smart_quotes.rb +499 -0
- data/lib/spontaneous/utils/smush_it.rb +66 -0
- data/lib/spontaneous/utils.rb +3 -1
- data/lib/spontaneous/version.rb +2 -2
- data/lib/spontaneous.rb +25 -29
- data/spontaneous.gemspec +186 -106
- data/test/experimental/test_features.rb +1 -1
- data/test/fixtures/asset_pipeline/application/css/basic.css.scss +4 -0
- data/test/fixtures/asset_pipeline/application/css/complex.css.scss.erb +6 -0
- data/test/fixtures/asset_pipeline/application/css/simple.css +3 -0
- data/test/fixtures/asset_pipeline/application/css/spontaneous.css +7 -0
- data/test/fixtures/asset_pipeline/application/css/subdir/complex.css.scss.erb +6 -0
- data/test/fixtures/asset_pipeline/application/css/subdir/library.css.scss +1 -0
- data/test/fixtures/asset_pipeline/application/css/subdir/simple.css +3 -0
- data/test/fixtures/asset_pipeline/application/js/basic.js.coffee +1 -0
- data/test/fixtures/asset_pipeline/application/js/complex.js.coffee.erb +1 -0
- data/test/fixtures/asset_pipeline/application/js/login.js +1 -0
- data/test/fixtures/asset_pipeline/application/js/require.js +1 -0
- data/test/fixtures/asset_pipeline/application/js/simple.js +1 -0
- data/test/fixtures/asset_pipeline/application/js/spontaneous.js +5 -0
- data/test/fixtures/asset_pipeline/application/js/subdir/complex.js.coffee.erb +1 -0
- data/test/fixtures/asset_pipeline/application/js/subdir/library.js.coffee +1 -0
- data/test/fixtures/asset_pipeline/application/js/subdir/simple.js +1 -0
- data/test/fixtures/asset_pipeline/application/js/vendor/jquery.js +1 -0
- data/test/fixtures/asset_pipeline/application/static/dot-texture.png +0 -0
- data/test/fixtures/asset_pipeline/application/static/subdir/px.gif +0 -0
- data/test/fixtures/assets/public1/css/a.scss +1 -0
- data/test/fixtures/assets/public1/js/a.js +1 -0
- data/test/fixtures/assets/public1/js/m.coffee +1 -0
- data/test/fixtures/assets/public2/css/b.scss +1 -0
- data/test/fixtures/assets/public2/css/c.css +1 -0
- data/test/fixtures/assets/public2/js/b.js +1 -0
- data/test/fixtures/assets/public2/js/c.js +1 -0
- data/test/fixtures/assets/public2/js/n.coffee +1 -0
- data/test/fixtures/back/config/user_levels.yml +3 -0
- data/test/fixtures/back/public/js/coffeescript.coffee +1 -0
- data/test/fixtures/back/templates/layouts/standard.css.cut +1 -0
- data/test/fixtures/back/templates/layouts/standard.js.cut +1 -0
- data/test/fixtures/example_application/config/database.yml +4 -4
- data/test/fixtures/helpers/templates/layouts/standard.html.cut +1 -0
- data/test/fixtures/helpers/templates/layouts/standard.mobile.cut +1 -0
- data/test/fixtures/images/vimlogo.pdf +0 -0
- data/test/fixtures/outputs/templates/layouts/standard.atom.cut +1 -0
- data/test/fixtures/permissions/config/user_levels.yml +6 -3
- data/test/fixtures/serialisation/class_hash.yaml.erb +1 -0
- data/test/fixtures/serialisation/root_hash.yaml.erb +2 -2
- data/test/fixtures/templates/extended/grandparent.html.cut +7 -7
- data/test/fixtures/templates/extended/main.html.cut +5 -5
- data/test/fixtures/templates/extended/parent.html.cut +8 -8
- data/test/fixtures/templates/extended/partial_with_locals.html.cut +1 -1
- data/test/fixtures/templates/extended/with_includes.html.cut +6 -6
- data/test/fixtures/templates/extended/with_includes_and_locals.html.cut +6 -7
- data/test/fixtures/templates/layouts/entries.html.cut +4 -4
- data/test/fixtures/templates/layouts/standard.html.cut +1 -0
- data/test/fixtures/templates/layouts/variables.html.cut +1 -1
- data/test/fixtures/templates/publishing/templates/layouts/static.html.cut +1 -1
- data/test/fixtures/templates/publishing/templates/layouts/static.rtf.cut +1 -0
- data/test/fixtures/templates/template_class/complex_template.html.cut +2 -2
- data/test/fixtures/templates/template_class/complex_template.pdf.cut +2 -2
- data/test/fixtures/templates/template_class/default_template_style.html.cut +1 -1
- data/test/fixtures/templates/template_class/images_with_template.html.cut +2 -2
- data/test/fixtures/templates/template_class/slots_template.html.cut +2 -2
- data/test/fixtures/templates/template_class/slots_template.pdf.cut +2 -2
- data/test/fixtures/user_manager/config/user_levels.yml +9 -0
- data/test/functional/test_application.rb +7 -7
- data/test/functional/test_back.rb +352 -97
- data/test/functional/test_front.rb +71 -20
- data/test/functional/test_user_manager.rb +284 -0
- data/test/javascript/env.js +13505 -0
- data/test/javascript/test_markdown.rb +43 -3
- data/test/support/custom_matchers.rb +3 -2
- data/test/test_helper.rb +50 -9
- data/test/test_javascript.rb +13 -13
- data/test/ui_helper.rb +1 -1
- data/test/unit/test_alias.rb +79 -8
- data/test/unit/test_asset_bundler.rb +220 -0
- data/test/unit/test_assets.rb +213 -0
- data/test/unit/test_async.rb +55 -0
- data/test/unit/test_authentication.rb +52 -39
- data/test/unit/test_boxes.rb +20 -15
- data/test/unit/test_changesets.rb +261 -0
- data/test/unit/test_content.rb +73 -33
- data/test/unit/test_content_inheritance.rb +18 -18
- data/test/unit/test_extensions.rb +26 -0
- data/test/unit/test_fields.rb +303 -16
- data/test/unit/test_formats.rb +267 -34
- data/test/unit/test_helpers.rb +79 -2
- data/test/unit/test_images.rb +10 -0
- data/test/unit/test_layouts.rb +21 -13
- data/test/unit/test_modifications.rb +648 -0
- data/test/unit/test_page.rb +6 -2
- data/test/unit/test_permissions.rb +101 -27
- data/test/unit/test_piece.rb +4 -4
- data/test/unit/test_plugins.rb +3 -2
- data/test/unit/test_publishing.rb +332 -0
- data/test/unit/test_render.rb +118 -67
- data/test/unit/test_revisions.rb +546 -0
- data/test/unit/test_schema.rb +83 -1
- data/test/unit/test_search.rb +59 -0
- data/test/unit/test_serialisation.rb +2 -47
- data/test/unit/test_site.rb +217 -108
- data/test/unit/test_storage.rb +26 -0
- data/test/unit/test_structure.rb +2 -2
- data/test/unit/test_styles.rb +90 -75
- data/test/unit/test_table_scoping.rb +21 -17
- data/test/unit/test_templates.rb +75 -69
- data/test/{slow → unit}/test_visibility.rb +78 -22
- metadata +528 -221
- data/application/css/add_alias_dialogue.scss +0 -27
- data/application/css/min/14c2a35812c443001b15d8b12a4780f88c678035.css +0 -1
- data/application/css/min/565d4c25e82148acb01c45c8d675b37a08676d77.css +0 -1
- data/application/css/min/84dbe894ea96eafd321c30823d630817bfc4b03b.css +0 -1
- data/application/css/spontaneous.scss +0 -111
- data/application/css/unsupported.scss +0 -16
- data/application/css/variables.scss +0 -80
- data/application/js/min/2a0c2962537a3181fedfff5c92596ba6d3122dc9.js +0 -3
- data/application/js/min/4cf1c493d3379ecba5287758c61238034c0893f9.js +0 -2
- data/application/js/min/78ac6b99d96750bb6b9f9aad4cb9cd91cd03f391.js +0 -3
- data/application/js/min/b8abf302a824c35385ff517b34111e1710ff3b37.js +0 -2
- data/application/js/min/c8efb9b9f7c3f6613fcebc6be60f605b6570a382.js +0 -90
- data/application/static/diagonal-texture.png +0 -0
- data/application/static/editing-0-noise.png +0 -0
- data/application/static/editing-1-noise.png +0 -0
- data/application/static/editing-texture-1.png +0 -0
- data/application/static/editing-texture.png +0 -0
- data/application/static/editing-toolbar-shadow-bottom.png +0 -0
- data/application/static/editing-toolbar-shadow-top.png +0 -0
- data/application/static/inner-glow.png +0 -0
- data/application/static/item-buttons-highlight.png +0 -0
- data/application/static/item-buttons.png +0 -0
- data/application/static/paper-texture-dark.png +0 -0
- data/application/static/plus_alt.svg +0 -8
- data/application/static/select-arrow-root.png +0 -0
- data/application/static/slot-up-arrow.png +0 -0
- data/application/static/spontaneous.png +0 -0
- data/lib/cutaneous/context_helper.rb +0 -187
- data/lib/cutaneous/preview_context.rb +0 -32
- data/lib/cutaneous/preview_renderer.rb +0 -10
- data/lib/cutaneous/publish_context.rb +0 -10
- data/lib/cutaneous/publish_renderer.rb +0 -14
- data/lib/cutaneous/publish_template.rb +0 -62
- data/lib/cutaneous/publish_token_parser.rb +0 -8
- data/lib/cutaneous/renderer.rb +0 -124
- data/lib/cutaneous/request_context.rb +0 -9
- data/lib/cutaneous/request_renderer.rb +0 -15
- data/lib/cutaneous/request_template.rb +0 -11
- data/lib/cutaneous/request_token_parser.rb +0 -9
- data/lib/cutaneous/token_parser.rb +0 -125
- data/lib/cutaneous.rb +0 -48
- data/lib/spontaneous/render/context_base.rb +0 -143
- data/lib/spontaneous/render/development_renderer.rb +0 -14
- data/lib/spontaneous/render/engine.rb +0 -19
- data/lib/spontaneous/render/format/html.rb +0 -5
- data/lib/spontaneous/render/format.rb +0 -75
- data/lib/spontaneous/render/helpers/script_helper.rb +0 -17
- data/lib/spontaneous/render/helpers/stylesheet_helper.rb +0 -16
- data/lib/spontaneous/render/helpers.rb +0 -14
- data/lib/spontaneous/render/preview_context.rb +0 -8
- data/lib/spontaneous/render/preview_renderer.rb +0 -24
- data/lib/spontaneous/render/publish_context.rb +0 -22
- data/lib/spontaneous/render/published_renderer.rb +0 -53
- data/lib/spontaneous/render/publishing_renderer.rb +0 -16
- data/lib/spontaneous/render/render_cache.rb +0 -26
- data/lib/spontaneous/render/renderer.rb +0 -50
- data/lib/spontaneous/render/request_context.rb +0 -8
- data/lib/spontaneous/render.rb +0 -214
- data/test/experimental/test_cutaneous.rb +0 -309
- data/test/fixtures/application/css/test.less +0 -5
- data/test/slow/test_publishing.rb +0 -1006
- /data/application/css/{developer.scss → developer.css.scss} +0 -0
- /data/application/js/vendor/{jquery-1.7.1.min.js → jquery.js} +0 -0
- /data/application/static/{location-arrow.png → location-arrow-c1c1d3ca472481c61a0a5f8cb289d743.png} +0 -0
- /data/application/static/{missing.png → missing-911ce6dbd9f4602e0f3fbcd7e78846a2.png} +0 -0
- /data/application/static/{orange-down-arrow.png → orange-down-arrow-395ae1929e8662b2ff0977daf12c35bb.png} +0 -0
- /data/application/static/{page-browser-next.png → page-browser-next-ce781a242c23b980b99b9db7abc20b05.png} +0 -0
- /data/application/static/{plus-box.png → plus-box-dcde74a1e496f68298c9b443caa1c5d5.png} +0 -0
- /data/application/static/{select-arrow.png → select-arrow-6e7dd3745b00e934b0d7a3250c46558b.png} +0 -0
- /data/application/static/{slot-down-arrow.png → slot-down-arrow-59ad5f5ee5b52a7ebd00bca4b3104194.png} +0 -0
- /data/application/static/{splash.png → splash-65b493a714df9b8b3ab170103401b53d.png} +0 -0
- /data/application/static/{spot.png → spot-71fab1d2f065034f5fc15e7bea2ad36c.png} +0 -0
- /data/application/static/{spot.svg → spot-8505041082d8d3bbe8d34c29dddb3b7d.svg} +0 -0
- /data/application/static/{texture.png → texture-03f7627e8264b1d607113ab32c593a58.png} +0 -0
@@ -13,6 +13,7 @@
|
|
13
13
|
// 3. Add some useful CSS-visible attributes to the HTML element
|
14
14
|
(function() {
|
15
15
|
var _window = window, _document = document;
|
16
|
+
var testFlexBoxCompatibility = false;
|
16
17
|
var prefixes = ' -webkit- -moz- -o- -ms- -khtml- '.split(' ');
|
17
18
|
try {
|
18
19
|
|
@@ -26,23 +27,26 @@
|
|
26
27
|
element.style.cssText = (property + prefixes.join(value + ';' + property)).slice(0, -property.length) + (extra || '');
|
27
28
|
}
|
28
29
|
|
29
|
-
var docElement = _document.documentElement,
|
30
|
-
c = _document.createElement('div'),
|
31
|
-
elem = _document.createElement('div'),
|
32
|
-
w;
|
33
30
|
|
34
|
-
|
35
|
-
|
31
|
+
if (testFlexBoxCompatibility) {
|
32
|
+
var docElement = _document.documentElement,
|
33
|
+
c = _document.createElement('div'),
|
34
|
+
elem = _document.createElement('div'),
|
35
|
+
w;
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
w = elem.offsetWidth
|
40
|
-
c.removeChild(elem);
|
41
|
-
docElement.removeChild(c);
|
37
|
+
set_prefixed_value_css(c, 'display', 'box', 'width:42px;padding:0;');
|
38
|
+
set_prefixed_property_css(elem, 'box-flex', '1', 'width:10px;');
|
42
39
|
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
c.appendChild(elem);
|
41
|
+
docElement.appendChild(c);
|
42
|
+
w = elem.offsetWidth
|
43
|
+
c.removeChild(elem);
|
44
|
+
docElement.removeChild(c);
|
45
|
+
|
46
|
+
if (w !== 42) {
|
47
|
+
// console.error(w)
|
48
|
+
throw (w) + " Flexible Box Model not supported"
|
49
|
+
}
|
46
50
|
}
|
47
51
|
|
48
52
|
///////////////////////////// XHR Uploads
|
@@ -134,6 +138,6 @@
|
|
134
138
|
b.setAttribute('data-useragent', navigator.userAgent);
|
135
139
|
b.setAttribute('data-platform', navigator.platform );
|
136
140
|
} catch (e) {
|
137
|
-
_window.location.href = "/@spontaneous/unsupported?msg=" + _window.
|
141
|
+
_window.location.href = "/@spontaneous/unsupported?msg=" + _window.encodeURIComponent(e) + "&useragent=" + _window.encodeURIComponent(_window.navigator.userAgent);
|
138
142
|
}
|
139
143
|
}());
|
data/application/js/content.js
CHANGED
@@ -16,6 +16,7 @@ Spontaneous.Content = (function($, S) {
|
|
16
16
|
id: function() {
|
17
17
|
return this.content.id;
|
18
18
|
},
|
19
|
+
|
19
20
|
is_page: function() {
|
20
21
|
return this.type().is_page();
|
21
22
|
},
|
@@ -62,33 +63,25 @@ Spontaneous.Content = (function($, S) {
|
|
62
63
|
return list;
|
63
64
|
}.cache(),
|
64
65
|
|
66
|
+
// fields that should be listed in the main field column
|
65
67
|
text_fields: function() {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
}
|
72
|
-
}
|
73
|
-
return fields;
|
68
|
+
return this.filter_fields(function(f) { return !f.is_image(); });
|
69
|
+
},
|
70
|
+
// fields that should be saved as strings
|
71
|
+
string_fields: function() {
|
72
|
+
return this.filter_fields(function(f) { return !f.is_file(); });
|
74
73
|
},
|
75
74
|
image_fields: function() {
|
76
|
-
|
77
|
-
for (var i = 0, ii = all_fields.length; i < ii; i++) {
|
78
|
-
var f = all_fields[i];
|
79
|
-
if (f.is_image()) {
|
80
|
-
fields.push(f);
|
81
|
-
}
|
82
|
-
}
|
83
|
-
return fields;
|
75
|
+
return this.filter_fields(function(f) { return f.is_image(); });
|
84
76
|
},
|
85
77
|
file_fields: function() {
|
78
|
+
return this.filter_fields(function(f) { return f.is_file(); });
|
79
|
+
},
|
80
|
+
filter_fields: function(filter) {
|
86
81
|
var fields = [], all_fields = this.field_list();
|
87
82
|
for (var i = 0, ii = all_fields.length; i < ii; i++) {
|
88
83
|
var f = all_fields[i];
|
89
|
-
if (f.
|
90
|
-
fields.push(f);
|
91
|
-
}
|
84
|
+
if (filter(f)) { fields.push(f); }
|
92
85
|
}
|
93
86
|
return fields;
|
94
87
|
},
|
@@ -96,22 +89,24 @@ Spontaneous.Content = (function($, S) {
|
|
96
89
|
var fields = {}, type = this.type(), prototypes = type.field_prototypes;
|
97
90
|
|
98
91
|
for (var i = 0, ii = this.content.fields.length; i < ii; i++) {
|
99
|
-
var f = this.content.fields[i],
|
100
|
-
prototype = prototypes[f.name]
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
92
|
+
var f = this.content.fields[i], prototype, type_class;
|
93
|
+
prototype = prototypes[f.name];
|
94
|
+
if (f && prototype) {
|
95
|
+
type_class = this.constantize(prototype.type);
|
96
|
+
if (!type_class) {
|
97
|
+
console.warn(
|
98
|
+
"Content#fields:",
|
99
|
+
"Field has invalid type", prototype.type,
|
100
|
+
"content_id:", this.content.id,
|
101
|
+
"type:", "'"+type.title+"'",
|
102
|
+
"field_name:", f.name
|
103
|
+
);
|
104
|
+
type_class = Spontaneous.FieldTypes.StringField;
|
105
|
+
}
|
106
|
+
var field = new type_class(this, f);
|
107
|
+
// field.watch('value', this.field_updated.bind(this, field));
|
108
|
+
fields[f.name] = field;
|
111
109
|
}
|
112
|
-
var field = new type_class(this, f);
|
113
|
-
// field.watch('value', this.field_updated.bind(this, field));
|
114
|
-
fields[f.name] = field;
|
115
110
|
};
|
116
111
|
return fields;
|
117
112
|
}.cache(),
|
@@ -138,7 +133,7 @@ Spontaneous.Content = (function($, S) {
|
|
138
133
|
var fields = response.fields;
|
139
134
|
for (var i = 0, ii = fields.length; i < ii; i++) {
|
140
135
|
var values = fields[i], field = this.field(values.name);
|
141
|
-
field.update(values);
|
136
|
+
if (field) { field.update(values); }
|
142
137
|
}
|
143
138
|
}
|
144
139
|
},
|
@@ -208,7 +203,6 @@ Spontaneous.Content = (function($, S) {
|
|
208
203
|
Spontaneous.Ajax.post(['/toggle', this.content.id].join('/'), {}, this.visibility_toggled.bind(this));
|
209
204
|
},
|
210
205
|
visibility_toggled: function(result) {
|
211
|
-
console.log('visibility_toggled', result)
|
212
206
|
this.set('hidden', result.hidden);
|
213
207
|
// this.trigger('visibility_toggled', result);
|
214
208
|
},
|
@@ -224,6 +218,15 @@ Spontaneous.Content = (function($, S) {
|
|
224
218
|
},
|
225
219
|
repositioned: function() {
|
226
220
|
this.trigger('repositioned');
|
221
|
+
},
|
222
|
+
state: function() {
|
223
|
+
return S.State.get(this);
|
224
|
+
},
|
225
|
+
setFieldMetadata: function(field, key, value) {
|
226
|
+
this.state().setFieldMetadata(field, key, value);
|
227
|
+
},
|
228
|
+
getFieldMetadata: function(field, key, value) {
|
229
|
+
return this.state().getFieldMetadata(field, key);
|
227
230
|
}
|
228
231
|
});
|
229
232
|
|
@@ -5,15 +5,19 @@ Spontaneous.ContentArea = (function($, S) {
|
|
5
5
|
var ContentArea = new JS.Singleton({
|
6
6
|
include: Spontaneous.Properties,
|
7
7
|
|
8
|
-
|
8
|
+
inner: null,
|
9
9
|
preview: null,
|
10
10
|
editing: null,
|
11
11
|
mode: 'edit',
|
12
12
|
|
13
13
|
init: function() {
|
14
|
-
this.wrap
|
15
|
-
this.
|
16
|
-
this.
|
14
|
+
this.wrap = dom.div("#content-outer");
|
15
|
+
this.metaWrap = dom.div("#content-meta").hide();
|
16
|
+
this.inner = dom.div('#content');
|
17
|
+
this.preview = S.Preview.init(this.inner);
|
18
|
+
this.editing = S.Editing.init(this.inner);
|
19
|
+
this.service = S.Services.init(this.inner);
|
20
|
+
this.wrap.append(this.metaWrap, this.inner);
|
17
21
|
return this.wrap;
|
18
22
|
},
|
19
23
|
|
@@ -25,14 +29,23 @@ Spontaneous.ContentArea = (function($, S) {
|
|
25
29
|
this.current().display(S.Location.location());
|
26
30
|
},
|
27
31
|
current: function() {
|
32
|
+
this.exitMeta();
|
33
|
+
// YUK
|
28
34
|
if (this.mode === 'preview') {
|
29
35
|
this.editing.hide();
|
36
|
+
this.service.hide();
|
30
37
|
this.preview.show();
|
31
38
|
return this.preview;
|
32
39
|
} else if (this.mode === 'edit') {
|
33
40
|
this.preview.hide();
|
41
|
+
this.service.hide();
|
34
42
|
this.editing.show();
|
35
43
|
return this.editing;
|
44
|
+
} else if (this.mode === 'service') {
|
45
|
+
this.preview.hide();
|
46
|
+
this.editing.hide();
|
47
|
+
this.service.show();
|
48
|
+
return this.service;
|
36
49
|
}
|
37
50
|
},
|
38
51
|
goto_page: function(page) {
|
@@ -40,7 +53,42 @@ Spontaneous.ContentArea = (function($, S) {
|
|
40
53
|
},
|
41
54
|
scroll_to_bottom: function(duration, delay) {
|
42
55
|
|
43
|
-
this.
|
56
|
+
this.inner.delay(delay || 0).animate({ scrollTop:this.inner[0].scrollHeight }, (duration || 1000));
|
57
|
+
},
|
58
|
+
showService: function(service) {
|
59
|
+
if (!this.modeBeforeService) {
|
60
|
+
this.modeBeforeService = this.mode;
|
61
|
+
}
|
62
|
+
this.mode = "service";
|
63
|
+
this.current().display(service.url);
|
64
|
+
},
|
65
|
+
hideService: function() {
|
66
|
+
var mode = this.modeBeforeService;
|
67
|
+
this.modeBeforeService = false;
|
68
|
+
this.display(mode);
|
69
|
+
},
|
70
|
+
enterMeta: function(view) {
|
71
|
+
if (this.metaView === view) { return; }
|
72
|
+
this.metaView = view;
|
73
|
+
var outer = this.metaWrap.hide();
|
74
|
+
this.inner.animate({top: "100%"}, 300, function() {
|
75
|
+
if (view && typeof view.show === "function") {
|
76
|
+
view.show(outer);
|
77
|
+
}
|
78
|
+
outer.fadeIn(300);
|
79
|
+
});
|
80
|
+
},
|
81
|
+
exitMeta: function() {
|
82
|
+
if (!this.metaView) { return; }
|
83
|
+
if (typeof this.metaView.detach === "function") {
|
84
|
+
this.metaView.detach();
|
85
|
+
}
|
86
|
+
this.metaView = null;
|
87
|
+
var inner = this.inner, outer = this.metaWrap;
|
88
|
+
inner.animate({top: "0%"}, 300, function() {
|
89
|
+
outer.empty().hide();
|
90
|
+
});
|
91
|
+
outer.fadeOut(300);
|
44
92
|
}
|
45
93
|
});
|
46
94
|
return ContentArea;
|
data/application/js/dialogue.js
CHANGED
@@ -75,6 +75,9 @@ Spontaneous.Dialogue = (function($, S) {
|
|
75
75
|
// set to define non-cancel action buttons
|
76
76
|
// for this dialogue
|
77
77
|
},
|
78
|
+
contentsHeight: function() {
|
79
|
+
return null;
|
80
|
+
},
|
78
81
|
cleanup: function() {
|
79
82
|
// over-ride if you need to do anything before the dialogue is closed
|
80
83
|
// (either by cancel or through other actions)
|
@@ -99,6 +102,7 @@ Spontaneous.Dialogue = (function($, S) {
|
|
99
102
|
open: function(instance) {
|
100
103
|
if (this._open || !instance) { return; }
|
101
104
|
this._instance = instance;
|
105
|
+
instance.manager = this;
|
102
106
|
$('body').css("overflow", "hidden");
|
103
107
|
this.overlay().fadeIn(200);
|
104
108
|
var c = this.container(), a = this._actions, b;
|
@@ -134,10 +138,20 @@ Spontaneous.Dialogue = (function($, S) {
|
|
134
138
|
}
|
135
139
|
this.button_map = button_map;
|
136
140
|
this._body.empty().append(instance.body());
|
141
|
+
|
137
142
|
c.fadeIn(200);
|
138
143
|
this._open = true;
|
139
144
|
},
|
140
145
|
|
146
|
+
updateLayout: function() {
|
147
|
+
var contentsHeight = this._instance.contentsHeight()
|
148
|
+
, dialogueHeight = (+contentsHeight) + this._actions.outerHeight() + this._title.outerHeight()
|
149
|
+
, el = this._frame;
|
150
|
+
dialogueHeight = Math.max(dialogueHeight, 100);
|
151
|
+
if (contentsHeight && dialogueHeight < this._originalHeight) {
|
152
|
+
el.animate({'height': dialogueHeight}, 400);
|
153
|
+
}
|
154
|
+
},
|
141
155
|
disable_button: function(button_name) {
|
142
156
|
var button = this.button_map[button_name.toLowerCase()]
|
143
157
|
button.disable();
|
@@ -173,6 +187,9 @@ Spontaneous.Dialogue = (function($, S) {
|
|
173
187
|
outline.append(controls_wrap);
|
174
188
|
wrap.append(outline)
|
175
189
|
$('#content').append(wrap);
|
190
|
+
this._originalHeight = outline.outerHeight();
|
191
|
+
console.log('orig height', this._originalHeight)
|
192
|
+
this._frame = outline;
|
176
193
|
this._actions = actions;
|
177
194
|
this._title = title;
|
178
195
|
this._container = wrap;
|
data/application/js/dom.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
// console.log('Loading DOM...');
|
2
2
|
|
3
3
|
Spontaneous.Dom = (function($, S) {
|
4
|
-
var tags = 'div p iframe a span img select option label ul li dl dt dd table tr td h1 h2 h3 h4 header input button form textarea'.split(' ');
|
4
|
+
var tags = 'div p iframe a span img select option label ul li dl dt dd table tr td h1 h2 h3 h4 header input button form textarea optgroup'.split(' ');
|
5
5
|
var Dom = {
|
6
6
|
body: function() {
|
7
7
|
return $(document.body);
|
@@ -32,7 +32,12 @@ Spontaneous.EditPanel = (function($, S) {
|
|
32
32
|
},
|
33
33
|
|
34
34
|
upload_values: function() {
|
35
|
-
var
|
35
|
+
var fields = this.parent_view.string_fields();
|
36
|
+
var values = fields.map(function(field) {
|
37
|
+
return field.serializedValue();
|
38
|
+
});
|
39
|
+
// console.log("field values", values)
|
40
|
+
// var values = this.form.serializeArray();
|
36
41
|
var field_data = new FormData();
|
37
42
|
var size = 0;
|
38
43
|
$.each(values, function(i, v) {
|
@@ -69,13 +74,13 @@ Spontaneous.EditPanel = (function($, S) {
|
|
69
74
|
},
|
70
75
|
|
71
76
|
upload_conflict: function(conflict_data) {
|
72
|
-
console.log('conflicted_fields', conflict_data)
|
77
|
+
// console.log('conflicted_fields', conflict_data)
|
73
78
|
var dialogue = new S.ConflictedFieldDialogue(this, conflict_data);
|
74
79
|
dialogue.open();
|
75
80
|
},
|
76
81
|
|
77
82
|
conflicts_resolved: function(conflict_list) {
|
78
|
-
console.log('conflicts resolved', conflict_list)
|
83
|
+
// console.log('conflicts resolved', conflict_list)
|
79
84
|
var ff = this.parent_view.field_list(), conflicts = {};
|
80
85
|
for (var i =0, ii = conflict_list.length; i < ii; i++) {
|
81
86
|
var conflict = conflict_list[i];
|
@@ -84,7 +89,7 @@ Spontaneous.EditPanel = (function($, S) {
|
|
84
89
|
for (var i = 0, ii = ff.length; i < ii; i++) {
|
85
90
|
var field = ff[i], conflict = conflicts[field.schema_id()];
|
86
91
|
if (conflict) {
|
87
|
-
console.log(">>> conflicts_resolved", field, conflict.version)
|
92
|
+
// console.log(">>> conflicts_resolved", field, conflict.version)
|
88
93
|
field.set_edited_value(conflict.value);
|
89
94
|
field.set_version(conflict.version);
|
90
95
|
}
|
@@ -135,19 +140,23 @@ Spontaneous.EditPanel = (function($, S) {
|
|
135
140
|
var text_fields = this.parent_view.text_fields();
|
136
141
|
var submit = dom.input({'type':'submit'});
|
137
142
|
var __dialogue = this;
|
143
|
+
var fieldViews = [];
|
138
144
|
editing.append(toolbar);
|
139
145
|
for (var i = 0, ii = text_fields.length; i < ii; i++) {
|
140
|
-
var field = text_fields[i];
|
141
|
-
|
146
|
+
var field = text_fields[i], view = this.field_edit(field);
|
147
|
+
fieldViews.push(view);
|
148
|
+
text_field_wrap.append(view);
|
142
149
|
}
|
150
|
+
|
143
151
|
if (text_fields.length > 0) {
|
144
152
|
outer.append(text_field_wrap);
|
145
153
|
}
|
146
154
|
var image_fields = this.parent_view.image_fields();
|
147
155
|
|
148
156
|
for (var i = 0, ii = image_fields.length; i < ii; i++) {
|
149
|
-
var field = image_fields[i];
|
150
|
-
|
157
|
+
var field = image_fields[i], view = this.field_edit(field).click(function() { __dialogue.field_focus(this); });
|
158
|
+
fieldViews.push(view);
|
159
|
+
image_field_wrap.append(view);
|
151
160
|
}
|
152
161
|
if (image_fields.length > 0) {
|
153
162
|
outer.append(image_field_wrap);
|
@@ -198,6 +207,10 @@ Spontaneous.EditPanel = (function($, S) {
|
|
198
207
|
next_field.input().focus();
|
199
208
|
},
|
200
209
|
on_show: function(focus_field) {
|
210
|
+
var fields = this.parent_view.field_list();
|
211
|
+
$.each(fields, function(n, f) {
|
212
|
+
f.on_show();
|
213
|
+
})
|
201
214
|
if (!focus_field || !(focus_field['focus']) || !focus_field.accepts_focus) { focus_field = null; }
|
202
215
|
var focus_field = focus_field || this.parent_view.text_fields()[0];
|
203
216
|
if (focus_field) {
|
@@ -232,6 +245,8 @@ Spontaneous.EditPanel = (function($, S) {
|
|
232
245
|
},
|
233
246
|
field_edit: function(field) {
|
234
247
|
var d = dom.div('.field');
|
248
|
+
// console.log("field_edit", field.type)
|
249
|
+
d.addClass(field.type.type.toLowerCase().split(".").splice(1).join("-"));
|
235
250
|
// d.append($(dom.label, {'class':'name', 'for':field.css_id()}).html(field.label()));
|
236
251
|
var label = dom.label('.name', {'for':field.css_id()}).html(field.label());
|
237
252
|
if (field.type.comment) {
|
@@ -33,6 +33,11 @@ function $A(iterable) {
|
|
33
33
|
|
34
34
|
(function($) {
|
35
35
|
|
36
|
+
// Cope with changing File API
|
37
|
+
File.filename = function(file) {
|
38
|
+
return file.fileName || file.name;
|
39
|
+
};
|
40
|
+
|
36
41
|
var function_id = 0;
|
37
42
|
|
38
43
|
if (!(typeof Function.prototype.bind === 'function')) {
|
@@ -58,9 +63,9 @@ function $A(iterable) {
|
|
58
63
|
|
59
64
|
$.extend(Number.prototype, {
|
60
65
|
to_filesize: function() {
|
61
|
-
var thou = 1000, units = ["
|
66
|
+
var thou = 1000, units = [" B", ' kB', ' MB', ' GB'],
|
62
67
|
power = Math.floor(Math.log(this) / Math.log(thou))
|
63
|
-
return this / (Math.pow(thou, power)) + units[power]
|
68
|
+
return Math.round(this / (Math.pow(thou, power))) + units[power]
|
64
69
|
}
|
65
70
|
});
|
66
71
|
|
@@ -37,7 +37,7 @@ Spontaneous.FieldPreview = (function($, S) {
|
|
37
37
|
$.each(fields, function(i, field) {
|
38
38
|
var li = dom.li();
|
39
39
|
var name = dom.div('.name').text(field.title);
|
40
|
-
var value = dom.div('.value')
|
40
|
+
var value = dom.div('.value');
|
41
41
|
li.click(function() {
|
42
42
|
__this.field_to_edit = field;
|
43
43
|
})
|
@@ -47,6 +47,7 @@ Spontaneous.FieldPreview = (function($, S) {
|
|
47
47
|
}
|
48
48
|
li.append(name).append(value);
|
49
49
|
wrapper.append(li);
|
50
|
+
value.html(field.preview(value));
|
50
51
|
});
|
51
52
|
return wrapper;
|
52
53
|
}
|
@@ -2,15 +2,18 @@
|
|
2
2
|
Spontaneous.FieldTypes.DateField = (function($, S) {
|
3
3
|
var dom = S.Dom;
|
4
4
|
var DateField = new JS.Class(Spontaneous.FieldTypes.StringField, {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
input: function() {
|
6
|
+
var input = this.callSuper();
|
7
|
+
input.datepicker({ "dateFormat": "DD, d MM yy" });
|
8
|
+
return input;
|
9
|
+
},
|
10
|
+
dateFormat: function() {
|
11
|
+
// var rubyFormat = this.type.date_format,
|
12
|
+
// parts = rubyFormat.split("%").map(function(d) { return d.split(/(\\s+)/); });
|
13
|
+
// console.log(parts)
|
14
|
+
return this.type.date_format;
|
15
|
+
}
|
12
16
|
});
|
13
|
-
|
14
17
|
return DateField;
|
15
18
|
})(jQuery, Spontaneous);
|
16
19
|
|