gollum_editor 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require_self
3
+ *= require_tree .
4
+ */
@@ -0,0 +1,13 @@
1
+ require 'rails/generators'
2
+
3
+ module GollumEditor
4
+ class InstallGenerator < ::Rails::Generators::Base
5
+ source_root File.expand_path("../../../", __FILE__)
6
+ desc "This generator installs Twitter Bootstrap to Asset Pipeline"
7
+
8
+ def add_assets
9
+ directory "assets", "vendor/assets"
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ require "gollum_editor/version"
2
+ require "gollum_editor/form_builder"
3
+ require "gollum_editor/form_helper"
@@ -0,0 +1,5 @@
1
+ module GollumEditor::FormBuilder
2
+ def gollum_editor(method, options = {})
3
+ @template.gollum_editor(@object_name, method, objectify_options(options))
4
+ end
5
+ end
@@ -0,0 +1,74 @@
1
+ module GollumEditor
2
+ module FormHelper
3
+ def gollum_editor(object_name, method, options = {})
4
+ options[:id] = 'gollum-editor-body'
5
+ controls = '<div id="gollum-editor-function-bar">
6
+ <div id="gollum-editor-function-buttons">
7
+ <a href="#" id="function-bold" class="function-button" title="Bold">
8
+ <span>Bold</span></a>
9
+ <a href="#" id="function-italic" class="function-button" title="Italic">
10
+ <span>Italic</span></a>
11
+ <a href="#" id="function-code" class="function-button" title="Code">
12
+ <span>Code</span></a>
13
+ <span class="function-divider">&nbsp;</span>
14
+ <a href="#" id="function-ul" class="function-button" title="Bullet List">
15
+ <span>Unordered List</span></a>
16
+ <a href="#" id="function-ol" class="function-button" title="Numbered List">
17
+ <span>Ordered List</span></a>
18
+ <a href="#" id="function-blockquote" class="function-button" title="Quote">
19
+ <span>Blockquote</span></a>
20
+
21
+ <a href="#" id="function-hr" class="function-button" title="Horizontal Rule">
22
+ <span>Horizontal Rule</span></a>
23
+ <span class="function-divider">&nbsp;</span>
24
+ <a href="#" id="function-h1" class="function-button" title="Heading 1">
25
+ <span>h1</span></a>
26
+ <a href="#" id="function-h2" class="function-button" title="Heading 2">
27
+ <span>h2</span></a>
28
+ <a href="#" id="function-h3" class="function-button" title="Heading 3">
29
+ <span>h3</span></a>
30
+ <span class="function-divider">&nbsp;</span>
31
+ <a href="#" id="function-link" class="function-button" title="Insert Link">
32
+ <span>Link</span></a>
33
+ <a href="#" id="function-image" class="function-button" title="Insert Image">
34
+ <span>Image</span></a>
35
+ <span class="function-divider">&nbsp;</span>
36
+ <a href="#" id="function-help" class="function-button" title="Help">
37
+ <span>Help</span></a>
38
+ </div>
39
+ </div>
40
+
41
+ <div id="gollum-editor-help" class="jaws">
42
+ <ul id="gollum-editor-help-parent">
43
+ <li><a href="javascript:void(0);" class="selected">Help 1</a></li>
44
+ <li><a href="javascript:void(0);">Help 1</a></li>
45
+ <li><a href="javascript:void(0);">Help 1</a></li>
46
+ </ul>
47
+ <ul id="gollum-editor-help-list">
48
+ <li><a href="javascript:void(0);">Help 2</a></li>
49
+ <li><a href="javascript:void(0);">Help 3</a></li>
50
+ <li><a href="javascript:void(0);">Help 4</a></li>
51
+ <li><a href="javascript:void(0);">Help 5</a></li>
52
+ <li><a href="javascript:void(0);">Help 6</a></li>
53
+ <li><a href="javascript:void(0);">Help 7</a></li>
54
+ <li><a href="javascript:void(0);">Help 8</a></li>
55
+ </ul>
56
+ <div id="gollum-editor-help-wrapper">
57
+ <div id="gollum-editor-help-content">
58
+ <p>
59
+ </p>
60
+ </div>
61
+ </div>
62
+ </div>
63
+
64
+ <span class="jaws"><br></span>'
65
+ input = text_area(object_name, method, options)
66
+ content_tag(:div, (controls.html_safe + input), { :id => 'gollum-editor' })
67
+ end
68
+
69
+ def self.included(arg)
70
+ ActionView::Helpers::FormBuilder.send(:include, GollumEditor::FormBuilder)
71
+ end
72
+ end
73
+ end
74
+ ActionView::Helpers::FormHelper.send(:include, GollumEditor::FormHelper)
@@ -0,0 +1,3 @@
1
+ module GollumEditor
2
+ VERSION = "0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gollum_editor
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sam Knight
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-06 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: Use the Gollum wiki text editor for text areas
15
+ email:
16
+ - sam@samknight.co.uk
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/assets/images/gollum_editor/icon-sprite.png
22
+ - lib/assets/javascripts/gollum_editor/gollum.dialog.js
23
+ - lib/assets/javascripts/gollum_editor/gollum.editor.js
24
+ - lib/assets/javascripts/gollum_editor/gollum.js
25
+ - lib/assets/javascripts/gollum_editor/gollum.placeholder.js
26
+ - lib/assets/javascripts/gollum_editor/jquery.color.js
27
+ - lib/assets/javascripts/gollum_editor/langs/markdown.js
28
+ - lib/assets/stylesheets/gollum_editor/dialog.css
29
+ - lib/assets/stylesheets/gollum_editor/editor.css
30
+ - lib/assets/stylesheets/gollum_editor/gollum.css
31
+ - lib/generators/gollum_editor/install_generator.rb
32
+ - lib/gollum_editor/form_builder.rb
33
+ - lib/gollum_editor/form_helper.rb
34
+ - lib/gollum_editor/version.rb
35
+ - lib/gollum_editor.rb
36
+ homepage: http://github.com/samknight/gollum_editor
37
+ licenses: []
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project: gollum_editor
56
+ rubygems_version: 1.8.10
57
+ signing_key:
58
+ specification_version: 3
59
+ summary: Gollum text editor
60
+ test_files: []