umeditor-rails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +2 -0
- data/app/assets/javascripts/umeditor.js +2 -0
- data/lib/tasks/umeditor.rake +12 -0
- data/lib/umeditor/rails/engine.rb +20 -0
- data/lib/umeditor/rails/version.rb +6 -0
- data/lib/umeditor/rails.rb +7 -0
- data/lib/umeditor-rails.rb +1 -0
- data/umeditor-rails.gemspec +23 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/emotion.css +87 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/emotion.js +272 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/0.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/bface.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/cface.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/fface.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/jxface2.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/tface.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/wface.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/emotion/images/yface.gif +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/formula/formula.css +32 -0
- data/vendor/assets/javascripts/umeditor/dialogs/formula/formula.html +212 -0
- data/vendor/assets/javascripts/umeditor/dialogs/formula/formula.js +124 -0
- data/vendor/assets/javascripts/umeditor/dialogs/formula/images/formula.png +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/image/image.css +42 -0
- data/vendor/assets/javascripts/umeditor/dialogs/image/image.js +445 -0
- data/vendor/assets/javascripts/umeditor/dialogs/image/images/close.png +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/image/images/upload1.png +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/image/images/upload2.png +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/link/link.js +73 -0
- data/vendor/assets/javascripts/umeditor/dialogs/map/map.html +148 -0
- data/vendor/assets/javascripts/umeditor/dialogs/map/map.js +263 -0
- data/vendor/assets/javascripts/umeditor/dialogs/video/images/center_focus.jpg +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/video/images/left_focus.jpg +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/video/images/none_focus.jpg +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/video/images/right_focus.jpg +0 -0
- data/vendor/assets/javascripts/umeditor/dialogs/video/video.css +59 -0
- data/vendor/assets/javascripts/umeditor/dialogs/video/video.js +282 -0
- data/vendor/assets/javascripts/umeditor/index.html +277 -0
- data/vendor/assets/javascripts/umeditor/lang/en/en.js +150 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/addimage.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/alldeletebtnupskin.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/background.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/button.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/copy.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/deletedisable.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/deleteenable.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/imglabel.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/listbackground.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/localimage.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/music.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/rotateleftdisable.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/rotateleftenable.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/rotaterightdisable.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/rotaterightenable.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/en/images/upload.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/zh-cn/images/copy.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/zh-cn/images/imglabel.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/zh-cn/images/localimage.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/zh-cn/images/music.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/zh-cn/images/upload.png +0 -0
- data/vendor/assets/javascripts/umeditor/lang/zh-cn/zh-cn.js +150 -0
- data/vendor/assets/javascripts/umeditor/themes/default/css/umeditor.css +773 -0
- data/vendor/assets/javascripts/umeditor/themes/default/css/umeditor.min.css +8 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/caret.png +0 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/close.png +0 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/icons.gif +0 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/icons.png +0 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/ok.gif +0 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/pop-bg.png +0 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/spacer.gif +0 -0
- data/vendor/assets/javascripts/umeditor/themes/default/images/videologo.gif +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/jquery.min.js +6 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/Symbola.eot +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/Symbola.otf +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/Symbola.svg +5102 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/Symbola.ttf +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/Symbola.woff +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/STIXFontLicense2010.txt +103 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.eot +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.svg +3318 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.ttf +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.woff +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.eot +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.svg +1738 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.ttf +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.woff +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.eot +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.svg +1137 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.ttf +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.woff +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.eot +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.svg +1089 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.ttf +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.woff +0 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/mathquill.css +357 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/mathquill.js +3888 -0
- data/vendor/assets/javascripts/umeditor/third-party/mathquill/mathquill.min.js +2 -0
- data/vendor/assets/javascripts/umeditor/umeditor.config.js +249 -0
- data/vendor/assets/javascripts/umeditor/umeditor.js +10923 -0
- data/vendor/assets/javascripts/umeditor/umeditor.min.js +264 -0
- metadata +178 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7193b4d223ff8a2e36eb173acb81a790ef07a294
|
4
|
+
data.tar.gz: ead4610576ebe266c78faf241d5887df4ca32c4b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8c298c5b0ddac38caa488307e9354d7d3ad2c84d3d42f06d2a439f660712460653bff8c5a459050d622d4359de07cbbc0e7148b5f800aa23a2b120799b1772d2
|
7
|
+
data.tar.gz: d20fe7ce7838b42d4e6402dd971a98af81860386c875893c34f0258ec40419fd07f016fefe910a720287f2c37e62d07a586a9bc192e123a7e7d6737978225e4a
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Stephen Xu
|
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,31 @@
|
|
1
|
+
# Umeditor::Rails
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'umeditor-rails'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install umeditor-rails
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/umeditor-rails/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
desc "Copy umeditor to the Rails `public/umeditor` directory"
|
2
|
+
task :umeditor do
|
3
|
+
require 'umeditor-rails'
|
4
|
+
|
5
|
+
target = "#{Rake.original_dir}/public/umeditor"
|
6
|
+
|
7
|
+
mkdir_p "#{target}"
|
8
|
+
|
9
|
+
files = Dir.glob("#{Umeditor::Rails.umeditor_path}/")
|
10
|
+
FileUtils.cp_r files, "#{target}"
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Umeditor::Rails
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
config.umeditor = ActiveSupport::OrderedOptions.new
|
4
|
+
|
5
|
+
# Set an explicit base path for ueditor assets (usually defaults to /assets/umeditor)
|
6
|
+
config.umeditor.base = nil
|
7
|
+
|
8
|
+
initializer "precompile", :group => :all do |app|
|
9
|
+
app.config.assets.precompile << "umeditor.js"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.base
|
13
|
+
config.umeditor.base || default_base
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.default_base
|
17
|
+
File.join(Rails.application.config.relative_url_root || "", Rails.application.config.assets.prefix || "/", "umeditor")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "umeditor/rails"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "umeditor/rails/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "umeditor-rails"
|
8
|
+
spec.version = Umeditor::Rails::VERSION
|
9
|
+
spec.authors = ["wlon"]
|
10
|
+
spec.email = ["xu.wlon@gmail.com"]
|
11
|
+
spec.summary = %q{Seamlessly integrates Umeditor into the Rails asset pipeline introduced in Rails 4.}
|
12
|
+
spec.description = %q{Rails asset pipeline integration for Umeditor.}
|
13
|
+
spec.homepage = "https://github.com/wlon/umeditor-rails"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
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.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
.edui-popup-emotion .edui-emotion-jd img{
|
2
|
+
background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;
|
3
|
+
cursor:pointer;width:35px;height:35px;display:block;
|
4
|
+
}
|
5
|
+
.edui-popup-emotion .edui-emotion-pp img{
|
6
|
+
background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;
|
7
|
+
cursor:pointer;width:25px;height:25px;display:block;
|
8
|
+
}
|
9
|
+
|
10
|
+
.edui-popup-emotion .edui-emotion-ldw img{
|
11
|
+
background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
|
12
|
+
cursor:pointer;width:35px;height:35px;display:block;
|
13
|
+
}
|
14
|
+
|
15
|
+
.edui-popup-emotion .edui-emotion-tsj img{
|
16
|
+
background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
|
17
|
+
cursor:pointer;width:35px;height:35px;display:block;
|
18
|
+
}
|
19
|
+
|
20
|
+
.edui-popup-emotion .edui-emotion-cat img{
|
21
|
+
background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
|
22
|
+
cursor:pointer;width:35px;height:35px;display:block;
|
23
|
+
}
|
24
|
+
|
25
|
+
.edui-popup-emotion .edui-emotion-bb img{
|
26
|
+
background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
|
27
|
+
cursor:pointer;width:35px;height:35px;display:block;
|
28
|
+
}
|
29
|
+
|
30
|
+
.edui-popup-emotion .edui-emotion-youa img{
|
31
|
+
background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
|
32
|
+
cursor:pointer;width:35px;height:35px;display:block;
|
33
|
+
}
|
34
|
+
|
35
|
+
.edui-popup-emotion .edui-emotion-smileytable {
|
36
|
+
width: 100%;
|
37
|
+
border-spacing: 0;
|
38
|
+
border-collapse: collapse;
|
39
|
+
table-layout: fixed;
|
40
|
+
}
|
41
|
+
|
42
|
+
.edui-popup-emotion .edui-emotion-wrapper {
|
43
|
+
padding: 15px;
|
44
|
+
}
|
45
|
+
|
46
|
+
.edui-popup-emotion .edui-tab-nav{
|
47
|
+
height: auto;
|
48
|
+
*height: 31px;
|
49
|
+
}
|
50
|
+
.edui-popup-emotion .edui-emotion-tabs{
|
51
|
+
clear: both;
|
52
|
+
width: 0;
|
53
|
+
height: 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
.edui-popup-emotion .edui-tab-content {
|
57
|
+
padding: 15px 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
.edui-popup-emotion .edui-emotion-preview-box {
|
61
|
+
width:90px;
|
62
|
+
height:76px;
|
63
|
+
border:2px solid #9cb945;
|
64
|
+
background:#FFFFFF;
|
65
|
+
background-position:center;
|
66
|
+
background-repeat:no-repeat;
|
67
|
+
position: absolute;
|
68
|
+
top: 67px;
|
69
|
+
left: 494px;
|
70
|
+
display: none;
|
71
|
+
}
|
72
|
+
|
73
|
+
.edui-popup-emotion .edui-tab-text {
|
74
|
+
font-size: 12px;
|
75
|
+
}
|
76
|
+
|
77
|
+
.edui-popup-emotion .edui-emotion-preview-left {
|
78
|
+
left: 15px;
|
79
|
+
}
|
80
|
+
|
81
|
+
.edui-popup-emotion .edui-emotion-preview-img {
|
82
|
+
width: 100%;
|
83
|
+
height: 100%;
|
84
|
+
display: block;
|
85
|
+
background-repeat: no-repeat;
|
86
|
+
background-position: center center;
|
87
|
+
}
|
@@ -0,0 +1,272 @@
|
|
1
|
+
(function(){
|
2
|
+
|
3
|
+
var editor = null;
|
4
|
+
|
5
|
+
UM.registerWidget('emotion',{
|
6
|
+
|
7
|
+
tpl: "<link type=\"text/css\" rel=\"stylesheet\" href=\"<%=emotion_url%>emotion.css\">" +
|
8
|
+
"<div class=\"edui-emotion-tab-Jpanel edui-emotion-wrapper\">" +
|
9
|
+
"<ul class=\"edui-emotion-Jtabnav edui-tab-nav\">" +
|
10
|
+
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab0\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_choice%></a></li>" +
|
11
|
+
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab1\" class=\"edui-tab-text\"><%=lang_input_Tuzki%></a></li>" +
|
12
|
+
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab2\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_lvdouwa%></a></li>" +
|
13
|
+
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab3\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_BOBO%></a></li>" +
|
14
|
+
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab4\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_babyCat%></a></li>" +
|
15
|
+
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab5\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_bubble%></a></li>" +
|
16
|
+
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab6\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_youa%></a></li>" +
|
17
|
+
"<li class=\"edui-emotion-tabs\"></li>" +
|
18
|
+
"</ul>" +
|
19
|
+
"<div class=\"edui-tab-content edui-emotion-JtabBodys\">" +
|
20
|
+
"<div class=\"edui-emotion-Jtab0 edui-tab-pane\"></div>" +
|
21
|
+
"<div class=\"edui-emotion-Jtab1 edui-tab-pane\"></div>" +
|
22
|
+
"<div class=\"edui-emotion-Jtab2 edui-tab-pane\"></div>" +
|
23
|
+
"<div class=\"edui-emotion-Jtab3 edui-tab-pane\"></div>" +
|
24
|
+
"<div class=\"edui-emotion-Jtab4 edui-tab-pane\"></div>" +
|
25
|
+
"<div class=\"edui-emotion-Jtab5 edui-tab-pane\"></div>" +
|
26
|
+
"<div class=\"edui-emotion-Jtab6 edui-tab-pane\"></div>" +
|
27
|
+
"</div>" +
|
28
|
+
"<div class=\"edui-emotion-JtabIconReview edui-emotion-preview-box\">" +
|
29
|
+
"<img src=\"<%=cover_img%>\" class=\'edui-emotion-JfaceReview edui-emotion-preview-img\'/>" +
|
30
|
+
"</div>",
|
31
|
+
|
32
|
+
sourceData: {
|
33
|
+
emotion: {
|
34
|
+
tabNum:7, //切换面板数量
|
35
|
+
SmilmgName:{ 'edui-emotion-Jtab0':['j_00', 84], 'edui-emotion-Jtab1':['t_00', 40], 'edui-emotion-Jtab2':['w_00', 52], 'edui-emotion-Jtab3':['B_00', 63], 'edui-emotion-Jtab4':['C_00', 20], 'edui-emotion-Jtab5':['i_f', 50], 'edui-emotion-Jtab6':['y_00', 40] }, //图片前缀名
|
36
|
+
imageFolders:{ 'edui-emotion-Jtab0':'jx2/', 'edui-emotion-Jtab1':'tsj/', 'edui-emotion-Jtab2':'ldw/', 'edui-emotion-Jtab3':'bobo/', 'edui-emotion-Jtab4':'babycat/', 'edui-emotion-Jtab5':'face/', 'edui-emotion-Jtab6':'youa/'}, //图片对应文件夹路径
|
37
|
+
imageCss:{'edui-emotion-Jtab0':'jd', 'edui-emotion-Jtab1':'tsj', 'edui-emotion-Jtab2':'ldw', 'edui-emotion-Jtab3':'bb', 'edui-emotion-Jtab4':'cat', 'edui-emotion-Jtab5':'pp', 'edui-emotion-Jtab6':'youa'}, //图片css类名
|
38
|
+
imageCssOffset:{'edui-emotion-Jtab0':35, 'edui-emotion-Jtab1':35, 'edui-emotion-Jtab2':35, 'edui-emotion-Jtab3':35, 'edui-emotion-Jtab4':35, 'edui-emotion-Jtab5':25, 'edui-emotion-Jtab6':35}, //图片偏移
|
39
|
+
SmileyInfor:{
|
40
|
+
'edui-emotion-Jtab0':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'],
|
41
|
+
'edui-emotion-Jtab1':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'],
|
42
|
+
'edui-emotion-Jtab2':['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'],
|
43
|
+
'edui-emotion-Jtab3':['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'],
|
44
|
+
'edui-emotion-Jtab4':['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'],
|
45
|
+
'edui-emotion-Jtab5':['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'],
|
46
|
+
'edui-emotion-Jtab6':['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上']
|
47
|
+
}
|
48
|
+
}
|
49
|
+
},
|
50
|
+
initContent:function( _editor, $widget ){
|
51
|
+
|
52
|
+
var me = this,
|
53
|
+
emotion = me.sourceData.emotion,
|
54
|
+
lang = _editor.getLang( 'emotion' )['static'],
|
55
|
+
emotionUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/emotion/',
|
56
|
+
options = $.extend( {}, lang, {
|
57
|
+
emotion_url: emotionUrl
|
58
|
+
}),
|
59
|
+
$root = me.root();
|
60
|
+
|
61
|
+
if( me.inited ) {
|
62
|
+
me.preventDefault();
|
63
|
+
this.switchToFirst();
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
|
67
|
+
me.inited = true;
|
68
|
+
|
69
|
+
editor = _editor;
|
70
|
+
this.widget = $widget;
|
71
|
+
|
72
|
+
emotion.SmileyPath = _editor.options.emotionLocalization === true ? emotionUrl + 'images/' : "http://img.baidu.com/hi/";
|
73
|
+
emotion.SmileyBox = me.createTabList( emotion.tabNum );
|
74
|
+
emotion.tabExist = me.createArr( emotion.tabNum );
|
75
|
+
|
76
|
+
options['cover_img'] = emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif' : 'default/0.gif');
|
77
|
+
|
78
|
+
$root.html( $.parseTmpl( me.tpl, options ) );
|
79
|
+
|
80
|
+
me.tabs = $.eduitab({selector:".edui-emotion-tab-Jpanel"});
|
81
|
+
|
82
|
+
//缓存预览对象
|
83
|
+
me.previewBox = $root.find(".edui-emotion-JtabIconReview");
|
84
|
+
me.previewImg = $root.find(".edui-emotion-JfaceReview");
|
85
|
+
|
86
|
+
me.initImgName();
|
87
|
+
|
88
|
+
},
|
89
|
+
initEvent:function(){
|
90
|
+
|
91
|
+
var me = this;
|
92
|
+
|
93
|
+
//防止点击过后关闭popup
|
94
|
+
me.root().on('click', function(e){
|
95
|
+
return false;
|
96
|
+
});
|
97
|
+
|
98
|
+
//移动预览
|
99
|
+
me.root().delegate( 'td', 'mouseover mouseout', function( evt ){
|
100
|
+
|
101
|
+
var $td = $( this),
|
102
|
+
url = $td.attr('data-surl') || null;
|
103
|
+
|
104
|
+
if( url ) {
|
105
|
+
me[evt.type]( this, url , $td.attr('data-posflag') );
|
106
|
+
}
|
107
|
+
|
108
|
+
return false;
|
109
|
+
|
110
|
+
} );
|
111
|
+
|
112
|
+
//点击选中
|
113
|
+
me.root().delegate( 'td', 'click', function( evt ){
|
114
|
+
|
115
|
+
var $td = $( this),
|
116
|
+
realUrl = $td.attr('data-realurl') || null;
|
117
|
+
|
118
|
+
if( realUrl ) {
|
119
|
+
me.insertSmiley( realUrl.replace( /'/g, "\\'" ), evt );
|
120
|
+
}
|
121
|
+
|
122
|
+
return false;
|
123
|
+
|
124
|
+
} );
|
125
|
+
|
126
|
+
//更新模板
|
127
|
+
me.tabs.edui().on("beforeshow", function( evt ){
|
128
|
+
|
129
|
+
var contentId = $(evt.target).attr('data-context').replace( /^.*\.(?=[^\s]*$)/, '' );
|
130
|
+
|
131
|
+
evt.stopPropagation();
|
132
|
+
|
133
|
+
me.updateTab( contentId );
|
134
|
+
|
135
|
+
});
|
136
|
+
|
137
|
+
this.switchToFirst();
|
138
|
+
|
139
|
+
},
|
140
|
+
initImgName: function() {
|
141
|
+
|
142
|
+
var emotion = this.sourceData.emotion;
|
143
|
+
|
144
|
+
for ( var pro in emotion.SmilmgName ) {
|
145
|
+
var tempName = emotion.SmilmgName[pro],
|
146
|
+
tempBox = emotion.SmileyBox[pro],
|
147
|
+
tempStr = "";
|
148
|
+
|
149
|
+
if ( tempBox.length ) return;
|
150
|
+
|
151
|
+
for ( var i = 1; i <= tempName[1]; i++ ) {
|
152
|
+
tempStr = tempName[0];
|
153
|
+
if ( i < 10 ) tempStr = tempStr + '0';
|
154
|
+
tempStr = tempStr + i + '.gif';
|
155
|
+
tempBox.push( tempStr );
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
},
|
160
|
+
/**
|
161
|
+
* 切换到第一个tab
|
162
|
+
*/
|
163
|
+
switchToFirst: function(){
|
164
|
+
this.root().find(".edui-emotion-Jtabnav .edui-tab-text:first").trigger('click');
|
165
|
+
},
|
166
|
+
updateTab: function( contentBoxId ) {
|
167
|
+
|
168
|
+
var me = this,
|
169
|
+
emotion = me.sourceData.emotion;
|
170
|
+
|
171
|
+
me.autoHeight( contentBoxId );
|
172
|
+
|
173
|
+
if ( !emotion.tabExist[ contentBoxId ] ) {
|
174
|
+
|
175
|
+
emotion.tabExist[ contentBoxId ] = true;
|
176
|
+
me.createTab( contentBoxId );
|
177
|
+
|
178
|
+
}
|
179
|
+
|
180
|
+
},
|
181
|
+
autoHeight: function( ) {
|
182
|
+
this.widget.height(this.root() + 2);
|
183
|
+
},
|
184
|
+
createTabList: function( tabNum ) {
|
185
|
+
var obj = {};
|
186
|
+
for ( var i = 0; i < tabNum; i++ ) {
|
187
|
+
obj["edui-emotion-Jtab" + i] = [];
|
188
|
+
}
|
189
|
+
return obj;
|
190
|
+
},
|
191
|
+
mouseover: function( td, srcPath, posFlag ) {
|
192
|
+
|
193
|
+
posFlag -= 0;
|
194
|
+
|
195
|
+
$(td).css( 'backgroundColor', '#ACCD3C' );
|
196
|
+
|
197
|
+
this.previewImg.css( "backgroundImage", "url(" + srcPath + ")" );
|
198
|
+
posFlag && this.previewBox.addClass('edui-emotion-preview-left');
|
199
|
+
this.previewBox.show();
|
200
|
+
|
201
|
+
},
|
202
|
+
mouseout: function( td ) {
|
203
|
+
$(td).css( 'backgroundColor', 'transparent' );
|
204
|
+
this.previewBox.removeClass('edui-emotion-preview-left').hide();
|
205
|
+
},
|
206
|
+
insertSmiley: function( url, evt ) {
|
207
|
+
var obj = {
|
208
|
+
src: url
|
209
|
+
};
|
210
|
+
obj._src = obj.src;
|
211
|
+
editor.execCommand( 'insertimage', obj );
|
212
|
+
if ( !evt.ctrlKey ) {
|
213
|
+
//关闭预览
|
214
|
+
this.previewBox.removeClass('edui-emotion-preview-left').hide();
|
215
|
+
this.widget.edui().hide();
|
216
|
+
}
|
217
|
+
},
|
218
|
+
createTab: function( contentBoxId ) {
|
219
|
+
|
220
|
+
var faceVersion = "?v=1.1", //版本号
|
221
|
+
me = this,
|
222
|
+
$contentBox = this.root().find("."+contentBoxId),
|
223
|
+
emotion = me.sourceData.emotion,
|
224
|
+
imagePath = emotion.SmileyPath + emotion.imageFolders[ contentBoxId ], //获取显示表情和预览表情的路径
|
225
|
+
positionLine = 11 / 2, //中间数
|
226
|
+
iWidth = iHeight = 35, //图片长宽
|
227
|
+
iColWidth = 3, //表格剩余空间的显示比例
|
228
|
+
tableCss = emotion.imageCss[ contentBoxId ],
|
229
|
+
cssOffset = emotion.imageCssOffset[ contentBoxId ],
|
230
|
+
textHTML = ['<table border="1" class="edui-emotion-smileytable">'],
|
231
|
+
i = 0, imgNum = emotion.SmileyBox[ contentBoxId ].length, imgColNum = 11, faceImage,
|
232
|
+
sUrl, realUrl, posflag, offset, infor;
|
233
|
+
|
234
|
+
for ( ; i < imgNum; ) {
|
235
|
+
textHTML.push( '<tr>' );
|
236
|
+
for ( var j = 0; j < imgColNum; j++, i++ ) {
|
237
|
+
faceImage = emotion.SmileyBox[ contentBoxId ][i];
|
238
|
+
if ( faceImage ) {
|
239
|
+
sUrl = imagePath + faceImage + faceVersion;
|
240
|
+
realUrl = imagePath + faceImage;
|
241
|
+
posflag = j < positionLine ? 0 : 1;
|
242
|
+
offset = cssOffset * i * (-1) - 1;
|
243
|
+
infor = emotion.SmileyInfor[ contentBoxId ][i];
|
244
|
+
|
245
|
+
textHTML.push( '<td class="edui-emotion-' + tableCss + '" data-surl="'+ sUrl +'" data-realurl="'+ realUrl +'" data-posflag="'+ posflag +'" align="center">' );
|
246
|
+
textHTML.push( '<span>' );
|
247
|
+
textHTML.push( '<img style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>' );
|
248
|
+
textHTML.push( '</span>' );
|
249
|
+
} else {
|
250
|
+
textHTML.push( '<td bgcolor="#FFFFFF">' );
|
251
|
+
}
|
252
|
+
textHTML.push( '</td>' );
|
253
|
+
}
|
254
|
+
textHTML.push( '</tr>' );
|
255
|
+
}
|
256
|
+
textHTML.push( '</table>' );
|
257
|
+
textHTML = textHTML.join( "" );
|
258
|
+
$contentBox.html( textHTML );
|
259
|
+
},
|
260
|
+
createArr: function( tabNum ) {
|
261
|
+
var arr = [];
|
262
|
+
for ( var i = 0; i < tabNum; i++ ) {
|
263
|
+
arr[i] = 0;
|
264
|
+
}
|
265
|
+
return arr;
|
266
|
+
},
|
267
|
+
width:603,
|
268
|
+
height:400
|
269
|
+
});
|
270
|
+
|
271
|
+
})();
|
272
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,32 @@
|
|
1
|
+
.edui-popup-formula .edui-formula-wrapper {
|
2
|
+
padding: 15px;
|
3
|
+
}
|
4
|
+
.edui-popup-formula .edui-formula-wrapper .edui-tab-nav{
|
5
|
+
height: auto;
|
6
|
+
*height: 31px;
|
7
|
+
}
|
8
|
+
.edui-popup-formula .edui-formula-wrapper .edui-tab-text {
|
9
|
+
font-size: 12px;
|
10
|
+
}
|
11
|
+
.edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth {
|
12
|
+
clear: both;
|
13
|
+
width: 0;
|
14
|
+
height: 0;
|
15
|
+
}
|
16
|
+
.edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul {
|
17
|
+
margin: 0px;
|
18
|
+
padding: 0px;
|
19
|
+
}
|
20
|
+
.edui-popup-formula .edui-formula-wrapper .edui-tab-content {
|
21
|
+
padding: 5px 0px 0px 0px;
|
22
|
+
}
|
23
|
+
.edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item {
|
24
|
+
display: block;
|
25
|
+
float: left;
|
26
|
+
margin: 0px 3px 3px 0px;
|
27
|
+
width: 30px;
|
28
|
+
height: 30px;
|
29
|
+
border:1px solid #cccccc;
|
30
|
+
background-image: url("images/formula.png");
|
31
|
+
cursor: pointer;
|
32
|
+
}
|