mercury-rails 0.2.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. data/app/controllers/{images_controller.rb → mercury/images_controller.rb} +3 -3
  2. data/app/controllers/mercury_controller.rb +13 -3
  3. data/app/models/{image.rb → mercury/image.rb} +3 -1
  4. data/app/views/layouts/mercury.html.erb +14 -6
  5. data/app/views/mercury/lightviews/about.html +7 -3
  6. data/app/views/mercury/modals/character.html +2 -2
  7. data/app/views/mercury/modals/htmleditor.html +2 -2
  8. data/app/views/mercury/modals/link.html +3 -3
  9. data/app/views/mercury/modals/media.html +3 -3
  10. data/app/views/mercury/modals/table.html +3 -3
  11. data/app/views/mercury/panels/snippets.html +1 -1
  12. data/app/views/mercury/selects/formatblock.html +9 -9
  13. data/app/views/mercury/snippets/example/options.html.erb +27 -16
  14. data/config/engine.rb +35 -0
  15. data/db/migrate/{20110526035601_create_images.rb → 20110526035601_create_mercury_images.rb} +2 -2
  16. data/features/loading/loading.feature +1 -1
  17. data/features/loading/navigating.feature +1 -1
  18. data/features/loading/user_interface.feature +2 -2
  19. data/features/regions/editable/basic_editing.feature +8 -8
  20. data/features/regions/editable/inserting_snippets.feature +4 -5
  21. data/features/regions/editable/inserting_tables.feature +9 -9
  22. data/features/step_definitions/mercury_steps.rb +20 -23
  23. data/features/step_definitions/web_steps.rb +5 -5
  24. data/features/support/mercury_selectors.rb +1 -0
  25. data/lib/generators/mercury/install/install_generator.rb +24 -3
  26. data/lib/generators/mercury/install/templates/mongoid_paperclip_image.rb +17 -0
  27. data/lib/mercury-rails.rb +0 -1
  28. data/lib/mercury/authentication.rb +8 -0
  29. data/spec/javascripts/mercury/dialog_spec.js.coffee +28 -21
  30. data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +0 -2
  31. data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +0 -2
  32. data/spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee +0 -2
  33. data/spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee +0 -2
  34. data/spec/javascripts/mercury/dialogs/style_spec.js.coffee +0 -2
  35. data/spec/javascripts/mercury/history_buffer_spec.js.coffee +0 -2
  36. data/spec/javascripts/mercury/lightview_spec.js.coffee +42 -21
  37. data/spec/javascripts/mercury/mercury_spec.js.coffee +87 -7
  38. data/spec/javascripts/mercury/modal_spec.js.coffee +53 -23
  39. data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +0 -2
  40. data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +2 -3
  41. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +0 -2
  42. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +2 -2
  43. data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +0 -2
  44. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +2 -4
  45. data/spec/javascripts/mercury/native_extensions_spec.js.coffee +20 -2
  46. data/spec/javascripts/mercury/page_editor_spec.js.coffee +130 -35
  47. data/spec/javascripts/mercury/palette_spec.js.coffee +4 -6
  48. data/spec/javascripts/mercury/panel_spec.js.coffee +44 -6
  49. data/spec/javascripts/mercury/region_spec.js.coffee +42 -8
  50. data/spec/javascripts/mercury/regions/editable_spec.js.coffee +0 -2
  51. data/spec/javascripts/mercury/regions/markupable_spec.js.coffee +0 -2
  52. data/spec/javascripts/mercury/regions/snippetable_spec.js.coffee +3 -5
  53. data/spec/javascripts/mercury/select_spec.js.coffee +4 -6
  54. data/spec/javascripts/mercury/snippet_spec.js.coffee +3 -4
  55. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +2 -4
  56. data/spec/javascripts/mercury/statusbar_spec.js.coffee +0 -2
  57. data/spec/javascripts/mercury/table_editor_spec.js.coffee +2 -4
  58. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +0 -2
  59. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +34 -15
  60. data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +0 -2
  61. data/spec/javascripts/mercury/toolbar_spec.js.coffee +41 -26
  62. data/spec/javascripts/mercury/tooltip_spec.js.coffee +3 -5
  63. data/spec/javascripts/mercury/uploader_spec.js.coffee +8 -14
  64. data/spec/javascripts/spec_helper.js +1 -0
  65. data/spec/javascripts/templates/mercury/page_editor.html +1 -0
  66. data/spec/javascripts/templates/mercury/region.html +2 -2
  67. data/vendor/assets/images/mercury/missing-image.png +0 -0
  68. data/vendor/assets/javascripts/mercury.js +218 -112
  69. data/vendor/assets/javascripts/mercury/dependencies/{jquery-1.6.js → jquery-1.7.js} +2030 -1595
  70. data/vendor/assets/javascripts/mercury/dependencies/jquery.additions.js +55 -0
  71. data/vendor/assets/javascripts/mercury/dialog.js.coffee +7 -5
  72. data/vendor/assets/javascripts/mercury/dialogs/backcolor.js.coffee +1 -1
  73. data/vendor/assets/javascripts/mercury/dialogs/forecolor.js.coffee +1 -1
  74. data/vendor/assets/javascripts/mercury/dialogs/formatblock.js.coffee +1 -1
  75. data/vendor/assets/javascripts/mercury/dialogs/{objectspanel.js.coffee → snippetpanel.js.coffee} +2 -2
  76. data/vendor/assets/javascripts/mercury/dialogs/style.js.coffee +1 -1
  77. data/vendor/assets/javascripts/mercury/finalize.js.coffee +3 -0
  78. data/vendor/assets/javascripts/mercury/lightview.js.coffee +76 -30
  79. data/vendor/assets/javascripts/mercury/locales/da.locale.js.coffee +211 -0
  80. data/vendor/assets/javascripts/mercury/locales/de.locale.js.coffee +206 -0
  81. data/vendor/assets/javascripts/mercury/locales/es.locale.js.coffee +211 -0
  82. data/vendor/assets/javascripts/mercury/locales/example.local.js.coffee +211 -0
  83. data/vendor/assets/javascripts/mercury/locales/fr.locale.js.coffee +211 -0
  84. data/vendor/assets/javascripts/mercury/locales/it.locale.js.coffee +208 -0
  85. data/vendor/assets/javascripts/mercury/locales/ko.local.js.coffee +206 -0
  86. data/vendor/assets/javascripts/mercury/locales/nl.locale.js.coffee +206 -0
  87. data/vendor/assets/javascripts/mercury/locales/pt.locale.js.coffee +211 -0
  88. data/vendor/assets/javascripts/mercury/locales/sv.local.js.coffee +209 -0
  89. data/vendor/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +213 -0
  90. data/vendor/assets/javascripts/mercury/mercury.js.coffee +62 -17
  91. data/vendor/assets/javascripts/mercury/modal.js.coffee +34 -21
  92. data/vendor/assets/javascripts/mercury/modals/htmleditor.js.coffee +1 -2
  93. data/vendor/assets/javascripts/mercury/modals/insertcharacter.js.coffee +3 -3
  94. data/vendor/assets/javascripts/mercury/modals/insertlink.js.coffee +4 -4
  95. data/vendor/assets/javascripts/mercury/modals/insertmedia.js.coffee +10 -9
  96. data/vendor/assets/javascripts/mercury/modals/insertsnippet.js.coffee +1 -1
  97. data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +8 -9
  98. data/vendor/assets/javascripts/mercury/native_extensions.js.coffee +26 -8
  99. data/vendor/assets/javascripts/mercury/page_editor.js.coffee +68 -46
  100. data/vendor/assets/javascripts/mercury/palette.js.coffee +1 -1
  101. data/vendor/assets/javascripts/mercury/panel.js.coffee +25 -7
  102. data/vendor/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +1 -0
  103. data/vendor/assets/javascripts/mercury/region.js.coffee +21 -17
  104. data/vendor/assets/javascripts/mercury/regions/editable.js.coffee +47 -35
  105. data/vendor/assets/javascripts/mercury/regions/markupable.js.coffee +43 -36
  106. data/vendor/assets/javascripts/mercury/regions/snippetable.js.coffee +22 -24
  107. data/vendor/assets/javascripts/mercury/select.js.coffee +3 -2
  108. data/vendor/assets/javascripts/mercury/snippet.js.coffee +2 -1
  109. data/vendor/assets/javascripts/mercury/snippet_toolbar.js.coffee +10 -7
  110. data/vendor/assets/javascripts/mercury/statusbar.js.coffee +4 -4
  111. data/vendor/assets/javascripts/mercury/table_editor.js.coffee +1 -3
  112. data/vendor/assets/javascripts/mercury/toolbar.button.js.coffee +42 -20
  113. data/vendor/assets/javascripts/mercury/toolbar.button_group.js.coffee +3 -3
  114. data/vendor/assets/javascripts/mercury/toolbar.expander.js.coffee +2 -2
  115. data/vendor/assets/javascripts/mercury/toolbar.js.coffee +8 -6
  116. data/vendor/assets/javascripts/mercury/tooltip.js.coffee +13 -9
  117. data/vendor/assets/javascripts/mercury/uploader.js.coffee +22 -16
  118. data/vendor/assets/javascripts/mercury_loader.js +2 -0
  119. data/vendor/assets/javascripts/mercury_overrides.js +6 -0
  120. data/vendor/assets/stylesheets/mercury/all_images.css.erb +89 -0
  121. data/vendor/assets/stylesheets/mercury/dialog.css +13 -4
  122. data/vendor/assets/stylesheets/mercury/lightview.css +66 -15
  123. data/vendor/assets/stylesheets/mercury/mercury.css +12 -7
  124. data/vendor/assets/stylesheets/mercury/modal.css +9 -5
  125. data/vendor/assets/stylesheets/mercury/toolbar.css +3 -29
  126. metadata +266 -144
  127. data/POST_INSTALL +0 -15
  128. data/README.md +0 -299
  129. data/VERSION +0 -1
  130. data/annotated_source.template +0 -57
  131. data/config/routes.rb +0 -15
  132. data/mercury-rails.gemspec +0 -288
  133. data/spec/javascripts/responses/blank.html +0 -1
  134. data/vendor/assets/javascripts/mercury/lightviews/imageprocessor.js.coffee +0 -2
