jhtmlarea 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +75 -0
- data/Rakefile +15 -0
- data/jhtmlarea.gemspec +25 -0
- data/lib/jhtmlarea/engine.rb +4 -0
- data/lib/jhtmlarea/version.rb +1 -1
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c895a8b15f4aa45fc7f8d7633af25b66ab2f3d1
|
4
|
+
data.tar.gz: 98a570de99c84e9177f15f64bf1e539585cca2a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a283bb60ccf2ce62cdaa26456f91f887d72a0558550b12c92a9fff5d774ebcd9af5b17843b03d792e213698cb81030cd8a9fc33be55ad6e72a88d5b2a8378d89
|
7
|
+
data.tar.gz: a4354902486edff8dd590d67afe10636ef829fd93918e5d0d9a4dd7df2be270e810bbbc42aeac983fe1c2bce751a0443399ee1ee0209283ab7404afa36e9e566
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 dow
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Jhtmlarea
|
2
|
+
|
3
|
+
A wrapper for [jHtmlArea](http://jhtmlarea.codeplex.com/), a lightweight textarea wysiwyg editor. The purpose is to make it easy to use this editor in Rails 3.2 and Rails 4.0 applications.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'jhtmlarea'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install jhtmlarea
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Add the following to app/assets/javascripts/application.js:
|
22
|
+
|
23
|
+
//= require jHtmlArea-0.7.5
|
24
|
+
//= require jHtmlArea.ColorPickerMenu-0.7.0
|
25
|
+
|
26
|
+
Add the following to app/assets/stylesheets/application.css:
|
27
|
+
|
28
|
+
*= require jHtmlArea
|
29
|
+
*= require jHtmlArea.ColorPickerMenu
|
30
|
+
|
31
|
+
Then add this code to the view with your form (you can edit out any buttons you don't need):
|
32
|
+
|
33
|
+
~~~
|
34
|
+
<script type="text/javascript">
|
35
|
+
$(function() {
|
36
|
+
$("textarea").htmlarea({
|
37
|
+
toolbar: [
|
38
|
+
"html",
|
39
|
+
"|",
|
40
|
+
"bold", "italic", "underline", "strikethrough",
|
41
|
+
"|",
|
42
|
+
"subscript", "superscript",
|
43
|
+
"|",
|
44
|
+
"increasefontsize", "decreasefontsize", "forecolor",
|
45
|
+
"|",
|
46
|
+
"unorderedlist", "orderedlist",
|
47
|
+
"|",
|
48
|
+
"indent", "outdent",
|
49
|
+
"|",
|
50
|
+
"justifyleft", "justifycenter", "justifyright",
|
51
|
+
"|",
|
52
|
+
"link", "unlink", "image", "horizontalrule",
|
53
|
+
"|",
|
54
|
+
"p", "h1", "h2", "h3", "h4", "h5", "h6",
|
55
|
+
"|",
|
56
|
+
"cut", "copy", "paste"
|
57
|
+
]
|
58
|
+
});
|
59
|
+
});
|
60
|
+
</script>
|
61
|
+
~~~
|
62
|
+
|
63
|
+
## Limitations
|
64
|
+
|
65
|
+
### This gem seems to work fine in Firefox and Chrome, but may not work as well with Safari or IE.
|
66
|
+
|
67
|
+
The original jHtmlArea 0.7.5 source caused errors in Rails 4 since it calls the `$.browser` function which is [no longer supported in jQuery 1.9](http://stackoverflow.com/questions/14524289/browser-is-undefined-error). [jQuery recommends](http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed) using a library such as [Modernizer](http://modernizr.com/) for feature detection. In the interest of getting a working editor as quickly as possible, I edited out this feature detection code from the original jHtmlArea source code.
|
68
|
+
|
69
|
+
## Contributing
|
70
|
+
|
71
|
+
1. Fork it
|
72
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
73
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
74
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
75
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
# borrowed from jquery-datatables-rails
|
4
|
+
desc "Fixes css image paths in scss files."
|
5
|
+
task :fix_css do
|
6
|
+
Dir.glob(File.join("vendor/assets/stylesheets/dataTables", "*.css.scss")).each do |filename|
|
7
|
+
content = File.read(filename)
|
8
|
+
content.gsub!(/url\('\.\.\/images\/([A-Za-z0-9_]*\.png)'\)/) do
|
9
|
+
"image-url('dataTables/#{$1}')"
|
10
|
+
end
|
11
|
+
File.open(filename, 'w') { |f| f << content }
|
12
|
+
end
|
13
|
+
print "Done.\n"
|
14
|
+
end
|
15
|
+
|
data/jhtmlarea.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jhtmlarea/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jhtmlarea"
|
8
|
+
spec.version = Jhtmlarea::VERSION
|
9
|
+
spec.authors = ["Dow Drake"]
|
10
|
+
spec.email = ["dowdrake@msn.com"]
|
11
|
+
spec.description = %q{ A wrapper for jHtmlArea, a TextArea Wysiwyg editor }
|
12
|
+
spec.summary = %q{ The object is to simplify the installation of jHtmlArea Wysiwyg in a Rails application. }
|
13
|
+
spec.homepage = "https://github.com/ddrake/jhtmlarea"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
|
24
|
+
spec.add_dependency "jquery-rails"
|
25
|
+
end
|
data/lib/jhtmlarea/engine.rb
CHANGED
@@ -2,6 +2,10 @@ module Jhtmlarea
|
|
2
2
|
if defined?(::Rails) and Gem::Requirement.new('>= 3.1').satisfied_by?(Gem::Version.new ::Rails.version)
|
3
3
|
module Rails
|
4
4
|
class Engine < ::Rails::Engine
|
5
|
+
initializer "jhtmlarea.assets.precompile" do |app|
|
6
|
+
app.config.assets.precompile +=
|
7
|
+
%w(jHtmlArea.png jHtmlArea_Toolbar_Group_BG.png jHtmlArea_Toolbar_Group__Btn_Select_BG.png)
|
8
|
+
end
|
5
9
|
end
|
6
10
|
end
|
7
11
|
end
|
data/lib/jhtmlarea/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jhtmlarea
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dow Drake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,18 +59,24 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- .gitignore
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- jhtmlarea.gemspec
|
68
|
+
- lib/jhtmlarea.rb
|
62
69
|
- lib/jhtmlarea/engine.rb
|
63
70
|
- lib/jhtmlarea/version.rb
|
64
|
-
- lib/jhtmlarea.rb
|
65
|
-
- vendor/assets/images/jHtmlArea_Toolbar_Group_BG.png
|
66
71
|
- vendor/assets/images/disk.png
|
67
|
-
- vendor/assets/images/jHtmlArea_Toolbar_Group__Btn_Select_BG.png
|
68
72
|
- vendor/assets/images/jHtmlArea.png
|
69
|
-
- vendor/assets/
|
73
|
+
- vendor/assets/images/jHtmlArea_Toolbar_Group_BG.png
|
74
|
+
- vendor/assets/images/jHtmlArea_Toolbar_Group__Btn_Select_BG.png
|
70
75
|
- vendor/assets/javascripts/jHtmlArea-0.7.5.js
|
71
|
-
- vendor/assets/
|
72
|
-
- vendor/assets/stylesheets/jHtmlArea.Editor.css.scss
|
76
|
+
- vendor/assets/javascripts/jHtmlArea.ColorPickerMenu-0.7.0.js
|
73
77
|
- vendor/assets/stylesheets/jHtmlArea.ColorPickerMenu.css.scss
|
78
|
+
- vendor/assets/stylesheets/jHtmlArea.Editor.css.scss
|
79
|
+
- vendor/assets/stylesheets/jHtmlArea.css.scss
|
74
80
|
homepage: https://github.com/ddrake/jhtmlarea
|
75
81
|
licenses:
|
76
82
|
- MIT
|