spontaneous 0.1.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +49 -0
- data/Gemfile.lock +146 -0
- data/LICENSE +0 -0
- data/README +0 -0
- data/Rakefile +284 -0
- data/Readme.markdown +7 -0
- data/application/css/add_alias_dialogue.scss +27 -0
- data/application/css/definitions.scss +249 -0
- data/application/css/developer.scss +9 -0
- data/application/css/editing.scss +649 -0
- data/application/css/login.scss +91 -0
- data/application/css/min/54ee0ed3c7fac7632bd5c020d69e9a2503e0c88c.css +1 -0
- data/application/css/min/c256adc144e2bdd0b0539356b04eb62db01e1dc3.css +1 -0
- data/application/css/popover.scss +335 -0
- data/application/css/schema_error.scss +90 -0
- data/application/css/spontaneous.scss +111 -0
- data/application/css/unsupported.scss +16 -0
- data/application/css/v2.scss +1606 -0
- data/application/css/variables.scss +80 -0
- data/application/js/add_alias_dialogue.js +59 -0
- data/application/js/add_home_dialogue.js +59 -0
- data/application/js/ajax.js +99 -0
- data/application/js/authentication.js +22 -0
- data/application/js/box.js +104 -0
- data/application/js/box_container.js +82 -0
- data/application/js/compatibility.js +132 -0
- data/application/js/conflicted_field_dialogue.js +92 -0
- data/application/js/content.js +224 -0
- data/application/js/content_area.js +44 -0
- data/application/js/dialogue.js +196 -0
- data/application/js/dom.js +71 -0
- data/application/js/edit_dialogue.js +137 -0
- data/application/js/edit_panel.js +232 -0
- data/application/js/editing.js +42 -0
- data/application/js/entry.js +13 -0
- data/application/js/extensions.js +104 -0
- data/application/js/field.js +4 -0
- data/application/js/field_preview.js +55 -0
- data/application/js/field_types/date_field.js +16 -0
- data/application/js/field_types/file_field.js +71 -0
- data/application/js/field_types/image_field.js +358 -0
- data/application/js/field_types/markdown_field.js +656 -0
- data/application/js/field_types/string_field.js +185 -0
- data/application/js/image.js +72 -0
- data/application/js/init.js +34 -0
- data/application/js/load.js +4 -0
- data/application/js/location.js +157 -0
- data/application/js/login.js +53 -0
- data/application/js/min/492a209de8ee955fa9c729a765377495001e11b1.js +17 -0
- data/application/js/min/80f684d77c940887a1d4a63e3a96102e993baa98.js +88 -0
- data/application/js/min/b8abf302a824c35385ff517b34111e1710ff3b37.js +2 -0
- data/application/js/min/c7140ec9475e5bf868b901e0621338d7d162358b.js +3 -0
- data/application/js/min/f07f2bd6630ee31e1c2288ec223383d8f0658ba6.js +2 -0
- data/application/js/page.js +43 -0
- data/application/js/page_browser.js +147 -0
- data/application/js/page_entry.js +47 -0
- data/application/js/popover.js +99 -0
- data/application/js/popover_view.js +56 -0
- data/application/js/preview.js +64 -0
- data/application/js/progress.js +358 -0
- data/application/js/properties.js +90 -0
- data/application/js/publish.js +187 -0
- data/application/js/require.js +129 -0
- data/application/js/sharded_upload.js +206 -0
- data/application/js/side_bar.js +30 -0
- data/application/js/spontaneous.js +6 -0
- data/application/js/state.js +64 -0
- data/application/js/status_bar.js +47 -0
- data/application/js/top_bar.js +368 -0
- data/application/js/types.js +98 -0
- data/application/js/upload.js +88 -0
- data/application/js/upload_manager.js +319 -0
- data/application/js/user.js +37 -0
- data/application/js/vendor/.DS_Store +0 -0
- data/application/js/vendor/JS.Class-2.1.5/CHANGELOG +283 -0
- data/application/js/vendor/JS.Class-2.1.5/MIT-LICENSE +30 -0
- data/application/js/vendor/JS.Class-2.1.5/README +30 -0
- data/application/js/vendor/JS.Class-2.1.5/min/command.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/comparable.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/constant_scope.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/core.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/decorator.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/enumerable.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/forwardable.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/hash.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/linked_list.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/loader.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/method_chain.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/observable.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/package.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/proxy.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/ruby.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/set.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/stack_trace.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/state.js +1 -0
- data/application/js/vendor/JS.Class-2.1.5/min/stdlib.js +16 -0
- data/application/js/vendor/JS.Class-2.1.5/src/command.js +93 -0
- data/application/js/vendor/JS.Class-2.1.5/src/comparable.js +37 -0
- data/application/js/vendor/JS.Class-2.1.5/src/constant_scope.js +48 -0
- data/application/js/vendor/JS.Class-2.1.5/src/core.js +1060 -0
- data/application/js/vendor/JS.Class-2.1.5/src/decorator.js +50 -0
- data/application/js/vendor/JS.Class-2.1.5/src/enumerable.js +505 -0
- data/application/js/vendor/JS.Class-2.1.5/src/forwardable.js +22 -0
- data/application/js/vendor/JS.Class-2.1.5/src/hash.js +334 -0
- data/application/js/vendor/JS.Class-2.1.5/src/linked_list.js +114 -0
- data/application/js/vendor/JS.Class-2.1.5/src/loader.js +553 -0
- data/application/js/vendor/JS.Class-2.1.5/src/method_chain.js +172 -0
- data/application/js/vendor/JS.Class-2.1.5/src/observable.js +55 -0
- data/application/js/vendor/JS.Class-2.1.5/src/package.js +472 -0
- data/application/js/vendor/JS.Class-2.1.5/src/proxy.js +58 -0
- data/application/js/vendor/JS.Class-2.1.5/src/ruby.js +44 -0
- data/application/js/vendor/JS.Class-2.1.5/src/set.js +332 -0
- data/application/js/vendor/JS.Class-2.1.5/src/stack_trace.js +151 -0
- data/application/js/vendor/JS.Class-2.1.5/src/state.js +95 -0
- data/application/js/vendor/JS.Class-2.1.5/src/stdlib.js +2612 -0
- data/application/js/vendor/crypto-2.3.0-crypto.js +160 -0
- data/application/js/vendor/crypto-2.3.0-sha1.js +91 -0
- data/application/js/vendor/diff_match_patch.js +2153 -0
- data/application/js/vendor/jquery-1.4.2.min.js +154 -0
- data/application/js/vendor/jquery-1.4.3.min.js +166 -0
- data/application/js/vendor/jquery-1.5.1.min.js +16 -0
- data/application/js/vendor/jquery-1.5.1rc1.min.js +24 -0
- data/application/js/vendor/jquery-1.6.2.min.js +18 -0
- data/application/js/vendor/jquery-ui-1.8.6.custom.min.js +265 -0
- data/application/js/vendor/jquery-ui-1.8.9.custom.min.js +415 -0
- data/application/js/vendor/jquery-ui-1.8.custom.min.js +106 -0
- data/application/js/vendor/jquery.hotkeys-0.7.9.js +248 -0
- data/application/js/vendor/jquery.hotkeys-0.7.9.min.js +19 -0
- data/application/js/vendor/jsdiff.js +169 -0
- data/application/js/views/box_view.js +229 -0
- data/application/js/views/page_piece_view.js +45 -0
- data/application/js/views/page_view.js +238 -0
- data/application/js/views/piece_view.js +178 -0
- data/application/js/views.js +110 -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/favicon.ico +0 -0
- data/application/static/inner-glow.png +0 -0
- data/application/static/item-buttons.png +0 -0
- data/application/static/location-arrow.png +0 -0
- data/application/static/logo-400px-transparent.png +0 -0
- data/application/static/missing.png +0 -0
- data/application/static/orange-down-arrow.png +0 -0
- data/application/static/page-browser-next.png +0 -0
- data/application/static/paper-texture-dark.png +0 -0
- data/application/static/px.gif +0 -0
- data/application/static/select-arrow-root.png +0 -0
- data/application/static/select-arrow.png +0 -0
- data/application/static/slot-down-arrow.png +0 -0
- data/application/static/splash.png +0 -0
- data/application/static/spontaneous.png +0 -0
- data/application/static/spot.png +0 -0
- data/application/static/spot.svg +40 -0
- data/application/static/texture.png +0 -0
- data/application/views/index.erubis +46 -0
- data/application/views/login.erubis +69 -0
- data/application/views/schema_modification_error.html.erb +61 -0
- data/application/views/unsupported.erubis +23 -0
- data/bin/limit-upload +5 -0
- data/bin/spot +10 -0
- data/bin/unlimit-upload +3 -0
- data/config/nginx.conf +60 -0
- data/db/migrations/20100610142136_init.rb +66 -0
- data/db/migrations/20101130104334_timestamps.rb +44 -0
- data/db/migrations/20101202113205_site_publishing_flags.rb +12 -0
- data/db/migrations/20101206124543_aliases.rb +16 -0
- data/db/migrations/20110201133550_visibility.rb +27 -0
- data/db/migrations/20110209152710_users_and_groups.rb +58 -0
- data/db/migrations/20110215133910_boxes.rb +25 -0
- data/db/migrations/20110521114145_remove_slots_and_entries.rb +21 -0
- data/db/migrations/20110604192145_rename_schema_id_columns.rb +22 -0
- data/db/migrations/20110805141925_rename_site_to_state.rb +11 -0
- data/lib/cutaneous/context_helper.rb +82 -0
- data/lib/cutaneous/first_pass_parser.rb +23 -0
- data/lib/cutaneous/first_pass_renderer.rb +18 -0
- data/lib/cutaneous/parser_core.rb +18 -0
- data/lib/cutaneous/preview_context.rb +31 -0
- data/lib/cutaneous/preview_renderer.rb +15 -0
- data/lib/cutaneous/publish_context.rb +9 -0
- data/lib/cutaneous/renderer.rb +122 -0
- data/lib/cutaneous/request_context.rb +8 -0
- data/lib/cutaneous/second_pass_parser.rb +23 -0
- data/lib/cutaneous/second_pass_renderer.rb +18 -0
- data/lib/cutaneous.rb +47 -0
- data/lib/sequel/plugins/content_table_inheritance.rb +196 -0
- data/lib/sequel/plugins/yajl_serialization.rb +154 -0
- data/lib/spontaneous/application/feature.rb +9 -0
- data/lib/spontaneous/application/plugin.rb +13 -0
- data/lib/spontaneous/application.rb +8 -0
- data/lib/spontaneous/box.rb +232 -0
- data/lib/spontaneous/box_style.rb +64 -0
- data/lib/spontaneous/change.rb +107 -0
- data/lib/spontaneous/cli/adapter.rb +13 -0
- data/lib/spontaneous/cli/base.rb +184 -0
- data/lib/spontaneous/cli/console.rb +0 -0
- data/lib/spontaneous/cli/media.rb +13 -0
- data/lib/spontaneous/cli/server.rb +50 -0
- data/lib/spontaneous/cli/site.rb +46 -0
- data/lib/spontaneous/cli/sync.rb +42 -0
- data/lib/spontaneous/cli/tasks.rb +9 -0
- data/lib/spontaneous/cli.rb +83 -0
- data/lib/spontaneous/collections/box_set.rb +56 -0
- data/lib/spontaneous/collections/change_set.rb +43 -0
- data/lib/spontaneous/collections/entry_set.rb +83 -0
- data/lib/spontaneous/collections/field_set.rb +53 -0
- data/lib/spontaneous/collections/prototype_set.rb +131 -0
- data/lib/spontaneous/collections/style_set.rb +13 -0
- data/lib/spontaneous/config.rb +156 -0
- data/lib/spontaneous/constants.rb +24 -0
- data/lib/spontaneous/content.rb +113 -0
- data/lib/spontaneous/content_query.rb +17 -0
- data/lib/spontaneous/errors.rb +48 -0
- data/lib/spontaneous/extensions/array.rb +18 -0
- data/lib/spontaneous/extensions/class.rb +17 -0
- data/lib/spontaneous/extensions/hash.rb +18 -0
- data/lib/spontaneous/extensions/json.rb +26 -0
- data/lib/spontaneous/extensions/kernel.rb +7 -0
- data/lib/spontaneous/extensions/object.rb +30 -0
- data/lib/spontaneous/extensions/object_space.rb +12 -0
- data/lib/spontaneous/extensions/string.rb +44 -0
- data/lib/spontaneous/facet.rb +47 -0
- data/lib/spontaneous/field_types/date_field.rb +12 -0
- data/lib/spontaneous/field_types/field.rb +252 -0
- data/lib/spontaneous/field_types/image_field.rb +329 -0
- data/lib/spontaneous/field_types/markdown_field.rb +37 -0
- data/lib/spontaneous/field_types/string_field.rb +14 -0
- data/lib/spontaneous/field_types.rb +40 -0
- data/lib/spontaneous/generators/page/inline.html.cut +1 -0
- data/lib/spontaneous/generators/page/page.html.cut.tt +4 -0
- data/lib/spontaneous/generators/page/page.rb.tt +9 -0
- data/lib/spontaneous/generators/page.rb +38 -0
- data/lib/spontaneous/generators/site/.gitignore +4 -0
- data/lib/spontaneous/generators/site/Gemfile.tt +31 -0
- data/lib/spontaneous/generators/site/Rakefile.tt +6 -0
- data/lib/spontaneous/generators/site/config/back.ru +7 -0
- data/lib/spontaneous/generators/site/config/boot.rb +19 -0
- data/lib/spontaneous/generators/site/config/database.yml.tt +21 -0
- data/lib/spontaneous/generators/site/config/deploy.rb.tt +0 -0
- data/lib/spontaneous/generators/site/config/environment.rb.tt +8 -0
- data/lib/spontaneous/generators/site/config/environments/development.rb.tt +15 -0
- data/lib/spontaneous/generators/site/config/environments/production.rb.tt +5 -0
- data/lib/spontaneous/generators/site/config/front.ru +8 -0
- data/lib/spontaneous/generators/site/config/user_levels.yml +22 -0
- data/lib/spontaneous/generators/site/lib/site.rb.tt +4 -0
- data/lib/spontaneous/generators/site/lib/tasks/site.rake.tt +8 -0
- data/lib/spontaneous/generators/site/public/css/site.css +0 -0
- data/lib/spontaneous/generators/site/public/favicon.ico +0 -0
- data/lib/spontaneous/generators/site/public/js/.empty_directory +0 -0
- data/lib/spontaneous/generators/site/public/js/site.js +0 -0
- data/lib/spontaneous/generators/site/public/robots.txt +0 -0
- data/lib/spontaneous/generators/site/schema/.map +1 -0
- data/lib/spontaneous/generators/site/schema/page.rb.tt +8 -0
- data/lib/spontaneous/generators/site/schema/piece.rb.tt +4 -0
- data/lib/spontaneous/generators/site/templates/layouts/standard.html.cut.tt +13 -0
- data/lib/spontaneous/generators/site.rb +77 -0
- data/lib/spontaneous/generators.rb +23 -0
- data/lib/spontaneous/image_size.rb +117 -0
- data/lib/spontaneous/json.rb +33 -0
- data/lib/spontaneous/layout.rb +15 -0
- data/lib/spontaneous/loader.rb +280 -0
- data/lib/spontaneous/logger.rb +369 -0
- data/lib/spontaneous/media.rb +84 -0
- data/lib/spontaneous/page.rb +92 -0
- data/lib/spontaneous/page_controller.rb +18 -0
- data/lib/spontaneous/page_piece.rb +77 -0
- data/lib/spontaneous/paths.rb +30 -0
- data/lib/spontaneous/permissions/access_group.rb +50 -0
- data/lib/spontaneous/permissions/access_key.rb +35 -0
- data/lib/spontaneous/permissions/user.rb +167 -0
- data/lib/spontaneous/permissions/user_level.rb +177 -0
- data/lib/spontaneous/permissions.rb +55 -0
- data/lib/spontaneous/piece.rb +30 -0
- data/lib/spontaneous/plugins/aliases.rb +128 -0
- data/lib/spontaneous/plugins/allowed_types.rb +173 -0
- data/lib/spontaneous/plugins/application/facets.rb +25 -0
- data/lib/spontaneous/plugins/application/paths.rb +137 -0
- data/lib/spontaneous/plugins/application/render.rb +29 -0
- data/lib/spontaneous/plugins/application/serialisation.rb +16 -0
- data/lib/spontaneous/plugins/application/state.rb +86 -0
- data/lib/spontaneous/plugins/boxes.rb +84 -0
- data/lib/spontaneous/plugins/controllers.rb +52 -0
- data/lib/spontaneous/plugins/entries.rb +193 -0
- data/lib/spontaneous/plugins/entry.rb +51 -0
- data/lib/spontaneous/plugins/fields.rb +103 -0
- data/lib/spontaneous/plugins/instance_code.rb +18 -0
- data/lib/spontaneous/plugins/layouts.rb +87 -0
- data/lib/spontaneous/plugins/media.rb +41 -0
- data/lib/spontaneous/plugins/page/formats.rb +67 -0
- data/lib/spontaneous/plugins/page/request.rb +89 -0
- data/lib/spontaneous/plugins/page_search.rb +64 -0
- data/lib/spontaneous/plugins/page_tree.rb +25 -0
- data/lib/spontaneous/plugins/paths.rb +125 -0
- data/lib/spontaneous/plugins/permissions.rb +63 -0
- data/lib/spontaneous/plugins/prototypes.rb +84 -0
- data/lib/spontaneous/plugins/publishing.rb +255 -0
- data/lib/spontaneous/plugins/render.rb +24 -0
- data/lib/spontaneous/plugins/schema_hierarchy.rb +76 -0
- data/lib/spontaneous/plugins/schema_id.rb +60 -0
- data/lib/spontaneous/plugins/schema_title.rb +33 -0
- data/lib/spontaneous/plugins/serialisation.rb +67 -0
- data/lib/spontaneous/plugins/site/instance.rb +22 -0
- data/lib/spontaneous/plugins/site/map.rb +19 -0
- data/lib/spontaneous/plugins/site/publishing.rb +74 -0
- data/lib/spontaneous/plugins/site/revisions.rb +28 -0
- data/lib/spontaneous/plugins/site/selectors.rb +41 -0
- data/lib/spontaneous/plugins/site_map.rb +34 -0
- data/lib/spontaneous/plugins/styles.rb +119 -0
- data/lib/spontaneous/plugins/supertype.rb +11 -0
- data/lib/spontaneous/plugins/visibility.rb +151 -0
- data/lib/spontaneous/plugins.rb +20 -0
- data/lib/spontaneous/prototypes/box_prototype.rb +168 -0
- data/lib/spontaneous/prototypes/field_prototype.rb +112 -0
- data/lib/spontaneous/prototypes/layout_prototype.rb +17 -0
- data/lib/spontaneous/prototypes/style_prototype.rb +42 -0
- data/lib/spontaneous/proxy_object.rb +12 -0
- data/lib/spontaneous/publishing/fire_and_forget.rb +57 -0
- data/lib/spontaneous/publishing/immediate.rb +197 -0
- data/lib/spontaneous/publishing/threaded.rb +25 -0
- data/lib/spontaneous/publishing.rb +10 -0
- data/lib/spontaneous/rack/around_back.rb +44 -0
- data/lib/spontaneous/rack/around_front.rb +29 -0
- data/lib/spontaneous/rack/around_preview.rb +26 -0
- data/lib/spontaneous/rack/assets.rb +98 -0
- data/lib/spontaneous/rack/back.rb +729 -0
- data/lib/spontaneous/rack/front.rb +41 -0
- data/lib/spontaneous/rack/http.rb +18 -0
- data/lib/spontaneous/rack/media.rb +29 -0
- data/lib/spontaneous/rack/public.rb +232 -0
- data/lib/spontaneous/rack/reloader.rb +42 -0
- data/lib/spontaneous/rack/static.rb +25 -0
- data/lib/spontaneous/rack.rb +55 -0
- data/lib/spontaneous/render/context.rb +100 -0
- data/lib/spontaneous/render/development_renderer.rb +14 -0
- data/lib/spontaneous/render/engine.rb +19 -0
- data/lib/spontaneous/render/format/html.rb +5 -0
- data/lib/spontaneous/render/format.rb +70 -0
- data/lib/spontaneous/render/preview_renderer.rb +18 -0
- data/lib/spontaneous/render/published_renderer.rb +54 -0
- data/lib/spontaneous/render/publishing_renderer.rb +13 -0
- data/lib/spontaneous/render/renderer.rb +46 -0
- data/lib/spontaneous/render.rb +173 -0
- data/lib/spontaneous/revision.rb +7 -0
- data/lib/spontaneous/schema/schema_modification.rb +260 -0
- data/lib/spontaneous/schema/uid.rb +221 -0
- data/lib/spontaneous/schema.rb +295 -0
- data/lib/spontaneous/server.rb +65 -0
- data/lib/spontaneous/site.rb +87 -0
- data/lib/spontaneous/state.rb +53 -0
- data/lib/spontaneous/style.rb +144 -0
- data/lib/spontaneous/tasks/database.rake +9 -0
- data/lib/spontaneous/tasks.rb +5 -0
- data/lib/spontaneous/version.rb +6 -0
- data/lib/spontaneous.rb +179 -0
- data/spontaneous.gemspec.tmpl +66 -0
- data/test/disabled/test_slots.rb +287 -0
- data/test/experimental/test_formats.rb +92 -0
- data/test/experimental/test_plugins.rb +64 -0
- data/test/fixtures/application/css/test.less +5 -0
- data/test/fixtures/application/js/test.js +1 -0
- data/test/fixtures/application/static/favicon.ico +1 -0
- data/test/fixtures/application/static/test.html +1 -0
- data/test/fixtures/application/views/index.erubis +1 -0
- data/test/fixtures/back/public/test.html +1 -0
- data/test/fixtures/back/templates/layouts/standard.html.cut +1 -0
- data/test/fixtures/config/config/environment.rb +4 -0
- data/test/fixtures/config/config/environments/development.rb +13 -0
- data/test/fixtures/config/config/environments/production.rb +22 -0
- data/test/fixtures/config/config/environments/staging.rb +2 -0
- data/test/fixtures/example_application/Gemfile +6 -0
- data/test/fixtures/example_application/Gemfile.lock +76 -0
- data/test/fixtures/example_application/Rakefile +6 -0
- data/test/fixtures/example_application/config/back.rb +15 -0
- data/test/fixtures/example_application/config/back.ru +8 -0
- data/test/fixtures/example_application/config/back.yml +8 -0
- data/test/fixtures/example_application/config/boot.rb +16 -0
- data/test/fixtures/example_application/config/database.yml +24 -0
- data/test/fixtures/example_application/config/environment.rb +4 -0
- data/test/fixtures/example_application/config/environments/development.rb +16 -0
- data/test/fixtures/example_application/config/environments/production.rb +21 -0
- data/test/fixtures/example_application/config/environments/staging.rb +1 -0
- data/test/fixtures/example_application/config/front.rb +8 -0
- data/test/fixtures/example_application/config/front.ru +8 -0
- data/test/fixtures/example_application/config/front.yml +8 -0
- data/test/fixtures/example_application/config/schema.yml +48 -0
- data/test/fixtures/example_application/config/unicorn.rb +1 -0
- data/test/fixtures/example_application/config/user_levels.yml +19 -0
- data/test/fixtures/example_application/public/css/test.css +0 -0
- data/test/fixtures/example_application/public/favicon.ico +1 -0
- data/test/fixtures/example_application/public/js/test.js +0 -0
- data/test/fixtures/example_application/public/test.html +1 -0
- data/test/fixtures/example_application/schema/client_project.rb +18 -0
- data/test/fixtures/example_application/schema/client_projects.rb +8 -0
- data/test/fixtures/example_application/schema/home_page.rb +22 -0
- data/test/fixtures/example_application/schema/info_page.rb +13 -0
- data/test/fixtures/example_application/schema/inline_image.rb +11 -0
- data/test/fixtures/example_application/schema/page.rb +4 -0
- data/test/fixtures/example_application/schema/piece.rb +3 -0
- data/test/fixtures/example_application/schema/project.rb +21 -0
- data/test/fixtures/example_application/schema/project_image.rb +18 -0
- data/test/fixtures/example_application/schema/projects_page.rb +12 -0
- data/test/fixtures/example_application/schema/text.rb +8 -0
- data/test/fixtures/example_application/templates/client_project/images.html.cut +1 -0
- data/test/fixtures/example_application/templates/client_project.html.cut +4 -0
- data/test/fixtures/example_application/templates/client_projects.html.cut +6 -0
- data/test/fixtures/example_application/templates/info_page/inline.html.cut +0 -0
- data/test/fixtures/example_application/templates/inline_image.html.cut +1 -0
- data/test/fixtures/example_application/templates/layouts/home.html.cut +15 -0
- data/test/fixtures/example_application/templates/layouts/info.html.cut +3 -0
- data/test/fixtures/example_application/templates/layouts/project.html.cut +13 -0
- data/test/fixtures/example_application/templates/layouts/projects.html.cut +11 -0
- data/test/fixtures/example_application/templates/layouts/standard.html.cut +0 -0
- data/test/fixtures/example_application/templates/project/inline.html.cut +5 -0
- data/test/fixtures/example_application/templates/project.html.cut +5 -0
- data/test/fixtures/example_application/templates/project_image.html.cut +1 -0
- data/test/fixtures/example_application/templates/text.html.cut +1 -0
- data/test/fixtures/images/rose.greyscale.jpg +0 -0
- data/test/fixtures/images/rose.jpg +0 -0
- data/test/fixtures/images/size.gif +0 -0
- data/test/fixtures/images/size.jpg +0 -0
- data/test/fixtures/images/size.png24 +0 -0
- data/test/fixtures/images/size.png8 +0 -0
- data/test/fixtures/layouts/layouts/custom1.html.cut +1 -0
- data/test/fixtures/layouts/layouts/custom1.pdf.cut +0 -0
- data/test/fixtures/layouts/layouts/custom1.xml.cut +0 -0
- data/test/fixtures/layouts/layouts/custom2.html.cut +1 -0
- data/test/fixtures/layouts/layouts/custom3.html.cut +0 -0
- data/test/fixtures/layouts/layouts/standard.html.cut +1 -0
- data/test/fixtures/media/101/003/rose.jpg +0 -0
- data/test/fixtures/permissions/config/user_levels.yml +9 -0
- data/test/fixtures/permissions/media/image.jpg +0 -0
- data/test/fixtures/plugins/schema_plugin/init.rb +1 -0
- data/test/fixtures/plugins/schema_plugin/schema/external.rb +5 -0
- data/test/fixtures/plugins/schema_plugin/templates/external.html.cut +1 -0
- data/test/fixtures/plugins/schema_plugin/templates/from_plugin.html.cut +0 -0
- data/test/fixtures/plugins/schema_plugin/templates/layouts/from_plugin.html.cut +0 -0
- data/test/fixtures/public/templates/layouts/default.html.cut +1 -0
- data/test/fixtures/public/templates/layouts/default.pdf.cut +1 -0
- data/test/fixtures/public/templates/layouts/default.rss.cut +1 -0
- data/test/fixtures/public/templates/layouts/dynamic.html.cut +1 -0
- data/test/fixtures/public/templates/layouts/standard.html.cut +0 -0
- data/test/fixtures/schema/before.yml +24 -0
- data/test/fixtures/schema/resolvable.yml +12 -0
- data/test/fixtures/schema/schema.yml +7 -0
- data/test/fixtures/serialisation/class_hash.yaml.erb +53 -0
- data/test/fixtures/serialisation/root_hash.yaml.erb +184 -0
- data/test/fixtures/sharding/rose.jpg +0 -0
- data/test/fixtures/sharding/xaa +0 -0
- data/test/fixtures/sharding/xab +0 -0
- data/test/fixtures/sharding/xac +0 -0
- data/test/fixtures/sharding/xad +0 -0
- data/test/fixtures/sharding/xae +0 -0
- data/test/fixtures/sharding/xaf +0 -0
- data/test/fixtures/sharding/xag +0 -0
- data/test/fixtures/styles/box_a/runny.html.cut +0 -0
- data/test/fixtures/styles/box_a.html.cut +1 -0
- data/test/fixtures/styles/named2.html.cut +1 -0
- data/test/fixtures/styles/orange/apple.html.cut +1 -0
- data/test/fixtures/styles/template_class/named1.html.cut +1 -0
- data/test/fixtures/styles/template_class/results.html.cut +1 -0
- data/test/fixtures/styles/template_class/walky.html.cut +0 -0
- data/test/fixtures/styles/template_class.epub.cut +0 -0
- data/test/fixtures/styles/template_class.html.cut +1 -0
- data/test/fixtures/styles/template_class.pdf.cut +0 -0
- data/test/fixtures/styles/template_sub_class1.html.cut +1 -0
- data/test/fixtures/templates/aliases/a/a_style.html.cut +0 -0
- data/test/fixtures/templates/aliases/a/page.html.cut +0 -0
- data/test/fixtures/templates/aliases/a_alias/a_alias_style.html.cut +0 -0
- data/test/fixtures/templates/aliases/layouts/b.html.cut +1 -0
- data/test/fixtures/templates/aliases/layouts/b_alias.html.cut +1 -0
- data/test/fixtures/templates/aliases/layouts/c_alias.html.cut +1 -0
- data/test/fixtures/templates/boxes/blank_content/things.html.cut +1 -0
- data/test/fixtures/templates/boxes/my_box_class/christy.html.cut +1 -0
- data/test/fixtures/templates/boxes/thangs.html.cut +1 -0
- data/test/fixtures/templates/boxes/with_template_box.html.cut +1 -0
- data/test/fixtures/templates/content/include.html.cut +1 -0
- data/test/fixtures/templates/content/include_dir.html.cut +1 -0
- data/test/fixtures/templates/content/included.epub.cut +1 -0
- data/test/fixtures/templates/content/included.html.cut +1 -0
- data/test/fixtures/templates/content/partial/included.html.cut +1 -0
- data/test/fixtures/templates/content/preprocess.html.cut +1 -0
- data/test/fixtures/templates/content/second.html.cut +1 -0
- data/test/fixtures/templates/content/template.epub.cut +1 -0
- data/test/fixtures/templates/content/template.html.cut +1 -0
- data/test/fixtures/templates/default_style_class.html.cut +1 -0
- data/test/fixtures/templates/direct.html.cut +1 -0
- data/test/fixtures/templates/extended/grandparent.html.cut +10 -0
- data/test/fixtures/templates/extended/main.html.cut +6 -0
- data/test/fixtures/templates/extended/parent.html.cut +10 -0
- data/test/fixtures/templates/layouts/entries.html.cut +7 -0
- data/test/fixtures/templates/layouts/page_style.html.cut +1 -0
- data/test/fixtures/templates/layouts/params.html.cut +1 -0
- data/test/fixtures/templates/layouts/preview_render.html.cut +2 -0
- data/test/fixtures/templates/layouts/standard_page.html.cut +1 -0
- data/test/fixtures/templates/layouts/subdir_style.html.cut +1 -0
- data/test/fixtures/templates/layouts/template_params.html.cut +1 -0
- data/test/fixtures/templates/page_class/inline_style.html.cut +1 -0
- data/test/fixtures/templates/preview_render/inline.html.cut +0 -0
- data/test/fixtures/templates/publishing/layouts/dynamic.html.cut +1 -0
- data/test/fixtures/templates/publishing/layouts/static.html.cut +1 -0
- data/test/fixtures/templates/template_class/anonymous_style.html.cut +4 -0
- data/test/fixtures/templates/template_class/another_template.html.cut +0 -0
- data/test/fixtures/templates/template_class/complex_template.html.cut +6 -0
- data/test/fixtures/templates/template_class/complex_template.pdf.cut +6 -0
- data/test/fixtures/templates/template_class/default_template_style.html.cut +4 -0
- data/test/fixtures/templates/template_class/images_with_template.html.cut +5 -0
- data/test/fixtures/templates/template_class/slots_template.html.cut +5 -0
- data/test/fixtures/templates/template_class/slots_template.pdf.cut +5 -0
- data/test/fixtures/templates/template_class/this_template.epub.cut +1 -0
- data/test/fixtures/templates/template_class/this_template.html.cut +1 -0
- data/test/fixtures/templates/template_class/this_template.pdf.cut +1 -0
- data/test/fixtures/templates/with_default_style_class.html.cut +1 -0
- data/test/functional/test_application.rb +176 -0
- data/test/functional/test_back.rb +902 -0
- data/test/functional/test_front.rb +571 -0
- data/test/javascript/test_dom.rb +94 -0
- data/test/javascript/test_markdown.rb +97 -0
- data/test/slow/test_publishing.rb +987 -0
- data/test/slow/test_visibility.rb +250 -0
- data/test/support/custom_matchers.rb +77 -0
- data/test/support/timing.rb +23 -0
- data/test/test_helper.rb +164 -0
- data/test/test_javascript.rb +34 -0
- data/test/ui/test_page_editing.rb +167 -0
- data/test/ui_helper.rb +114 -0
- data/test/unit/test_alias.rb +254 -0
- data/test/unit/test_authentication.rb +510 -0
- data/test/unit/test_boxes.rb +497 -0
- data/test/unit/test_config.rb +156 -0
- data/test/unit/test_content.rb +221 -0
- data/test/unit/test_content_inheritance.rb +103 -0
- data/test/unit/test_extensions.rb +14 -0
- data/test/unit/test_fields.rb +392 -0
- data/test/unit/test_generators.rb +97 -0
- data/test/unit/test_image_size.rb +25 -0
- data/test/unit/test_images.rb +265 -0
- data/test/unit/test_layouts.rb +111 -0
- data/test/unit/test_logger.rb +80 -0
- data/test/unit/test_media.rb +70 -0
- data/test/unit/test_page.rb +244 -0
- data/test/unit/test_permissions.rb +834 -0
- data/test/unit/test_piece.rb +80 -0
- data/test/unit/test_prototype_set.rb +192 -0
- data/test/unit/test_prototypes.rb +102 -0
- data/test/unit/test_render.rb +359 -0
- data/test/unit/test_schema.rb +1009 -0
- data/test/unit/test_serialisation.rb +215 -0
- data/test/unit/test_site.rb +145 -0
- data/test/unit/test_structure.rb +85 -0
- data/test/unit/test_styles.rb +417 -0
- data/test/unit/test_templates.rb +224 -0
- data/test/unit/test_type_hierarchy.rb +28 -0
- metadata +1017 -0
@@ -0,0 +1,110 @@
|
|
1
|
+
|
2
|
+
Spontaneous.Views = (function($, S) {
|
3
|
+
var dom = S.Dom;
|
4
|
+
var View = new JS.Class({
|
5
|
+
initialize: function(content) {
|
6
|
+
this.content = content;
|
7
|
+
},
|
8
|
+
id: function() {
|
9
|
+
return this.content.id();
|
10
|
+
},
|
11
|
+
uid: function() {
|
12
|
+
return this.content.uid();
|
13
|
+
},
|
14
|
+
depth_class: function() {
|
15
|
+
return 'depth-'+this.content.depth();
|
16
|
+
},
|
17
|
+
depth: function() {
|
18
|
+
return this.content.depth();
|
19
|
+
},
|
20
|
+
visibility_class: function() {
|
21
|
+
return this.content.hidden() ? 'hidden' : 'visible';
|
22
|
+
},
|
23
|
+
boxes_class: function() {
|
24
|
+
return this.content.has_boxes() ? 'boxes' : 'no-boxes';
|
25
|
+
},
|
26
|
+
|
27
|
+
has_fields: function() {
|
28
|
+
return this.content.field_list().length > 0;
|
29
|
+
},
|
30
|
+
field_list: function() {
|
31
|
+
return this.content.field_list();
|
32
|
+
},
|
33
|
+
image_fields: function() {
|
34
|
+
return this.content.image_fields();
|
35
|
+
},
|
36
|
+
text_fields: function() {
|
37
|
+
return this.content.text_fields();
|
38
|
+
},
|
39
|
+
file_fields: function() {
|
40
|
+
return this.content.file_fields();
|
41
|
+
},
|
42
|
+
mouseover: function(event) {
|
43
|
+
},
|
44
|
+
mouseout: function(event) {
|
45
|
+
},
|
46
|
+
save_path: function() {
|
47
|
+
return this.content.save_path();
|
48
|
+
},
|
49
|
+
create_edit_wrapper: function(read_content) {
|
50
|
+
var s = {'style':'position: relative; overflow: hidden;'}
|
51
|
+
var outer = dom.div(s);
|
52
|
+
var write = dom.div({'style':'position: absolute; height: 0; overflow: hidden;'})
|
53
|
+
var write_inner = dom.div();
|
54
|
+
var read = dom.div(s);
|
55
|
+
var read_inner = dom.div();
|
56
|
+
write.append(write_inner);
|
57
|
+
read_inner.append(read_content);
|
58
|
+
read.append(read_inner);
|
59
|
+
outer.append(write).append(read);
|
60
|
+
this.editing_area = {
|
61
|
+
outer: outer,
|
62
|
+
write: write,
|
63
|
+
write_inner: write_inner,
|
64
|
+
read: read,
|
65
|
+
read_inner: read_inner
|
66
|
+
};
|
67
|
+
return outer;
|
68
|
+
},
|
69
|
+
|
70
|
+
edit: function(focus_field) {
|
71
|
+
var time_to_reveal = 300, back = 10, front = 20,
|
72
|
+
a = this.editing_area, o = a.outer, w = a.write, r = a.read, wi = a.write_inner, ri = a.read_inner;
|
73
|
+
var panel = new Spontaneous.EditPanel(this), view = panel.view();
|
74
|
+
r.css('z-index', front);
|
75
|
+
w.css('z-index', back).css('height', 'auto').show();
|
76
|
+
wi.append(view);
|
77
|
+
var h = wi.outerHeight();
|
78
|
+
o.add(r).animate({'height':h}, { queue: false, duration: time_to_reveal });
|
79
|
+
w.css({'position':'relative'});
|
80
|
+
r.css({'position':'absolute', 'top':0, 'right':0, 'left':0}).animate({'top':h}, { queue: false, duration: time_to_reveal, complete:function() {
|
81
|
+
w.css({'z-index': front, 'position':'relative', 'height':'auto'})
|
82
|
+
r.css({'z-index': back, 'position':'absolute'})
|
83
|
+
o.css('height', 'auto');
|
84
|
+
panel.on_show(focus_field);
|
85
|
+
}});
|
86
|
+
},
|
87
|
+
edit_closing: false,
|
88
|
+
edit_closed: function() {
|
89
|
+
if (this.edit_closing) { return; }
|
90
|
+
this.edit_closing = true;
|
91
|
+
var time_to_reveal = 300, back = 10, front = 20,
|
92
|
+
a = this.editing_area, o = a.outer, w = a.write, r = a.read, wi = a.write_inner, ri = a.read_inner,
|
93
|
+
h = ri.outerHeight(), __content = this;
|
94
|
+
o.add(r).animate({'height':h}, { queue: false, duration: time_to_reveal });
|
95
|
+
r.css({'z-index':front, 'height':h, 'top':wi.outerHeight()+'px'}).animate({'top':0}, { queue: true, duration: time_to_reveal, complete: function() {
|
96
|
+
w.css({'position':'absolute', 'z-index':back});
|
97
|
+
r.css({'position':'relative', 'height':'auto', 'z-index':front})
|
98
|
+
o.css('height', 'auto')
|
99
|
+
wi.empty();
|
100
|
+
__content.edit_closing = false;
|
101
|
+
}});
|
102
|
+
},
|
103
|
+
save_complete:function(response) {
|
104
|
+
this.content.save_complete(response);
|
105
|
+
}
|
106
|
+
});
|
107
|
+
return {
|
108
|
+
View: View
|
109
|
+
}
|
110
|
+
}(jQuery, Spontaneous));
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
3
|
+
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4
|
+
width="24px" height="26px" viewBox="0 0 24 26" style=""
|
5
|
+
xml:space="preserve">
|
6
|
+
<path style="fill:#10b2fe;" d="M3.449,6.193C3.387,6.218,3.223,6.38,3.182,6.439c-0.062,0.09-0.174,0.414-0.256,0.512
|
7
|
+
C2.834,7.062,2.613,7.068,2.494,7.199c-0.217,0.24-0.381,0.547-0.613,0.854C1.844,8.099,1.762,8.431,1.762,8.539v0.699
|
8
|
+
c0,0.084-0.162,0.326-0.186,0.412c-0.015,0.047,0.016,0.203,0,0.248c-0.035,0.104-0.184,0.404-0.254,0.508
|
9
|
+
c-0.061,0.088-0.203,0.105-0.291,0.172c-0.09,0.07-0.357,0.303-0.373,0.381c-0.066,0.363-0.15,0.686-0.133,1.117l0.262,0.611
|
10
|
+
c-0.059,0.318-0.113,0.693-0.133,1.076l-0.621,0.664c-0.033,0.035-0.054,0.322,0,0.367c0.287,0.256,0.689,0.445,0.924,0.787
|
11
|
+
L1.26,16.24c0.068,0.512-0.041,0.949-0.303,1.184c-0.037,0.033-0.195-0.012-0.232,0.008c-0.129,0.072-0.242,0.199-0.322,0.332
|
12
|
+
c-0.027,0.047,0,0.26,0,0.332c0.131,0.074,0.262,0.154,0.395,0.254c0.107,0.08,0.189-0.096,0.348-0.055
|
13
|
+
c0.312,0.08,0.631,0.168,0.863,0.326v0.828l-0.123,0.578c0.061,0.203,0.104,0.424,0.133,0.652c0.005,0.062,0.176,0.238,0.255,0.291
|
14
|
+
c0.112,0.072,0.313,0.109,0.354,0.291l-0.754,0.691l-0.016,0.453l0.911-0.959c0.365-0.043,0.564,0.18,0.73,0.436
|
15
|
+
c0.022,0.242,0.062,0.516,0.133,0.785c0.033,0.129,0.201,0.215,0.355,0.361c0.439-0.143,1.021-0.127,1.449,0.248
|
16
|
+
c0.102,0.158,0.193,0.523,0.328,0.797c0.057,0.117,0.318,0.391,0.404,0.398l1.644,0.123c0.11,0.008,0.478,0.049,0.558,0.127
|
17
|
+
l0.84,0.836c0.176,0.35,0.467,0.604,0.736,0.795c0.422-0.174,0.73-0.406,1.068-0.654c0.186-0.023,0.393-0.029,0.609-0.117
|
18
|
+
c0.102-0.041,0.225,0.248,0.34,0.248l0.871,0.006l0.621,0.109l0.596,0.137c0.215,0.016,0.393-0.117,0.553-0.195l0.5-0.484
|
19
|
+
c0.133-0.107,0.32-0.162,0.523-0.182l0.695-0.652c0.363,0.07,0.727,0.188,1.213,0.143c0.029-0.004,0.139-0.08,0.166-0.109
|
20
|
+
c0.354-0.377,0.619-0.828,1.01-1.311l0.715-0.49c0.393-0.229,0.947-0.279,1.318-0.467c0.129-0.068,0.355-0.33,0.371-0.377
|
21
|
+
c0.115-0.348,0.113-0.795,0.09-1.172l0.318-0.678c0.018-0.041-0.043-0.256,0-0.287c0.219-0.162,0.506-0.297,0.697-0.574
|
22
|
+
c0.076-0.262,0.326-0.445,0.607-0.549L22.751,18c-0.006-0.055-0.223-0.215-0.236-0.275c-0.051-0.225-0.129-0.453-0.135-0.646
|
23
|
+
c0.188-0.338,0.426-0.576,0.754-0.758c-0.004,0.002,0.121,0.014,0.158,0c0.094-0.033,0.154-0.129,0.193-0.217
|
24
|
+
c0.025-0.057,0.029-0.289,0.014-0.359c-0.021-0.086-0.127-0.35-0.186-0.412l-0.438-0.457c-0.002-0.361,0.133-0.604,0.332-0.789
|
25
|
+
c0.373-0.021,0.617-0.207,0.781-0.469c0.008-0.012,0.014-0.146,0.002-0.162c-0.125-0.178-0.279-0.336-0.543-0.416
|
26
|
+
c-0.227,0.049-0.465,0.002-0.562-0.18c-0.119-0.223-0.201-0.479-0.248-0.74l-0.004-0.773c0.307-0.162,0.512-0.428,0.74-0.678v-0.564
|
27
|
+
c0-0.088-0.141-0.199-0.213-0.191c-0.363,0.039-0.652-0.07-0.953-0.162c-0.072-0.021-0.328-0.256-0.381-0.35
|
28
|
+
c-0.129-0.232-0.215-0.52-0.301-0.799c0.086-0.281,0.164-0.572,0.311-0.801c0.129-0.201,0.379-0.266,0.57-0.428
|
29
|
+
c-0.168-0.012-0.342,0.062-0.443,0.031c-0.213-0.066-0.414-0.137-0.602-0.223h-1c-0.119,0-0.287-0.209-0.305-0.342
|
30
|
+
c-0.033-0.268-0.143-0.531-0.223-0.76c0.172-0.139,0.303-0.352,0.25-0.637c-0.018-0.102-0.09-0.307-0.18-0.293
|
31
|
+
c-0.459,0.066-0.984,0.141-1.43,0.047c-0.086-0.018-0.34-0.127-0.412-0.18c-0.189-0.135-0.277-0.365-0.367-0.629
|
32
|
+
c-0.012-0.037,0.027-0.277-0.004-0.338c-0.045-0.092-0.279-0.348-0.369-0.391l-0.658-0.309h-0.904
|
33
|
+
c-0.439-0.207-0.922-0.389-1.461-0.518c-0.117-0.027-0.312-0.193-0.312-0.309l0.002-0.984c0.033-0.457,0.166-0.85,0.236-1.277
|
34
|
+
c0.012-0.084,0.027-0.283-0.039-0.262c-0.062,0.02-0.184,0.178-0.191,0.221c-0.062,0.459-0.111,0.949-0.139,1.434
|
35
|
+
c-0.006,0.098-0.123,0.156-0.207,0.205c-0.027,0.018-0.174-0.012-0.197,0.008l-0.906,0.865c-0.041,0.041-0.332,0.016-0.41-0.002
|
36
|
+
c-0.42-0.094-0.801-0.273-1.135-0.396l-0.883,0.398H9.445c-0.363,0.16-0.691,0.35-1.004,0.588C8.367,3.376,8.199,3.457,8.152,3.425
|
37
|
+
C7.811,3.21,7.486,3.087,7.281,2.865C7.254,2.833,7.068,2.833,7.022,2.857c-0.13,0.07-0.321,0.217-0.321,0.332v0.656
|
38
|
+
c0,0.107-0.066,0.471-0.117,0.508C6.328,4.541,6.111,4.757,5.791,4.81c-0.432,0.072-0.736-0.072-1.1-0.125
|
39
|
+
c-0.23,0.348-0.361,0.756-0.505,1.1C4.135,5.914,3.871,6.144,3.779,6.193C3.727,6.218,3.506,6.169,3.449,6.193z"/>
|
40
|
+
</svg>
|
Binary file
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
7
|
+
<title>Spontaneous: Loading...</title>
|
8
|
+
<link REL="SHORTCUT ICON" HREF="/@spontaneous/static/favicon.ico" />
|
9
|
+
|
10
|
+
<%- Spontaneous::Rack::Assets::CSS::EDITING_CSS.each do |css_file| %>
|
11
|
+
<link rel="stylesheet" href="<%= style_url(css_file) %>" type="text/css" media="screen" charset="utf-8" />
|
12
|
+
<% end %>
|
13
|
+
<%- Spontaneous::Rack::Assets::JavaScript::JQUERY.each do |js_file| %>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="<%= script_url(js_file) %>"></script>
|
15
|
+
<% end %>
|
16
|
+
<%- Spontaneous::Rack::Assets::JavaScript::COMPATIBILITY.each do |js_file| %>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="<%= script_url(js_file) %>"></script>
|
18
|
+
<% end %>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
Spontaneous = {
|
21
|
+
site_domain: '<%= Spontaneous::Site.config.site_domain %>',
|
22
|
+
site_id: '<%= Spontaneous::Site.config.site_id %>',
|
23
|
+
debug: <%= Spontaneous.development? %>,
|
24
|
+
development: <%= Spontaneous.development? %>,
|
25
|
+
asynchronous: false,
|
26
|
+
editor_protocol: 'mvim',
|
27
|
+
onload: function() {
|
28
|
+
jQuery.noConflict();
|
29
|
+
}
|
30
|
+
};
|
31
|
+
</script>
|
32
|
+
<%- Spontaneous::Rack::Assets::JavaScript::REQUIRE.each do |js_file| %>
|
33
|
+
<script type="text/javascript" charset="utf-8" src="<%= script_url(js_file) %>"></script>
|
34
|
+
<% end -%>
|
35
|
+
</head>
|
36
|
+
<body id="spontaneous">
|
37
|
+
<script type="text/javascript" charset="utf-8">
|
38
|
+
Spontaneous.Require.init(Spontaneous.asynchronous);
|
39
|
+
<%# list of scripts to append, in order %>
|
40
|
+
var sources = <%= script_list(Spontaneous::Rack::Assets::JavaScript::EDITING_JS) %>;
|
41
|
+
for (var i = 0, ii = sources.length; i < ii; i++) {
|
42
|
+
Spontaneous.require(sources[i]);
|
43
|
+
}
|
44
|
+
</script>
|
45
|
+
</body>
|
46
|
+
</html>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<title><%= Spontaneous::Site.config.site_domain %>: Please Login</title>
|
6
|
+
<link REL="SHORTCUT ICON" HREF="/@spontaneous/static/favicon.ico" />
|
7
|
+
<link rel="apple-touch-icon" href="/@spontaneous/static/spot.png" />
|
8
|
+
<%- Spontaneous::Rack::Assets::CSS::LOGIN_CSS.each do |css_file| %>
|
9
|
+
<link rel="stylesheet" href="<%= style_url(css_file) %>" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
<% end %>
|
11
|
+
<%- Spontaneous::Rack::Assets::JavaScript::JQUERY.each do |js_file| %>
|
12
|
+
<script type="text/javascript" charset="utf-8" src="<%= script_url(js_file) %>"></script>
|
13
|
+
<% end %>
|
14
|
+
<%- Spontaneous::Rack::Assets::JavaScript::COMPATIBILITY.each do |js_file| %>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="<%= script_url(js_file) %>"></script>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<script type="text/javascript">
|
19
|
+
var Spontaneous = {
|
20
|
+
site_domain: '<%= Spontaneous::Site.config.site_domain %>',
|
21
|
+
site_id: '<%= Spontaneous::Site.config.site_id %>',
|
22
|
+
};
|
23
|
+
</script>
|
24
|
+
<%- Spontaneous::Rack::Assets::JavaScript::LOGIN_JS.each do |js_file| %>
|
25
|
+
<script type="text/javascript" charset="utf-8" src="<%= script_url(js_file) %>"></script>
|
26
|
+
<% end %>
|
27
|
+
<script type="text/javascript">
|
28
|
+
(function($) {
|
29
|
+
$(function() {
|
30
|
+
<% if locals[:invalid_key] %>
|
31
|
+
var key = Spontaneous.Auth.Key.remove(Spontaneous.site_id);
|
32
|
+
<% else %>
|
33
|
+
var key = Spontaneous.Auth.Key.load(Spontaneous.site_id);
|
34
|
+
<% end %>
|
35
|
+
if (key) {
|
36
|
+
$('#reauthenticate-key').val(key).parent('form')[0].submit();
|
37
|
+
} else {
|
38
|
+
$('#outer').fadeIn();
|
39
|
+
}
|
40
|
+
});
|
41
|
+
}(jQuery));
|
42
|
+
</script>
|
43
|
+
</head>
|
44
|
+
<body id="spontaneous">
|
45
|
+
<div id="outer" style="display: none">
|
46
|
+
<h1>Please Login</h1>
|
47
|
+
<div id="login">
|
48
|
+
<div id="splash"></div>
|
49
|
+
<form id="login-form" action="/@spontaneous/login" method="post" accept-charset="UTF-8">
|
50
|
+
|
51
|
+
<p id="error-message" class="error" <% unless locals[:failed] %>style="display: none"<% end %>><span id="failure-message">Login failed for ‘<span id="failed-name"><%= locals[:login] %></span>’</span></p>
|
52
|
+
|
53
|
+
<div class="inputs">
|
54
|
+
<p>
|
55
|
+
<label><input type="text" id="user-login" name="user[login]" value="<%= locals[:login] %>" /><span>Username</span></label>
|
56
|
+
</p>
|
57
|
+
<p>
|
58
|
+
<label><input type="password" name="user[password]" value="" /><span>Password</span></label>
|
59
|
+
</p>
|
60
|
+
<p class="submit"><button type="submit">Login</button></p>
|
61
|
+
</div>
|
62
|
+
</form>
|
63
|
+
<form action="/@spontaneous/reauthenticate" method="post" accept-charset="UTF-8">
|
64
|
+
<input type="hidden" id="reauthenticate-key" name="api_key" value="" />
|
65
|
+
</form>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
</body>
|
69
|
+
</html>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
7
|
+
<title>Spontaneous: Loading...</title>
|
8
|
+
<link REL="SHORTCUT ICON" HREF="/@spontaneous/static/favicon.ico" />
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="/@spontaneous/css/schema_error.css" type="text/css" media="screen" charset="utf-8" />
|
11
|
+
<script type="text/javascript" charset="utf-8" src="/@spontaneous/js/vendor/jquery-1.5.1.min.js"></script>
|
12
|
+
<script type="text/javascript">
|
13
|
+
function _confirm(id) {
|
14
|
+
var t = 200;
|
15
|
+
$('.actions li p:visible').slideUp(t);
|
16
|
+
$(id).slideDown(t)
|
17
|
+
}
|
18
|
+
function _cancel(id) {
|
19
|
+
$(id).slideUp(200)
|
20
|
+
}
|
21
|
+
function solution(action, source, dest) {
|
22
|
+
console.log(action, source, dest);
|
23
|
+
}
|
24
|
+
</script>
|
25
|
+
</head>
|
26
|
+
<body id="spontaneous">
|
27
|
+
<div id="container">
|
28
|
+
|
29
|
+
<%
|
30
|
+
types = actions.map { |a| a.source.owner}.uniq
|
31
|
+
%>
|
32
|
+
|
33
|
+
<h1>There are unresolved changes to <%= types.length > 1 ? "s" : "" %> <%= types.map { |o| "<strong>‘#{o}’</strong>"}.join(', ')%></h1>
|
34
|
+
<p class="src"><a href="mvim://open?url=file://<%= actions[0].source.owner.__source_file %>"><%= actions[0].source.owner.__source_file %></a></p>
|
35
|
+
|
36
|
+
<p>Please choose one of the following solutions:</p>
|
37
|
+
|
38
|
+
<ul class="actions">
|
39
|
+
<% actions.each do |action|
|
40
|
+
id = "#{action.action}-#{action.source.name}#{action.dest ? "-#{action.dest.name}" : ""}"
|
41
|
+
%>
|
42
|
+
<li>
|
43
|
+
<form action="/@spontaneous/schema/<%= action.action %>" method="post">
|
44
|
+
<input type="hidden" name="origin" value="<%= env['SCRIPT_NAME'] %>" />
|
45
|
+
<input type="hidden" name="uid" value="<%= action.source.to_s %>" />
|
46
|
+
<% if action.dest %>
|
47
|
+
<input type="hidden" name="ref" value="<%= action.dest.schema_name %>" />
|
48
|
+
<% end %>
|
49
|
+
<a onclick="_confirm('#<%= id %>')"><strong><%= action.action.capitalize %></strong> <%= action.category %> ‘<em><%= action.source.name %></em>’ <% if action.dest %>
|
50
|
+
to ‘<em><%= action.dest.name %></em>’
|
51
|
+
<% end %>
|
52
|
+
</a>
|
53
|
+
<p id="<%= id %>" style="display: none">Are you sure? <a class="button cancel" onclick="_cancel('#<%= id %>')">No</a> <button class="button" onclick="solution('<%= action.action %>', '<%= action.source.name %>', '<%= action.dest ? action.dest.name : '' %>')">Yes</button></p>
|
54
|
+
</form>
|
55
|
+
</li>
|
56
|
+
<% end %>
|
57
|
+
</ul>
|
58
|
+
</div>
|
59
|
+
</body>
|
60
|
+
</html>
|
61
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<title>Spontaneous CMS: Unsupported Browser</title>
|
6
|
+
<link REL="SHORTCUT ICON" HREF="/@spontaneous/static/favicon.ico" />
|
7
|
+
<link rel="stylesheet" href="/@spontaneous/css/unsupported.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="outer">
|
12
|
+
<h1>Sorry!</h1>
|
13
|
+
<h2>You are using an unsupported browser...</h2>
|
14
|
+
<p>In order to provide the best editing experience Spontaneous uses features found in the best, modern, browsers.</p>
|
15
|
+
<p>Please download and install one of the following browsers in order to use this CMS as well as enjoy the best of the internet. You won’t regret it...</p>
|
16
|
+
<ul>
|
17
|
+
<li><a href="http://www.google.com/chrome">Google Chrome</a></li>
|
18
|
+
<li><a href="http://www.mozilla.com/firefox/">Firefox 4</a></li>
|
19
|
+
<!-- <li><a href="http://www.mozilla.com/firefox/">Safari</a></li> -->
|
20
|
+
</ul>
|
21
|
+
</div>
|
22
|
+
</body>
|
23
|
+
</html>
|
data/bin/limit-upload
ADDED
data/bin/spot
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby -U -KU
|
2
|
+
|
3
|
+
require 'rubygems' unless defined?(Gem) # Useful only on --dev mode
|
4
|
+
require 'bundler/setup'
|
5
|
+
|
6
|
+
spot_path = File.expand_path('../../lib', __FILE__)
|
7
|
+
$:.unshift(spot_path) if File.directory?(spot_path) && !$:.include?(spot_path)
|
8
|
+
|
9
|
+
require 'spontaneous/cli'
|
10
|
+
Spontaneous::Cli::Runner.start(ARGV)
|
data/bin/unlimit-upload
ADDED
data/config/nginx.conf
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# adapted from:
|
2
|
+
# http://unicorn.bogomips.org/examples/nginx.conf
|
3
|
+
|
4
|
+
daemon off;
|
5
|
+
worker_processes 1;
|
6
|
+
pid tmp/nginx.pid;
|
7
|
+
error_log tmp/nginx.error.log;
|
8
|
+
|
9
|
+
events {
|
10
|
+
worker_connections 1024;
|
11
|
+
accept_mutex off;
|
12
|
+
use kqueue;
|
13
|
+
}
|
14
|
+
|
15
|
+
http {
|
16
|
+
include /opt/local/etc/nginx/mime.types;
|
17
|
+
access_log tmp/nginx.access.log;
|
18
|
+
default_type application/octet-stream;
|
19
|
+
sendfile on;
|
20
|
+
tcp_nopush on;
|
21
|
+
tcp_nodelay off;
|
22
|
+
|
23
|
+
client_body_temp_path /tmp/client_temp;
|
24
|
+
proxy_temp_path /tmp/proxy_temp;
|
25
|
+
fastcgi_temp_path /tmp/fastcgi_temp;
|
26
|
+
scgi_temp_path /tmp/scgi_temp;
|
27
|
+
|
28
|
+
upstream app_server {
|
29
|
+
server 127.0.0.1:9001 fail_timeout=0;
|
30
|
+
}
|
31
|
+
|
32
|
+
server {
|
33
|
+
listen 9000 default;
|
34
|
+
server_name _;
|
35
|
+
root test/fixtures/example_application/public;
|
36
|
+
|
37
|
+
client_max_body_size 4G;
|
38
|
+
|
39
|
+
location /@spontaneous/js/ {
|
40
|
+
alias application/js/;
|
41
|
+
}
|
42
|
+
location /@spontaneous/static/ {
|
43
|
+
alias application/static/;
|
44
|
+
}
|
45
|
+
|
46
|
+
location / {
|
47
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
48
|
+
proxy_set_header Host $http_host;
|
49
|
+
proxy_redirect off;
|
50
|
+
|
51
|
+
if (!-f $request_filename) {
|
52
|
+
proxy_pass http://app_server;
|
53
|
+
break;
|
54
|
+
}
|
55
|
+
|
56
|
+
}
|
57
|
+
error_page 500 502 503 504 /500.html;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
adapter_scheme = self.adapter_scheme
|
6
|
+
create_table(:content) do
|
7
|
+
primary_key :id
|
8
|
+
varchar :type_id, :index => true
|
9
|
+
text :instance_code
|
10
|
+
integer :depth, :default => 0
|
11
|
+
|
12
|
+
# used for Page tree structure
|
13
|
+
# #pageonly
|
14
|
+
integer :parent_id, :index => true
|
15
|
+
varchar :ancestor_path, :index => true # materialised path
|
16
|
+
|
17
|
+
# used to get the parent Content item (Page or Piece)
|
18
|
+
integer :container_id, :index => true
|
19
|
+
|
20
|
+
# used to find all content for a Page
|
21
|
+
integer :page_id, :index => true
|
22
|
+
|
23
|
+
# content stores
|
24
|
+
case adapter_scheme
|
25
|
+
when :mysql, :mysql2
|
26
|
+
column :field_store, 'mediumtext'
|
27
|
+
column :entry_store, 'mediumtext'
|
28
|
+
else
|
29
|
+
text :field_store
|
30
|
+
text :entry_store
|
31
|
+
end
|
32
|
+
|
33
|
+
# used to store the template assigned to a page
|
34
|
+
# #pageonly
|
35
|
+
varchar :style_id
|
36
|
+
|
37
|
+
varchar :label
|
38
|
+
varchar :slot_name
|
39
|
+
varchar :slot_id
|
40
|
+
|
41
|
+
# URL path fields
|
42
|
+
# #pageonly
|
43
|
+
varchar :slug
|
44
|
+
varchar :path, :index => true # url path
|
45
|
+
|
46
|
+
# For quick path-independent page lookups
|
47
|
+
# #pageonly
|
48
|
+
varchar :uid, :index => true
|
49
|
+
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
create_table(:sites) do
|
54
|
+
primary_key :id
|
55
|
+
integer :revision, :default => 1
|
56
|
+
integer :published_revision, :default => 0
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
down do
|
61
|
+
drop_table :content
|
62
|
+
drop_table :sites
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
adapter_scheme = self.adapter_scheme
|
6
|
+
|
7
|
+
add_column :content, :created_at, DateTime
|
8
|
+
add_column :content, :modified_at, DateTime
|
9
|
+
|
10
|
+
add_column :content, :first_published_at, DateTime
|
11
|
+
add_column :content, :last_published_at, DateTime
|
12
|
+
|
13
|
+
add_column :content, :first_published_revision, Integer
|
14
|
+
|
15
|
+
# keeps track of publication dates
|
16
|
+
create_table(:revisions) do
|
17
|
+
primary_key :id
|
18
|
+
integer :revision
|
19
|
+
timestamp :published_at
|
20
|
+
end
|
21
|
+
|
22
|
+
# keeps track of all pages changed by a set of actions
|
23
|
+
create_table(:changes) do
|
24
|
+
primary_key :id
|
25
|
+
varchar :title
|
26
|
+
timestamp :created_at
|
27
|
+
text :modified_list
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
down do
|
32
|
+
drop_column :artists, :first_published_at
|
33
|
+
drop_column :content, :created_at, DateTime
|
34
|
+
drop_column :content, :modified_at, DateTime
|
35
|
+
drop_column :content, :first_published_at, DateTime
|
36
|
+
drop_column :content, :last_published_at, DateTime
|
37
|
+
drop_column :content, :first_published_revision, Integer
|
38
|
+
drop_table :revisions
|
39
|
+
drop_table :changes
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
|