├── app ├── assets │ ├── javascripts │ │ └── mercury.js │ └── stylesheets │ │ └── mercury.css ├── controllers │ └── mercury │ │ └── application_controller.rb └── views │ └── layouts │ └── mercury │ └── application.html.erb ├── Gemfile ├── config └── routes.rb ├── lib ├── mercury │ ├── version.rb │ └── engine.rb └── mercury-rails.rb ├── .gitignore ├── mercury-rails.gemspec ├── Rakefile ├── README.md └── LICENSE /app/assets/javascripts/mercury.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/stylesheets/mercury.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Mercury::Engine.routes.draw do 2 | end 3 | -------------------------------------------------------------------------------- /lib/mercury/version.rb: -------------------------------------------------------------------------------- 1 | module Mercury 2 | VERSION = '2.0.1' 3 | end 4 | -------------------------------------------------------------------------------- /lib/mercury-rails.rb: -------------------------------------------------------------------------------- 1 | require 'mercury/engine' 2 | 3 | module Mercury 4 | end 5 | -------------------------------------------------------------------------------- /lib/mercury/engine.rb: -------------------------------------------------------------------------------- 1 | module Mercury 2 | class Engine < ::Rails::Engine 3 | isolate_namespace Mercury 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/controllers/mercury/application_controller.rb: -------------------------------------------------------------------------------- 1 | module Mercury 2 | class ApplicationController < ActionController::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | log/*.log 3 | pkg/ 4 | spec/dummy/db/*.sqlite3 5 | spec/dummy/db/*.sqlite3-journal 6 | spec/dummy/log/*.log 7 | spec/dummy/tmp/ 8 | spec/dummy/.sass-cache 9 | -------------------------------------------------------------------------------- /app/views/layouts/mercury/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mercury 5 | <%= stylesheet_link_tag 'mercury/application' %> 6 | <%= javascript_include_tag 'mercury/application' %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mercury-rails.gemspec: -------------------------------------------------------------------------------- 1 | $:.push File.expand_path('../lib', __FILE__) 2 | 3 | require 'mercury/version' 4 | 5 | Gem::Specification.new do |s| 6 | s.name = 'mercury-rails' 7 | s.version = Mercury::VERSION 8 | s.authors = ['Jeremy Jackson'] 9 | s.email = ['jejacks0n@gmail.com'] 10 | s.homepage = 'http://github.com/jejacks0n/mercury' 11 | s.summary = %Q{Mercury2: The Rails HTML5 WYSIWYG editor} 12 | s.description = %Q{Mercury Editor is a Coffeescript and jQuery based WYSIWYG editor} 13 | 14 | s.files = Dir['{app,config,db,lib}/**/*', 'LICENSE', 'README.md'] 15 | 16 | s.add_dependency 'rails', '~> 4.0.0.rc1' 17 | s.add_development_dependency 'sqlite3' 18 | end 19 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #begin 2 | # require 'bundler/setup' 3 | #rescue LoadError 4 | # puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | #end 6 | # 7 | #require 'rdoc/task' 8 | # 9 | #RDoc::Task.new(:rdoc) do |rdoc| 10 | # rdoc.rdoc_dir = 'rdoc' 11 | # rdoc.title = 'MercuryRails' 12 | # rdoc.options << '--line-numbers' 13 | # rdoc.rdoc_files.include('README.md') 14 | # rdoc.rdoc_files.include('lib/**/*.rb') 15 | #end 16 | # 17 | #APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) 18 | #load 'rails/tasks/engine.rake' 19 | # 20 | # 21 | # 22 | #Bundler::GemHelper.install_tasks 23 | # 24 | #require 'rake/testtask' 25 | # 26 | #Rake::TestTask.new(:test) do |t| 27 | # t.libs << 'lib' 28 | # t.libs << 'test' 29 | # t.pattern = 'test/**/*_test.rb' 30 | # t.verbose = false 31 | #end 32 | # 33 | # 34 | #task default: :test 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Mercury Editor 2 - Rails Engine 2 | =============================== 3 | 4 | Mercury Editor is a web based WYSIWYG editor, and takes a different approach than any editor out there. It provides a full framework in which you can more easily create complex regions and interfaces. In Mercury Editor, regions dictate it's toolbars, buttons, and context for highlighting buttons. This simplifies the configuration, and provides more flexibility in terms of defining your own custom functionality that doesn't fit into the standard Mercury Editor features. 5 | 6 | Mercury Editor also provides a comprehensive plugin architecture. Plugins makes additional functionality easier to write, test, and maintain -- and allows for a more consistent way to provide it to others. 7 | 8 | 9 | ## Developer Notice 10 | 11 | This branch represents the future version of Mercury Editor. This iteration of Mercury Editor (Mercury2) separates the Rails portions from the Javascript portions of the project. This project serves as an example of how to implement functionality like snippets and image uploading/resizing. If you're interested in integrating Mercury2 with your own platform, this is the best place to start. 12 | 13 | This is currently a work in progress. 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mercury Editor is a Coffeescript and jQuery based WYSIWYG editor. 2 | 3 | Documentation and other useful information can be found at 4 | https://github.com/jejacks0n/mercury 5 | 6 | Copyright (c) 2011 Jeremy Jackson 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | --------------------------------------------------------------------------------