@@ -1,15 +0,0 @@
1
- +============================================================================+
2
- Congratulations, Mercury was successfully installed in your app. Documentation
3
- and other useful info can be found at: https://github.com/jejacks0n/mercury
4
-
5
- Here's a post install checklist:
6
-
7
- * Setup the database for image processing (if you haven't already) by running
8
-
9
- rake mercury_engine:install:migrations
10
- rake db:migrate
11
-
12
- * Learn about, and make your configuration adjustments in the mercury.js file
13
-
14
- * If installed, check out mercury.html.erb and mercury_overrides.css for more
15
- customization info.
data/README.md DELETED
@@ -1,299 +0,0 @@
1
- # Mercury Editor
2
-
3
- Mercury Editor is a fully featured editor much like TinyMCE or CKEditor, but with a different usage paradigm. It
4
- expects that an entire page is something that can be editable, and allows different types of editable regions to be
5
- specified. It displays a single toolbar for every region on the page, and uses the HTML5 contentEditable features on
6
- block elements, instead of iframes, which allows for CSS to be applied in ways that most other editors can't handle.
7
-
8
- Mercury has been written using CoffeeScript and jQuery for the Javascript portions, and is written on top of Rails 3.1.
9
-
10
-
11
- ## Translations
12
-
13
- Hey international open source contributors, want to contribute to the Mercury Editor project without having to do much
14
- coding? We're looking for good translations. If you have a good grasp of english, another common language, and have
15
- the desire and time to do a translation for the project it would be awesome to hear from you. Just shoot me a message
16
- or email and I'll provide more details. While any translation would be a good thing, the languages that seem like they
17
- would give the most value are:
18
-
19
- - French
20
- - German
21
- - Spanish
22
- - Japanese
23
- - Chinese
24
- - Dutch
25
-
26
-
27
- ## Awesomeness
28
-
29
- Mercury has been added as a Featured Project on Pivotal Tracker! If you're interested in what's planned, check out the
30
- public project at: https://www.pivotaltracker.com/projects/295823
31
-
32
-
33
- ## Browser Support
34
-
35
- Mercury has been written for the future, and thus doesn't support legacy browsers or browsers that don't follow the W3C
36
- specifications for content editing. Any browser will be supported if they support the W3C specification in the future,
37
- but there aren't plans for adding support for alternate implementations at this time.
38
-
39
- Supported Browsers:
40
-
41
- - Chrome 10+
42
- - Safari 5+
43
- - Firefox 4+
44
-
45
-
46
- ## A Demo
47
-
48
- Feel free to check out [the demo](http://jejacks0n.github.com/mercury/). The demo will be updated quite a bit in the
49
- next weeks, so feel free to check back every now and then.. We'll be adding a full walkthrough that details each of the
50
- major features shortly. If you would like to see how Mercury was implemented in the demo check the gh-pages branch,
51
- it's a useful resource to see how you can integrate the Mercury bundle.
52
-
53
-
54
- ## The Story
55
-
56
- I was looking for a fully featured editor that didn't use iframes, and there weren't any decent ones. My primary goal
57
- was to have areas that were editable, but that also allowed CSS to flow naturally. A few have cropped up since then
58
- (Aloha Editor for instance), and as good as they are, none had all the features I was looking for.
59
-
60
- Mercury was written to be as simple as possible, while also providing an advanced feature set. Instead of complex
61
- configuration, we chose a mix of configuration and code simplicity, which should give you a much better chance at
62
- customizing Mercury to suit your exact needs. This doesn't mean there's not configuration, and what's there provides
63
- much of what you'll need, but efforts were taken to keep it simple and powerful.
64
-
65
- Even though it's a great editor, Mercury Editor may not be the best for your needs (based on browser support,
66
- functionality, etc.) so here's a list of some other editors that you might want to check out:
67
-
68
- - [Aloha Editor](http://www.aloha-editor.org/)
69
- - [jHtmlArea](http://jhtmlarea.codeplex.com/)
70
- - [MarkItUp](http://markitup.jaysalvat.com/home/)
71
- - [TinyMCE](http://tinymce.moxiecode.com/)
72
- - [CKEditor](http://ckeditor.com/)
73
- - [NicEdit](http://nicedit.com/)
74
-
75
-
76
- ## Features
77
-
78
- The feature list is actually pretty long, so here's a short list that need highlighting.
79
-
80
- - Previewing: Preview content while you're working to see exactly how it'll look.
81
- - Link Tools: Insert and edit links, including TOC/Bookmark links.
82
- - Media Tools: Insert and edit images, youtube videos, and vimeo videos.
83
- - Image Uploading: Drag images from your desktop and they'll be automatically uploaded and inserted.
84
- - Table Editing: Advanced table editing and creation.
85
- - Snippets: Insert and edit predefined and reusable bits of markup/code using drag and drop.
86
- - Notes: Attach notes to any page and communicate with other content authors.
87
-
88
-
89
- ## Installation
90
-
91
- ### For Rails
92
-
93
- Include the gem in your Gemfile and bundle to install the gem.
94
-
95
- gem 'mercury-rails'
96
-
97
- Make sure you get the migrations that you'll need.
98
-
99
- rake mercury_engine:install:migrations
100
- rake db:migrate
101
-
102
- You can also get the configuration file by running the generator.
103
-
104
- rails generate mercury:install
105
-
106
- This generator puts the mercury base file (configuration) into your project in /app/assets/javascripts/mercury.js.
107
-
108
- ### For Other Frameworks / Languages
109
-
110
- Get the distro files by downloading them from github using the downloads feature, or pull them out of the project
111
- manually (the files are in /public/mercury). Copy the files into your project, and if you adjust where they're
112
- located (eg. not within mercury/javascripts or mercury/stylesheets) make sure you update the
113
- mercury_loader.js file to reflect this.
114
-
115
- Images are bundled into the CSS if you use the mercury.bundle.css file, but if you'd rather not use the bundled CSS
116
- you'll need to grab the images manually and adjust the paths in the css file.
117
-
118
- The dialogs (eg. color palettes, modals, and other dialog types) are bundled into the mercury_dialogs.js file. If you
119
- would like to customize a view you can remove the view from the mercury_dialogs.js file and adjust the path you want to
120
- load using the configuration -- your custom view will then load using Ajax.
121
-
122
- Bundling snippet options and snippets doesn't work in this way, so you may need to disable snippets or adjust where
123
- they're loaded from.. We'll see how this pans out and adjust over time if needed, so feedback would be useful here.
124
-
125
- If you use the distro instead of using the Rails Engine, you won't be able to utilize the Route usage method outlined in
126
- the Usage portion of this documentation.
127
-
128
-
129
- ## Usage
130
-
131
- Mercury has an expectation that content regions will be on the page (not required, but probably useful). To define
132
- content regions that Mercury will make editable you need to add a `mercury-region` class attribute to a div (this is
133
- configurable). Then specify what region type by using the `data-type` attribute -- which can be *editable*,
134
- *markupable*, or *snippetable*. It's important for saving that an id attribute be set on regions, you should always
135
- include. Region types are outlined below.
136
-
137
- <div id="primary" class="mercury-region" data-type="editable">
138
- default content
139
- </div>
140
-
141
- There's two methods to initialize Mercury Editor, and each one has it's benefits and drawbacks.
142
-
143
- ### Script Method
144
-
145
- Include the mercury_loader.js file. The loader will reload the page and enable Mercury in full page editing mode, so
146
- you may want to wrap this in conditional logic (eg. only admins or something).
147
-
148
- javascript_include_tag 'mercury_loader.js'
149
-
150
- Even though many efforts have been made to keep conflicts with javascript libraries from happening, we can't avoid all
151
- of them. If you use this method, understand that there may be conflicts with javascript and css. You should use the
152
- route method if you see any issues.
153
-
154
- ### Route Method
155
-
156
- The other way to initialize Mercury, which provides some slight performance improvements to the script method, is to
157
- access the editor route. There's a glob route that captures everything beginning with /editor, so for instance to edit
158
- an /about_us content page, you should access it at the /editor/about_us path. Again, you may want to define this route
159
- in your own routes file to restrict access to it.
160
-
161
- If you use this method, you may want to notify Mercury when the page is ready to be initialized. To do this just
162
- trigger the initialize:frame event. You can do this when the dom is ready to be interacted with (eg. dom:loaded,
163
- document.ready), or at the bottom of your body tag. It's recommended that you do this because it gives you some load
164
- performance improvements, but it's not required.
165
-
166
- Mercury.trigger('initialize:frame');
167
-
168
-
169
- ## Region Types
170
-
171
- ### Editable
172
-
173
- Editable Regions are HTML markup, and use the HTML5 contentEditable feature. This is the core of what Mercury is about,
174
- and provides the most flexibility and visual representation of what the content will look like when saved.
175
-
176
- ### Markupable
177
-
178
- These regions are based on Markdown syntax (specifically the github flavored version), and isn't as full featured as the
179
- editable region type -- primarily because markdown is meant to be simple, so to keep it such you can't do things like
180
- set colors etc. This region type is super useful if you want to keep the markup clean and simple.
181
-
182
- ### Snippetable
183
-
184
- Snippetable regions only allow snippets. There isn't any content editing in these regions, but snippets can sometimes
185
- be the way to go with complex markup and functionality. Snippets are basically chunks of reusable markup, that can be
186
- defined by a developer and placed into content regions later. More on this below.
187
-
188
-
189
- ## Snippets
190
-
191
- Snippets are reusable and configurable chunks of markup. They can be defined by developers, and then placed anywhere in
192
- content regions. When you drag a snippet into a region you'll be prompted to enter options, and after entering options
193
- the snippet will be rendered into the page as a preview. Snippets can be dragged around (in snippetable regions) and
194
- edited or removed.
195
-
196
- Mercury does very little to save content and snippets for you, but it does provide the ability to load snippets from
197
- your own storage implementation. Here's an example of loading existing snippet options back into Mercury.
198
-
199
- if (top.Mercury) top.Mercury.Snippet.load({
200
- snippet_1: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "Jeremy"}}
201
- });
202
-
203
-
204
- ## Saving Content / Rendering Content
205
-
206
- Note: Mercury doesn't implement saving or rendering of content. We leave this part up to you because it can vary in so
207
- many different ways.. You may want to implement content versioning, use a nosql data store like mongo etc. and we don't
208
- want to force our opinions.
209
-
210
- Mercury will submit JSON or form values back to the server on save, and this can be adjusted in the configuration. By
211
- default it will use JSON, that JSON looks like:
212
-
213
- {
214
- "region_name": {
215
- "type": "editable",
216
- "value": "[contents with a snippet]",
217
- "snippets": {
218
- "snippet_1": {
219
- "name": "example",
220
- "options": {
221
- "options[favorite_beer]": "Bells Hopslam",
222
- "options[first_name]": "Jeremy"
223
- }
224
- }
225
- }
226
- }
227
- }
228
-
229
- Where it gets saved to is also up to you.. by default it submits a post to the current url, but you can adjust this by
230
- setting Mercury.saveURL, or passing it into the Mercury.PageEditor constructor.. how you do this is dependent on how
231
- you're using loading mercury (via the loader, or by using the route method). In both situations setting Mercury.saveURL
232
- is the most consistent.
233
-
234
- top.Mercury.saveURL = '/contents';
235
-
236
- Assuming you have a ContentsController and a RESTful route, this will make it through to the create action. Where you
237
- can store the content in whatever way you think is appropriate for your project.
238
-
239
- Rendering content is up to you as well.. Now that you have content saved, you can add that content back to your pages,
240
- and there's a lot of ways you could approach this. In the past I've used Nokogiri to find and replace the contents of
241
- regions, and do some additional handling for putting snippets back into the content. You could also use regular
242
- expressions to do this, which is probably faster, but maybe not as safe.
243
-
244
- I'm interested in what solutions people are looking for and end up using for this, so feel free to shoot me a line if
245
- you write something (eg. a middleware layer, an nginx module, or just something simple to get the job done).
246
-
247
-
248
- ## Project Details
249
-
250
- ### WYSIWYG Editors Suck
251
-
252
- They just do. Which as I've learned, is primarily due to the browser implementations. Don't get me wrong, what the
253
- browsers have implemented is amazing, because it's hard stuff, plain and simple. But if you're expecting a WYSIWYG
254
- editor to solve all your content problems you're wrong. A better perception is that it will solve many of them, but
255
- shifts some into a new area.
256
-
257
- With that being said, Mercury tries to solve many of those issues and succeeds to a great degree, but it seems to be
258
- nearly impossible (impractical at least) to address everything, and the browsers don't expose enough to fix some things.
259
- This is true for every editor that I've looked into as well, and will likely just take time as the browser vendors begin
260
- to prioritize and fix these issues.
261
-
262
- It's important to understand this, and the details are more suited for long nerdy blog posts, so they won't be covered
263
- here.
264
-
265
- ### The Code and Why
266
-
267
- #### CoffeeScript
268
-
269
- Mercury has been written entirely in CoffeeScript because it simplifies a lot of the patterns that are used, and allows
270
- for very readable code. The goal was to provide good readable code that could be adjusted based on need, instead of a
271
- complex configuration that makes the code harder to understand and tweak.
272
-
273
- #### jQuery
274
-
275
- jQuery was used as the javascript library, but is primarily used for the selectors, traversing, and manipulating the
276
- DOM. Chaining is kept to a minimum for readability, and even though much of Mercury could've been written as jQuery
277
- plugins, it was not.
278
-
279
- #### Rails
280
-
281
- With the asset handling that comes bundled with Rails 3.1, Rails Engines, and the gem tools, there really wasn't any
282
- other option. The javascript from Mercury can be used by any back end system, and isn't limited to Rails. Many of the
283
- features do require a back end, and those features would have to be written in whatever language you wanted support for.
284
- The coffeescript files can be found in the repo, and I would be fully supportive of anyone who wanted to add support for
285
- different back end frameworks or languages. There's a server specification in the wiki that will help as well.
286
-
287
- #### Specs / Integration Tests
288
-
289
- Mercury is fully tested using Jasmine (via Evergreen) and Cucumber. You can clone the project to run the full suite.
290
-
291
- rake spec:javascripts
292
- rake cucumber
293
-
294
-
295
- ## License
296
-
297
- Licensed under the [MIT License](http://creativecommons.org/licenses/MIT/)
298
-
299
- Copyright 2011 [Jeremy Jackson](https://github.com/jejacks0n)
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.3
@@ -1,57 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="content-type" content="text/html;charset=utf-8">
5
- <title>Mercury Editor - Annotated Source - {{ title }}</title>
6
- <link href="/mercury/assets/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css"/>
7
- <script src="/mercury/assets/javascripts/application.js" type="text/javascript"></script>
8
- <!--[if lt IE 7]>
9
- <script type="text/javascript" src="/mercury/assets/javascripts/unitpngfix.js"></script>
10
- <![endif]-->
11
- </head>
12
- <body>
13
-
14
- <div id="background"></div>
15
-
16
- <h1 id="logo"><a href="/mercury">Mercury Editor</a></h1>
17
-
18
- <ul id="navigation">
19
- <li><a href="/mercury">Home</a></li>
20
- <li><a href="/mercury/downloads">Downloads</a></li>
21
- <li><a href="/mercury/walkthrough">Walkthrough</a></li>
22
- <li><a href="/mercury/documentation">Documentation</a></li>
23
- <li class="active"><a href="/mercury/annotated_source">Annotated Source</a></li>
24
- </ul>
25
-
26
- <table cellspacing=0 cellpadding=0>
27
- <thead>
28
- <tr>
29
- <th class=docs><h1>{{ title }}</h1></th>
30
- <th class=code></th>
31
- </tr>
32
- </thead>
33
- <tbody>
34
- {{#sections}}
35
- <tr id='section-{{ section_id }}'>
36
- <td class=docs>
37
- <div class="pilwrap">
38
- <a class="pilcrow" href="#section-{{ section_id }}">&#182;</a>
39
- </div>
40
- {{{ docs }}}
41
- </td>
42
- <td class=code>
43
- <div class='highlight'><pre>{{{ code }}}</pre></div>
44
- </td>
45
- </tr>
46
- {{/sections}}
47
- </table>
48
-
49
- <div id="footer">
50
- <hr>
51
- Copyright 2011 Jeremy Jackson. All rights reserved.
52
- </div>
53
-
54
- </body>
55
- </html>
56
-
57
-
@@ -1,15 +0,0 @@
1
- Rails.application.routes.draw do
2
-
3
- resources :images
4
-
5
- match '/editor(/*requested_uri)' => "mercury#edit", :as => :mercury_editor
6
- scope '/mercury' do
7
- match ':type/:resource' => "mercury#resource"
8
- match 'snippets/:name/options' => "mercury#snippet_options"
9
- match 'snippets/:name/preview' => "mercury#snippet_preview"
10
- end
11
-
12
- if defined?(Mercury::Application)
13
- match 'mercury/test_page' => "mercury#test_page"
14
- end
15
- end
@@ -1,288 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = "mercury-rails"
8
- s.version = "0.2.3"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Jeremy Jackson"]
12
- s.date = "2011-10-24"
13
- s.description = "A fully featured and advanced HTML5 WYSIWYG editor written in CoffeeScript on top of Rails 3.1"
14
- s.email = "jejacks0n@gmail.com"
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.md"
18
- ]
19
- s.files = [
20
- "LICENSE",
21
- "POST_INSTALL",
22
- "README.md",
23
- "VERSION",
24
- "annotated_source.template",
25
- "app/controllers/images_controller.rb",
26
- "app/controllers/mercury_controller.rb",
27
- "app/models/image.rb",
28
- "app/views/layouts/mercury.html.erb",
29
- "app/views/mercury/lightviews/about.html",
30
- "app/views/mercury/modals/character.html",
31
- "app/views/mercury/modals/htmleditor.html",
32
- "app/views/mercury/modals/link.html",
33
- "app/views/mercury/modals/media.html",
34
- "app/views/mercury/modals/table.html",
35
- "app/views/mercury/palettes/backcolor.html",
36
- "app/views/mercury/palettes/forecolor.html",
37
- "app/views/mercury/panels/history.html",
38
- "app/views/mercury/panels/notes.html",
39
- "app/views/mercury/panels/snippets.html",
40
- "app/views/mercury/selects/formatblock.html",
41
- "app/views/mercury/selects/style.html",
42
- "app/views/mercury/snippets/example/options.html.erb",
43
- "app/views/mercury/snippets/example/preview.html.erb",
44
- "config/engine.rb",
45
- "config/routes.rb",
46
- "db/migrate/20110526035601_create_images.rb",
47
- "features/loading/loading.feature",
48
- "features/loading/navigating.feature",
49
- "features/loading/user_interface.feature",
50
- "features/regions/editable/advanced_editing.feature",
51
- "features/regions/editable/basic_editing.feature",
52
- "features/regions/editable/inserting_links.feature",
53
- "features/regions/editable/inserting_media.feature",
54
- "features/regions/editable/inserting_snippets.feature",
55
- "features/regions/editable/inserting_special_characters.feature",
56
- "features/regions/editable/inserting_tables.feature",
57
- "features/regions/editable/pasting.feature",
58
- "features/regions/editable/uploading_images.feature",
59
- "features/regions/markupable/advanced_editing.feature",
60
- "features/regions/markupable/basic_editing.feature",
61
- "features/regions/markupable/inserting_links.feature",
62
- "features/regions/markupable/inserting_media.feature",
63
- "features/regions/markupable/inserting_snippets.feature",
64
- "features/regions/markupable/inserting_special_characters.feature",
65
- "features/regions/markupable/inserting_tables.feature",
66
- "features/regions/markupable/uploading_images.feature",
67
- "features/regions/snippetable/advanced_editing.feature",
68
- "features/regions/snippetable/basic_editing.feature",
69
- "features/regions/snippetable/inserting_snippets.feature",
70
- "features/saving/saving.feature",
71
- "features/step_definitions/debug_steps.rb",
72
- "features/step_definitions/mercury_steps.rb",
73
- "features/step_definitions/web_steps.rb",
74
- "features/support/env.rb",
75
- "features/support/mercury_contents.rb",
76
- "features/support/mercury_selectors.rb",
77
- "features/support/paths.rb",
78
- "features/support/selectors.rb",
79
- "lib/generators/mercury/install/install_generator.rb",
80
- "lib/mercury-rails.rb",
81
- "mercury-rails.gemspec",
82
- "spec/javascripts/mercury/dialog_spec.js.coffee",
83
- "spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee",
84
- "spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee",
85
- "spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee",
86
- "spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee",
87
- "spec/javascripts/mercury/dialogs/style_spec.js.coffee",
88
- "spec/javascripts/mercury/history_buffer_spec.js.coffee",
89
- "spec/javascripts/mercury/lightview_spec.js.coffee",
90
- "spec/javascripts/mercury/mercury_spec.js.coffee",
91
- "spec/javascripts/mercury/modal_spec.js.coffee",
92
- "spec/javascripts/mercury/modals/htmleditor_spec.js.coffee",
93
- "spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee",
94
- "spec/javascripts/mercury/modals/insertlink_spec.js.coffee",
95
- "spec/javascripts/mercury/modals/insertmedia_spec.js.coffee",
96
- "spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee",
97
- "spec/javascripts/mercury/modals/inserttable_spec.js.coffee",
98
- "spec/javascripts/mercury/native_extensions_spec.js.coffee",
99
- "spec/javascripts/mercury/page_editor_spec.js.coffee",
100
- "spec/javascripts/mercury/palette_spec.js.coffee",
101
- "spec/javascripts/mercury/panel_spec.js.coffee",
102
- "spec/javascripts/mercury/region_spec.js.coffee",
103
- "spec/javascripts/mercury/regions/editable_spec.js.coffee",
104
- "spec/javascripts/mercury/regions/markupable_spec.js.coffee",
105
- "spec/javascripts/mercury/regions/snippetable_spec.js.coffee",
106
- "spec/javascripts/mercury/select_spec.js.coffee",
107
- "spec/javascripts/mercury/snippet_spec.js.coffee",
108
- "spec/javascripts/mercury/snippet_toolbar_spec.js.coffee",
109
- "spec/javascripts/mercury/statusbar_spec.js.coffee",
110
- "spec/javascripts/mercury/table_editor_spec.js.coffee",
111
- "spec/javascripts/mercury/toolbar.button_group_spec.js.coffee",
112
- "spec/javascripts/mercury/toolbar.button_spec.js.coffee",
113
- "spec/javascripts/mercury/toolbar.expander_spec.js.coffee",
114
- "spec/javascripts/mercury/toolbar_spec.js.coffee",
115
- "spec/javascripts/mercury/tooltip_spec.js.coffee",
116
- "spec/javascripts/mercury/uploader_spec.js.coffee",
117
- "spec/javascripts/responses/blank.html",
118
- "spec/javascripts/spec_helper.js",
119
- "spec/javascripts/templates/mercury/dialog.html",
120
- "spec/javascripts/templates/mercury/dialogs/backcolor.html",
121
- "spec/javascripts/templates/mercury/dialogs/forecolor.html",
122
- "spec/javascripts/templates/mercury/dialogs/formatblock.html",
123
- "spec/javascripts/templates/mercury/dialogs/snippetpanel.html",
124
- "spec/javascripts/templates/mercury/dialogs/style.html",
125
- "spec/javascripts/templates/mercury/lightview.html",
126
- "spec/javascripts/templates/mercury/modal.html",
127
- "spec/javascripts/templates/mercury/modals/htmleditor.html",
128
- "spec/javascripts/templates/mercury/modals/insertcharacter.html",
129
- "spec/javascripts/templates/mercury/modals/insertlink.html",
130
- "spec/javascripts/templates/mercury/modals/insertmedia.html",
131
- "spec/javascripts/templates/mercury/modals/insertsnippet.html",
132
- "spec/javascripts/templates/mercury/modals/inserttable.html",
133
- "spec/javascripts/templates/mercury/page_editor.html",
134
- "spec/javascripts/templates/mercury/palette.html",
135
- "spec/javascripts/templates/mercury/panel.html",
136
- "spec/javascripts/templates/mercury/region.html",
137
- "spec/javascripts/templates/mercury/regions/editable.html",
138
- "spec/javascripts/templates/mercury/regions/snippetable.html",
139
- "spec/javascripts/templates/mercury/select.html",
140
- "spec/javascripts/templates/mercury/snippet.html",
141
- "spec/javascripts/templates/mercury/snippet_toolbar.html",
142
- "spec/javascripts/templates/mercury/statusbar.html",
143
- "spec/javascripts/templates/mercury/table_editor.html",
144
- "spec/javascripts/templates/mercury/toolbar.button.html",
145
- "spec/javascripts/templates/mercury/toolbar.button_group.html",
146
- "spec/javascripts/templates/mercury/toolbar.expander.html",
147
- "spec/javascripts/templates/mercury/toolbar.html",
148
- "spec/javascripts/templates/mercury/tooltip.html",
149
- "spec/javascripts/templates/mercury/uploader.html",
150
- "vendor/assets/images/mercury/button.png",
151
- "vendor/assets/images/mercury/close.png",
152
- "vendor/assets/images/mercury/default-snippet.png",
153
- "vendor/assets/images/mercury/loading-dark.gif",
154
- "vendor/assets/images/mercury/loading-light.gif",
155
- "vendor/assets/images/mercury/search-icon.png",
156
- "vendor/assets/images/mercury/temp-logo.png",
157
- "vendor/assets/images/mercury/toolbar/editable/buttons.png",
158
- "vendor/assets/images/mercury/toolbar/primary/_expander.png",
159
- "vendor/assets/images/mercury/toolbar/primary/_pressed.png",
160
- "vendor/assets/images/mercury/toolbar/primary/historypanel.png",
161
- "vendor/assets/images/mercury/toolbar/primary/insertcharacter.png",
162
- "vendor/assets/images/mercury/toolbar/primary/insertlink.png",
163
- "vendor/assets/images/mercury/toolbar/primary/insertmedia.png",
164
- "vendor/assets/images/mercury/toolbar/primary/inserttable.png",
165
- "vendor/assets/images/mercury/toolbar/primary/inspectorpanel.png",
166
- "vendor/assets/images/mercury/toolbar/primary/notespanel.png",
167
- "vendor/assets/images/mercury/toolbar/primary/preview.png",
168
- "vendor/assets/images/mercury/toolbar/primary/redo.png",
169
- "vendor/assets/images/mercury/toolbar/primary/save.png",
170
- "vendor/assets/images/mercury/toolbar/primary/snippetpanel.png",
171
- "vendor/assets/images/mercury/toolbar/primary/undo.png",
172
- "vendor/assets/images/mercury/toolbar/snippetable/buttons.png",
173
- "vendor/assets/javascripts/mercury.js",
174
- "vendor/assets/javascripts/mercury/dependencies/jquery-1.6.js",
175
- "vendor/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js",
176
- "vendor/assets/javascripts/mercury/dependencies/jquery.additions.js",
177
- "vendor/assets/javascripts/mercury/dependencies/jquery.htmlClean.js",
178
- "vendor/assets/javascripts/mercury/dependencies/liquidmetal.js",
179
- "vendor/assets/javascripts/mercury/dependencies/showdown.js",
180
- "vendor/assets/javascripts/mercury/dialog.js.coffee",
181
- "vendor/assets/javascripts/mercury/dialogs/backcolor.js.coffee",
182
- "vendor/assets/javascripts/mercury/dialogs/forecolor.js.coffee",
183
- "vendor/assets/javascripts/mercury/dialogs/formatblock.js.coffee",
184
- "vendor/assets/javascripts/mercury/dialogs/objectspanel.js.coffee",
185
- "vendor/assets/javascripts/mercury/dialogs/style.js.coffee",
186
- "vendor/assets/javascripts/mercury/history_buffer.js.coffee",
187
- "vendor/assets/javascripts/mercury/lightview.js.coffee",
188
- "vendor/assets/javascripts/mercury/lightviews/imageprocessor.js.coffee",
189
- "vendor/assets/javascripts/mercury/mercury.js.coffee",
190
- "vendor/assets/javascripts/mercury/modal.js.coffee",
191
- "vendor/assets/javascripts/mercury/modals/htmleditor.js.coffee",
192
- "vendor/assets/javascripts/mercury/modals/insertcharacter.js.coffee",
193
- "vendor/assets/javascripts/mercury/modals/insertlink.js.coffee",
194
- "vendor/assets/javascripts/mercury/modals/insertmedia.js.coffee",
195
- "vendor/assets/javascripts/mercury/modals/insertsnippet.js.coffee",
196
- "vendor/assets/javascripts/mercury/modals/inserttable.js.coffee",
197
- "vendor/assets/javascripts/mercury/native_extensions.js.coffee",
198
- "vendor/assets/javascripts/mercury/page_editor.js.coffee",
199
- "vendor/assets/javascripts/mercury/palette.js.coffee",
200
- "vendor/assets/javascripts/mercury/panel.js.coffee",
201
- "vendor/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee",
202
- "vendor/assets/javascripts/mercury/plugins/save_as_xml/plugin.js",
203
- "vendor/assets/javascripts/mercury/region.js.coffee",
204
- "vendor/assets/javascripts/mercury/regions/editable.js.coffee",
205
- "vendor/assets/javascripts/mercury/regions/markupable.js.coffee",
206
- "vendor/assets/javascripts/mercury/regions/snippetable.js.coffee",
207
- "vendor/assets/javascripts/mercury/select.js.coffee",
208
- "vendor/assets/javascripts/mercury/snippet.js.coffee",
209
- "vendor/assets/javascripts/mercury/snippet_toolbar.js.coffee",
210
- "vendor/assets/javascripts/mercury/statusbar.js.coffee",
211
- "vendor/assets/javascripts/mercury/support/history.js",
212
- "vendor/assets/javascripts/mercury/table_editor.js.coffee",
213
- "vendor/assets/javascripts/mercury/toolbar.button.js.coffee",
214
- "vendor/assets/javascripts/mercury/toolbar.button_group.js.coffee",
215
- "vendor/assets/javascripts/mercury/toolbar.expander.js.coffee",
216
- "vendor/assets/javascripts/mercury/toolbar.js.coffee",
217
- "vendor/assets/javascripts/mercury/tooltip.js.coffee",
218
- "vendor/assets/javascripts/mercury/uploader.js.coffee",
219
- "vendor/assets/javascripts/mercury_loader.js",
220
- "vendor/assets/stylesheets/mercury.css",
221
- "vendor/assets/stylesheets/mercury/dialog.css",
222
- "vendor/assets/stylesheets/mercury/lightview.css",
223
- "vendor/assets/stylesheets/mercury/mercury.css",
224
- "vendor/assets/stylesheets/mercury/modal.css",
225
- "vendor/assets/stylesheets/mercury/statusbar.css",
226
- "vendor/assets/stylesheets/mercury/toolbar.css",
227
- "vendor/assets/stylesheets/mercury/tooltip.css",
228
- "vendor/assets/stylesheets/mercury/uploader.css",
229
- "vendor/assets/stylesheets/mercury_overrides.css"
230
- ]
231
- s.homepage = "http://github.com/jejacks0n/mercury"
232
- s.licenses = ["MIT"]
233
- s.require_paths = ["lib"]
234
- s.rubygems_version = "1.8.10"
235
- s.summary = "A fully featured and advanced HTML5 WYSIWYG editor written in CoffeeScript on top of Rails 3.1"
236
-
237
- if s.respond_to? :specification_version then
238
- s.specification_version = 3
239
-
240
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
241
- s.add_runtime_dependency(%q<rails>, ["~> 3.1.0"])
242
- s.add_runtime_dependency(%q<paperclip>, [">= 0"])
243
- s.add_runtime_dependency(%q<formtastic>, [">= 0"])
244
- s.add_runtime_dependency(%q<json>, [">= 0"])
245
- s.add_runtime_dependency(%q<sass-rails>, [">= 0"])
246
- s.add_runtime_dependency(%q<coffee-script>, [">= 0"])
247
- s.add_development_dependency(%q<rocco>, [">= 0"])
248
- s.add_development_dependency(%q<uglifier>, [">= 0"])
249
- s.add_development_dependency(%q<jquery-rails>, [">= 0"])
250
- s.add_development_dependency(%q<jeweler>, [">= 0"])
251
- s.add_development_dependency(%q<sqlite3>, [">= 0"])
252
- s.add_development_dependency(%q<thin>, [">= 0"])
253
- s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
254
- s.add_development_dependency(%q<evergreen>, [">= 0"])
255
- else
256
- s.add_dependency(%q<rails>, ["~> 3.1.0"])
257
- s.add_dependency(%q<paperclip>, [">= 0"])
258
- s.add_dependency(%q<formtastic>, [">= 0"])
259
- s.add_dependency(%q<json>, [">= 0"])
260
- s.add_dependency(%q<sass-rails>, [">= 0"])
261
- s.add_dependency(%q<coffee-script>, [">= 0"])
262
- s.add_dependency(%q<rocco>, [">= 0"])
263
- s.add_dependency(%q<uglifier>, [">= 0"])
264
- s.add_dependency(%q<jquery-rails>, [">= 0"])
265
- s.add_dependency(%q<jeweler>, [">= 0"])
266
- s.add_dependency(%q<sqlite3>, [">= 0"])
267
- s.add_dependency(%q<thin>, [">= 0"])
268
- s.add_dependency(%q<ruby-debug19>, [">= 0"])
269
- s.add_dependency(%q<evergreen>, [">= 0"])
270
- end
271
- else
272
- s.add_dependency(%q<rails>, ["~> 3.1.0"])
273
- s.add_dependency(%q<paperclip>, [">= 0"])
274
- s.add_dependency(%q<formtastic>, [">= 0"])
275
- s.add_dependency(%q<json>, [">= 0"])
276
- s.add_dependency(%q<sass-rails>, [">= 0"])
277
- s.add_dependency(%q<coffee-script>, [">= 0"])
278
- s.add_dependency(%q<rocco>, [">= 0"])
279
- s.add_dependency(%q<uglifier>, [">= 0"])
280
- s.add_dependency(%q<jquery-rails>, [">= 0"])
281
- s.add_dependency(%q<jeweler>, [">= 0"])
282
- s.add_dependency(%q<sqlite3>, [">= 0"])
283
- s.add_dependency(%q<thin>, [">= 0"])
284
- s.add_dependency(%q<ruby-debug19>, [">= 0"])
285
- s.add_dependency(%q<evergreen>, [">= 0"])
286
- end
287
- end
288
-