locomotive_cms 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +45 -0
- data/README.textile +23 -0
- data/app/controllers/admin/accounts_controller.rb +24 -0
- data/app/controllers/admin/asset_collections_controller.rb +66 -0
- data/app/controllers/admin/assets_controller.rb +48 -0
- data/app/controllers/admin/base_controller.rb +55 -0
- data/app/controllers/admin/content_types_controller.rb +52 -0
- data/app/controllers/admin/contents_controller.rb +72 -0
- data/app/controllers/admin/current_sites_controller.rb +33 -0
- data/app/controllers/admin/layouts_controller.rb +56 -0
- data/app/controllers/admin/memberships_controller.rb +39 -0
- data/app/controllers/admin/my_accounts_controller.rb +21 -0
- data/app/controllers/admin/page_parts_controller.rb +12 -0
- data/app/controllers/admin/pages_controller.rb +70 -0
- data/app/controllers/admin/passwords_controller.rb +11 -0
- data/app/controllers/admin/rendering_controller.rb +15 -0
- data/app/controllers/admin/sessions_controller.rb +17 -0
- data/app/controllers/admin/sites_controller.rb +48 -0
- data/app/controllers/admin/snippets_controller.rb +56 -0
- data/app/controllers/admin/theme_assets_controller.rb +79 -0
- data/app/controllers/application_controller.rb +3 -0
- data/app/controllers/home_controller.rb +7 -0
- data/app/helpers/admin/accounts_helper.rb +8 -0
- data/app/helpers/admin/assets_helper.rb +15 -0
- data/app/helpers/admin/base_helper.rb +54 -0
- data/app/helpers/admin/custom_fields_helper.rb +24 -0
- data/app/helpers/admin/login_helper.rb +17 -0
- data/app/helpers/admin/pages_helper.rb +23 -0
- data/app/helpers/admin/sites_helper.rb +24 -0
- data/app/models/account.rb +46 -0
- data/app/models/asset.rb +38 -0
- data/app/models/asset_collection.rb +60 -0
- data/app/models/content_instance.rb +29 -0
- data/app/models/content_type.rb +63 -0
- data/app/models/extensions/asset/vignette.rb +40 -0
- data/app/models/extensions/page/parts.rb +54 -0
- data/app/models/extensions/page/render.rb +19 -0
- data/app/models/extensions/page/tree.rb +97 -0
- data/app/models/layout.rb +49 -0
- data/app/models/liquid_template.rb +32 -0
- data/app/models/membership.rb +36 -0
- data/app/models/page.rb +87 -0
- data/app/models/page_part.rb +38 -0
- data/app/models/site.rb +93 -0
- data/app/models/snippet.rb +3 -0
- data/app/models/theme_asset.rb +101 -0
- data/app/uploaders/asset_uploader.rb +68 -0
- data/app/uploaders/theme_asset_uploader.rb +42 -0
- data/app/views/admin/accounts/new.html.haml +22 -0
- data/app/views/admin/asset_collections/_asset.html.haml +7 -0
- data/app/views/admin/asset_collections/edit.html.haml +30 -0
- data/app/views/admin/asset_collections/index.html.haml +8 -0
- data/app/views/admin/asset_collections/new.html.haml +17 -0
- data/app/views/admin/assets/_form.html.haml +18 -0
- data/app/views/admin/assets/edit.html.haml +15 -0
- data/app/views/admin/assets/new.html.haml +12 -0
- data/app/views/admin/content_types/_form.html.haml +13 -0
- data/app/views/admin/content_types/edit.html.haml +16 -0
- data/app/views/admin/content_types/new.html.haml +15 -0
- data/app/views/admin/contents/_form.html.haml +10 -0
- data/app/views/admin/contents/edit.html.haml +16 -0
- data/app/views/admin/contents/index.html.haml +35 -0
- data/app/views/admin/contents/new.html.haml +15 -0
- data/app/views/admin/current_sites/_form.html.haml +45 -0
- data/app/views/admin/current_sites/edit.html.haml +15 -0
- data/app/views/admin/layouts/_form.html.haml +10 -0
- data/app/views/admin/layouts/_layout.html.haml +7 -0
- data/app/views/admin/layouts/edit.html.haml +18 -0
- data/app/views/admin/layouts/index.html.haml +15 -0
- data/app/views/admin/layouts/new.html.haml +15 -0
- data/app/views/admin/memberships/new.html.haml +15 -0
- data/app/views/admin/my_accounts/edit.html.haml +42 -0
- data/app/views/admin/pages/_form.html.haml +37 -0
- data/app/views/admin/pages/_page.html.haml +16 -0
- data/app/views/admin/pages/edit.html.haml +15 -0
- data/app/views/admin/pages/index.html.haml +18 -0
- data/app/views/admin/pages/new.html.haml +12 -0
- data/app/views/admin/passwords/edit.html.haml +18 -0
- data/app/views/admin/passwords/new.html.haml +17 -0
- data/app/views/admin/sessions/new.html.haml +15 -0
- data/app/views/admin/shared/_custom_fields.html.haml +47 -0
- data/app/views/admin/shared/_footer.html.haml +5 -0
- data/app/views/admin/shared/_form_actions.html.haml +15 -0
- data/app/views/admin/shared/_head.html.haml +18 -0
- data/app/views/admin/shared/_header.html.haml +8 -0
- data/app/views/admin/shared/_menu.html.haml +5 -0
- data/app/views/admin/shared/menu/_assets.html.haml +7 -0
- data/app/views/admin/shared/menu/_contents.html.haml +27 -0
- data/app/views/admin/shared/menu/_settings.html.haml +6 -0
- data/app/views/admin/sites/_form.html.haml +35 -0
- data/app/views/admin/sites/new.html.haml +12 -0
- data/app/views/admin/snippets/_form.html.haml +11 -0
- data/app/views/admin/snippets/_snippet.html.haml +7 -0
- data/app/views/admin/snippets/edit.html.haml +15 -0
- data/app/views/admin/snippets/index.html.haml +15 -0
- data/app/views/admin/snippets/new.html.haml +12 -0
- data/app/views/admin/theme_assets/_asset.html.haml +12 -0
- data/app/views/admin/theme_assets/_form.html.haml +39 -0
- data/app/views/admin/theme_assets/edit.html.haml +15 -0
- data/app/views/admin/theme_assets/images.html.haml +15 -0
- data/app/views/admin/theme_assets/index.html.haml +27 -0
- data/app/views/admin/theme_assets/new.html.haml +12 -0
- data/app/views/devise/confirmations/new.html.haml +12 -0
- data/app/views/devise/mailer/confirmation_instructions.html.haml +8 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +12 -0
- data/app/views/devise/mailer/unlock_instructions.html.haml +10 -0
- data/app/views/devise/registrations/edit.html.haml +35 -0
- data/app/views/devise/registrations/new.html.haml +20 -0
- data/app/views/devise/sessions/new.html.haml +22 -0
- data/app/views/devise/shared/_links.haml +20 -0
- data/app/views/devise/unlocks/new.html.haml +12 -0
- data/app/views/home/show.html.haml +4 -0
- data/app/views/layouts/admin/application.html.haml +26 -0
- data/app/views/layouts/admin/login.html.haml +17 -0
- data/app/views/layouts/application.html.haml +7 -0
- data/config/application.rb +48 -0
- data/config/boot.rb +17 -0
- data/config/cucumber.yml +8 -0
- data/config/database.yml +20 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +35 -0
- data/config/environments/production.rb +33 -0
- data/config/environments/test.rb +33 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/carrierwave.rb +57 -0
- data/config/initializers/devise.rb +119 -0
- data/config/initializers/formtastic.rb +5 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/locomotive.rb +7 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/mongoid.rb +61 -0
- data/config/initializers/rspec_generator.rb +8 -0
- data/config/locales/admin_ui_en.yml +211 -0
- data/config/locales/admin_ui_fr.yml +21 -0
- data/config/locales/carrierwave_en.yml +4 -0
- data/config/locales/carrierwave_fr.yml +4 -0
- data/config/locales/default_en.yml +29 -0
- data/config/locales/default_fr.yml +30 -0
- data/config/locales/devise.en.yml +36 -0
- data/config/routes.rb +57 -0
- data/lib/core_ext.rb +32 -0
- data/lib/generators/locomotive_generator.rb +14 -0
- data/lib/locomotive.rb +35 -0
- data/lib/locomotive/configuration.rb +67 -0
- data/lib/locomotive/devise/sessions_controller.rb +2 -0
- data/lib/locomotive/engine.rb +21 -0
- data/lib/locomotive/liquid.rb +5 -0
- data/lib/locomotive/liquid/db_file_system.rb +18 -0
- data/lib/locomotive/liquid/drops/asset_collections.rb +19 -0
- data/lib/locomotive/liquid/drops/base.rb +50 -0
- data/lib/locomotive/liquid/drops/content.rb +19 -0
- data/lib/locomotive/liquid/drops/contents.rb +63 -0
- data/lib/locomotive/liquid/drops/javascripts.rb +18 -0
- data/lib/locomotive/liquid/drops/stylesheets.rb +19 -0
- data/lib/locomotive/liquid/filters/date.rb +30 -0
- data/lib/locomotive/liquid/filters/html.rb +114 -0
- data/lib/locomotive/liquid/filters/misc.rb +30 -0
- data/lib/locomotive/liquid/liquify_template.rb +57 -0
- data/lib/locomotive/liquid/tags/blueprint.rb +21 -0
- data/lib/locomotive/liquid/tags/jquery.rb +17 -0
- data/lib/locomotive/liquid/tags/paginate.rb +100 -0
- data/lib/locomotive/liquid/tags/snippet.rb +42 -0
- data/lib/locomotive/liquid/tags/with_scope.rb +39 -0
- data/lib/locomotive/mongoid.rb +2 -0
- data/lib/locomotive/mongoid/document.rb +20 -0
- data/lib/locomotive/mongoid/model_extensions.rb +1 -0
- data/lib/locomotive/patches.rb +2 -0
- data/lib/locomotive/regexps.rb +13 -0
- data/lib/locomotive/render.rb +59 -0
- data/lib/locomotive/routing/default_constraint.rb +45 -0
- data/lib/locomotive/routing/site_dispatcher.rb +48 -0
- data/lib/misc_form_builder.rb +35 -0
- data/lib/tasks/cucumber.rake +53 -0
- data/lib/tasks/rspec.rake +69 -0
- data/public/images/admin/background/body.png +0 -0
- data/public/images/admin/background/footer.png +0 -0
- data/public/images/admin/background/light.png +0 -0
- data/public/images/admin/buttons/action-left.png +0 -0
- data/public/images/admin/buttons/action-right.png +0 -0
- data/public/images/admin/buttons/add-left.png +0 -0
- data/public/images/admin/buttons/add-right.png +0 -0
- data/public/images/admin/buttons/dark-gray-left.png +0 -0
- data/public/images/admin/buttons/dark-gray-right.png +0 -0
- data/public/images/admin/buttons/emboss-left.png +0 -0
- data/public/images/admin/buttons/emboss-right.png +0 -0
- data/public/images/admin/buttons/gray-left.png +0 -0
- data/public/images/admin/buttons/gray-right.png +0 -0
- data/public/images/admin/buttons/light-gray-left.png +0 -0
- data/public/images/admin/buttons/light-gray-right.png +0 -0
- data/public/images/admin/buttons/search.png +0 -0
- data/public/images/admin/buttons/transparent-left.png +0 -0
- data/public/images/admin/buttons/transparent-right.png +0 -0
- data/public/images/admin/form/big_item.png +0 -0
- data/public/images/admin/form/error-arrow.png +0 -0
- data/public/images/admin/form/field.png +0 -0
- data/public/images/admin/form/folded-arrow-off.png +0 -0
- data/public/images/admin/form/folded-arrow-on.png +0 -0
- data/public/images/admin/form/folded.png +0 -0
- data/public/images/admin/form/footer.png +0 -0
- data/public/images/admin/form/growl-error.png +0 -0
- data/public/images/admin/form/growl-notice.png +0 -0
- data/public/images/admin/form/header-first-on.png +0 -0
- data/public/images/admin/form/header-left-on.png +0 -0
- data/public/images/admin/form/header-on.png +0 -0
- data/public/images/admin/form/header-right-on.png +0 -0
- data/public/images/admin/form/header.png +0 -0
- data/public/images/admin/form/icons/drag.png +0 -0
- data/public/images/admin/form/icons/spinner.gif +0 -0
- data/public/images/admin/form/icons/trash.png +0 -0
- data/public/images/admin/form/item.png +0 -0
- data/public/images/admin/form/pen.png +0 -0
- data/public/images/admin/icons/filetype/medium/AC3.png +0 -0
- data/public/images/admin/icons/filetype/medium/ACE.png +0 -0
- data/public/images/admin/icons/filetype/medium/ADE.png +0 -0
- data/public/images/admin/icons/filetype/medium/ADP.png +0 -0
- data/public/images/admin/icons/filetype/medium/AI.png +0 -0
- data/public/images/admin/icons/filetype/medium/AIFF.png +0 -0
- data/public/images/admin/icons/filetype/medium/AU.png +0 -0
- data/public/images/admin/icons/filetype/medium/AVI.png +0 -0
- data/public/images/admin/icons/filetype/medium/BAT.png +0 -0
- data/public/images/admin/icons/filetype/medium/BIN.png +0 -0
- data/public/images/admin/icons/filetype/medium/BMP.png +0 -0
- data/public/images/admin/icons/filetype/medium/BUP.png +0 -0
- data/public/images/admin/icons/filetype/medium/CAB.png +0 -0
- data/public/images/admin/icons/filetype/medium/CAT.png +0 -0
- data/public/images/admin/icons/filetype/medium/CHM.png +0 -0
- data/public/images/admin/icons/filetype/medium/CSS.png +0 -0
- data/public/images/admin/icons/filetype/medium/CUE.png +0 -0
- data/public/images/admin/icons/filetype/medium/DAT.png +0 -0
- data/public/images/admin/icons/filetype/medium/DCR.png +0 -0
- data/public/images/admin/icons/filetype/medium/DER.png +0 -0
- data/public/images/admin/icons/filetype/medium/DIC.png +0 -0
- data/public/images/admin/icons/filetype/medium/DIVX.png +0 -0
- data/public/images/admin/icons/filetype/medium/DIZ.png +0 -0
- data/public/images/admin/icons/filetype/medium/DLL.png +0 -0
- data/public/images/admin/icons/filetype/medium/DOC.png +0 -0
- data/public/images/admin/icons/filetype/medium/DOCX.png +0 -0
- data/public/images/admin/icons/filetype/medium/DOS.png +0 -0
- data/public/images/admin/icons/filetype/medium/DVD.png +0 -0
- data/public/images/admin/icons/filetype/medium/DWG.png +0 -0
- data/public/images/admin/icons/filetype/medium/DWT.png +0 -0
- data/public/images/admin/icons/filetype/medium/EMF.png +0 -0
- data/public/images/admin/icons/filetype/medium/EXC.png +0 -0
- data/public/images/admin/icons/filetype/medium/FON.png +0 -0
- data/public/images/admin/icons/filetype/medium/GIF.png +0 -0
- data/public/images/admin/icons/filetype/medium/HLP.png +0 -0
- data/public/images/admin/icons/filetype/medium/HTML.png +0 -0
- data/public/images/admin/icons/filetype/medium/IFO.png +0 -0
- data/public/images/admin/icons/filetype/medium/INF.png +0 -0
- data/public/images/admin/icons/filetype/medium/INI.png +0 -0
- data/public/images/admin/icons/filetype/medium/INS.png +0 -0
- data/public/images/admin/icons/filetype/medium/IP.png +0 -0
- data/public/images/admin/icons/filetype/medium/ISO.png +0 -0
- data/public/images/admin/icons/filetype/medium/ISP.png +0 -0
- data/public/images/admin/icons/filetype/medium/JAVA.png +0 -0
- data/public/images/admin/icons/filetype/medium/JFIF.png +0 -0
- data/public/images/admin/icons/filetype/medium/JPEG.png +0 -0
- data/public/images/admin/icons/filetype/medium/JPG.png +0 -0
- data/public/images/admin/icons/filetype/medium/LOG.png +0 -0
- data/public/images/admin/icons/filetype/medium/M4A.png +0 -0
- data/public/images/admin/icons/filetype/medium/MID.png +0 -0
- data/public/images/admin/icons/filetype/medium/MMF.png +0 -0
- data/public/images/admin/icons/filetype/medium/MMM.png +0 -0
- data/public/images/admin/icons/filetype/medium/MOV.png +0 -0
- data/public/images/admin/icons/filetype/medium/MOVIE.png +0 -0
- data/public/images/admin/icons/filetype/medium/MP2.png +0 -0
- data/public/images/admin/icons/filetype/medium/MP2V.png +0 -0
- data/public/images/admin/icons/filetype/medium/MP3.png +0 -0
- data/public/images/admin/icons/filetype/medium/MP4.png +0 -0
- data/public/images/admin/icons/filetype/medium/MPE.png +0 -0
- data/public/images/admin/icons/filetype/medium/MPEG.png +0 -0
- data/public/images/admin/icons/filetype/medium/MPG.png +0 -0
- data/public/images/admin/icons/filetype/medium/MPV2.png +0 -0
- data/public/images/admin/icons/filetype/medium/NFO.png +0 -0
- data/public/images/admin/icons/filetype/medium/PDD.png +0 -0
- data/public/images/admin/icons/filetype/medium/PDF.png +0 -0
- data/public/images/admin/icons/filetype/medium/PHP.png +0 -0
- data/public/images/admin/icons/filetype/medium/PNG.png +0 -0
- data/public/images/admin/icons/filetype/medium/PPT.png +0 -0
- data/public/images/admin/icons/filetype/medium/PPTX.png +0 -0
- data/public/images/admin/icons/filetype/medium/PSD.png +0 -0
- data/public/images/admin/icons/filetype/medium/RAR.png +0 -0
- data/public/images/admin/icons/filetype/medium/REG.png +0 -0
- data/public/images/admin/icons/filetype/medium/RTF.png +0 -0
- data/public/images/admin/icons/filetype/medium/SCP.png +0 -0
- data/public/images/admin/icons/filetype/medium/THEME.png +0 -0
- data/public/images/admin/icons/filetype/medium/TIF.png +0 -0
- data/public/images/admin/icons/filetype/medium/TIFF.png +0 -0
- data/public/images/admin/icons/filetype/medium/TLB.png +0 -0
- data/public/images/admin/icons/filetype/medium/TTF.png +0 -0
- data/public/images/admin/icons/filetype/medium/TXT.png +0 -0
- data/public/images/admin/icons/filetype/medium/Thumbs.db +0 -0
- data/public/images/admin/icons/filetype/medium/UIS.png +0 -0
- data/public/images/admin/icons/filetype/medium/URL.png +0 -0
- data/public/images/admin/icons/filetype/medium/VBS.png +0 -0
- data/public/images/admin/icons/filetype/medium/VCR.png +0 -0
- data/public/images/admin/icons/filetype/medium/VOB.png +0 -0
- data/public/images/admin/icons/filetype/medium/WAV.png +0 -0
- data/public/images/admin/icons/filetype/medium/WBA.png +0 -0
- data/public/images/admin/icons/filetype/medium/WMA.png +0 -0
- data/public/images/admin/icons/filetype/medium/WMV.png +0 -0
- data/public/images/admin/icons/filetype/medium/WPL.png +0 -0
- data/public/images/admin/icons/filetype/medium/WRI.png +0 -0
- data/public/images/admin/icons/filetype/medium/WTX.png +0 -0
- data/public/images/admin/icons/filetype/medium/XLS.png +0 -0
- data/public/images/admin/icons/filetype/medium/XLSX.png +0 -0
- data/public/images/admin/icons/filetype/medium/XML.png +0 -0
- data/public/images/admin/icons/filetype/medium/XSL.png +0 -0
- data/public/images/admin/icons/filetype/medium/ZAP.png +0 -0
- data/public/images/admin/icons/filetype/medium/ZIP.png +0 -0
- data/public/images/admin/icons/filetype/medium/unknown.png +0 -0
- data/public/images/admin/icons/filetype/thumb/AC3.png +0 -0
- data/public/images/admin/icons/filetype/thumb/ACE.png +0 -0
- data/public/images/admin/icons/filetype/thumb/ADE.png +0 -0
- data/public/images/admin/icons/filetype/thumb/ADP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/AI.png +0 -0
- data/public/images/admin/icons/filetype/thumb/AIFF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/AU.png +0 -0
- data/public/images/admin/icons/filetype/thumb/AVI.png +0 -0
- data/public/images/admin/icons/filetype/thumb/BAT.png +0 -0
- data/public/images/admin/icons/filetype/thumb/BIN.png +0 -0
- data/public/images/admin/icons/filetype/thumb/BMP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/BUP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/CAB.png +0 -0
- data/public/images/admin/icons/filetype/thumb/CAT.png +0 -0
- data/public/images/admin/icons/filetype/thumb/CHM.png +0 -0
- data/public/images/admin/icons/filetype/thumb/CSS.png +0 -0
- data/public/images/admin/icons/filetype/thumb/CUE.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DAT.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DCR.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DER.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DIC.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DIVX.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DIZ.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DLL.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DOC.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DOCX.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DOS.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DVD.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DWG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/DWT.png +0 -0
- data/public/images/admin/icons/filetype/thumb/EMF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/EXC.png +0 -0
- data/public/images/admin/icons/filetype/thumb/FON.png +0 -0
- data/public/images/admin/icons/filetype/thumb/GIF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/HLP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/HTML.png +0 -0
- data/public/images/admin/icons/filetype/thumb/IFO.png +0 -0
- data/public/images/admin/icons/filetype/thumb/INF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/INI.png +0 -0
- data/public/images/admin/icons/filetype/thumb/INS.png +0 -0
- data/public/images/admin/icons/filetype/thumb/IP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/ISO.png +0 -0
- data/public/images/admin/icons/filetype/thumb/ISP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/JAVA.png +0 -0
- data/public/images/admin/icons/filetype/thumb/JFIF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/JPEG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/JPG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/LOG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/M4A.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MID.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MMF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MMM.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MOV.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MOVIE.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MP2.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MP2V.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MP3.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MP4.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MPE.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MPEG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MPG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/MPV2.png +0 -0
- data/public/images/admin/icons/filetype/thumb/NFO.png +0 -0
- data/public/images/admin/icons/filetype/thumb/PDD.png +0 -0
- data/public/images/admin/icons/filetype/thumb/PDF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/PHP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/PNG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/PPT.png +0 -0
- data/public/images/admin/icons/filetype/thumb/PPTX.png +0 -0
- data/public/images/admin/icons/filetype/thumb/PSD.png +0 -0
- data/public/images/admin/icons/filetype/thumb/RAR.png +0 -0
- data/public/images/admin/icons/filetype/thumb/REG.png +0 -0
- data/public/images/admin/icons/filetype/thumb/RTF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/SCP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/THEME.png +0 -0
- data/public/images/admin/icons/filetype/thumb/TIF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/TIFF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/TLB.png +0 -0
- data/public/images/admin/icons/filetype/thumb/TTF.png +0 -0
- data/public/images/admin/icons/filetype/thumb/TXT.png +0 -0
- data/public/images/admin/icons/filetype/thumb/UIS.png +0 -0
- data/public/images/admin/icons/filetype/thumb/URL.png +0 -0
- data/public/images/admin/icons/filetype/thumb/VBS.png +0 -0
- data/public/images/admin/icons/filetype/thumb/VCR.png +0 -0
- data/public/images/admin/icons/filetype/thumb/VOB.png +0 -0
- data/public/images/admin/icons/filetype/thumb/WAV.png +0 -0
- data/public/images/admin/icons/filetype/thumb/WBA.png +0 -0
- data/public/images/admin/icons/filetype/thumb/WMA.png +0 -0
- data/public/images/admin/icons/filetype/thumb/WMV.png +0 -0
- data/public/images/admin/icons/filetype/thumb/WPL.png +0 -0
- data/public/images/admin/icons/filetype/thumb/WRI.png +0 -0
- data/public/images/admin/icons/filetype/thumb/WTX.png +0 -0
- data/public/images/admin/icons/filetype/thumb/XLS.png +0 -0
- data/public/images/admin/icons/filetype/thumb/XLSX.png +0 -0
- data/public/images/admin/icons/filetype/thumb/XML.png +0 -0
- data/public/images/admin/icons/filetype/thumb/XSL.png +0 -0
- data/public/images/admin/icons/filetype/thumb/ZAP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/ZIP.png +0 -0
- data/public/images/admin/icons/filetype/thumb/unknown.png +0 -0
- data/public/images/admin/icons/flags/en.png +0 -0
- data/public/images/admin/icons/flags/fr.png +0 -0
- data/public/images/admin/list/empty.png +0 -0
- data/public/images/admin/list/icons/cross.png +0 -0
- data/public/images/admin/list/icons/drag.png +0 -0
- data/public/images/admin/list/icons/node_closed.png +0 -0
- data/public/images/admin/list/icons/node_open.png +0 -0
- data/public/images/admin/list/icons/trash.png +0 -0
- data/public/images/admin/list/item-left.png +0 -0
- data/public/images/admin/list/item-right.png +0 -0
- data/public/images/admin/list/item.png +0 -0
- data/public/images/admin/list/none.png +0 -0
- data/public/images/admin/list/thumb.png +0 -0
- data/public/images/admin/login/bottom_panel_bg.png +0 -0
- data/public/images/admin/login/buttons/left_bg.png +0 -0
- data/public/images/admin/login/buttons/right_bg.png +0 -0
- data/public/images/admin/login/content_panel_bg.png +0 -0
- data/public/images/admin/login/input_bg.png +0 -0
- data/public/images/admin/login/light_bg.png +0 -0
- data/public/images/admin/login/top_panel_bg.png +0 -0
- data/public/images/admin/login/wrapper_bg.png +0 -0
- data/public/images/admin/menu/arrow.png +0 -0
- data/public/images/admin/menu/blue-bg.png +0 -0
- data/public/images/admin/menu/blue-border.png +0 -0
- data/public/images/admin/menu/gray-bg.png +0 -0
- data/public/images/admin/menu/gray-border.png +0 -0
- data/public/images/admin/menu/green-bg.png +0 -0
- data/public/images/admin/menu/green-border.png +0 -0
- data/public/images/admin/menu/icons/add.png +0 -0
- data/public/images/admin/menu/icons/bullet.png +0 -0
- data/public/images/admin/menu/icons/folder.png +0 -0
- data/public/images/admin/menu/icons/settings.png +0 -0
- data/public/images/admin/menu/left.png +0 -0
- data/public/images/admin/menu/popup-body.png +0 -0
- data/public/images/admin/menu/popup-footer.png +0 -0
- data/public/images/admin/menu/popup-header.png +0 -0
- data/public/images/admin/menu/right.png +0 -0
- data/public/images/admin/menu/shadow.png +0 -0
- data/public/images/admin/menu/top-left.png +0 -0
- data/public/images/admin/menu/top.png +0 -0
- data/public/images/admin/nocoffee.gif +0 -0
- data/public/images/admin/plugins/fancybox/blank.gif +0 -0
- data/public/images/admin/plugins/fancybox/fancy_close.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_loading.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_nav_left.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_nav_right.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_e.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_n.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_ne.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_nw.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_s.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_se.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_sw.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_shadow_w.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_title_left.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_title_main.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_title_over.png +0 -0
- data/public/images/admin/plugins/fancybox/fancy_title_right.png +0 -0
- data/public/images/admin/plugins/fancybox/fancybox-x.png +0 -0
- data/public/images/admin/plugins/fancybox/fancybox-y.png +0 -0
- data/public/images/admin/plugins/fancybox/fancybox.png +0 -0
- data/public/images/admin/plugins/toggle_handle-bg.png +0 -0
- data/public/images/admin/plugins/toggle_handle_left-bg.png +0 -0
- data/public/images/admin/plugins/toggle_handle_right-bg.png +0 -0
- data/public/images/admin/plugins/toggle_shadow-bg.png +0 -0
- data/public/images/admin/rails.png +0 -0
- data/public/javascripts/admin/application.js +105 -0
- data/public/javascripts/admin/asset_collections.js +50 -0
- data/public/javascripts/admin/content_types.js +16 -0
- data/public/javascripts/admin/contents.js +17 -0
- data/public/javascripts/admin/custom_fields.js +113 -0
- data/public/javascripts/admin/jquery.js +154 -0
- data/public/javascripts/admin/jquery.ui.js +404 -0
- data/public/javascripts/admin/page_parts.js +83 -0
- data/public/javascripts/admin/pages.js +67 -0
- data/public/javascripts/admin/plugins/codemirror/codemirror.js +469 -0
- data/public/javascripts/admin/plugins/codemirror/editor.js +1465 -0
- data/public/javascripts/admin/plugins/codemirror/highlight.js +68 -0
- data/public/javascripts/admin/plugins/codemirror/mirrorframe.js +81 -0
- data/public/javascripts/admin/plugins/codemirror/parsecss.js +155 -0
- data/public/javascripts/admin/plugins/codemirror/parsedummy.js +32 -0
- data/public/javascripts/admin/plugins/codemirror/parsehtmlmixed.js +74 -0
- data/public/javascripts/admin/plugins/codemirror/parsejavascript.js +352 -0
- data/public/javascripts/admin/plugins/codemirror/parseliquid.js +409 -0
- data/public/javascripts/admin/plugins/codemirror/parsesparql.js +162 -0
- data/public/javascripts/admin/plugins/codemirror/parsexml.js +286 -0
- data/public/javascripts/admin/plugins/codemirror/select.js +619 -0
- data/public/javascripts/admin/plugins/codemirror/stringstream.js +140 -0
- data/public/javascripts/admin/plugins/codemirror/tokenize.js +57 -0
- data/public/javascripts/admin/plugins/codemirror/tokenizejavascript.js +174 -0
- data/public/javascripts/admin/plugins/codemirror/undo.js +410 -0
- data/public/javascripts/admin/plugins/codemirror/util.js +130 -0
- data/public/javascripts/admin/plugins/cookie.js +96 -0
- data/public/javascripts/admin/plugins/fancybox.js +1077 -0
- data/public/javascripts/admin/plugins/growl.js +143 -0
- data/public/javascripts/admin/plugins/json2.js +478 -0
- data/public/javascripts/admin/plugins/plupload/gears_init.js +86 -0
- data/public/javascripts/admin/plugins/plupload/jquery.plupload.queue.min.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.browserplus.min.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.flash.min.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.flash.swf +0 -0
- data/public/javascripts/admin/plugins/plupload/plupload.full.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.gears.min.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.html4.min.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.html5.min.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.silverlight.min.js +1 -0
- data/public/javascripts/admin/plugins/plupload/plupload.silverlight.xap +0 -0
- data/public/javascripts/admin/plugins/scrollTo.js +11 -0
- data/public/javascripts/admin/plugins/toggle.js +109 -0
- data/public/javascripts/admin/plugins/wslide.js +125 -0
- data/public/javascripts/admin/rails.js +127 -0
- data/public/javascripts/admin/site.js +36 -0
- data/public/javascripts/admin/snippets.js +16 -0
- data/public/javascripts/admin/theme_assets.js +103 -0
- data/public/stylesheets/admin/application.css +257 -0
- data/public/stylesheets/admin/blueprint/ie.css +26 -0
- data/public/stylesheets/admin/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/buttons/icons/key.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/buttons/readme.txt +32 -0
- data/public/stylesheets/admin/blueprint/plugins/buttons/screen.css +97 -0
- data/public/stylesheets/admin/blueprint/plugins/fancy-type/readme.txt +14 -0
- data/public/stylesheets/admin/blueprint/plugins/fancy-type/screen.css +71 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/readme.txt +18 -0
- data/public/stylesheets/admin/blueprint/plugins/link-icons/screen.css +40 -0
- data/public/stylesheets/admin/blueprint/plugins/rtl/readme.txt +10 -0
- data/public/stylesheets/admin/blueprint/plugins/rtl/screen.css +109 -0
- data/public/stylesheets/admin/blueprint/print.css +30 -0
- data/public/stylesheets/admin/blueprint/screen.css +253 -0
- data/public/stylesheets/admin/blueprint/src/forms.css +49 -0
- data/public/stylesheets/admin/blueprint/src/grid.css +213 -0
- data/public/stylesheets/admin/blueprint/src/grid.png +0 -0
- data/public/stylesheets/admin/blueprint/src/ie.css +59 -0
- data/public/stylesheets/admin/blueprint/src/print.css +85 -0
- data/public/stylesheets/admin/blueprint/src/reset.css +38 -0
- data/public/stylesheets/admin/blueprint/src/typography.css +105 -0
- data/public/stylesheets/admin/box.css +14 -0
- data/public/stylesheets/admin/buttons.css +67 -0
- data/public/stylesheets/admin/formtastic.css +137 -0
- data/public/stylesheets/admin/formtastic_changes.css +461 -0
- data/public/stylesheets/admin/layout.css +175 -0
- data/public/stylesheets/admin/login.css +141 -0
- data/public/stylesheets/admin/menu.css +241 -0
- data/public/stylesheets/admin/page_parts.css +60 -0
- data/public/stylesheets/admin/plugins/codemirror/csscolors.css +51 -0
- data/public/stylesheets/admin/plugins/codemirror/docs.css +50 -0
- data/public/stylesheets/admin/plugins/codemirror/javascriptcolors.css +56 -0
- data/public/stylesheets/admin/plugins/codemirror/jscolors.css +59 -0
- data/public/stylesheets/admin/plugins/codemirror/liquidcolors.css +35 -0
- data/public/stylesheets/admin/plugins/codemirror/people.jpg +0 -0
- data/public/stylesheets/admin/plugins/codemirror/sparqlcolors.css +43 -0
- data/public/stylesheets/admin/plugins/codemirror/xmlcolors.css +55 -0
- data/public/stylesheets/admin/plugins/fancybox.css +363 -0
- data/public/stylesheets/admin/plugins/toggle.css +42 -0
- data/spec/factories.rb +77 -0
- data/spec/lib/locomotive/liquid/filters/html_spec.rb +82 -0
- data/spec/lib/locomotive/liquid/filters/misc_spec.rb +36 -0
- data/spec/lib/locomotive/liquid/tags/paginate_spec.rb +99 -0
- data/spec/lib/locomotive/liquid/tags/snippet_spec.rb +20 -0
- data/spec/lib/locomotive/liquid/tags/with_scope_spec.rb +20 -0
- data/spec/lib/locomotive/render_spec.rb +85 -0
- data/spec/models/account_spec.rb +65 -0
- data/spec/models/asset_collections_spec.rb +174 -0
- data/spec/models/content_instance_spec.rb +33 -0
- data/spec/models/content_type_spec.rb +49 -0
- data/spec/models/layout_spec.rb +64 -0
- data/spec/models/liquid_template_spec.rb +19 -0
- data/spec/models/membership_spec.rb +55 -0
- data/spec/models/page_spec.rb +329 -0
- data/spec/models/site_spec.rb +143 -0
- data/spec/models/snippet_spec.rb +9 -0
- data/spec/models/theme_asset_spec.rb +89 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/support/be_valid.rb +31 -0
- data/spec/support/carrierwave.rb +32 -0
- data/spec/support/locomotive.rb +41 -0
- data/vendor/plugins/custom_fields/MIT-LICENSE +20 -0
- data/vendor/plugins/custom_fields/README +13 -0
- data/vendor/plugins/custom_fields/Rakefile +23 -0
- data/vendor/plugins/custom_fields/init.rb +2 -0
- data/vendor/plugins/custom_fields/install.rb +1 -0
- data/vendor/plugins/custom_fields/lib/custom_fields.rb +14 -0
- data/vendor/plugins/custom_fields/lib/custom_fields/custom_field.rb +84 -0
- data/vendor/plugins/custom_fields/lib/custom_fields/custom_fields_for.rb +49 -0
- data/vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/embeds_many.rb +24 -0
- data/vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/document.rb +35 -0
- data/vendor/plugins/custom_fields/uninstall.rb +1 -0
- metadata +848 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
|
3
|
+
// slider
|
4
|
+
var resetSlider = function() {
|
5
|
+
$('#page-parts .wrapper ul').wslide({
|
6
|
+
width: 880,
|
7
|
+
height: 400,
|
8
|
+
autolink: false,
|
9
|
+
duration: 300,
|
10
|
+
horiz: true
|
11
|
+
});
|
12
|
+
}
|
13
|
+
|
14
|
+
resetSlider();
|
15
|
+
|
16
|
+
// codemirror
|
17
|
+
$('#parts code textarea').each(function() { addCodeMirrorEditor('liquid', $(this)); });
|
18
|
+
|
19
|
+
var refreshParts = function(parts) {
|
20
|
+
// console.log('refreshParts');
|
21
|
+
$('#page-parts .nav a').removeClass('enabled');
|
22
|
+
|
23
|
+
$(parts).each(function() {
|
24
|
+
// console.log("iterating..." + this.slug);
|
25
|
+
var control = $('#control-part-' + this.slug);
|
26
|
+
|
27
|
+
// adding missing part
|
28
|
+
if (control.size() == 0) {
|
29
|
+
// console.log('adding part');
|
30
|
+
var nbParts = $('#page-parts .nav a').size();
|
31
|
+
$('#page-parts .nav .clear').before('<a id="control-part-' + this.slug + '" class="enabled part-' + nbParts + '" href="#parts-' + (nbParts + 1) + '"><span>' + this.name + '</span></a>');
|
32
|
+
|
33
|
+
var textareaInput = '<textarea rows="20" name="page[parts_attributes][' + nbParts + '][value]" id="page_parts_attributes_' + nbParts + '_value"/>';
|
34
|
+
var hiddenInputs = '<input type="hidden" name="page[parts_attributes][' + nbParts + '][name]" value="' + this.name + '" />'
|
35
|
+
hiddenInputs += '<input type="hidden" name="page[parts_attributes][' + nbParts + '][slug]" value="' + this.slug + '" />'
|
36
|
+
$('#page-parts .wrapper ul').append('<li id="part-' + nbParts + '" class="new"><code>' + textareaInput + '</code>' + hiddenInputs + '</li>');
|
37
|
+
|
38
|
+
resetSlider();
|
39
|
+
$('#parts li:last code textarea').each(function() { addCodeMirrorEditor('liquid', $(this)); });
|
40
|
+
} else {
|
41
|
+
var index = parseInt(control.attr('class').match(/part-(.+)/)[1]) + 1;
|
42
|
+
var wrapper = $('#parts-' + index);
|
43
|
+
|
44
|
+
// updating part
|
45
|
+
control.html('<span>' + this.name + '</span>').addClass('enabled').show();
|
46
|
+
wrapper.find('input.disabled').val('false');
|
47
|
+
wrapper.show();
|
48
|
+
}
|
49
|
+
});
|
50
|
+
|
51
|
+
// removing or hiding parts
|
52
|
+
$('#page-parts .nav a:not(.enabled)').each(function() {
|
53
|
+
var index = parseInt($(this).attr('class').match(/part-(.+)/)[1]) + 1;
|
54
|
+
var wrapper = $('#parts-' + index);
|
55
|
+
if (wrapper.hasClass('new')) {
|
56
|
+
$(this).remove(); wrapper.remove();
|
57
|
+
} else {
|
58
|
+
wrapper.find('input.disabled').val('true');
|
59
|
+
$(this).hide(); wrapper.hide();
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
// go to the first one if we hid the selected wrapper
|
64
|
+
var selectedNav = $('#page-parts .nav a.on');
|
65
|
+
if (selectedNav.size() == 1) {
|
66
|
+
var index = parseInt(selectedNav.attr('class').match(/part-(.+)/)[1]) + 1;
|
67
|
+
if ($('#parts-' + index + ':visible').size() == 0)
|
68
|
+
$('#page-parts .nav a:first').click();
|
69
|
+
} else
|
70
|
+
$('#page-parts .nav a:first').click();
|
71
|
+
}
|
72
|
+
|
73
|
+
var loadPartsFromLayout = function() {
|
74
|
+
if ($('#page_layout_id').val() == '')
|
75
|
+
return ;
|
76
|
+
|
77
|
+
var url = $('#page_layout_id').attr('data_url').replace('_id_to_replace_', $('#page_layout_id').val());
|
78
|
+
$.get(url, '', function(data) { refreshParts(data.parts); }, 'json');
|
79
|
+
}
|
80
|
+
|
81
|
+
$('#page_layout_id').change(loadPartsFromLayout);
|
82
|
+
|
83
|
+
});
|
@@ -0,0 +1,67 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
|
3
|
+
// open / close folder
|
4
|
+
$('#pages-list ul.folder img.toggler').click(function(e) {
|
5
|
+
var toggler = $(this);
|
6
|
+
var children = toggler.parent().find('> ul.folder');
|
7
|
+
if (children.is(':visible')) {
|
8
|
+
children.slideUp('fast', function() {
|
9
|
+
toggler.attr('src', toggler.attr('src').replace('open', 'closed'));
|
10
|
+
$.cookie(children.attr('id'), 'none');
|
11
|
+
});
|
12
|
+
} else {
|
13
|
+
children.slideDown('fast', function() {
|
14
|
+
toggler.attr('src', toggler.attr('src').replace('closed', 'open'));
|
15
|
+
$.cookie(children.attr('id'), 'block');
|
16
|
+
});
|
17
|
+
}
|
18
|
+
});
|
19
|
+
|
20
|
+
// sortable folder items
|
21
|
+
$('#pages-list ul.folder').sortable({
|
22
|
+
'handle': 'em',
|
23
|
+
'axis': 'y',
|
24
|
+
'update': function(event, ui) {
|
25
|
+
var params = $(this).sortable('serialize', { 'key': 'children[]' });
|
26
|
+
params += '&_method=put';
|
27
|
+
|
28
|
+
$.post($(this).attr('data_url'), params, function(data) {
|
29
|
+
$.growl('success', data.message);
|
30
|
+
}, 'json');
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
// automatic slug from page title
|
35
|
+
$('#page_title').keypress(function() {
|
36
|
+
var input = $(this);
|
37
|
+
var slug = $('#page_slug');
|
38
|
+
|
39
|
+
if (!slug.hasClass('filled')) {
|
40
|
+
setTimeout(function() {
|
41
|
+
slug.val(input.val().replace(/\s/g, '_').toLowerCase()).addClass('touched');
|
42
|
+
}, 50);
|
43
|
+
}
|
44
|
+
});
|
45
|
+
|
46
|
+
$('#page_slug').keypress(function() {
|
47
|
+
$(this).addClass('filled').addClass('touched');
|
48
|
+
});
|
49
|
+
|
50
|
+
var lookForSlugAndUrl = function() {
|
51
|
+
params = 'parent_id=' + $('#page_parent_id').val() + "&slug=" + $('#page_slug').val();
|
52
|
+
$.get($('#page_slug').attr('data_url'), params, function(data) {
|
53
|
+
$('#page_slug_input .inline-hints').html(data.url).effect('highlight');
|
54
|
+
}, 'json');
|
55
|
+
};
|
56
|
+
|
57
|
+
$('#page_parent_id').change(lookForSlugAndUrl);
|
58
|
+
|
59
|
+
setInterval(function() {
|
60
|
+
var slug = $('#page_slug');
|
61
|
+
if (slug.hasClass('touched')) {
|
62
|
+
slug.removeClass('touched');
|
63
|
+
lookForSlugAndUrl();
|
64
|
+
}
|
65
|
+
}, 2000);
|
66
|
+
|
67
|
+
});
|
@@ -0,0 +1,469 @@
|
|
1
|
+
/* CodeMirror main module
|
2
|
+
*
|
3
|
+
* Implements the CodeMirror constructor and prototype, which take care
|
4
|
+
* of initializing the editor frame, and providing the outside interface.
|
5
|
+
*/
|
6
|
+
|
7
|
+
// The CodeMirrorConfig object is used to specify a default
|
8
|
+
// configuration. If you specify such an object before loading this
|
9
|
+
// file, the values you put into it will override the defaults given
|
10
|
+
// below. You can also assign to it after loading.
|
11
|
+
var CodeMirrorConfig = window.CodeMirrorConfig || {};
|
12
|
+
|
13
|
+
var CodeMirror = (function(){
|
14
|
+
function setDefaults(object, defaults) {
|
15
|
+
for (var option in defaults) {
|
16
|
+
if (!object.hasOwnProperty(option))
|
17
|
+
object[option] = defaults[option];
|
18
|
+
}
|
19
|
+
}
|
20
|
+
function forEach(array, action) {
|
21
|
+
for (var i = 0; i < array.length; i++)
|
22
|
+
action(array[i]);
|
23
|
+
}
|
24
|
+
|
25
|
+
// These default options can be overridden by passing a set of
|
26
|
+
// options to a specific CodeMirror constructor. See manual.html for
|
27
|
+
// their meaning.
|
28
|
+
setDefaults(CodeMirrorConfig, {
|
29
|
+
stylesheet: "",
|
30
|
+
path: "",
|
31
|
+
parserfile: [],
|
32
|
+
basefiles: ["util.js", "stringstream.js", "select.js", "undo.js", "editor.js", "tokenize.js"],
|
33
|
+
iframeClass: null,
|
34
|
+
passDelay: 200,
|
35
|
+
passTime: 50,
|
36
|
+
lineNumberDelay: 200,
|
37
|
+
lineNumberTime: 50,
|
38
|
+
continuousScanning: false,
|
39
|
+
saveFunction: null,
|
40
|
+
onChange: null,
|
41
|
+
undoDepth: 50,
|
42
|
+
undoDelay: 800,
|
43
|
+
disableSpellcheck: true,
|
44
|
+
textWrapping: true,
|
45
|
+
readOnly: false,
|
46
|
+
width: "",
|
47
|
+
height: "300px",
|
48
|
+
autoMatchParens: false,
|
49
|
+
parserConfig: null,
|
50
|
+
tabMode: "indent", // or "spaces", "default", "shift"
|
51
|
+
reindentOnLoad: false,
|
52
|
+
activeTokens: null,
|
53
|
+
cursorActivity: null,
|
54
|
+
lineNumbers: false,
|
55
|
+
indentUnit: 2,
|
56
|
+
domain: null
|
57
|
+
});
|
58
|
+
|
59
|
+
function addLineNumberDiv(container) {
|
60
|
+
var nums = document.createElement("DIV"),
|
61
|
+
scroller = document.createElement("DIV");
|
62
|
+
nums.style.position = "absolute";
|
63
|
+
nums.style.height = "100%";
|
64
|
+
if (nums.style.setExpression) {
|
65
|
+
try {nums.style.setExpression("height", "this.previousSibling.offsetHeight + 'px'");}
|
66
|
+
catch(e) {} // Seems to throw 'Not Implemented' on some IE8 versions
|
67
|
+
}
|
68
|
+
nums.style.top = "0px";
|
69
|
+
nums.style.overflow = "hidden";
|
70
|
+
container.appendChild(nums);
|
71
|
+
scroller.className = "CodeMirror-line-numbers";
|
72
|
+
nums.appendChild(scroller);
|
73
|
+
return nums;
|
74
|
+
}
|
75
|
+
|
76
|
+
function frameHTML(options) {
|
77
|
+
if (typeof options.parserfile == "string")
|
78
|
+
options.parserfile = [options.parserfile];
|
79
|
+
if (typeof options.stylesheet == "string")
|
80
|
+
options.stylesheet = [options.stylesheet];
|
81
|
+
|
82
|
+
var html = ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head>"];
|
83
|
+
// Hack to work around a bunch of IE8-specific problems.
|
84
|
+
html.push("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/>");
|
85
|
+
forEach(options.stylesheet, function(file) {
|
86
|
+
html.push("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + file + "\"/>");
|
87
|
+
});
|
88
|
+
forEach(options.basefiles.concat(options.parserfile), function(file) {
|
89
|
+
html.push("<script type=\"text/javascript\" src=\"" + options.path + file + "\"><" + "/script>");
|
90
|
+
});
|
91
|
+
html.push("</head><body style=\"border-width: 0;\" class=\"editbox\" spellcheck=\"" +
|
92
|
+
(options.disableSpellcheck ? "false" : "true") + "\"></body></html>");
|
93
|
+
return html.join("");
|
94
|
+
}
|
95
|
+
|
96
|
+
var internetExplorer = document.selection && window.ActiveXObject && /MSIE/.test(navigator.userAgent);
|
97
|
+
|
98
|
+
function CodeMirror(place, options) {
|
99
|
+
// Backward compatibility for deprecated options.
|
100
|
+
if (options.dumbTabs) options.tabMode = "spaces";
|
101
|
+
else if (options.normalTab) options.tabMode = "default";
|
102
|
+
|
103
|
+
// Use passed options, if any, to override defaults.
|
104
|
+
this.options = options = options || {};
|
105
|
+
setDefaults(options, CodeMirrorConfig);
|
106
|
+
|
107
|
+
var frame = this.frame = document.createElement("IFRAME");
|
108
|
+
if (options.iframeClass) frame.className = options.iframeClass;
|
109
|
+
frame.frameBorder = 0;
|
110
|
+
frame.style.border = "0";
|
111
|
+
frame.style.width = '100%';
|
112
|
+
frame.style.height = '100%';
|
113
|
+
// display: block occasionally suppresses some Firefox bugs, so we
|
114
|
+
// always add it, redundant as it sounds.
|
115
|
+
frame.style.display = "block";
|
116
|
+
|
117
|
+
var div = this.wrapping = document.createElement("DIV");
|
118
|
+
div.style.position = "relative";
|
119
|
+
div.className = "CodeMirror-wrapping";
|
120
|
+
div.style.width = options.width;
|
121
|
+
div.style.height = options.height;
|
122
|
+
// This is used by Editor.reroutePasteEvent
|
123
|
+
var teHack = this.textareaHack = document.createElement("TEXTAREA");
|
124
|
+
div.appendChild(teHack);
|
125
|
+
teHack.style.position = "absolute";
|
126
|
+
teHack.style.left = "-10000px";
|
127
|
+
teHack.style.width = "10px";
|
128
|
+
|
129
|
+
// Link back to this object, so that the editor can fetch options
|
130
|
+
// and add a reference to itself.
|
131
|
+
frame.CodeMirror = this;
|
132
|
+
if (options.domain && internetExplorer) {
|
133
|
+
this.html = frameHTML(options);
|
134
|
+
frame.src = "javascript:(function(){document.open();" +
|
135
|
+
(options.domain ? "document.domain=\"" + options.domain + "\";" : "") +
|
136
|
+
"document.write(window.frameElement.CodeMirror.html);document.close();})()";
|
137
|
+
}
|
138
|
+
else {
|
139
|
+
frame.src = "javascript:false";
|
140
|
+
}
|
141
|
+
|
142
|
+
if (place.appendChild) place.appendChild(div);
|
143
|
+
else place(div);
|
144
|
+
div.appendChild(frame);
|
145
|
+
if (options.lineNumbers) this.lineNumbers = addLineNumberDiv(div);
|
146
|
+
|
147
|
+
this.win = frame.contentWindow;
|
148
|
+
if (!options.domain || !internetExplorer) {
|
149
|
+
this.win.document.open();
|
150
|
+
this.win.document.write(frameHTML(options));
|
151
|
+
this.win.document.close();
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
CodeMirror.prototype = {
|
156
|
+
init: function() {
|
157
|
+
if (this.options.initCallback) this.options.initCallback(this);
|
158
|
+
if (this.options.lineNumbers) this.activateLineNumbers();
|
159
|
+
if (this.options.reindentOnLoad) this.reindent();
|
160
|
+
},
|
161
|
+
|
162
|
+
getCode: function() {return this.editor.getCode();},
|
163
|
+
setCode: function(code) {this.editor.importCode(code);},
|
164
|
+
selection: function() {this.focusIfIE(); return this.editor.selectedText();},
|
165
|
+
reindent: function() {this.editor.reindent();},
|
166
|
+
reindentSelection: function() {this.focusIfIE(); this.editor.reindentSelection(null);},
|
167
|
+
|
168
|
+
focusIfIE: function() {
|
169
|
+
// in IE, a lot of selection-related functionality only works when the frame is focused
|
170
|
+
if (this.win.select.ie_selection) this.focus();
|
171
|
+
},
|
172
|
+
focus: function() {
|
173
|
+
this.win.focus();
|
174
|
+
if (this.editor.selectionSnapshot) // IE hack
|
175
|
+
this.win.select.setBookmark(this.win.document.body, this.editor.selectionSnapshot);
|
176
|
+
},
|
177
|
+
replaceSelection: function(text) {
|
178
|
+
this.focus();
|
179
|
+
this.editor.replaceSelection(text);
|
180
|
+
return true;
|
181
|
+
},
|
182
|
+
replaceChars: function(text, start, end) {
|
183
|
+
this.editor.replaceChars(text, start, end);
|
184
|
+
},
|
185
|
+
getSearchCursor: function(string, fromCursor, caseFold) {
|
186
|
+
return this.editor.getSearchCursor(string, fromCursor, caseFold);
|
187
|
+
},
|
188
|
+
|
189
|
+
undo: function() {this.editor.history.undo();},
|
190
|
+
redo: function() {this.editor.history.redo();},
|
191
|
+
historySize: function() {return this.editor.history.historySize();},
|
192
|
+
clearHistory: function() {this.editor.history.clear();},
|
193
|
+
|
194
|
+
grabKeys: function(callback, filter) {this.editor.grabKeys(callback, filter);},
|
195
|
+
ungrabKeys: function() {this.editor.ungrabKeys();},
|
196
|
+
|
197
|
+
setParser: function(name) { this.editor.setParser(name); },
|
198
|
+
setSpellcheck: function(on) {this.win.document.body.spellcheck = on;},
|
199
|
+
setStylesheet: function(names) {
|
200
|
+
if (typeof names === "string") names = [names];
|
201
|
+
var activeStylesheets = {};
|
202
|
+
var matchedNames = {};
|
203
|
+
var links = this.win.document.getElementsByTagName("link");
|
204
|
+
// Create hashes of active stylesheets and matched names.
|
205
|
+
// This is O(n^2) but n is expected to be very small.
|
206
|
+
for (var x = 0, link; link = links[x]; x++) {
|
207
|
+
if (link.rel.indexOf("stylesheet") !== -1) {
|
208
|
+
for (var y = 0; y < names.length; y++) {
|
209
|
+
var name = names[y];
|
210
|
+
if (link.href.substring(link.href.length - name.length) === name) {
|
211
|
+
activeStylesheets[link.href] = true;
|
212
|
+
matchedNames[name] = true;
|
213
|
+
}
|
214
|
+
}
|
215
|
+
}
|
216
|
+
}
|
217
|
+
// Activate the selected stylesheets and disable the rest.
|
218
|
+
for (var x = 0, link; link = links[x]; x++) {
|
219
|
+
if (link.rel.indexOf("stylesheet") !== -1) {
|
220
|
+
link.disabled = !(link.href in activeStylesheets);
|
221
|
+
}
|
222
|
+
}
|
223
|
+
// Create any new stylesheets.
|
224
|
+
for (var y = 0; y < names.length; y++) {
|
225
|
+
var name = names[y];
|
226
|
+
if (!(name in matchedNames)) {
|
227
|
+
var link = this.win.document.createElement("link");
|
228
|
+
link.rel = "stylesheet";
|
229
|
+
link.type = "text/css";
|
230
|
+
link.href = name;
|
231
|
+
this.win.document.getElementsByTagName('head')[0].appendChild(link);
|
232
|
+
}
|
233
|
+
}
|
234
|
+
},
|
235
|
+
setTextWrapping: function(on) {
|
236
|
+
if (on == this.options.textWrapping) return;
|
237
|
+
this.win.document.body.style.whiteSpace = on ? "" : "nowrap";
|
238
|
+
this.options.textWrapping = on;
|
239
|
+
if (this.lineNumbers) {
|
240
|
+
this.setLineNumbers(false);
|
241
|
+
this.setLineNumbers(true);
|
242
|
+
}
|
243
|
+
},
|
244
|
+
setIndentUnit: function(unit) {this.win.indentUnit = unit;},
|
245
|
+
setUndoDepth: function(depth) {this.editor.history.maxDepth = depth;},
|
246
|
+
setTabMode: function(mode) {this.options.tabMode = mode;},
|
247
|
+
setLineNumbers: function(on) {
|
248
|
+
if (on && !this.lineNumbers) {
|
249
|
+
this.lineNumbers = addLineNumberDiv(this.wrapping);
|
250
|
+
this.activateLineNumbers();
|
251
|
+
}
|
252
|
+
else if (!on && this.lineNumbers) {
|
253
|
+
this.wrapping.removeChild(this.lineNumbers);
|
254
|
+
this.wrapping.style.marginLeft = "";
|
255
|
+
this.lineNumbers = null;
|
256
|
+
}
|
257
|
+
},
|
258
|
+
|
259
|
+
cursorPosition: function(start) {this.focusIfIE(); return this.editor.cursorPosition(start);},
|
260
|
+
firstLine: function() {return this.editor.firstLine();},
|
261
|
+
lastLine: function() {return this.editor.lastLine();},
|
262
|
+
nextLine: function(line) {return this.editor.nextLine(line);},
|
263
|
+
prevLine: function(line) {return this.editor.prevLine(line);},
|
264
|
+
lineContent: function(line) {return this.editor.lineContent(line);},
|
265
|
+
setLineContent: function(line, content) {this.editor.setLineContent(line, content);},
|
266
|
+
removeLine: function(line){this.editor.removeLine(line);},
|
267
|
+
insertIntoLine: function(line, position, content) {this.editor.insertIntoLine(line, position, content);},
|
268
|
+
selectLines: function(startLine, startOffset, endLine, endOffset) {
|
269
|
+
this.win.focus();
|
270
|
+
this.editor.selectLines(startLine, startOffset, endLine, endOffset);
|
271
|
+
},
|
272
|
+
nthLine: function(n) {
|
273
|
+
var line = this.firstLine();
|
274
|
+
for (; n > 1 && line !== false; n--)
|
275
|
+
line = this.nextLine(line);
|
276
|
+
return line;
|
277
|
+
},
|
278
|
+
lineNumber: function(line) {
|
279
|
+
var num = 0;
|
280
|
+
while (line !== false) {
|
281
|
+
num++;
|
282
|
+
line = this.prevLine(line);
|
283
|
+
}
|
284
|
+
return num;
|
285
|
+
},
|
286
|
+
jumpToLine: function(line) {
|
287
|
+
if (typeof line == "number") line = this.nthLine(line);
|
288
|
+
this.selectLines(line, 0);
|
289
|
+
this.win.focus();
|
290
|
+
},
|
291
|
+
currentLine: function() { // Deprecated, but still there for backward compatibility
|
292
|
+
return this.lineNumber(this.cursorLine());
|
293
|
+
},
|
294
|
+
cursorLine: function() {
|
295
|
+
return this.cursorPosition().line;
|
296
|
+
},
|
297
|
+
|
298
|
+
activateLineNumbers: function() {
|
299
|
+
var frame = this.frame, win = frame.contentWindow, doc = win.document, body = doc.body,
|
300
|
+
nums = this.lineNumbers, scroller = nums.firstChild, self = this;
|
301
|
+
var barWidth = null;
|
302
|
+
|
303
|
+
function sizeBar() {
|
304
|
+
if (frame.offsetWidth == 0) return;
|
305
|
+
for (var root = frame; root.parentNode; root = root.parentNode);
|
306
|
+
if (!nums.parentNode || root != document || !win.Editor) {
|
307
|
+
// Clear event handlers (their nodes might already be collected, so try/catch)
|
308
|
+
try{clear();}catch(e){}
|
309
|
+
clearInterval(sizeInterval);
|
310
|
+
return;
|
311
|
+
}
|
312
|
+
|
313
|
+
if (nums.offsetWidth != barWidth) {
|
314
|
+
barWidth = nums.offsetWidth;
|
315
|
+
nums.style.left = "-" + (frame.parentNode.style.marginLeft = barWidth + "px");
|
316
|
+
}
|
317
|
+
}
|
318
|
+
function doScroll() {
|
319
|
+
nums.scrollTop = body.scrollTop || doc.documentElement.scrollTop || 0;
|
320
|
+
}
|
321
|
+
// Cleanup function, registered by nonWrapping and wrapping.
|
322
|
+
var clear = function(){};
|
323
|
+
sizeBar();
|
324
|
+
var sizeInterval = setInterval(sizeBar, 500);
|
325
|
+
|
326
|
+
function nonWrapping() {
|
327
|
+
var nextNum = 1, pending;
|
328
|
+
function update() {
|
329
|
+
var target = 50 + Math.max(body.offsetHeight, Math.max(frame.offsetHeight, body.scrollHeight || 0));
|
330
|
+
var endTime = new Date().getTime() + self.options.lineNumberTime;
|
331
|
+
while (scroller.offsetHeight < target && (!scroller.firstChild || scroller.offsetHeight)) {
|
332
|
+
scroller.appendChild(document.createElement("DIV"));
|
333
|
+
scroller.lastChild.innerHTML = nextNum++;
|
334
|
+
if (new Date().getTime() > endTime) {
|
335
|
+
if (pending) clearTimeout(pending);
|
336
|
+
pending = setTimeout(update, self.options.lineNumberDelay);
|
337
|
+
break;
|
338
|
+
}
|
339
|
+
}
|
340
|
+
doScroll();
|
341
|
+
}
|
342
|
+
var onScroll = win.addEventHandler(win, "scroll", update, true),
|
343
|
+
onResize = win.addEventHandler(win, "resize", update, true);
|
344
|
+
clear = function(){onScroll(); onResize(); if (pending) clearTimeout(pending);};
|
345
|
+
update();
|
346
|
+
}
|
347
|
+
function wrapping() {
|
348
|
+
var node, lineNum, next, pos;
|
349
|
+
|
350
|
+
function addNum(n) {
|
351
|
+
if (!lineNum) lineNum = scroller.appendChild(document.createElement("DIV"));
|
352
|
+
lineNum.innerHTML = n;
|
353
|
+
pos = lineNum.offsetHeight + lineNum.offsetTop;
|
354
|
+
lineNum = lineNum.nextSibling;
|
355
|
+
}
|
356
|
+
function work() {
|
357
|
+
if (!scroller.parentNode || scroller.parentNode != self.lineNumbers) return;
|
358
|
+
|
359
|
+
var endTime = new Date().getTime() + self.options.lineNumberTime;
|
360
|
+
while (node) {
|
361
|
+
addNum(next++);
|
362
|
+
for (; node && !win.isBR(node); node = node.nextSibling) {
|
363
|
+
var bott = node.offsetTop + node.offsetHeight;
|
364
|
+
while (scroller.offsetHeight && bott - 3 > pos) addNum(" ");
|
365
|
+
}
|
366
|
+
if (node) node = node.nextSibling;
|
367
|
+
if (new Date().getTime() > endTime) {
|
368
|
+
pending = setTimeout(work, self.options.lineNumberDelay);
|
369
|
+
return;
|
370
|
+
}
|
371
|
+
}
|
372
|
+
// While there are un-processed number DIVs, or the scroller is smaller than the frame...
|
373
|
+
var target = 50 + Math.max(body.offsetHeight, Math.max(frame.offsetHeight, body.scrollHeight || 0));
|
374
|
+
while (lineNum || (scroller.offsetHeight < target && (!scroller.firstChild || scroller.offsetHeight)))
|
375
|
+
addNum(next++);
|
376
|
+
doScroll();
|
377
|
+
}
|
378
|
+
function start() {
|
379
|
+
doScroll();
|
380
|
+
node = body.firstChild;
|
381
|
+
lineNum = scroller.firstChild;
|
382
|
+
pos = 0;
|
383
|
+
next = 1;
|
384
|
+
work();
|
385
|
+
}
|
386
|
+
|
387
|
+
start();
|
388
|
+
var pending = null;
|
389
|
+
function update() {
|
390
|
+
if (pending) clearTimeout(pending);
|
391
|
+
if (self.editor.allClean()) start();
|
392
|
+
else pending = setTimeout(update, 200);
|
393
|
+
}
|
394
|
+
self.updateNumbers = update;
|
395
|
+
var onScroll = win.addEventHandler(win, "scroll", doScroll, true),
|
396
|
+
onResize = win.addEventHandler(win, "resize", update, true);
|
397
|
+
clear = function(){
|
398
|
+
if (pending) clearTimeout(pending);
|
399
|
+
if (self.updateNumbers == update) self.updateNumbers = null;
|
400
|
+
onScroll();
|
401
|
+
onResize();
|
402
|
+
};
|
403
|
+
}
|
404
|
+
(this.options.textWrapping ? wrapping : nonWrapping)();
|
405
|
+
}
|
406
|
+
};
|
407
|
+
|
408
|
+
CodeMirror.InvalidLineHandle = {toString: function(){return "CodeMirror.InvalidLineHandle";}};
|
409
|
+
|
410
|
+
CodeMirror.replace = function(element) {
|
411
|
+
if (typeof element == "string")
|
412
|
+
element = document.getElementById(element);
|
413
|
+
return function(newElement) {
|
414
|
+
element.parentNode.replaceChild(newElement, element);
|
415
|
+
};
|
416
|
+
};
|
417
|
+
|
418
|
+
CodeMirror.fromTextArea = function(area, options) {
|
419
|
+
if (typeof area == "string")
|
420
|
+
area = document.getElementById(area);
|
421
|
+
|
422
|
+
options = options || {};
|
423
|
+
if (area.style.width && options.width == null)
|
424
|
+
options.width = area.style.width;
|
425
|
+
if (area.style.height && options.height == null)
|
426
|
+
options.height = area.style.height;
|
427
|
+
if (options.content == null) options.content = area.value;
|
428
|
+
|
429
|
+
if (area.form) {
|
430
|
+
function updateField() {
|
431
|
+
area.value = mirror.getCode();
|
432
|
+
}
|
433
|
+
if (typeof area.form.addEventListener == "function")
|
434
|
+
area.form.addEventListener("submit", updateField, false);
|
435
|
+
else
|
436
|
+
area.form.attachEvent("onsubmit", updateField);
|
437
|
+
}
|
438
|
+
|
439
|
+
function insert(frame) {
|
440
|
+
if (area.nextSibling)
|
441
|
+
area.parentNode.insertBefore(frame, area.nextSibling);
|
442
|
+
else
|
443
|
+
area.parentNode.appendChild(frame);
|
444
|
+
}
|
445
|
+
|
446
|
+
area.style.display = "none";
|
447
|
+
var mirror = new CodeMirror(insert, options);
|
448
|
+
return mirror;
|
449
|
+
};
|
450
|
+
|
451
|
+
CodeMirror.isProbablySupported = function() {
|
452
|
+
// This is rather awful, but can be useful.
|
453
|
+
var match;
|
454
|
+
if (window.opera)
|
455
|
+
return Number(window.opera.version()) >= 9.52;
|
456
|
+
else if (/Apple Computers, Inc/.test(navigator.vendor) && (match = navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./)))
|
457
|
+
return Number(match[1]) >= 3;
|
458
|
+
else if (document.selection && window.ActiveXObject && (match = navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/)))
|
459
|
+
return Number(match[1]) >= 6;
|
460
|
+
else if (match = navigator.userAgent.match(/gecko\/(\d{8})/i))
|
461
|
+
return Number(match[1]) >= 20050901;
|
462
|
+
else if (match = navigator.userAgent.match(/AppleWebKit\/(\d+)/))
|
463
|
+
return Number(match[1]) >= 525;
|
464
|
+
else
|
465
|
+
return null;
|
466
|
+
};
|
467
|
+
|
468
|
+
return CodeMirror;
|
469
|
+
})();
|