noodall-ui 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +29 -0
- data/Gemfile +29 -0
- data/Gemfile.lock +205 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +17 -0
- data/app/controllers/noodall/admin/assets_controller.rb +241 -0
- data/app/controllers/noodall/admin/base_controller.rb +8 -0
- data/app/controllers/noodall/admin/components_controller.rb +22 -0
- data/app/controllers/noodall/admin/groups_controller.rb +11 -0
- data/app/controllers/noodall/admin/nodes_controller.rb +159 -0
- data/app/controllers/noodall/nodes_controller.rb +41 -0
- data/app/helpers/noodall/admin/assets_helper.rb +15 -0
- data/app/helpers/noodall/admin/base_helper.rb +14 -0
- data/app/helpers/noodall/admin/nodes_helper.rb +37 -0
- data/app/helpers/noodall/components_helper.rb +38 -0
- data/app/helpers/noodall/layout_helper.rb +25 -0
- data/app/helpers/noodall/nodes_helper.rb +72 -0
- data/app/models/asset.rb +103 -0
- data/app/views/layouts/noodall_admin.html.erb +66 -0
- data/app/views/noodall/admin/assets/_browser.html.erb +28 -0
- data/app/views/noodall/admin/assets/_form.html.erb +54 -0
- data/app/views/noodall/admin/assets/_menu.html.erb +8 -0
- data/app/views/noodall/admin/assets/_show.html.erb +48 -0
- data/app/views/noodall/admin/assets/_tags.html.erb +13 -0
- data/app/views/noodall/admin/assets/add.html.erb +10 -0
- data/app/views/noodall/admin/assets/form.html.erb +12 -0
- data/app/views/noodall/admin/assets/form.js.erb +2 -0
- data/app/views/noodall/admin/assets/index.html.erb +65 -0
- data/app/views/noodall/admin/assets/index.js.erb +1 -0
- data/app/views/noodall/admin/assets/show.html.erb +3 -0
- data/app/views/noodall/admin/assets/show.js.erb +1 -0
- data/app/views/noodall/admin/assets/tags.html.erb +3 -0
- data/app/views/noodall/admin/assets/tags.js.erb +1 -0
- data/app/views/noodall/admin/components/_component.erb +0 -0
- data/app/views/noodall/admin/nodes/_body.html.erb +5 -0
- data/app/views/noodall/admin/nodes/_branch.html.erb +10 -0
- data/app/views/noodall/admin/nodes/_home.html.erb +27 -0
- data/app/views/noodall/admin/nodes/_slot_form.html.erb +16 -0
- data/app/views/noodall/admin/nodes/change_template.html.erb +38 -0
- data/app/views/noodall/admin/nodes/index.html.erb +69 -0
- data/app/views/noodall/admin/nodes/new.html.erb +30 -0
- data/app/views/noodall/admin/nodes/show.html.erb +144 -0
- data/app/views/noodall/admin/nodes/tree.html.erb +3 -0
- data/app/views/noodall/admin/nodes/tree.js.erb +2 -0
- data/app/views/noodall/components/_component.erb +0 -0
- data/app/views/noodall/nodes/search.html.erb +14 -0
- data/app/views/noodall/nodes/sitemap.html.erb +3 -0
- data/app/views/noodall/nodes/sitemap.xml.rxml +22 -0
- data/config/application.rb +29 -0
- data/config/boot.rb +13 -0
- data/config/cucumber.yml +8 -0
- data/config/database.yml +14 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +30 -0
- data/config/environments/production.rb +50 -0
- data/config/environments/test.rb +35 -0
- data/config/locales/en.yml +5 -0
- data/config.ru +4 -0
- data/demo/controllers/application_controller.rb +22 -0
- data/demo/initializers/dragonfly.rb +1 -0
- data/demo/initializers/mongo_mapper.rb +13 -0
- data/demo/initializers/noodall.rb +2 -0
- data/demo/initializers/secret_token.rb +7 -0
- data/demo/initializers/session_store.rb +8 -0
- data/demo/models/gallery.rb +17 -0
- data/demo/models/page_a.rb +9 -0
- data/demo/models/page_b.rb +4 -0
- data/demo/models/page_c.rb +7 -0
- data/demo/models/promo.rb +22 -0
- data/demo/models/user.rb +12 -0
- data/demo/routes.rb +3 -0
- data/demo/seeds.rb +8 -0
- data/demo/views/admin/components/_gallery.html.erb +49 -0
- data/demo/views/admin/components/_promo.html.erb +34 -0
- data/demo/views/admin/nodes/_page_a.html.erb +47 -0
- data/demo/views/admin/nodes/_page_b.html.erb +35 -0
- data/demo/views/admin/nodes/_page_c.html.erb +35 -0
- data/demo/views/components/_gallery.html.erb +23 -0
- data/demo/views/components/_promo.html.erb +5 -0
- data/demo/views/layouts/application.html.erb +121 -0
- data/demo/views/nodes/page_a.html.erb +14 -0
- data/demo/views/nodes/page_b.html.erb +9 -0
- data/demo/views/nodes/page_c.html.erb +12 -0
- data/features/change_templates.feature +25 -0
- data/features/content_templates.feature +18 -0
- data/features/gallery_component.feature +22 -0
- data/features/manage_assets.feature +28 -0
- data/features/manage_content_tree.feature +42 -0
- data/features/preview.feature +8 -0
- data/features/promo_component.feature +18 -0
- data/features/publish_content.feature +28 -0
- data/features/search.feature +12 -0
- data/features/sitemap.feature +9 -0
- data/features/step_definitions/asset_steps.rb +66 -0
- data/features/step_definitions/cms_node_steps.rb +126 -0
- data/features/step_definitions/component_steps.rb +137 -0
- data/features/step_definitions/content_steps.rb +187 -0
- data/features/step_definitions/date_select_steps.rb +39 -0
- data/features/step_definitions/groups_access_steps.rb +92 -0
- data/features/step_definitions/node_steps.rb +25 -0
- data/features/step_definitions/preview_steps.rb +7 -0
- data/features/step_definitions/pubish_content_steps.rb +45 -0
- data/features/step_definitions/search_steps.rb +21 -0
- data/features/step_definitions/sign_in_steps.rb +3 -0
- data/features/step_definitions/web_steps.rb +219 -0
- data/features/support/env.rb +52 -0
- data/features/support/logo.png +0 -0
- data/features/support/paths.rb +56 -0
- data/generators/component/USAGE +8 -0
- data/generators/component/component_generator.rb +35 -0
- data/generators/component/lib/insert_commands.rb +61 -0
- data/generators/component/templates/admin_template.html.erb +50 -0
- data/generators/component/templates/factory.rb +5 -0
- data/generators/component/templates/model.rb +8 -0
- data/generators/component/templates/template.html.erb +41 -0
- data/generators/node/USAGE +8 -0
- data/generators/node/lib/insert_commands.rb +47 -0
- data/generators/node/node_generator.rb +35 -0
- data/generators/node/templates/admin_template.html.erb +49 -0
- data/generators/node/templates/factory.rb +5 -0
- data/generators/node/templates/model.rb +11 -0
- data/generators/node/templates/template.html.erb +41 -0
- data/generators/node_features/USAGE +8 -0
- data/generators/node_features/node_features_generator.rb +16 -0
- data/lib/generators/noodall/node/USAGE +8 -0
- data/lib/generators/noodall/node/node_generator.rb +21 -0
- data/lib/generators/noodall/node/templates/admin_template.html.erb +52 -0
- data/lib/generators/noodall/node/templates/factory.rb +8 -0
- data/lib/generators/noodall/node/templates/model.rb +13 -0
- data/lib/generators/noodall/node/templates/template.html.erb +12 -0
- data/lib/noodall/canable.rb +1 -0
- data/lib/noodall/dragonfly.rb +23 -0
- data/lib/noodall/engine.rb +13 -0
- data/lib/noodall/permalinks.rb +12 -0
- data/lib/noodall/routes.rb +45 -0
- data/lib/noodall/ui/version.rb +5 -0
- data/lib/noodall/ui.rb +17 -0
- data/lib/noodall/video_thumbnail_encoder.rb +31 -0
- data/lib/noodall-ui.rb +6 -0
- data/lib/tasks/cucumber.rake +53 -0
- data/log/.gitignore +0 -0
- data/noodall-ui.gemspec +28 -0
- data/public/favicon.ico +0 -0
- data/public/images/admin/add-small.png +0 -0
- data/public/images/admin/add.png +0 -0
- data/public/images/admin/add_file.gif +0 -0
- data/public/images/admin/advanced.gif +0 -0
- data/public/images/admin/back.png +0 -0
- data/public/images/admin/cancel-small.gif +0 -0
- data/public/images/admin/cancel.gif +0 -0
- data/public/images/admin/change-bg.gif +0 -0
- data/public/images/admin/change.gif +0 -0
- data/public/images/admin/check.png +0 -0
- data/public/images/admin/clear.gif +0 -0
- data/public/images/admin/close.png +0 -0
- data/public/images/admin/create.gif +0 -0
- data/public/images/admin/delete.gif +0 -0
- data/public/images/admin/delete.png +0 -0
- data/public/images/admin/doc-icon.png +0 -0
- data/public/images/admin/document.png +0 -0
- data/public/images/admin/down.png +0 -0
- data/public/images/admin/download.png +0 -0
- data/public/images/admin/draft.gif +0 -0
- data/public/images/admin/draft.png +0 -0
- data/public/images/admin/edit.gif +0 -0
- data/public/images/admin/edit.png +0 -0
- data/public/images/admin/image.png +0 -0
- data/public/images/admin/image_small.png +0 -0
- data/public/images/admin/info-white.png +0 -0
- data/public/images/admin/info.png +0 -0
- data/public/images/admin/media.gif +0 -0
- data/public/images/admin/nav-2.gif +0 -0
- data/public/images/admin/nav.gif +0 -0
- data/public/images/admin/next.png +0 -0
- data/public/images/admin/no-type-icon.png +0 -0
- data/public/images/admin/pagination.gif +0 -0
- data/public/images/admin/pdf-icon.png +0 -0
- data/public/images/admin/prev.png +0 -0
- data/public/images/admin/preview.gif +0 -0
- data/public/images/admin/publish.gif +0 -0
- data/public/images/admin/remove.gif +0 -0
- data/public/images/admin/reset.gif +0 -0
- data/public/images/admin/select_image.gif +0 -0
- data/public/images/admin/select_images.gif +0 -0
- data/public/images/admin/set.gif +0 -0
- data/public/images/admin/sort.png +0 -0
- data/public/images/admin/tag.png +0 -0
- data/public/images/admin/templates/article-page.gif +0 -0
- data/public/images/admin/templates/articles-list.gif +0 -0
- data/public/images/admin/templates/course-page.gif +0 -0
- data/public/images/admin/templates/event-page.gif +0 -0
- data/public/images/admin/templates/events-list.gif +0 -0
- data/public/images/admin/templates/home.gif +0 -0
- data/public/images/admin/templates/landing-page.gif +0 -0
- data/public/images/admin/templates/page-a.gif +0 -0
- data/public/images/admin/templates/page-b.gif +0 -0
- data/public/images/admin/templates/school-landing-page.gif +0 -0
- data/public/images/admin/templates/study-landing-page.gif +0 -0
- data/public/images/admin/top-level.png +0 -0
- data/public/images/admin/top-level_small.png +0 -0
- data/public/images/admin/txt-icon.png +0 -0
- data/public/images/admin/uncheck.png +0 -0
- data/public/images/admin/up.png +0 -0
- data/public/images/admin/update.gif +0 -0
- data/public/images/admin/upload.png +0 -0
- data/public/images/admin/video.png +0 -0
- data/public/images/admin/view.png +0 -0
- data/public/images/admin/xls-icon.png +0 -0
- data/public/images/fancybox/blank.gif +0 -0
- data/public/images/fancybox/fancy_close.png +0 -0
- data/public/images/fancybox/fancy_loading.png +0 -0
- data/public/images/fancybox/fancy_nav_left.png +0 -0
- data/public/images/fancybox/fancy_nav_right.png +0 -0
- data/public/images/fancybox/fancy_shadow_e.png +0 -0
- data/public/images/fancybox/fancy_shadow_n.png +0 -0
- data/public/images/fancybox/fancy_shadow_ne.png +0 -0
- data/public/images/fancybox/fancy_shadow_nw.png +0 -0
- data/public/images/fancybox/fancy_shadow_s.png +0 -0
- data/public/images/fancybox/fancy_shadow_se.png +0 -0
- data/public/images/fancybox/fancy_shadow_sw.png +0 -0
- data/public/images/fancybox/fancy_shadow_w.png +0 -0
- data/public/images/fancybox/fancy_title_left.png +0 -0
- data/public/images/fancybox/fancy_title_main.png +0 -0
- data/public/images/fancybox/fancy_title_over.png +0 -0
- data/public/images/fancybox/fancy_title_right.png +0 -0
- data/public/images/fancybox/fancybox-x.png +0 -0
- data/public/images/fancybox/fancybox-y.png +0 -0
- data/public/images/fancybox/fancybox.png +0 -0
- data/public/images/plupload/backgrounds.gif +0 -0
- data/public/images/plupload/buttons-disabled.png +0 -0
- data/public/images/plupload/buttons.png +0 -0
- data/public/images/plupload/delete.gif +0 -0
- data/public/images/plupload/done.gif +0 -0
- data/public/images/plupload/error.gif +0 -0
- data/public/images/plupload/throbber.gif +0 -0
- data/public/images/plupload/transp50.png +0 -0
- data/public/javascripts/admin/application.js +586 -0
- data/public/javascripts/admin/asset_edit.js +30 -0
- data/public/javascripts/admin/assets.js +98 -0
- data/public/javascripts/admin/gotham.font.js +20 -0
- data/public/javascripts/admin/jquery.jqtransform.js +366 -0
- data/public/javascripts/admin/nodes.js +30 -0
- data/public/javascripts/admin/tiny_mce_config.js +118 -0
- data/public/javascripts/ajaxify.js +20 -0
- data/public/javascripts/application.js +37 -0
- data/public/javascripts/carousel.lite.js +1 -0
- data/public/javascripts/cufon-yui.js +8 -0
- data/public/javascripts/fancybox.js +1078 -0
- data/public/javascripts/plupload/gears_init.js +86 -0
- data/public/javascripts/plupload/jquery.plupload.queue.min.js +1 -0
- data/public/javascripts/plupload/plupload.flash.swf +0 -0
- data/public/javascripts/plupload/plupload.full.min.js +1 -0
- data/public/javascripts/plupload/plupload.silverlight.xap +0 -0
- data/public/javascripts/rails.js +132 -0
- data/public/javascripts/tiny_mce/jquery.tinymce.js +1 -0
- data/public/javascripts/tiny_mce/langs/en.js +169 -0
- data/public/javascripts/tiny_mce/license.txt +504 -0
- data/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css +5 -0
- data/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
- data/public/javascripts/tiny_mce/plugins/advhr/js/rule.js +43 -0
- data/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +5 -0
- data/public/javascripts/tiny_mce/plugins/advhr/rule.htm +57 -0
- data/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css +13 -0
- data/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
- data/public/javascripts/tiny_mce/plugins/advimage/image.htm +232 -0
- data/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/advimage/js/image.js +443 -0
- data/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +43 -0
- data/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css +8 -0
- data/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
- data/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js +528 -0
- data/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +52 -0
- data/public/javascripts/tiny_mce/plugins/advlink/link.htm +333 -0
- data/public/javascripts/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/advlist/editor_plugin_src.js +154 -0
- data/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +117 -0
- data/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +422 -0
- data/public/javascripts/tiny_mce/plugins/autosave/langs/en.js +4 -0
- data/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
- data/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +127 -0
- data/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
- data/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
- data/public/javascripts/tiny_mce/plugins/emotions/emotions.htm +40 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js +22 -0
- data/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
- data/public/javascripts/tiny_mce/plugins/example/dialog.htm +22 -0
- data/public/javascripts/tiny_mce/plugins/example/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
- data/public/javascripts/tiny_mce/plugins/example/img/example.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/example/js/dialog.js +19 -0
- data/public/javascripts/tiny_mce/plugins/example/langs/en.js +3 -0
- data/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
- data/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
- data/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +149 -0
- data/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +571 -0
- data/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +471 -0
- data/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
- data/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +148 -0
- data/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +109 -0
- data/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +635 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
- data/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -0
- data/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
- data/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +212 -0
- data/public/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +136 -0
- data/public/javascripts/tiny_mce/plugins/media/css/content.css +6 -0
- data/public/javascripts/tiny_mce/plugins/media/css/media.css +16 -0
- data/public/javascripts/tiny_mce/plugins/media/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +414 -0
- data/public/javascripts/tiny_mce/plugins/media/img/flash.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf +0 -0
- data/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/media/img/trans.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/media/js/embed.js +73 -0
- data/public/javascripts/tiny_mce/plugins/media/js/media.js +630 -0
- data/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +103 -0
- data/public/javascripts/tiny_mce/plugins/media/media.htm +817 -0
- data/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
- data/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +90 -0
- data/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css +1 -0
- data/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +77 -0
- data/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +929 -0
- data/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -0
- data/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -0
- data/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
- data/public/javascripts/tiny_mce/plugins/paste/pastetext.htm +27 -0
- data/public/javascripts/tiny_mce/plugins/paste/pasteword.htm +21 -0
- data/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
- data/public/javascripts/tiny_mce/plugins/preview/example.html +28 -0
- data/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
- data/public/javascripts/tiny_mce/plugins/preview/preview.html +17 -0
- data/public/javascripts/tiny_mce/plugins/print/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
- data/public/javascripts/tiny_mce/plugins/save/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
- data/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
- data/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +57 -0
- data/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +130 -0
- data/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
- data/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +99 -0
- data/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css +1 -0
- data/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +341 -0
- data/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/style/css/props.css +13 -0
- data/public/javascripts/tiny_mce/plugins/style/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
- data/public/javascripts/tiny_mce/plugins/style/js/props.js +641 -0
- data/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +63 -0
- data/public/javascripts/tiny_mce/plugins/style/props.htm +726 -0
- data/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +112 -0
- data/public/javascripts/tiny_mce/plugins/table/cell.htm +178 -0
- data/public/javascripts/tiny_mce/plugins/table/css/cell.css +17 -0
- data/public/javascripts/tiny_mce/plugins/table/css/row.css +25 -0
- data/public/javascripts/tiny_mce/plugins/table/css/table.css +13 -0
- data/public/javascripts/tiny_mce/plugins/table/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +1118 -0
- data/public/javascripts/tiny_mce/plugins/table/js/cell.js +286 -0
- data/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js +27 -0
- data/public/javascripts/tiny_mce/plugins/table/js/row.js +237 -0
- data/public/javascripts/tiny_mce/plugins/table/js/table.js +449 -0
- data/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
- data/public/javascripts/tiny_mce/plugins/table/merge_cells.htm +32 -0
- data/public/javascripts/tiny_mce/plugins/table/row.htm +155 -0
- data/public/javascripts/tiny_mce/plugins/table/table.htm +187 -0
- data/public/javascripts/tiny_mce/plugins/template/blank.htm +12 -0
- data/public/javascripts/tiny_mce/plugins/template/css/template.css +23 -0
- data/public/javascripts/tiny_mce/plugins/template/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
- data/public/javascripts/tiny_mce/plugins/template/js/template.js +106 -0
- data/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
- data/public/javascripts/tiny_mce/plugins/template/template.htm +32 -0
- data/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +76 -0
- data/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +98 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +141 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +141 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +148 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +141 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +161 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +144 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +161 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +126 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +63 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +231 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +62 -0
- data/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
- data/public/javascripts/tiny_mce/themes/advanced/about.htm +54 -0
- data/public/javascripts/tiny_mce/themes/advanced/anchor.htm +26 -0
- data/public/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
- data/public/javascripts/tiny_mce/themes/advanced/color_picker.htm +73 -0
- data/public/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
- data/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1167 -0
- data/public/javascripts/tiny_mce/themes/advanced/image.htm +80 -0
- data/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/js/about.js +72 -0
- data/public/javascripts/tiny_mce/themes/advanced/js/anchor.js +37 -0
- data/public/javascripts/tiny_mce/themes/advanced/js/charmap.js +335 -0
- data/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js +253 -0
- data/public/javascripts/tiny_mce/themes/advanced/js/image.js +245 -0
- data/public/javascripts/tiny_mce/themes/advanced/js/link.js +156 -0
- data/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js +62 -0
- data/public/javascripts/tiny_mce/themes/advanced/langs/en.js +62 -0
- data/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +51 -0
- data/public/javascripts/tiny_mce/themes/advanced/link.htm +58 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css +35 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +213 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +35 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +116 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +215 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
- data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
- data/public/javascripts/tiny_mce/themes/advanced/source_editor.htm +26 -0
- data/public/javascripts/tiny_mce/themes/simple/editor_template.js +1 -0
- data/public/javascripts/tiny_mce/themes/simple/editor_template_src.js +85 -0
- data/public/javascripts/tiny_mce/themes/simple/img/icons.gif +0 -0
- data/public/javascripts/tiny_mce/themes/simple/langs/en.js +11 -0
- data/public/javascripts/tiny_mce/themes/simple/skins/default/content.css +25 -0
- data/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css +32 -0
- data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
- data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
- data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
- data/public/javascripts/tiny_mce/tiny_mce.js +1 -0
- data/public/javascripts/tiny_mce/tiny_mce_popup.js +5 -0
- data/public/javascripts/tiny_mce/tiny_mce_src.js +13134 -0
- data/public/javascripts/tiny_mce/utils/editable_selects.js +70 -0
- data/public/javascripts/tiny_mce/utils/form_utils.js +200 -0
- data/public/javascripts/tiny_mce/utils/mctabs.js +77 -0
- data/public/javascripts/tiny_mce/utils/validate.js +220 -0
- data/public/stylesheets/admin/fancybox.css +341 -0
- data/public/stylesheets/admin/forms.css +520 -0
- data/public/stylesheets/admin/handheld.css +6 -0
- data/public/stylesheets/admin/ie.css +118 -0
- data/public/stylesheets/admin/ie6.css +23 -0
- data/public/stylesheets/admin/ie8.css +16 -0
- data/public/stylesheets/admin/layout.css +723 -0
- data/public/stylesheets/admin/print.css +27 -0
- data/public/stylesheets/admin/reset.css +81 -0
- data/public/stylesheets/admin/skin.css +698 -0
- data/public/stylesheets/admin/tinymce.css +2 -0
- data/public/stylesheets/admin/typography.css +207 -0
- data/public/stylesheets/ellipsis.xml +15 -0
- data/public/stylesheets/fancybox.css +313 -0
- data/public/stylesheets/forms.css +7 -0
- data/public/stylesheets/ie.css +12 -0
- data/public/stylesheets/ie8.css +8 -0
- data/public/stylesheets/layout.css +31 -0
- data/public/stylesheets/plupload.queue.css +181 -0
- data/public/stylesheets/reset.css +84 -0
- data/public/stylesheets/sass/forms.scss +7 -0
- data/public/stylesheets/sass/ie.scss +12 -0
- data/public/stylesheets/sass/ie8.scss +8 -0
- data/public/stylesheets/sass/layout.scss +45 -0
- data/public/stylesheets/sass/skin.scss +35 -0
- data/public/stylesheets/sass/typography.scss +162 -0
- data/public/stylesheets/skin.css +22 -0
- data/public/stylesheets/typography.css +162 -0
- data/script/cucumber +10 -0
- data/script/rails +6 -0
- data/spec/factories/asset.rb +16 -0
- data/spec/factories/component.rb +9 -0
- data/spec/factories/node.rb +15 -0
- data/spec/factories/user.rb +5 -0
- data/spec/files/beef.png +0 -0
- data/spec/files/get_video.flv +0 -0
- data/spec/files/test.pdf +0 -0
- data/spec/noodall-ui_spec.rb +9 -0
- data/spec/spec_helper.rb +4 -0
- data/tmp/.gitignore +0 -0
- metadata +685 -0
@@ -0,0 +1,586 @@
|
|
1
|
+
// Turn off fnacy box keypresses
|
2
|
+
$.fn.fancybox.defaults.enableEscapeButton = false;
|
3
|
+
|
4
|
+
// We should remove once JQuery UI is updated
|
5
|
+
$.extend($.ui.autocomplete, {
|
6
|
+
escapeRegex: function(value) {
|
7
|
+
return value.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1");
|
8
|
+
},
|
9
|
+
filter: function(array, term) {
|
10
|
+
var matcher = new RegExp($.ui.autocomplete.escapeRegex(term), "i");
|
11
|
+
return $.grep(array, function(value) {
|
12
|
+
return matcher.test(value.label || value.value || value);
|
13
|
+
});
|
14
|
+
}
|
15
|
+
});
|
16
|
+
|
17
|
+
Cufon.replace('#content h1', {
|
18
|
+
hover: 'true',
|
19
|
+
fontFamily: 'Gotham Book'
|
20
|
+
});
|
21
|
+
|
22
|
+
Cufon.replace('#header h1', {
|
23
|
+
hover: 'true',
|
24
|
+
fontFamily: 'Gotham Bold'
|
25
|
+
});
|
26
|
+
|
27
|
+
function setup_tooltips() {
|
28
|
+
// tooltip for question mark icons
|
29
|
+
var version = parseInt($.browser.version.substr(0, 1));
|
30
|
+
var tooltip_elements = 'span.tooltip';
|
31
|
+
if ($.browser.msie && version == 6) {
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
$(tooltip_elements).unbind();
|
36
|
+
$(tooltip_elements).hover(
|
37
|
+
function() {
|
38
|
+
this.tip = this.title;
|
39
|
+
$(this).append('<div class="tooltip-show">' + this.tip + '</div>');
|
40
|
+
this.title = "";
|
41
|
+
this.width = $(this).width();
|
42
|
+
$(this).find('.tooltip-show').css({
|
43
|
+
left: this.width - 22
|
44
|
+
});
|
45
|
+
$('.tooltip-show').fadeIn(400);
|
46
|
+
},
|
47
|
+
function() {
|
48
|
+
$('.tooltip-show').fadeOut(400);
|
49
|
+
$(this).children().remove();
|
50
|
+
this.title = this.tip;
|
51
|
+
});
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
$(document).ready(function() {
|
56
|
+
|
57
|
+
//video previews
|
58
|
+
domain = window.location.href.replace(/http:\/\/([^\/]+)\/.*/i,'$1');
|
59
|
+
var videoUrl = 'video=http://'+ domain + escape($('a.lightboxVideo').attr('href')) + '&standalone=true';
|
60
|
+
|
61
|
+
$('a.lightboxVideo').fancybox({
|
62
|
+
'padding': 10,
|
63
|
+
'autoScale': true,
|
64
|
+
'transitionIn': 'elastic',
|
65
|
+
'transitionOut': 'elastic',
|
66
|
+
'title': false,
|
67
|
+
'titleShow': false,
|
68
|
+
'width': 700,
|
69
|
+
'height': 400,
|
70
|
+
'type': 'swf',
|
71
|
+
|
72
|
+
'swf': {
|
73
|
+
'allowFullScreen': true,
|
74
|
+
'flashvars': videoUrl,
|
75
|
+
wmode: 'transparent'
|
76
|
+
},
|
77
|
+
|
78
|
+
'href': '/flash/video.swf',
|
79
|
+
'centerOnScroll': true
|
80
|
+
});
|
81
|
+
|
82
|
+
setup_tooltips();
|
83
|
+
// Template Choices
|
84
|
+
$('.template label img').hide();
|
85
|
+
$('.template label img').css({
|
86
|
+
position: 'absolute'
|
87
|
+
});
|
88
|
+
$('.template input:radio:checked').parent().children('img').show();
|
89
|
+
$('.template input').click(function() {
|
90
|
+
$('.template label img').hide();
|
91
|
+
$(this).parent().children('img').fadeIn('fast');
|
92
|
+
});
|
93
|
+
|
94
|
+
//Field Types on form creator
|
95
|
+
if ($('#field-type').length > 0) {
|
96
|
+
|
97
|
+
var current_help = '';
|
98
|
+
$('.field-help').hide();
|
99
|
+
$('#' + $('#field-type option:selected').val()).show();
|
100
|
+
|
101
|
+
current_help = $('#' + $('#field-type option:selected').val());
|
102
|
+
|
103
|
+
$('#field-type').change(function() {
|
104
|
+
$(current_help).hide('fast');
|
105
|
+
$('#' + $('#field-type option:selected').val()).show('fast');
|
106
|
+
current_help = $('#' + $('#field-type option:selected').val());
|
107
|
+
});
|
108
|
+
}
|
109
|
+
|
110
|
+
// Advanced Publishing Options
|
111
|
+
//hide the options if you click outside of the grey box (needs improving to include the tinymce window)
|
112
|
+
$('#main-form').click(function(e) {
|
113
|
+
//Hide the menus if visible
|
114
|
+
if ($(".show-advanced a.advanced").hasClass('open')) {
|
115
|
+
e.stopPropagation();
|
116
|
+
$("#advanced").stop(true, true).slideUp("fast");
|
117
|
+
$(".show-advanced a.advanced").removeClass("open");
|
118
|
+
}
|
119
|
+
});
|
120
|
+
|
121
|
+
$("#advanced").hide();
|
122
|
+
$("legend.advanced").hide();
|
123
|
+
|
124
|
+
$(".show-advanced").append("<a class='advanced' href='#advanced'>Advanced</a>");
|
125
|
+
|
126
|
+
$(".show-advanced a.advanced").click(
|
127
|
+
function() {
|
128
|
+
if ($(".show-advanced a.advanced").hasClass('open')) {
|
129
|
+
$("#advanced").stop(true, true).slideUp("fast");
|
130
|
+
$(".show-advanced a.advanced").removeClass("open");
|
131
|
+
} else {
|
132
|
+
$("#advanced").stop(true, true).slideDown("fast");
|
133
|
+
$(".show-advanced a.advanced").addClass("open");
|
134
|
+
$(".show-advanced a.advanced.open").fadeIn("fast");
|
135
|
+
}
|
136
|
+
});
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
$('body#assets.index .file').click(function() {
|
144
|
+
document.location = $(this).find("a.show").attr('href');
|
145
|
+
});
|
146
|
+
|
147
|
+
// slot form lightbox, used in nodes cms forms
|
148
|
+
$('a.slot_link').fancybox({
|
149
|
+
'autoScale': false,
|
150
|
+
// 'transitionIn' : 'none',
|
151
|
+
// 'transitionOut' : 'none',
|
152
|
+
'title': false,
|
153
|
+
'centerOnScroll': true,
|
154
|
+
'hideOnOverlayClick': true,
|
155
|
+
'hideOnContentClick': false,
|
156
|
+
'onComplete': Component.fancy_open_slot
|
157
|
+
});
|
158
|
+
|
159
|
+
// Preview
|
160
|
+
preview_link = $('<a class="preview" href="#preview-pane" title="Content Preview">Preview</a>');
|
161
|
+
|
162
|
+
$("body#nodes.show #node_submit").after(preview_link);
|
163
|
+
|
164
|
+
// Using selectors as latest version of webkit does not like binding to objects
|
165
|
+
$('a.preview').fancybox({
|
166
|
+
'autoDimensions': false,
|
167
|
+
'width': '95%',
|
168
|
+
'height': '95%'
|
169
|
+
});
|
170
|
+
$('a.preview').click(get_preview_html);
|
171
|
+
// Original code
|
172
|
+
// preview_link.fancybox({
|
173
|
+
// 'autoDimensions' : false,
|
174
|
+
// 'width' : '95%',
|
175
|
+
// 'height' : '95%'
|
176
|
+
// });
|
177
|
+
// preview_link.click(get_preview_html);
|
178
|
+
// Change the component
|
179
|
+
$('select.component-selector').bind('change', open_component_form);
|
180
|
+
|
181
|
+
// Set up table
|
182
|
+
initComponentTable();
|
183
|
+
|
184
|
+
// Set up multi files
|
185
|
+
// Hide the last multi file li which is empty and used as a template
|
186
|
+
$('li.multi-file:last-child').hide();
|
187
|
+
// Hide the file details elements
|
188
|
+
$('li.multi-file .file-form').hide();
|
189
|
+
// Make them sortable
|
190
|
+
$('.multi-file-files ol').sortable({
|
191
|
+
axis: 'y',
|
192
|
+
handle: 'img'
|
193
|
+
});
|
194
|
+
|
195
|
+
// Add emptys div for browsers/preview
|
196
|
+
$('body').append('<div style="display:none;"><div id="asset-browser"></div><div id="tree-browser"></div><div id="preview-pane"><iframe name="preview-frame" src="about:blank"/></div></div>');
|
197
|
+
});
|
198
|
+
|
199
|
+
function get_preview_html(e) {
|
200
|
+
preview_params = $('div#content form').serializeArray();
|
201
|
+
var preview_form = $("<form>").attr("method", "post").attr("sytle", "display:none;").attr("target", "preview-frame").attr("action", $('div#content form').attr('action') + "/preview");
|
202
|
+
$.each(preview_params, function(i, element) {
|
203
|
+
if (element.name != '_method') {
|
204
|
+
$("<input type='hidden'>").attr("name", element.name).attr("value", element.value).appendTo(preview_form);
|
205
|
+
}
|
206
|
+
});
|
207
|
+
preview_form.appendTo("body");
|
208
|
+
preview_form.submit();
|
209
|
+
preview_form.remove();
|
210
|
+
};
|
211
|
+
|
212
|
+
function initComponentTable() {
|
213
|
+
// Mark slots that have content as filled
|
214
|
+
$('table.component-table td a').each(function(i, link) {
|
215
|
+
target = '#' + this.href.split('#').pop();
|
216
|
+
if ($(target + ' .component_form_detail').text().replace(/[\s\t]/g, '') != "") {
|
217
|
+
$(this).addClass('filled');
|
218
|
+
}
|
219
|
+
});
|
220
|
+
}
|
221
|
+
|
222
|
+
var Node = {
|
223
|
+
id: function() {
|
224
|
+
return $('form#node-form').attr('action').split('/').pop();
|
225
|
+
}
|
226
|
+
};
|
227
|
+
|
228
|
+
var Component = {
|
229
|
+
last_slot_index: 0,
|
230
|
+
last_slot_type: null,
|
231
|
+
last_component_type: null,
|
232
|
+
set_slot: function(select_tag) {
|
233
|
+
target = $(select_tag);
|
234
|
+
Component.last_component_type = target.val();
|
235
|
+
Component.last_slot_type = target.attr('id').replace(/([^_]+)_slot_\d+_type/i, "$1");
|
236
|
+
Component.last_slot_index = target.attr('id').replace(/[^_]+_slot_(\d+)_type/i, "$1");
|
237
|
+
},
|
238
|
+
fancy_open_slot: function(args) {
|
239
|
+
Component.open_slot(args[0]);
|
240
|
+
},
|
241
|
+
open_slot: function(slot_link) {
|
242
|
+
Component.slot_form_id = '#' + $(slot_link).attr('href').split('#').pop();
|
243
|
+
Component.slot_form = $(Component.slot_form_id);
|
244
|
+
Component.slot_reset = Component.slot_form.clone();
|
245
|
+
|
246
|
+
//trigger load events attached to any textareas (tinymce)
|
247
|
+
Component.slot_reset.find('textarea.lite-editor').tinymce(lite_tiny_mce_config);
|
248
|
+
},
|
249
|
+
reopen_slot: function(e) {
|
250
|
+
// reopen the last form
|
251
|
+
$.fancybox({
|
252
|
+
'href': Component.slot_form_id,
|
253
|
+
'onComplete': function(){ $(Component.slot_form_id + ' textarea.lite-editor').tinymce(lite_tiny_mce_config); }
|
254
|
+
});
|
255
|
+
},
|
256
|
+
reset_slot: function(e) {
|
257
|
+
$.fancybox.close();
|
258
|
+
Component.slot_form.replaceWith(Component.slot_reset.clone());
|
259
|
+
|
260
|
+
// Reset
|
261
|
+
Component.slot_form = $(Component.slot_form_id);
|
262
|
+
|
263
|
+
// Make file selectors sortable
|
264
|
+
Component.slot_form.find('.multi-file-files ol').sortable({
|
265
|
+
axis: 'y',
|
266
|
+
handle: 'img'
|
267
|
+
});
|
268
|
+
Component.slot_form.find('select.component-selector').bind('change', open_component_form);
|
269
|
+
|
270
|
+
$('#' + Component.last_slot_type + '_slot_' + Component.last_slot_index + '_tag').html(Component.slot_form.find('select.component-selector').val());
|
271
|
+
return false;
|
272
|
+
},
|
273
|
+
add_asset: function(asset_id) {
|
274
|
+
file_form = Component.slot_form.find('.multi-file:last').first().clone();
|
275
|
+
file_form.prepend(Browser.assets_to_add_html[asset_id]);
|
276
|
+
file_form.find('.asset_id').val(asset_id);
|
277
|
+
Component.slot_form.find('.multi-file-files ol li:last').before(file_form); // Before the last as the last is the hidden emtpty
|
278
|
+
file_form.show();
|
279
|
+
// Hide the file details elements
|
280
|
+
Component.slot_form.find('li.multi-file .file-form').hide();
|
281
|
+
},
|
282
|
+
add_all_assets: function() {
|
283
|
+
$.each(Browser.assets_to_add, function(i, asset_id){
|
284
|
+
Component.add_asset(asset_id);
|
285
|
+
});
|
286
|
+
Component.reopen_slot();
|
287
|
+
}
|
288
|
+
};
|
289
|
+
|
290
|
+
var Browser = {
|
291
|
+
assets_to_add: [],
|
292
|
+
assets_to_add_html: [],
|
293
|
+
allowed_types: [],
|
294
|
+
mode: 'single', // Single or Multi
|
295
|
+
set_opener: function(opening_tag) {
|
296
|
+
Browser.opener = opening_tag;
|
297
|
+
types_text = Browser.opener.siblings('.types').text();
|
298
|
+
if (types_text && types_text.length > 0) {
|
299
|
+
Browser.allowed_types = types_text.toLowerCase().split(', ');
|
300
|
+
} else {
|
301
|
+
Browser.allowed_types = [];
|
302
|
+
}
|
303
|
+
},
|
304
|
+
toggle_added_asset: function(id) {
|
305
|
+
id_in_array = Browser.assets_to_add.indexOf(id);
|
306
|
+
if (id_in_array == -1) {
|
307
|
+
Browser.assets_to_add.push(id);
|
308
|
+
Browser.assets_to_add_html[id] = $('#asset-' + asset_id ).clone();
|
309
|
+
} else {
|
310
|
+
Browser.assets_to_add.splice(id_in_array,1);
|
311
|
+
Browser.assets_to_add_html.splice(id_in_array,1);
|
312
|
+
}
|
313
|
+
if (Browser.mode == 'single') {
|
314
|
+
Browser.do_action_and_close();
|
315
|
+
}
|
316
|
+
},
|
317
|
+
toggle_from_link: function(e) {
|
318
|
+
// Get the id from the href
|
319
|
+
asset_id = $(this).siblings('a.show').attr('href').split('?')[0].split('/').pop();
|
320
|
+
$(this).toggleClass('selected');
|
321
|
+
Browser.toggle_added_asset(asset_id);
|
322
|
+
return false;
|
323
|
+
},
|
324
|
+
attach_asset: function() {
|
325
|
+
asset_id = Browser.assets_to_add[0];
|
326
|
+
if (asset_id) {
|
327
|
+
// Remove the current
|
328
|
+
$(Browser.opener).closest('.file-selectable').find('.file-detail').remove();
|
329
|
+
// Set the detail
|
330
|
+
$(Browser.opener).closest('.file-selectable').prepend(Browser.assets_to_add_html[asset_id]);
|
331
|
+
// Stick it in the asset_id
|
332
|
+
$(Browser.opener).closest('.file-selectable').find('.asset_id').val(asset_id);
|
333
|
+
}
|
334
|
+
return false;
|
335
|
+
},
|
336
|
+
close: function() {
|
337
|
+
Browser.before_close();
|
338
|
+
$('#asset-browser').removeClass(Browser.mode);
|
339
|
+
Browser.assets_to_add = [];
|
340
|
+
Browser.allowed_types = [];
|
341
|
+
Browser.mode = 'single';
|
342
|
+
Browser.after_close();
|
343
|
+
// Reset callbacks
|
344
|
+
Browser.before_close = $.noop;
|
345
|
+
Browser.after_close = $.noop;
|
346
|
+
return false;
|
347
|
+
},
|
348
|
+
open: function() {
|
349
|
+
// open asset lightbox
|
350
|
+
action = '/';
|
351
|
+
if (Browser.allowed_types.length > 0) {
|
352
|
+
action += Browser.allowed_types[0];
|
353
|
+
}
|
354
|
+
$.get("/admin/assets" + action, {
|
355
|
+
allowed_types: Browser.allowed_types,
|
356
|
+
mode: Browser.mode,
|
357
|
+
readonly:true
|
358
|
+
},
|
359
|
+
function() {
|
360
|
+
// reopen the opening form if you close this form
|
361
|
+
$.fancybox({
|
362
|
+
href: '#asset-browser',
|
363
|
+
onClosed: Browser.close
|
364
|
+
});
|
365
|
+
$('#asset-browser').addClass(Browser.mode);
|
366
|
+
},
|
367
|
+
'script');
|
368
|
+
|
369
|
+
return false;
|
370
|
+
},
|
371
|
+
after_ajax: function() {
|
372
|
+
if (Browser.mode == 'multi') {
|
373
|
+
$.each(Browser.assets_to_add, function(i, asset_id){
|
374
|
+
$('#asset-' + asset_id).siblings('a.add').addClass('selected');
|
375
|
+
});
|
376
|
+
}
|
377
|
+
},
|
378
|
+
do_action_and_close: function() {
|
379
|
+
Browser.action();
|
380
|
+
Browser.close();
|
381
|
+
},
|
382
|
+
// Callback stubs to be overridden
|
383
|
+
before_close: $.noop,
|
384
|
+
after_close: $.noop,
|
385
|
+
action: $.noop
|
386
|
+
};
|
387
|
+
|
388
|
+
function open_component_form(e) {
|
389
|
+
Component.set_slot(e.target);
|
390
|
+
|
391
|
+
form_detail = $(e.target).closest('div.component_form').find('.component_form_detail');
|
392
|
+
|
393
|
+
// Set the slot to nil to clear on save
|
394
|
+
form_detail.html('<input name="node[' + Component.last_slot_type + '_slot_' + Component.last_slot_index + ']" type="hidden" value=""/>');
|
395
|
+
|
396
|
+
table_cell = $("table.component-table td a[href$='" + Component.slot_form_id + "']");
|
397
|
+
|
398
|
+
if (Component.last_component_type == '') {
|
399
|
+
$('#' + Component.last_slot_type + '_slot_' + Component.last_slot_index + '_tag').html('');
|
400
|
+
// Mark table cell as filled
|
401
|
+
table_cell.removeClass('filled');
|
402
|
+
return;
|
403
|
+
}
|
404
|
+
table_cell.addClass('filled');
|
405
|
+
|
406
|
+
prefix = target.attr('id').replace(/([^_]+_slot_\d+)_type/i, "$1");
|
407
|
+
|
408
|
+
// get module html
|
409
|
+
$.get('/admin/components/form/' + Component.last_component_type.toLowerCase().replace(/\s/g, '_'), {
|
410
|
+
slot: Component.last_slot_type + '_slot_' + Component.last_slot_index
|
411
|
+
},
|
412
|
+
function(data) {
|
413
|
+
form_detail.html(data);
|
414
|
+
$('#' + Component.last_slot_type + '_slot_' + Component.last_slot_index + '_tag').html(Component.last_component_type);
|
415
|
+
Component.slot_form.find('li.multi-file').last().hide();
|
416
|
+
Component.slot_form.find('textarea.lite-editor').tinymce(lite_tiny_mce_config);
|
417
|
+
});
|
418
|
+
};
|
419
|
+
|
420
|
+
function clear_component_form(e) {
|
421
|
+
slot_form = $(e.target).closest('div.component_form');
|
422
|
+
select_tag = slot_form.find('select.component-selector');
|
423
|
+
select_tag.val('');
|
424
|
+
select_tag.trigger('change');
|
425
|
+
$.fancybox.close();
|
426
|
+
//remove filled indicator
|
427
|
+
$("table.component-table td a[href$='#" + slot_form.attr('id') + "']").removeClass('filled');
|
428
|
+
}
|
429
|
+
|
430
|
+
function detach_asset_browser_image(event) {
|
431
|
+
form_detail = $(event.target).closest('.component_form_detail');
|
432
|
+
|
433
|
+
if (form_detail.find('input.asset_id').size() > 2) {
|
434
|
+
//remove this one
|
435
|
+
} else {
|
436
|
+
|
437
|
+
}
|
438
|
+
}
|
439
|
+
|
440
|
+
|
441
|
+
// LIVE ELEMENTS
|
442
|
+
// Comment delete buttons
|
443
|
+
$('table.comments a.delete').live('click', function() {
|
444
|
+
if (confirm('Are you sure you wish to delete this comment?')) {
|
445
|
+
$.ajax({
|
446
|
+
url: $(this).attr('href'),
|
447
|
+
type: 'DELETE',
|
448
|
+
contentType: 'text/javascript'
|
449
|
+
});
|
450
|
+
}
|
451
|
+
return false;
|
452
|
+
});
|
453
|
+
|
454
|
+
// the button at the bottom of ever component lightbox that does the same thing as the lightbox close button
|
455
|
+
$('.form-save').live('click', $.fancybox.close);
|
456
|
+
|
457
|
+
// the button at the bottom of every component lightbox that clears component
|
458
|
+
$('.form-reset').live('click', Component.reset_slot);
|
459
|
+
|
460
|
+
// the button at the bottom of every component lightbox that clears component
|
461
|
+
$('.form-delete').live('click', clear_component_form);
|
462
|
+
|
463
|
+
// Cancel button
|
464
|
+
$('#asset-browser li.cancel a').live('click', Browser.close);
|
465
|
+
|
466
|
+
// Action button
|
467
|
+
$('#asset-browser li.action a').live('click', Browser.do_action_and_close);
|
468
|
+
|
469
|
+
// Open the file select
|
470
|
+
$('span.select-file').live('click', function(event) {
|
471
|
+
Browser.set_opener($(this));
|
472
|
+
Browser.action = Browser.attach_asset;
|
473
|
+
Browser.open();
|
474
|
+
});
|
475
|
+
// After close the file select in component form reopen slot form
|
476
|
+
$('.component_form span.select-file').live('click', function(event) {
|
477
|
+
Browser.after_close = Component.reopen_slot;
|
478
|
+
});
|
479
|
+
|
480
|
+
// Open the file select for multi file component
|
481
|
+
$('.add-multi-asset').live('click', function(event) {
|
482
|
+
Browser.mode = 'multi';
|
483
|
+
Browser.set_opener($(this));
|
484
|
+
Browser.action = Component.add_all_assets;
|
485
|
+
Browser.after_close = Component.reopen_slot;
|
486
|
+
Browser.open();
|
487
|
+
});
|
488
|
+
|
489
|
+
// Mark an asset to be added an asset into the component
|
490
|
+
$('#asset-browser a.add').live('click', Browser.toggle_from_link);
|
491
|
+
|
492
|
+
// Remove multi file
|
493
|
+
$('li.multi-file span.done').live('click', function(e) {
|
494
|
+
$(this).closest('.multi-file').find('.file-form').hide();
|
495
|
+
});
|
496
|
+
|
497
|
+
$('li.multi-file span.edit').live('click', function(e) {
|
498
|
+
$(this).closest('.multi-file').find('.file-form').toggle();
|
499
|
+
});
|
500
|
+
|
501
|
+
$("li.multi-file span.delete").live("click", function(e) {
|
502
|
+
$(this).closest('li.multi-file').remove();
|
503
|
+
});
|
504
|
+
|
505
|
+
// Node mover and shaker
|
506
|
+
$('span.node-mover, #parent-title').live('click', function(event) {
|
507
|
+
node_id = $(this).closest('form').attr('action').split('/').pop();
|
508
|
+
// open asset lightbox
|
509
|
+
$.get("/admin/nodes/tree", {
|
510
|
+
allowed_types: $('#parent_types').val().split(','),
|
511
|
+
not_branch: node_id
|
512
|
+
},
|
513
|
+
function() {
|
514
|
+
// reopen the opening form if you close this form
|
515
|
+
$.fancybox({
|
516
|
+
href: '#tree-browser',
|
517
|
+
title: "Select a parent"
|
518
|
+
});
|
519
|
+
$('#tree-browser').attr('class', 'parent');
|
520
|
+
$('#tree-browser .tree:first').append('<li><a id="id-none">Root</a></li>');
|
521
|
+
},
|
522
|
+
'script');
|
523
|
+
|
524
|
+
event.stopImmediatePropagation();
|
525
|
+
return false;
|
526
|
+
});
|
527
|
+
|
528
|
+
$('#tree-browser ol.tree span.expand').live('click', function(e) {
|
529
|
+
$(this).toggleClass('expanded').siblings('ol.tree').toggle();
|
530
|
+
});
|
531
|
+
|
532
|
+
$('#tree-browser.parent a').live('click', function(e) {
|
533
|
+
id = this.id.replace('id-', '');
|
534
|
+
$('#node_parent').val(id);
|
535
|
+
$('#parent-title').html($(this).text() + '<a class="edit-item">Edit</a>');
|
536
|
+
$.fancybox.close();
|
537
|
+
return false;
|
538
|
+
});
|
539
|
+
|
540
|
+
// Node Linker
|
541
|
+
$('span.link-node').live('click', function(event) {
|
542
|
+
Component.link_input = $(this).siblings('input').first();
|
543
|
+
// open asset lightbox
|
544
|
+
$.get("/admin/nodes/tree", function() {
|
545
|
+
// reopen the opening form if you close this form
|
546
|
+
$.fancybox({
|
547
|
+
href: '#tree-browser',
|
548
|
+
title: "Link to content"
|
549
|
+
});
|
550
|
+
$('#tree-browser').attr('class', 'link');
|
551
|
+
},
|
552
|
+
'script');
|
553
|
+
|
554
|
+
event.stopImmediatePropagation();
|
555
|
+
return false;
|
556
|
+
});
|
557
|
+
|
558
|
+
$('#tree-browser.link a').live('click', function(e) {
|
559
|
+
$(Component.link_input).val($(this).attr('href'));
|
560
|
+
Component.reopen_slot();
|
561
|
+
return false;
|
562
|
+
});
|
563
|
+
|
564
|
+
// Asset Linker
|
565
|
+
$('span.link-asset').live('click', {readonly:true}, function(event) {
|
566
|
+
Component.link_input = $(this).siblings('input').first();
|
567
|
+
Component.allowed_types = [];
|
568
|
+
// open asset lightbox
|
569
|
+
$.get("/admin/assets", function() {
|
570
|
+
// reopen the opening form if you close this form
|
571
|
+
$.fancybox({
|
572
|
+
href: '#asset-browser'
|
573
|
+
});
|
574
|
+
$('#asset-browser').attr('class', 'link');
|
575
|
+
},
|
576
|
+
'script');
|
577
|
+
|
578
|
+
event.stopImmediatePropagation();
|
579
|
+
return false;
|
580
|
+
});
|
581
|
+
|
582
|
+
$('#asset-browser.link a.add').live('click', function(e) {
|
583
|
+
$(Component.link_input).val($(this).attr('href'));
|
584
|
+
Component.reopen_slot();
|
585
|
+
return false;
|
586
|
+
});
|
@@ -0,0 +1,30 @@
|
|
1
|
+
function tagsAutocomplete() {
|
2
|
+
$.get('/admin/assets/tags.json', function(data) {
|
3
|
+
$("input#asset_tag_list").autocomplete({
|
4
|
+
minLength: 0,
|
5
|
+
source: function(request, response) {
|
6
|
+
// delegate back to autocomplete, but extract the last term
|
7
|
+
response($.ui.autocomplete.filter(data, request.term.split(/,\s*/).pop()));
|
8
|
+
},
|
9
|
+
focus: function() {
|
10
|
+
// prevent value inserted on focus
|
11
|
+
return false;
|
12
|
+
},
|
13
|
+
select: function(event, ui) {
|
14
|
+
var terms = this.value.split(/,\s*/);
|
15
|
+
// remove the current input
|
16
|
+
terms.pop();
|
17
|
+
// add the selected item
|
18
|
+
terms.push( ui.item.value );
|
19
|
+
// add placeholder to get the comma-and-space at the end
|
20
|
+
terms.push("");
|
21
|
+
this.value = terms.join(", ");
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
});
|
25
|
+
});
|
26
|
+
}
|
27
|
+
|
28
|
+
$(function() {
|
29
|
+
tagsAutocomplete();
|
30
|
+
});
|