active_admin_editor 0.3.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +56 -28
- data/Rakefile +10 -19
- data/app/assets/images/active_admin/editor/loader.gif +0 -0
- data/app/assets/javascripts/active_admin/editor.js +14 -6
- data/app/assets/javascripts/active_admin/editor/config.js.erb +12 -0
- data/app/assets/javascripts/active_admin/editor/editor.js +101 -0
- data/app/assets/javascripts/active_admin/editor/parser_rules.js +561 -0
- data/app/assets/javascripts/active_admin/editor/templates/toolbar.jst.ejs +47 -0
- data/app/assets/javascripts/active_admin/editor/templates/uploader.jst.ejs +6 -0
- data/app/assets/stylesheets/active_admin/editor.css.scss +66 -205
- data/app/inputs/html_editor_input.rb +9 -79
- data/lib/active_admin/editor.rb +2 -2
- data/lib/active_admin/editor/config.rb +34 -0
- data/lib/active_admin/editor/policy.rb +50 -0
- data/lib/active_admin/editor/rails/engine.rb +7 -2
- data/lib/active_admin/editor/version.rb +1 -1
- data/lib/generators/active_admin/editor/editor_generator.rb +4 -5
- data/lib/generators/active_admin/editor/templates/active_admin_editor.rb +6 -0
- data/{test → spec}/dummy/README.rdoc +0 -0
- data/{test → spec}/dummy/Rakefile +0 -0
- data/{test → spec}/dummy/app/admin/dashboards.rb +0 -0
- data/{test → spec}/dummy/app/admin/pages.rb +1 -7
- data/spec/dummy/app/assets/javascripts/active_admin.js +1 -0
- data/{test → spec}/dummy/app/assets/javascripts/application.js +0 -0
- data/{test → spec}/dummy/app/assets/stylesheets/active_admin.css.scss +0 -1
- data/{test → spec}/dummy/app/assets/stylesheets/application.css +1 -2
- data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
- data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
- data/{test → spec}/dummy/app/models/admin_user.rb +0 -0
- data/{test → spec}/dummy/app/models/page.rb +0 -0
- data/{test → spec}/dummy/app/views/layouts/application.html.erb +0 -0
- data/{test → spec}/dummy/config.ru +0 -0
- data/{test → spec}/dummy/config/application.rb +4 -1
- data/{test → spec}/dummy/config/boot.rb +0 -0
- data/{test → spec}/dummy/config/database.yml +0 -0
- data/{test → spec}/dummy/config/environment.rb +0 -0
- data/{test → spec}/dummy/config/environments/development.rb +0 -0
- data/{test → spec}/dummy/config/environments/production.rb +1 -1
- data/{test → spec}/dummy/config/environments/test.rb +0 -0
- data/{test → spec}/dummy/config/initializers/active_admin.rb +0 -0
- data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/{test → spec}/dummy/config/initializers/devise.rb +1 -1
- data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
- data/spec/dummy/config/initializers/konacha.rb +10 -0
- data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
- data/{test → spec}/dummy/config/initializers/secret_token.rb +1 -1
- data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
- data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +0 -0
- data/{test → spec}/dummy/config/locales/devise.en.yml +0 -0
- data/{test → spec}/dummy/config/locales/en.yml +0 -0
- data/spec/dummy/config/routes.rb +7 -0
- data/{test → spec}/dummy/db/development.sqlite3 +0 -0
- data/{test/dummy/db/migrate/20120430130552_create_admin_notes.rb → spec/dummy/db/migrate/20121224120152_create_admin_notes.rb} +0 -0
- data/{test/dummy/db/migrate/20120430130553_move_admin_notes_to_comments.rb → spec/dummy/db/migrate/20121224120153_move_admin_notes_to_comments.rb} +0 -0
- data/{test/dummy/db/migrate/20120430200549_devise_create_admin_users.rb → spec/dummy/db/migrate/20121224200148_devise_create_admin_users.rb} +0 -0
- data/{test/dummy/db/migrate/20120430201522_create_pages.rb → spec/dummy/db/migrate/20121224200305_create_pages.rb} +0 -0
- data/{test → spec}/dummy/db/schema.rb +1 -9
- data/{test → spec}/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +14689 -0
- data/spec/dummy/log/test.log +965 -0
- data/{test → spec}/dummy/public/404.html +0 -0
- data/{test → spec}/dummy/public/422.html +0 -0
- data/{test → spec}/dummy/public/500.html +0 -0
- data/{test → spec}/dummy/public/favicon.ico +0 -0
- data/{test → spec}/dummy/script/rails +0 -0
- data/{test → spec}/dummy/tmp/cache/assets/C17/7E0/sprockets%2F10282a65710402dd907a870692e08e54 +0 -0
- data/spec/dummy/tmp/cache/assets/C4C/360/sprockets%2F72117b2727aba75092e90773336f414e +0 -0
- data/spec/dummy/tmp/cache/assets/C7E/A00/sprockets%2F792b6f07a3b1f6e7f7020544633d6163 +0 -0
- data/spec/dummy/tmp/cache/assets/C7E/A30/sprockets%2F4e07a03809f626374b024b66b14e5b99 +0 -0
- data/{test/dummy/tmp/cache/assets/C6F/E20/sprockets%2Fa87763437b13303bb17930a3144e4de2 → spec/dummy/tmp/cache/assets/C8D/BD0/sprockets%2Fb7f30a05e9483519378748810c6b57ec} +0 -0
- data/spec/dummy/tmp/cache/assets/C94/D20/sprockets%2F3397997b6066dfc6995b0eaa23913907 +0 -0
- data/spec/dummy/tmp/cache/assets/C9D/E70/sprockets%2F4a5d05f556354e305a5184b065c62ac0 +0 -0
- data/{test → spec}/dummy/tmp/cache/assets/C9F/170/sprockets%2F5d65e155aad3374ae12771242be22580 +0 -0
- data/spec/dummy/tmp/cache/assets/C9F/4B0/sprockets%2Fad8482516a116a14c2049944dc5800cc +0 -0
- data/spec/dummy/tmp/cache/assets/CAB/5D0/sprockets%2Fae6053e1f832b219519600e978f40b1e +0 -0
- data/spec/dummy/tmp/cache/assets/CB2/5A0/sprockets%2F4e7c202a6f2335881a86d6fc17329d08 +0 -0
- data/spec/dummy/tmp/cache/assets/CB7/160/sprockets%2F9b2ab958728324ca63e77600c53e934e +0 -0
- data/spec/dummy/tmp/cache/assets/CB7/940/sprockets%2F6d7c27e22691733a4db6968177c22d3c +0 -0
- data/spec/dummy/tmp/cache/assets/CB9/F00/sprockets%2F1c8ee45e33fe3869b7816f065d436211 +0 -0
- data/spec/dummy/tmp/cache/assets/CC3/E30/sprockets%2F0911249a810f39f82185eef9e0959a9d +0 -0
- data/{test/dummy/tmp/cache/assets/C70/420/sprockets%2F53d54131590a8591ad22c925a0077e2b → spec/dummy/tmp/cache/assets/CC7/830/sprockets%2F10abd9e76d16838868b873632597e4eb} +0 -0
- data/spec/dummy/tmp/cache/assets/CCB/120/sprockets%2Fb9500896df13a12225b836bda0b7320e +0 -0
- data/spec/dummy/tmp/cache/assets/CCC/BA0/sprockets%2F0e0e79da1b5b3033c89cfa8211306074 +0 -0
- data/{test/dummy/tmp/cache/assets/D1C/C80/sprockets%2F8c62944dcb299f2c6c52b6c60f57905c → spec/dummy/tmp/cache/assets/CCD/EC0/sprockets%2F9694fc1ad28709775e7a7f82369ed721} +0 -0
- data/{test/dummy/tmp/cache/assets/BE7/A60/sprockets%2Fae54231359059e8083a690411099f001 → spec/dummy/tmp/cache/assets/CD6/810/sprockets%2F901ca591b49d076903b08128b26cbdb7} +0 -0
- data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/CD9/350/sprockets%2F32028818c2c71992ada5fba5846a570a +0 -0
- data/spec/dummy/tmp/cache/assets/CDA/710/sprockets%2F62127bc83fb039a235ab75167b866cb5 +0 -0
- data/spec/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
- data/spec/dummy/tmp/cache/assets/CDF/420/sprockets%2F0be8c2291b745181fd56b7c4770a7d08 +0 -0
- data/spec/dummy/tmp/cache/assets/CE0/970/sprockets%2Fc9f200ae739b9f7b288228ac18346c20 +0 -0
- data/spec/dummy/tmp/cache/assets/CE5/570/sprockets%2F22a48aa90a12bd639b68970b85d619f8 +0 -0
- data/spec/dummy/tmp/cache/assets/CEE/C80/sprockets%2F18515cf2523bdc58f32fe536665ff657 +0 -0
- data/spec/dummy/tmp/cache/assets/CF1/0A0/sprockets%2Ff258b9f7ff79b17799a1014d71d41c64 +0 -0
- data/spec/dummy/tmp/cache/assets/CF2/380/sprockets%2Fb7f95440782366509acb6ddd5f6938a5 +0 -0
- data/spec/dummy/tmp/cache/assets/CF4/AE0/sprockets%2F764571ead1c1995d83a95d9269da457c +0 -0
- data/spec/dummy/tmp/cache/assets/CF7/570/sprockets%2F172af7030e61fae1056ee122c8f0a533 +0 -0
- data/spec/dummy/tmp/cache/assets/CF8/0B0/sprockets%2F1fc42b20103cc98d433f230c9e84b10d +0 -0
- data/spec/dummy/tmp/cache/assets/D00/490/sprockets%2F60ff8fc770f770b47a563e8cd4696994 +0 -0
- data/{test → spec}/dummy/tmp/cache/assets/D03/CD0/sprockets%2Ff025a9441aa20929b3175d8d6ab3c18e +0 -0
- data/spec/dummy/tmp/cache/assets/D08/C10/sprockets%2F1905d76e0c7ba5c68fad2376d44d1105 +0 -0
- data/spec/dummy/tmp/cache/assets/D09/1E0/sprockets%2F1275ff2f505dc32c9715eb4bc33b0379 +0 -0
- data/spec/dummy/tmp/cache/assets/D10/420/sprockets%2Fa4dc298af1d087c33871f077b0f16f17 +0 -0
- data/spec/dummy/tmp/cache/assets/D23/ED0/sprockets%2F77308cdf3281f5ef8b5d188bf8e74036 +0 -0
- data/spec/dummy/tmp/cache/assets/D2E/800/sprockets%2F4f418afd1d357065fa7bb580041a28aa +0 -0
- data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/D34/C90/sprockets%2Fda1e05e39683311b61cb095c6c2fdd63 +0 -0
- data/spec/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
- data/{test/dummy/tmp/cache/assets/CF6/620/sprockets%2Fa2a0cea1f6f3124e713392f0c52704c4 → spec/dummy/tmp/cache/assets/D39/DF0/sprockets%2F1351e4754ff46cdca7cc05f72a1f1780} +0 -0
- data/spec/dummy/tmp/cache/assets/D3C/DF0/sprockets%2Ff432a7e254a9b296d3dfa02ce86903a5 +0 -0
- data/spec/dummy/tmp/cache/assets/D3E/E70/sprockets%2F038e0e6d5f82f9562663ac2611bbedd4 +0 -0
- data/spec/dummy/tmp/cache/assets/D41/2F0/sprockets%2Fe5d704d8dc364cb7e3e822bb4e253916 +0 -0
- data/spec/dummy/tmp/cache/assets/D44/C10/sprockets%2F2266669d5531ceb6da3418dd26e7d2df +0 -0
- data/spec/dummy/tmp/cache/assets/D46/3F0/sprockets%2F45e4032f9ee82213f32b98dae1e859cc +0 -0
- data/spec/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
- data/spec/dummy/tmp/cache/assets/D49/DA0/sprockets%2Fff38d1c9e2d93d45642fed29d3e30372 +0 -0
- data/spec/dummy/tmp/cache/assets/D4E/8C0/sprockets%2Ffa56f431b696af04ff09e2d98e286e32 +0 -0
- data/spec/dummy/tmp/cache/assets/D53/0B0/sprockets%2F4b2b0082dbfd4ae3f0af30c22612865c +0 -0
- data/{test → spec}/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
- data/spec/dummy/tmp/cache/assets/D5A/070/sprockets%2Fd8818fa8a8ef79eab35083ed7747366b +0 -0
- data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/D5D/520/sprockets%2Fbee57aef677100ff765e815f994b689b +0 -0
- data/spec/dummy/tmp/cache/assets/D60/5A0/sprockets%2Fa0350de718dad460b2072ddaee54d981 +0 -0
- data/spec/dummy/tmp/cache/assets/D71/A00/sprockets%2F26b65eb6806e407ba2bf573d8e09cfe1 +0 -0
- data/spec/dummy/tmp/cache/assets/D75/DD0/sprockets%2Fcaf4a123e55f662a4b9c7ff520872f8e +0 -0
- data/spec/dummy/tmp/cache/assets/D76/730/sprockets%2Fd1699d0cbcfe965c5c51a95e31580df2 +0 -0
- data/spec/dummy/tmp/cache/assets/D76/DA0/sprockets%2F30e9a50c62e4c0e692f6ecd996ea319c +0 -0
- data/spec/dummy/tmp/cache/assets/D77/460/sprockets%2Fe55bb3a682bfa8d973ed7da8075f0760 +0 -0
- data/spec/dummy/tmp/cache/assets/D7A/060/sprockets%2F77ca5dbe828fbf2ffd35b5a246726483 +0 -0
- data/spec/dummy/tmp/cache/assets/D7C/C30/sprockets%2Ffff7e9e07a287afd2545a319a51e8c74 +0 -0
- data/spec/dummy/tmp/cache/assets/D84/5F0/sprockets%2F00b3982f58c6eccfe3eee6487b52f758 +0 -0
- data/spec/dummy/tmp/cache/assets/D8A/590/sprockets%2Fefb091963e2f1d4af57368698a8efe5f +0 -0
- data/spec/dummy/tmp/cache/assets/D8B/B30/sprockets%2F4dba4514d3a98322b21d72c8eab42cdd +0 -0
- data/{test → spec}/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
- data/spec/dummy/tmp/cache/assets/D95/830/sprockets%2Ffe3ca69e3c532ba34b060ad2ab88938c +0 -0
- data/spec/dummy/tmp/cache/assets/D97/B00/sprockets%2F6320e6270ecefff1d38a7e2ac651c45b +0 -0
- data/spec/dummy/tmp/cache/assets/D9E/100/sprockets%2Fa9bd0212de7fa8673e1b643ffb72e4a8 +0 -0
- data/spec/dummy/tmp/cache/assets/DA3/CB0/sprockets%2Feed56563f89ef40af5dc3446faa01a75 +0 -0
- data/spec/dummy/tmp/cache/assets/DAA/830/sprockets%2Fe3ec7fe8843d4533eb6dc2c3e6a848b4 +0 -0
- data/spec/dummy/tmp/cache/assets/DB1/170/sprockets%2F39ccab8b246a72889ae697c84df5a4ce +0 -0
- data/spec/dummy/tmp/cache/assets/DB1/BB0/sprockets%2Fb8d3905f9c3da9396b5d2ddf56908fac +0 -0
- data/{test/dummy/tmp/cache/assets/E8D/A20/sprockets%2F0d9efcac5ff6e3dc1d79ad04dd2e60fc → spec/dummy/tmp/cache/assets/DBA/6B0/sprockets%2F4acc06bba5e909e9aab90dab06b19503} +0 -0
- data/spec/dummy/tmp/cache/assets/DBF/0B0/sprockets%2F1aacf4a74e2d4d026ee99e320d5b03ec +0 -0
- data/spec/dummy/tmp/cache/assets/DC4/410/sprockets%2Fd83e593eb29628c1ce0cda1bb52bd3b6 +0 -0
- data/spec/dummy/tmp/cache/assets/DCF/600/sprockets%2F8da546237ce6e75da190e3b092eabeef +0 -0
- data/{test/dummy/tmp/cache/assets/D2A/340/sprockets%2F989f69c85eb048200d6e8f458eb14cd9 → spec/dummy/tmp/cache/assets/DD5/C40/sprockets%2F7c17ce947d82be9ccfd0af20ea78930c} +0 -0
- data/spec/dummy/tmp/cache/assets/DDC/320/sprockets%2F5da6cc4cce8f2187c3c329fdd752f69c +0 -0
- data/{test → spec}/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
- data/spec/dummy/tmp/cache/assets/DEC/8B0/sprockets%2F5cccef02565cd21f12b277c63abbfe1c +0 -0
- data/spec/dummy/tmp/cache/assets/DF4/CB0/sprockets%2F50c79ab150d98daf2d8b0d03baffdb47 +0 -0
- data/spec/dummy/tmp/cache/assets/E02/970/sprockets%2Fa5d6fd3fd2a6d81fbccd14cc929f8145 +0 -0
- data/spec/dummy/tmp/cache/assets/E3B/4F0/sprockets%2Fe52b61cae0b3e9ecd57a884f7eefe85b +0 -0
- data/spec/dummy/tmp/cache/assets/E54/600/sprockets%2Fec46dd83126fcd2afef6ac23c2c6cc1e +0 -0
- data/spec/dummy/tmp/cache/assets/E77/760/sprockets%2F2f147bc1e7bd8ee79edeae7995b7fedc +0 -0
- data/spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3/_button.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3/_clearfix.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/d4fa0ff2408ef66f63a8a338cbe8bfd596851f99 → spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3}/_font-family.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3/_hide-text.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3/_html5-input-types.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3/_position.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3/_prefixer.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/49e23cf4eab4ccca4c89a71b1b955b60e6f0c9a3/_timing-functions.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/709e3d65cae1ef23a4e00d6993aebe4c283645f9/_base.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/709e3d65cae1ef23a4e00d6993aebe4c283645f9/_forms.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/709e3d65cae1ef23a4e00d6993aebe4c283645f9/_header.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/709e3d65cae1ef23a4e00d6993aebe4c283645f9/_mixins.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/709e3d65cae1ef23a4e00d6993aebe4c283645f9/_typography.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/81344752c8bed34a2e2b1a10124f3a9949022145/editor.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/ab802d596deb2a86dbfabb589da36878d2b5904f/_dashboard.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/ab802d596deb2a86dbfabb589da36878d2b5904f/_logged_out.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_blank_slates.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_breadcrumbs.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_buttons.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb → spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837}/_columns.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_comments.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_date_picker.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_flash_messages.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_grid.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_links.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_pagination.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_panels.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_scopes.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_status_tags.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_table_tools.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/b71086e2961ae0986cb398b343b2daedba367837/_tables.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_animation.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_appearance.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_background-image.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_background-size.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_background.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78 → spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a}/_border-image.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_border-radius.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_box-shadow.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_box-sizing.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_columns.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_flex-box.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_font-face.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_hidpi-media-query.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_image-rendering.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_inline-block.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_linear-gradient.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_perspective.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_radial-gradient.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_transform.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_transition.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/bbd465490a040c2572db5eef14e0f3c13a72a69a/_user-select.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434/_compact.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434/_deprecated-webkit-gradient.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99 → spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434}/_flex-grid.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99 → spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434}/_grid-width.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434/_linear-gradient.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99 → spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434}/_modular-scale.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434/_radial-gradient.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99 → spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434}/_render-gradients.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434/_tint-shade.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/c4b0263b663ecd8b52decc9efd85c43eaa5c2434/_transition-property-name.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/c841b2fc6dd2fd657ddbe3309936a6f84dd72935/active_admin.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/d51f47c50caa8cd1f62b5744c3cc3d84c660be11/_footer.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/d51f47c50caa8cd1f62b5744c3cc3d84c660be11/_main_structure.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/d51f47c50caa8cd1f62b5744c3cc3d84c660be11/_title_bar.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/e4457c75f1deecfb1d8551dd1f7b6c94e974342d/_bourbon-deprecated-upcoming.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/e4457c75f1deecfb1d8551dd1f7b6c94e974342d/_bourbon.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8 → spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223}/_all.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_buttons.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_gradients.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_icons.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_reset.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_rounded.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_sections.css.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8 → spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223}/_shadows.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_typography.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223/_utilities.scssc +0 -0
- data/{test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8 → spec/dummy/tmp/cache/sass/f3dc328b9588c36647c8e87cc67c412cafc8c223}/_variables.css.scssc +0 -0
- data/spec/factories.rb +11 -0
- data/spec/javascripts/editor_spec.js +149 -0
- data/spec/javascripts/spec_helper.js +5 -0
- data/spec/javascripts/support/mock_wysihtml5.js +3 -0
- data/spec/javascripts/templates/editor.jst.ejs +7 -0
- data/spec/requests/pages_request_spec.rb +12 -0
- data/spec/spec_helper.rb +46 -0
- data/spec/support/sign_in_helpers.rb +12 -0
- data/{test/dummy/tmp/cache/assets/E09/9D0/sprockets%2F6ebd49e8fab7b27e05b33fd5d08ff3e6 → vendor/assets/javascripts/wysihtml5.js} +0 -0
- metadata +614 -636
- data/app/assets/images/active_admin/editor/icons.png +0 -0
- data/app/assets/javascripts/active_admin/editor/core.js.coffee +0 -114
- data/app/assets/javascripts/active_admin/editor/quicksave.js +0 -36
- data/app/models/asset.rb +0 -3
- data/app/models/image_asset.rb +0 -5
- data/app/uploaders/image_asset_uploader.rb +0 -62
- data/db/migrate/20120510000541_create_assets.rb +0 -10
- data/db/migrate/20120511003637_add_dimensions_to_asset.rb +0 -5
- data/lib/active_admin/editor/admin/assets.rb +0 -73
- data/lib/generators/active_admin/editor/templates/wysiwyg.css +0 -130
- data/test/active_admin_editor_test.rb +0 -7
- data/test/dummy/app/assets/javascripts/active_admin.js +0 -2
- data/test/dummy/app/assets/javascripts/pages.js +0 -2
- data/test/dummy/app/assets/stylesheets/pages.css.scss +0 -3
- data/test/dummy/app/assets/stylesheets/scaffolds.css.scss +0 -56
- data/test/dummy/app/controllers/pages_controller.rb +0 -2
- data/test/dummy/app/helpers/pages_helper.rb +0 -2
- data/test/dummy/app/views/pages/_form.html.erb +0 -25
- data/test/dummy/app/views/pages/edit.html.erb +0 -6
- data/test/dummy/app/views/pages/index.html.erb +0 -25
- data/test/dummy/app/views/pages/new.html.erb +0 -5
- data/test/dummy/app/views/pages/show.html.erb +0 -15
- data/test/dummy/config/routes.rb +0 -64
- data/test/dummy/db/migrate/20120510000716_create_assets.active_admin_editor.rb +0 -11
- data/test/dummy/db/migrate/20120511003700_add_dimensions_to_asset.active_admin_editor.rb +0 -6
- data/test/dummy/log/development.log +0 -31941
- data/test/dummy/log/test.log +0 -2
- data/test/dummy/public/assets/wysiwyg.css +0 -130
- data/test/dummy/public/uploads/image_asset/storage/54/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/54/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/54/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/54/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/54/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/55/Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/55/half_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/55/one_quarter_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/55/three_quarters_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/55/thumb_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/56/57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/56/half_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/56/one_quarter_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/56/three_quarters_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/56/thumb_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/57/half_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/57/one_quarter_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/57/sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/57/three_quarters_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/57/thumb_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/58/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/58/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/58/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/58/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/58/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/59/half_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/59/one_quarter_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/59/sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/59/three_quarters_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/59/thumb_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/60/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/60/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/60/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/60/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/60/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/61/half_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/61/one_quarter_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/61/sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/61/three_quarters_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/61/thumb_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/62/Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/62/half_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/62/one_quarter_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/62/three_quarters_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/62/thumb_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/63/Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/63/half_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/63/one_quarter_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/63/three_quarters_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/63/thumb_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/64/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/64/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/64/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/64/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/64/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/65/Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/65/half_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/65/one_quarter_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/65/three_quarters_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/65/thumb_Howard_Carter-2012-hp.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/66/57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/66/half_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/66/one_quarter_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/66/three_quarters_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/66/thumb_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/67/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/67/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/67/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/67/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/67/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/68/half_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/68/one_quarter_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/68/sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/68/three_quarters_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/68/thumb_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/69/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/69/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/69/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/69/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/69/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/70/half_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/70/one_quarter_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/70/sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/70/three_quarters_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/70/thumb_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/71/57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/71/half_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/71/one_quarter_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/71/three_quarters_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/71/thumb_57056_435442738470_535763470_5037008_1205729_o.jpg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/72/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/72/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/72/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/72/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/72/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/73/half_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/73/one_quarter_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/73/sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/73/three_quarters_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/73/thumb_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/74/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/74/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/74/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/74/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/74/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/75/half_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/75/one_quarter_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/75/sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/75/three_quarters_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/75/thumb_sonic.gif +0 -0
- data/test/dummy/public/uploads/image_asset/storage/76/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/76/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/76/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/76/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/76/thumb_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/77/download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/77/half_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/77/one_quarter_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/77/three_quarters_download.jpeg +0 -0
- data/test/dummy/public/uploads/image_asset/storage/77/thumb_download.jpeg +0 -0
- data/test/dummy/spec/spec_helper.rb +0 -32
- data/test/dummy/tmp/cache/assets/C72/380/sprockets%2F085743324cb9a032a0440c87176ef50e +0 -0
- data/test/dummy/tmp/cache/assets/CA9/330/sprockets%2F0046f25f9e307b161d310611dd9858dd +0 -0
- data/test/dummy/tmp/cache/assets/CB2/5A0/sprockets%2F4e7c202a6f2335881a86d6fc17329d08 +0 -0
- data/test/dummy/tmp/cache/assets/CB7/160/sprockets%2F9b2ab958728324ca63e77600c53e934e +0 -0
- data/test/dummy/tmp/cache/assets/CC6/480/sprockets%2Ff8e54e577438cf26bf468009786a903a +0 -0
- data/test/dummy/tmp/cache/assets/CCB/F60/sprockets%2F37e7f721672108ddf565be87f469459b +0 -0
- data/test/dummy/tmp/cache/assets/CD4/1E0/sprockets%2F46501789497b9c56ccf438f9888b0ee5 +0 -0
- data/test/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
- data/test/dummy/tmp/cache/assets/CDC/C10/sprockets%2F0b87133dfa360f2799bc4e4a1f605770 +0 -0
- data/test/dummy/tmp/cache/assets/CDE/3A0/sprockets%2F0bca93682984766a76d0be1ac5224d63 +0 -0
- data/test/dummy/tmp/cache/assets/CDF/3D0/sprockets%2Ff3b4991c7e984391cbed33d0e7307110 +0 -0
- data/test/dummy/tmp/cache/assets/CE7/D20/sprockets%2F0cf7e72de6c0096314484bc8741983be +0 -0
- data/test/dummy/tmp/cache/assets/CFD/D30/sprockets%2Ff597343ff4246e6b1342a2040eb1aed0 +0 -0
- data/test/dummy/tmp/cache/assets/D00/490/sprockets%2F60ff8fc770f770b47a563e8cd4696994 +0 -0
- data/test/dummy/tmp/cache/assets/D12/D90/sprockets%2F730166fec55450e25f338d94f25fbdb2 +0 -0
- data/test/dummy/tmp/cache/assets/D14/4C0/sprockets%2F3c885645faaced56cd6241ff72731452 +0 -0
- data/test/dummy/tmp/cache/assets/D17/140/sprockets%2F84b539318e251143175dc9dddd94ef5a +0 -0
- data/test/dummy/tmp/cache/assets/D1A/B10/sprockets%2F5b1418eaf731d31cbde4896984a974b5 +0 -0
- data/test/dummy/tmp/cache/assets/D1D/A50/sprockets%2Ff93342e6a970ec28f95fee502f8621f0 +0 -0
- data/test/dummy/tmp/cache/assets/D1F/BF0/sprockets%2F1201bb2d37e022d6c51a70b79d2bad62 +0 -0
- data/test/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
- data/test/dummy/tmp/cache/assets/D3B/280/sprockets%2Ff11f6091cf86dad1b6049f0f4a3064d9 +0 -0
- data/test/dummy/tmp/cache/assets/D41/2F0/sprockets%2Fe5d704d8dc364cb7e3e822bb4e253916 +0 -0
- data/test/dummy/tmp/cache/assets/D41/420/sprockets%2F1990ec015968043c3be576cbaf73aee6 +0 -0
- data/test/dummy/tmp/cache/assets/D41/920/sprockets%2F174ee4ee4110194ef4862fd0970b6aef +0 -0
- data/test/dummy/tmp/cache/assets/D43/250/sprockets%2Fa8a2dca5967a78460fb409a874f502fb +0 -0
- data/test/dummy/tmp/cache/assets/D48/080/sprockets%2Fc0d6a8b862860337a9be9a967eb2e7b1 +0 -0
- data/test/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
- data/test/dummy/tmp/cache/assets/D4A/4D0/sprockets%2F3556ebc283be58663c77ce3d6bfa0468 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/EB0/sprockets%2F486aeddb095486c9fab90c44c193557f +0 -0
- data/test/dummy/tmp/cache/assets/D59/9F0/sprockets%2Fe178b2fe035eee0a035dec1307f5310c +0 -0
- data/test/dummy/tmp/cache/assets/D76/730/sprockets%2Fd1699d0cbcfe965c5c51a95e31580df2 +0 -0
- data/test/dummy/tmp/cache/assets/D7B/3E0/sprockets%2F8e7aef5bf1a26944e3344c59ce8b4a39 +0 -0
- data/test/dummy/tmp/cache/assets/D7F/4F0/sprockets%2F873b7bf710fdfa6d498d5d436c2a85f5 +0 -0
- data/test/dummy/tmp/cache/assets/D83/9A0/sprockets%2Fa60938962a537af3eabd578c6eff2f69 +0 -0
- data/test/dummy/tmp/cache/assets/D9F/8A0/sprockets%2Fc5848f3fb004cba9c50403ec7eeaf794 +0 -0
- data/test/dummy/tmp/cache/assets/DB5/060/sprockets%2Fce73aea0ce2d0cd644b010d36398aa5b +0 -0
- data/test/dummy/tmp/cache/assets/DBF/0B0/sprockets%2F1aacf4a74e2d4d026ee99e320d5b03ec +0 -0
- data/test/dummy/tmp/cache/assets/DC9/930/sprockets%2Fe4a488d2edd179e61b5120a31fbfdc7d +0 -0
- data/test/dummy/tmp/cache/assets/E2E/A70/sprockets%2F74bbb7a81546bbbd8dd7cdf128fba84c +0 -0
- data/test/dummy/tmp/cache/sass/2c5767f8b54c235968e95862ab983eb40c635a92/active_admin.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/52b571e0119322d02c8cc7bb4b050bea8f5bcd4d/wysiwyg.cssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_animation.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_appearance.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_background-image.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_background-size.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_border-radius.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_box-shadow.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_box-sizing.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_columns.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_flex-box.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_inline-block.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_linear-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_radial-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_transform.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_transition.scssc +0 -0
- data/test/dummy/tmp/cache/sass/673f56dad1dad173d9d03084181896c36c0dbf78/_user-select.scssc +0 -0
- data/test/dummy/tmp/cache/sass/81344752c8bed34a2e2b1a10124f3a9949022145/editor.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99/_deprecated-webkit-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99/_linear-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99/_radial-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/8a21f4ddb4e355cd1d27402133b3c3b4d52fef99/_tint-shade.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9fbb259b21224a40d373efb03472116bfe5b3080/_base.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9fbb259b21224a40d373efb03472116bfe5b3080/_forms.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9fbb259b21224a40d373efb03472116bfe5b3080/_header.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9fbb259b21224a40d373efb03472116bfe5b3080/_mixins.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9fbb259b21224a40d373efb03472116bfe5b3080/_typography.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/b58525431f2249a229cce8231a7c54e172a70fca/_bourbon.scssc +0 -0
- data/test/dummy/tmp/cache/sass/cf06b6cc81899a787b5cd92ca81915d948392791/_dashboard.scssc +0 -0
- data/test/dummy/tmp/cache/sass/cf06b6cc81899a787b5cd92ca81915d948392791/_logged_out.scssc +0 -0
- data/test/dummy/tmp/cache/sass/d4fa0ff2408ef66f63a8a338cbe8bfd596851f99/_button.scssc +0 -0
- data/test/dummy/tmp/cache/sass/d4fa0ff2408ef66f63a8a338cbe8bfd596851f99/_clearfix.scssc +0 -0
- data/test/dummy/tmp/cache/sass/d4fa0ff2408ef66f63a8a338cbe8bfd596851f99/_html5-input-types.scssc +0 -0
- data/test/dummy/tmp/cache/sass/d4fa0ff2408ef66f63a8a338cbe8bfd596851f99/_position.scssc +0 -0
- data/test/dummy/tmp/cache/sass/d4fa0ff2408ef66f63a8a338cbe8bfd596851f99/_timing-functions.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ed6594695ffe5aab1687dbefdc87d116d8df5097/_footer.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ed6594695ffe5aab1687dbefdc87d116d8df5097/_main_structure.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ed6594695ffe5aab1687dbefdc87d116d8df5097/_title_bar.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_buttons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_gradients.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_icons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_rounded.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_sections.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_typography.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fae26a125b983ba9d6ccccd7a9247d9c55158fb8/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_blank_slates.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_breadcrumbs.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_buttons.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_comments.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_date_picker.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_flash_messages.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_grid.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_links.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_pagination.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_panels.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_scopes.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_status_tags.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_table_tools.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fc6d9c30657c60e19616d65bb39967cfb21769bb/_tables.css.scssc +0 -0
- data/test/dummy/tmp/restart.txt +0 -0
- data/test/test_helper.rb +0 -15
- data/vendor/assets/javascripts/active_admin/editor/fileuploader.js +0 -1248
- data/vendor/assets/javascripts/active_admin/editor/jquery.paginate.min.js +0 -1
- data/vendor/assets/javascripts/active_admin/editor/wysihtml5.min.js +0 -261
- data/vendor/assets/javascripts/active_admin/editor/wysihtml5/parser_rules.js +0 -553
data/README.md
CHANGED
@@ -1,52 +1,35 @@
|
|
1
1
|
# Active Admin Editor
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/ejholmes/active_admin_editor.png)](https://travis-ci.org/ejholmes/active_admin_editor)
|
4
|
+
|
5
|
+
This is a wysiwyg html editor for the [Active Admin](http://activeadmin.info/)
|
4
6
|
interface using [wysihtml5](https://github.com/xing/wysihtml5).
|
5
7
|
|
6
|
-
![screenshot](
|
8
|
+
![screenshot](https://dl.dropbox.com/u/1906634/Captured/6V2rZ.png)
|
7
9
|
|
8
10
|
## Installation
|
9
11
|
|
10
|
-
|
11
|
-
# Gemfile
|
12
|
+
Add the following to your `Gemfile`:
|
12
13
|
|
14
|
+
```ruby
|
13
15
|
gem 'active_admin_editor'
|
14
16
|
```
|
15
17
|
|
16
|
-
|
18
|
+
And include the wysiwyg styles in your `application.css`:
|
17
19
|
|
18
|
-
```
|
19
|
-
# app/assets/stylesheets/application.css
|
20
|
+
```css
|
20
21
|
//= require active_admin/editor/wysiwyg
|
21
22
|
```
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
# app/assets/javascripts/active_admin.js
|
27
|
-
//= require active_admin/editor
|
28
|
-
```
|
29
|
-
|
30
|
-
```ruby
|
31
|
-
# app/assets/javascripts/active_admin.css.scss
|
32
|
-
@import 'active_admin/editor';
|
33
|
-
```
|
34
|
-
|
35
|
-
Now install the migrations:
|
36
|
-
|
37
|
-
```bash
|
38
|
-
$ rake active_admin_editor:install:migrations
|
39
|
-
$ rake db:migrate
|
40
|
-
```
|
41
|
-
|
42
|
-
And finally install the wysiwyg css file:
|
24
|
+
Then run the following to install the default intializer:
|
43
25
|
|
44
26
|
```bash
|
45
27
|
$ rails g active_admin:editor
|
46
28
|
```
|
47
29
|
|
48
30
|
## Usage
|
49
|
-
|
31
|
+
|
32
|
+
This gem provides you with a custom formtastic input called `:html_editor` to build out an wysihtml5 enabled input.
|
50
33
|
All you have to do is specify the `:as` option for your inputs.
|
51
34
|
|
52
35
|
**Example**
|
@@ -63,3 +46,48 @@ ActiveAdmin.register Page do
|
|
63
46
|
end
|
64
47
|
end
|
65
48
|
```
|
49
|
+
|
50
|
+
## Image Uploads
|
51
|
+
|
52
|
+
The editor supports uploading of images direct to s3. Add the following to an
|
53
|
+
initializer:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
ActiveAdmin::Editor.configure do |config|
|
57
|
+
config.s3_bucket = '<your bucket>'
|
58
|
+
config.aws_access_key_id = '<your aws access key>'
|
59
|
+
config.aws_access_secret = '<your aws secret>'
|
60
|
+
# config.storage_dir = 'uploads'
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
Then add the following CORS configuration to the S3 bucket:
|
65
|
+
|
66
|
+
```xml
|
67
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
68
|
+
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
69
|
+
<CORSRule>
|
70
|
+
<AllowedOrigin>*</AllowedOrigin>
|
71
|
+
<AllowedMethod>PUT</AllowedMethod>
|
72
|
+
<AllowedMethod>POST</AllowedMethod>
|
73
|
+
<AllowedMethod>GET</AllowedMethod>
|
74
|
+
<AllowedMethod>HEAD</AllowedMethod>
|
75
|
+
<MaxAgeSeconds>3000</MaxAgeSeconds>
|
76
|
+
<ExposeHeader>Location</ExposeHeader>
|
77
|
+
<AllowedHeader>*</AllowedHeader>
|
78
|
+
</CORSRule>
|
79
|
+
</CORSConfiguration>
|
80
|
+
```
|
81
|
+
|
82
|
+
## Contributing
|
83
|
+
|
84
|
+
1. Fork it
|
85
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
86
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
87
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
88
|
+
5. Create new Pull Request
|
89
|
+
|
90
|
+
### Tests
|
91
|
+
|
92
|
+
Runy RSpec tests with `bundle exec rake`. Run JavaScript specs with `bundle
|
93
|
+
exec rake konacha:serve`.
|
data/Rakefile
CHANGED
@@ -12,27 +12,18 @@ rescue LoadError
|
|
12
12
|
RDoc::Task = Rake::RDocTask
|
13
13
|
end
|
14
14
|
|
15
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
-
rdoc.rdoc_dir = 'rdoc'
|
17
|
-
rdoc.title = 'ActiveAdminEditor'
|
18
|
-
rdoc.options << '--line-numbers'
|
19
|
-
rdoc.rdoc_files.include('README.rdoc')
|
20
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
15
|
Bundler::GemHelper.install_tasks
|
27
16
|
|
28
|
-
|
17
|
+
APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
29
19
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
t.pattern = 'test/**/*_test.rb'
|
34
|
-
t.verbose = false
|
35
|
-
end
|
20
|
+
Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f }
|
21
|
+
require 'rspec/core'
|
22
|
+
require 'rspec/core/rake_task'
|
36
23
|
|
24
|
+
desc 'Run all specs in spec directory (excluding plugin specs)'
|
25
|
+
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
|
37
26
|
|
38
|
-
task :default => :
|
27
|
+
task :default => :spec
|
28
|
+
task 'konacha:serve' => 'app:konacha:serve'
|
29
|
+
task 'konacha:run' => 'app:konacha:run'
|
Binary file
|
@@ -1,6 +1,14 @@
|
|
1
|
-
//= require
|
2
|
-
//= require active_admin/editor/
|
3
|
-
//= require active_admin/editor/
|
4
|
-
//= require active_admin/editor/
|
5
|
-
|
6
|
-
|
1
|
+
//= require wysihtml5
|
2
|
+
//= require active_admin/editor/editor
|
3
|
+
//= require active_admin/editor/config
|
4
|
+
//= require active_admin/editor/parser_rules
|
5
|
+
|
6
|
+
(function(window, document, $) {
|
7
|
+
window.AA.editors = []
|
8
|
+
|
9
|
+
$(function() {
|
10
|
+
$('.html_editor').each(function() {
|
11
|
+
window.AA.editors.push(new Editor(this, window.AA.editor))
|
12
|
+
})
|
13
|
+
})
|
14
|
+
})(window, document, jQuery)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
(function(window, document) {
|
2
|
+
window.AA = (window.AA || {})
|
3
|
+
window.AA.editor = (window.AA.editor || {})
|
4
|
+
|
5
|
+
<% %w(aws_access_key_id aws_access_secret s3_bucket storage_dir).each do |option| %>
|
6
|
+
window.AA.editor.<%= option %> = '<%= ActiveAdmin::Editor.configuration.send(option.to_sym) %>'
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
window.AA.editor.stylesheets = '<%= asset_path 'active_admin/editor/wysiwyg.css' %>'
|
10
|
+
window.AA.editor.spinner = '<%= asset_path 'active_admin/editor/loader.gif' %>'
|
11
|
+
window.AA.editor.uploads_enabled = <%= ActiveAdmin::Editor.configuration.s3_configured? %>
|
12
|
+
})(window, document)
|
@@ -0,0 +1,101 @@
|
|
1
|
+
//= require_tree ./templates
|
2
|
+
|
3
|
+
(function(window, document, wysihtml5) {
|
4
|
+
var config = null
|
5
|
+
|
6
|
+
var Editor = function(el, _config) {
|
7
|
+
config = _config
|
8
|
+
var _this = this
|
9
|
+
this.$el = $(el)
|
10
|
+
this.$textarea = this.$el.find('textarea')
|
11
|
+
this.policy = this.$el.data('policy')
|
12
|
+
|
13
|
+
this.addToolbar()
|
14
|
+
this.attachEditor()
|
15
|
+
}
|
16
|
+
|
17
|
+
Editor.prototype.addToolbar = function() {
|
18
|
+
var template = JST['active_admin/editor/templates/toolbar']({
|
19
|
+
id: this.$el.attr('id') + '-toolbar'
|
20
|
+
})
|
21
|
+
|
22
|
+
this.$toolbar = $(template)
|
23
|
+
|
24
|
+
if (config.uploads_enabled) {
|
25
|
+
var _this = this
|
26
|
+
this.$toolbar.find('input.uploadable').each(function() {
|
27
|
+
_this.addUploader(this)
|
28
|
+
})
|
29
|
+
}
|
30
|
+
|
31
|
+
this.$el.find('.wrap').prepend(this.$toolbar)
|
32
|
+
}
|
33
|
+
|
34
|
+
Editor.prototype.addUploader = function(input) {
|
35
|
+
var $input = $(input)
|
36
|
+
|
37
|
+
var template = JST['active_admin/editor/templates/uploader']({ spinner: config.spinner })
|
38
|
+
var $uploader = $(template)
|
39
|
+
|
40
|
+
var $dialog = $input.closest('[data-wysihtml5-dialog]')
|
41
|
+
$dialog.append($uploader)
|
42
|
+
|
43
|
+
var _this = this
|
44
|
+
$uploader.find('input:file').on('change', function() {
|
45
|
+
$input.val('')
|
46
|
+
_this.upload(this.files[0], function(location) {
|
47
|
+
$input.val(location)
|
48
|
+
})
|
49
|
+
})
|
50
|
+
}
|
51
|
+
|
52
|
+
Editor.prototype.attachEditor = function() {
|
53
|
+
this.editor = new wysihtml5.Editor(this.$textarea.attr('id'), {
|
54
|
+
toolbar: this.$toolbar.attr('id'),
|
55
|
+
stylesheets: config.stylesheets,
|
56
|
+
parserRules: config.parserRules
|
57
|
+
})
|
58
|
+
}
|
59
|
+
|
60
|
+
Editor.prototype.uploading = function(uploading) {
|
61
|
+
this._uploading = uploading
|
62
|
+
this.$el.toggleClass('uploading', this._uploading)
|
63
|
+
return this._uploading
|
64
|
+
}
|
65
|
+
|
66
|
+
Editor.prototype.upload = function(file, callback) {
|
67
|
+
var _this = this
|
68
|
+
_this.uploading(true)
|
69
|
+
|
70
|
+
var xhr = new XMLHttpRequest()
|
71
|
+
, fd = new FormData()
|
72
|
+
, key = config.storage_dir + '/' + Date.now().toString() + '-' + file.name
|
73
|
+
|
74
|
+
fd.append('key', key)
|
75
|
+
fd.append('AWSAccessKeyId', config.aws_access_key_id)
|
76
|
+
fd.append('acl', 'public-read')
|
77
|
+
fd.append('policy', this.policy.document)
|
78
|
+
fd.append('signature', this.policy.signature)
|
79
|
+
fd.append('Content-Type', file.type)
|
80
|
+
fd.append('file', file)
|
81
|
+
|
82
|
+
xhr.upload.addEventListener('progress', function(e) {
|
83
|
+
_this.loaded = e.loaded
|
84
|
+
_this.total = e.total
|
85
|
+
_this.progress = e.loaded / e.total
|
86
|
+
}, false)
|
87
|
+
|
88
|
+
xhr.onreadystatechange = function() {
|
89
|
+
if (xhr.readyState != 4) { return }
|
90
|
+
_this.uploading(false)
|
91
|
+
callback(xhr.getResponseHeader('Location'))
|
92
|
+
}
|
93
|
+
|
94
|
+
xhr.open('POST', 'https://' + config.s3_bucket + '.s3.amazonaws.com', true)
|
95
|
+
xhr.send(fd)
|
96
|
+
|
97
|
+
return xhr
|
98
|
+
}
|
99
|
+
|
100
|
+
window.Editor = Editor
|
101
|
+
})(window, document, wysihtml5)
|
@@ -0,0 +1,561 @@
|
|
1
|
+
/**
|
2
|
+
* Full HTML5 compatibility rule set
|
3
|
+
* These rules define which tags and CSS classes are supported and which tags should be specially treated.
|
4
|
+
*
|
5
|
+
* Examples based on this rule set:
|
6
|
+
*
|
7
|
+
* <a href="http://foobar.com">foo</a>
|
8
|
+
* ... becomes ...
|
9
|
+
* <a href="http://foobar.com" target="_blank" rel="nofollow">foo</a>
|
10
|
+
*
|
11
|
+
* <img align="left" src="http://foobar.com/image.png">
|
12
|
+
* ... becomes ...
|
13
|
+
* <img class="wysiwyg-float-left" src="http://foobar.com/image.png" alt="">
|
14
|
+
*
|
15
|
+
* <div>foo<script>alert(document.cookie)</script></div>
|
16
|
+
* ... becomes ...
|
17
|
+
* <div>foo</div>
|
18
|
+
*
|
19
|
+
* <marquee>foo</marquee>
|
20
|
+
* ... becomes ...
|
21
|
+
* <span>foo</span>
|
22
|
+
*
|
23
|
+
* foo <br clear="both"> bar
|
24
|
+
* ... becomes ...
|
25
|
+
* foo <br class="wysiwyg-clear-both"> bar
|
26
|
+
*
|
27
|
+
* <div>hello <iframe src="http://google.com"></iframe></div>
|
28
|
+
* ... becomes ...
|
29
|
+
* <div>hello </div>
|
30
|
+
*
|
31
|
+
* <center>hello</center>
|
32
|
+
* ... becomes ...
|
33
|
+
* <div class="wysiwyg-text-align-center">hello</div>
|
34
|
+
*/
|
35
|
+
|
36
|
+
(function(window, document) {
|
37
|
+
window.AA = (window.AA || {})
|
38
|
+
window.AA.editor = (window.AA.editor || {})
|
39
|
+
|
40
|
+
var parserRules = {
|
41
|
+
/**
|
42
|
+
* CSS Class white-list
|
43
|
+
* Following CSS classes won't be removed when parsed by the wysihtml5 HTML parser
|
44
|
+
*/
|
45
|
+
"classes": {
|
46
|
+
"wysiwyg-clear-both": 1,
|
47
|
+
"wysiwyg-clear-left": 1,
|
48
|
+
"wysiwyg-clear-right": 1,
|
49
|
+
"wysiwyg-color-aqua": 1,
|
50
|
+
"wysiwyg-color-black": 1,
|
51
|
+
"wysiwyg-color-blue": 1,
|
52
|
+
"wysiwyg-color-fuchsia": 1,
|
53
|
+
"wysiwyg-color-gray": 1,
|
54
|
+
"wysiwyg-color-green": 1,
|
55
|
+
"wysiwyg-color-lime": 1,
|
56
|
+
"wysiwyg-color-maroon": 1,
|
57
|
+
"wysiwyg-color-navy": 1,
|
58
|
+
"wysiwyg-color-olive": 1,
|
59
|
+
"wysiwyg-color-purple": 1,
|
60
|
+
"wysiwyg-color-red": 1,
|
61
|
+
"wysiwyg-color-silver": 1,
|
62
|
+
"wysiwyg-color-teal": 1,
|
63
|
+
"wysiwyg-color-white": 1,
|
64
|
+
"wysiwyg-color-yellow": 1,
|
65
|
+
"wysiwyg-float-left": 1,
|
66
|
+
"wysiwyg-float-right": 1,
|
67
|
+
"wysiwyg-font-size-large": 1,
|
68
|
+
"wysiwyg-font-size-larger": 1,
|
69
|
+
"wysiwyg-font-size-medium": 1,
|
70
|
+
"wysiwyg-font-size-small": 1,
|
71
|
+
"wysiwyg-font-size-smaller": 1,
|
72
|
+
"wysiwyg-font-size-x-large": 1,
|
73
|
+
"wysiwyg-font-size-x-small": 1,
|
74
|
+
"wysiwyg-font-size-xx-large": 1,
|
75
|
+
"wysiwyg-font-size-xx-small": 1,
|
76
|
+
"wysiwyg-text-align-center": 1,
|
77
|
+
"wysiwyg-text-align-justify": 1,
|
78
|
+
"wysiwyg-text-align-left": 1,
|
79
|
+
"wysiwyg-text-align-right": 1
|
80
|
+
},
|
81
|
+
/**
|
82
|
+
* Tag list
|
83
|
+
*
|
84
|
+
* The following options are available:
|
85
|
+
*
|
86
|
+
* - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
|
87
|
+
* The following methods are implemented in wysihtml5.dom.parse:
|
88
|
+
* - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
|
89
|
+
* <p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
|
90
|
+
* - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
|
91
|
+
* <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
|
92
|
+
* - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
|
93
|
+
*
|
94
|
+
* - remove: removes the element and its content
|
95
|
+
*
|
96
|
+
* - rename_tag: renames the element to the given tag
|
97
|
+
*
|
98
|
+
* - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
|
99
|
+
*
|
100
|
+
* - set_attributes: sets/overrides the given attributes
|
101
|
+
*
|
102
|
+
* - check_attributes: checks the given HTML attribute via the given method
|
103
|
+
* - url: allows only valid urls (starting with http:// or https://)
|
104
|
+
* - src: allows something like "/foobar.jpg", "http://google.com", ...
|
105
|
+
* - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg"
|
106
|
+
* - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
|
107
|
+
* - numbers: ensures that the attribute only contains numeric characters
|
108
|
+
*/
|
109
|
+
"tags": {
|
110
|
+
"tr": {
|
111
|
+
"add_class": {
|
112
|
+
"align": "align_text"
|
113
|
+
}
|
114
|
+
},
|
115
|
+
"strike": {
|
116
|
+
"remove": 1
|
117
|
+
},
|
118
|
+
"form": {
|
119
|
+
"rename_tag": "div"
|
120
|
+
},
|
121
|
+
"rt": {
|
122
|
+
"rename_tag": "span"
|
123
|
+
},
|
124
|
+
"code": {},
|
125
|
+
"acronym": {
|
126
|
+
"rename_tag": "span"
|
127
|
+
},
|
128
|
+
"br": {
|
129
|
+
"add_class": {
|
130
|
+
"clear": "clear_br"
|
131
|
+
}
|
132
|
+
},
|
133
|
+
"details": {
|
134
|
+
"rename_tag": "div"
|
135
|
+
},
|
136
|
+
"h4": {
|
137
|
+
"add_class": {
|
138
|
+
"align": "align_text"
|
139
|
+
}
|
140
|
+
},
|
141
|
+
"em": {},
|
142
|
+
"title": {
|
143
|
+
"remove": 1
|
144
|
+
},
|
145
|
+
"multicol": {
|
146
|
+
"rename_tag": "div"
|
147
|
+
},
|
148
|
+
"figure": {
|
149
|
+
"rename_tag": "div"
|
150
|
+
},
|
151
|
+
"xmp": {
|
152
|
+
"rename_tag": "span"
|
153
|
+
},
|
154
|
+
"small": {
|
155
|
+
"rename_tag": "span",
|
156
|
+
"set_class": "wysiwyg-font-size-smaller"
|
157
|
+
},
|
158
|
+
"area": {
|
159
|
+
"remove": 1
|
160
|
+
},
|
161
|
+
"time": {
|
162
|
+
"rename_tag": "span"
|
163
|
+
},
|
164
|
+
"dir": {
|
165
|
+
"rename_tag": "ul"
|
166
|
+
},
|
167
|
+
"bdi": {
|
168
|
+
"rename_tag": "span"
|
169
|
+
},
|
170
|
+
"command": {
|
171
|
+
"remove": 1
|
172
|
+
},
|
173
|
+
"ul": {},
|
174
|
+
"progress": {
|
175
|
+
"rename_tag": "span"
|
176
|
+
},
|
177
|
+
"dfn": {
|
178
|
+
"rename_tag": "span"
|
179
|
+
},
|
180
|
+
"iframe": {
|
181
|
+
"remove": 1
|
182
|
+
},
|
183
|
+
"figcaption": {
|
184
|
+
"rename_tag": "div"
|
185
|
+
},
|
186
|
+
"a": {
|
187
|
+
"check_attributes": {
|
188
|
+
"href": "url" // if you compiled master manually then change this from 'url' to 'href'
|
189
|
+
},
|
190
|
+
"set_attributes": {
|
191
|
+
"rel": "nofollow",
|
192
|
+
"target": "_blank"
|
193
|
+
}
|
194
|
+
},
|
195
|
+
"img": {
|
196
|
+
"check_attributes": {
|
197
|
+
"width": "numbers",
|
198
|
+
"alt": "alt",
|
199
|
+
"src": "url", // if you compiled master manually then change this from 'url' to 'src'
|
200
|
+
"height": "numbers"
|
201
|
+
},
|
202
|
+
"add_class": {
|
203
|
+
"align": "align_img"
|
204
|
+
}
|
205
|
+
},
|
206
|
+
"rb": {
|
207
|
+
"rename_tag": "span"
|
208
|
+
},
|
209
|
+
"footer": {
|
210
|
+
"rename_tag": "div"
|
211
|
+
},
|
212
|
+
"noframes": {
|
213
|
+
"remove": 1
|
214
|
+
},
|
215
|
+
"abbr": {
|
216
|
+
"rename_tag": "span"
|
217
|
+
},
|
218
|
+
"u": {},
|
219
|
+
"bgsound": {
|
220
|
+
"remove": 1
|
221
|
+
},
|
222
|
+
"sup": {
|
223
|
+
"rename_tag": "span"
|
224
|
+
},
|
225
|
+
"address": {
|
226
|
+
"rename_tag": "div"
|
227
|
+
},
|
228
|
+
"basefont": {
|
229
|
+
"remove": 1
|
230
|
+
},
|
231
|
+
"nav": {
|
232
|
+
"rename_tag": "div"
|
233
|
+
},
|
234
|
+
"h1": {
|
235
|
+
"add_class": {
|
236
|
+
"align": "align_text"
|
237
|
+
}
|
238
|
+
},
|
239
|
+
"head": {
|
240
|
+
"remove": 1
|
241
|
+
},
|
242
|
+
"tbody": {
|
243
|
+
"add_class": {
|
244
|
+
"align": "align_text"
|
245
|
+
}
|
246
|
+
},
|
247
|
+
"dd": {
|
248
|
+
"rename_tag": "div"
|
249
|
+
},
|
250
|
+
"s": {
|
251
|
+
"rename_tag": "span"
|
252
|
+
},
|
253
|
+
"li": {},
|
254
|
+
"td": {
|
255
|
+
"check_attributes": {
|
256
|
+
"rowspan": "numbers",
|
257
|
+
"colspan": "numbers"
|
258
|
+
},
|
259
|
+
"add_class": {
|
260
|
+
"align": "align_text"
|
261
|
+
}
|
262
|
+
},
|
263
|
+
"object": {
|
264
|
+
"remove": 1
|
265
|
+
},
|
266
|
+
"div": {
|
267
|
+
"add_class": {
|
268
|
+
"align": "align_text"
|
269
|
+
}
|
270
|
+
},
|
271
|
+
"option": {
|
272
|
+
"rename_tag": "span"
|
273
|
+
},
|
274
|
+
"select": {
|
275
|
+
"rename_tag": "span"
|
276
|
+
},
|
277
|
+
"i": {},
|
278
|
+
"track": {
|
279
|
+
"remove": 1
|
280
|
+
},
|
281
|
+
"wbr": {
|
282
|
+
"remove": 1
|
283
|
+
},
|
284
|
+
"fieldset": {
|
285
|
+
"rename_tag": "div"
|
286
|
+
},
|
287
|
+
"big": {
|
288
|
+
"rename_tag": "span",
|
289
|
+
"set_class": "wysiwyg-font-size-larger"
|
290
|
+
},
|
291
|
+
"button": {
|
292
|
+
"rename_tag": "span"
|
293
|
+
},
|
294
|
+
"noscript": {
|
295
|
+
"remove": 1
|
296
|
+
},
|
297
|
+
"svg": {
|
298
|
+
"remove": 1
|
299
|
+
},
|
300
|
+
"input": {
|
301
|
+
"remove": 1
|
302
|
+
},
|
303
|
+
"table": {},
|
304
|
+
"keygen": {
|
305
|
+
"remove": 1
|
306
|
+
},
|
307
|
+
"h5": {
|
308
|
+
"add_class": {
|
309
|
+
"align": "align_text"
|
310
|
+
}
|
311
|
+
},
|
312
|
+
"meta": {
|
313
|
+
"remove": 1
|
314
|
+
},
|
315
|
+
"map": {
|
316
|
+
"rename_tag": "div"
|
317
|
+
},
|
318
|
+
"isindex": {
|
319
|
+
"remove": 1
|
320
|
+
},
|
321
|
+
"mark": {
|
322
|
+
"rename_tag": "span"
|
323
|
+
},
|
324
|
+
"caption": {
|
325
|
+
"add_class": {
|
326
|
+
"align": "align_text"
|
327
|
+
}
|
328
|
+
},
|
329
|
+
"tfoot": {
|
330
|
+
"add_class": {
|
331
|
+
"align": "align_text"
|
332
|
+
}
|
333
|
+
},
|
334
|
+
"base": {
|
335
|
+
"remove": 1
|
336
|
+
},
|
337
|
+
"video": {
|
338
|
+
"remove": 1
|
339
|
+
},
|
340
|
+
"strong": {},
|
341
|
+
"canvas": {
|
342
|
+
"remove": 1
|
343
|
+
},
|
344
|
+
"output": {
|
345
|
+
"rename_tag": "span"
|
346
|
+
},
|
347
|
+
"marquee": {
|
348
|
+
"rename_tag": "span"
|
349
|
+
},
|
350
|
+
"b": {},
|
351
|
+
"q": {
|
352
|
+
"check_attributes": {
|
353
|
+
"cite": "url"
|
354
|
+
}
|
355
|
+
},
|
356
|
+
"applet": {
|
357
|
+
"remove": 1
|
358
|
+
},
|
359
|
+
"span": {},
|
360
|
+
"rp": {
|
361
|
+
"rename_tag": "span"
|
362
|
+
},
|
363
|
+
"spacer": {
|
364
|
+
"remove": 1
|
365
|
+
},
|
366
|
+
"source": {
|
367
|
+
"remove": 1
|
368
|
+
},
|
369
|
+
"aside": {
|
370
|
+
"rename_tag": "div"
|
371
|
+
},
|
372
|
+
"frame": {
|
373
|
+
"remove": 1
|
374
|
+
},
|
375
|
+
"section": {
|
376
|
+
"rename_tag": "div"
|
377
|
+
},
|
378
|
+
"body": {
|
379
|
+
"rename_tag": "div"
|
380
|
+
},
|
381
|
+
"ol": {},
|
382
|
+
"nobr": {
|
383
|
+
"rename_tag": "span"
|
384
|
+
},
|
385
|
+
"html": {
|
386
|
+
"rename_tag": "div"
|
387
|
+
},
|
388
|
+
"summary": {
|
389
|
+
"rename_tag": "span"
|
390
|
+
},
|
391
|
+
"var": {
|
392
|
+
"rename_tag": "span"
|
393
|
+
},
|
394
|
+
"del": {
|
395
|
+
"remove": 1
|
396
|
+
},
|
397
|
+
"blockquote": {
|
398
|
+
"check_attributes": {
|
399
|
+
"cite": "url"
|
400
|
+
}
|
401
|
+
},
|
402
|
+
"style": {
|
403
|
+
"remove": 1
|
404
|
+
},
|
405
|
+
"device": {
|
406
|
+
"remove": 1
|
407
|
+
},
|
408
|
+
"meter": {
|
409
|
+
"rename_tag": "span"
|
410
|
+
},
|
411
|
+
"h3": {
|
412
|
+
"add_class": {
|
413
|
+
"align": "align_text"
|
414
|
+
}
|
415
|
+
},
|
416
|
+
"textarea": {
|
417
|
+
"rename_tag": "span"
|
418
|
+
},
|
419
|
+
"embed": {
|
420
|
+
"remove": 1
|
421
|
+
},
|
422
|
+
"hgroup": {
|
423
|
+
"rename_tag": "div"
|
424
|
+
},
|
425
|
+
"font": {
|
426
|
+
"rename_tag": "span",
|
427
|
+
"add_class": {
|
428
|
+
"size": "size_font"
|
429
|
+
}
|
430
|
+
},
|
431
|
+
"tt": {
|
432
|
+
"rename_tag": "span"
|
433
|
+
},
|
434
|
+
"noembed": {
|
435
|
+
"remove": 1
|
436
|
+
},
|
437
|
+
"thead": {
|
438
|
+
"add_class": {
|
439
|
+
"align": "align_text"
|
440
|
+
}
|
441
|
+
},
|
442
|
+
"blink": {
|
443
|
+
"rename_tag": "span"
|
444
|
+
},
|
445
|
+
"plaintext": {
|
446
|
+
"rename_tag": "span"
|
447
|
+
},
|
448
|
+
"xml": {
|
449
|
+
"remove": 1
|
450
|
+
},
|
451
|
+
"h6": {
|
452
|
+
"add_class": {
|
453
|
+
"align": "align_text"
|
454
|
+
}
|
455
|
+
},
|
456
|
+
"param": {
|
457
|
+
"remove": 1
|
458
|
+
},
|
459
|
+
"th": {
|
460
|
+
"check_attributes": {
|
461
|
+
"rowspan": "numbers",
|
462
|
+
"colspan": "numbers"
|
463
|
+
},
|
464
|
+
"add_class": {
|
465
|
+
"align": "align_text"
|
466
|
+
}
|
467
|
+
},
|
468
|
+
"legend": {
|
469
|
+
"rename_tag": "span"
|
470
|
+
},
|
471
|
+
"hr": {},
|
472
|
+
"label": {
|
473
|
+
"rename_tag": "span"
|
474
|
+
},
|
475
|
+
"dl": {
|
476
|
+
"rename_tag": "div"
|
477
|
+
},
|
478
|
+
"kbd": {
|
479
|
+
"rename_tag": "span"
|
480
|
+
},
|
481
|
+
"listing": {
|
482
|
+
"rename_tag": "div"
|
483
|
+
},
|
484
|
+
"dt": {
|
485
|
+
"rename_tag": "span"
|
486
|
+
},
|
487
|
+
"nextid": {
|
488
|
+
"remove": 1
|
489
|
+
},
|
490
|
+
"pre": {},
|
491
|
+
"center": {
|
492
|
+
"rename_tag": "div",
|
493
|
+
"set_class": "wysiwyg-text-align-center"
|
494
|
+
},
|
495
|
+
"audio": {
|
496
|
+
"remove": 1
|
497
|
+
},
|
498
|
+
"datalist": {
|
499
|
+
"rename_tag": "span"
|
500
|
+
},
|
501
|
+
"samp": {
|
502
|
+
"rename_tag": "span"
|
503
|
+
},
|
504
|
+
"col": {
|
505
|
+
"remove": 1
|
506
|
+
},
|
507
|
+
"article": {
|
508
|
+
"rename_tag": "div"
|
509
|
+
},
|
510
|
+
"cite": {},
|
511
|
+
"link": {
|
512
|
+
"remove": 1
|
513
|
+
},
|
514
|
+
"script": {
|
515
|
+
"remove": 1
|
516
|
+
},
|
517
|
+
"bdo": {
|
518
|
+
"rename_tag": "span"
|
519
|
+
},
|
520
|
+
"menu": {
|
521
|
+
"rename_tag": "ul"
|
522
|
+
},
|
523
|
+
"colgroup": {
|
524
|
+
"remove": 1
|
525
|
+
},
|
526
|
+
"ruby": {
|
527
|
+
"rename_tag": "span"
|
528
|
+
},
|
529
|
+
"h2": {
|
530
|
+
"add_class": {
|
531
|
+
"align": "align_text"
|
532
|
+
}
|
533
|
+
},
|
534
|
+
"ins": {
|
535
|
+
"rename_tag": "span"
|
536
|
+
},
|
537
|
+
"p": {
|
538
|
+
"add_class": {
|
539
|
+
"align": "align_text"
|
540
|
+
}
|
541
|
+
},
|
542
|
+
"sub": {
|
543
|
+
"rename_tag": "span"
|
544
|
+
},
|
545
|
+
"comment": {
|
546
|
+
"remove": 1
|
547
|
+
},
|
548
|
+
"frameset": {
|
549
|
+
"remove": 1
|
550
|
+
},
|
551
|
+
"optgroup": {
|
552
|
+
"rename_tag": "span"
|
553
|
+
},
|
554
|
+
"header": {
|
555
|
+
"rename_tag": "div"
|
556
|
+
}
|
557
|
+
}
|
558
|
+
};
|
559
|
+
|
560
|
+
window.AA.editor.parserRules = parserRules
|
561
|
+
})(window, document)
|