ueditor-rails 1.2.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +49 -0
  5. data/Rakefile +1 -0
  6. data/app/assets/javascripts/ueditor.js +3 -0
  7. data/lib/tasks/ueditor.rake +12 -0
  8. data/lib/ueditor-rails.rb +1 -0
  9. data/lib/ueditor/rails.rb +9 -0
  10. data/lib/ueditor/rails/engine.rb +20 -0
  11. data/lib/ueditor/rails/version.rb +6 -0
  12. data/ueditor-rails.gemspec +20 -0
  13. data/vendor/assets/javascripts/ueditor/.DS_Store +0 -0
  14. data/vendor/assets/javascripts/ueditor/dialogs/.DS_Store +0 -0
  15. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.css +43 -0
  16. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.html +54 -0
  17. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.js +186 -0
  18. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/0.gif +0 -0
  19. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/bface.gif +0 -0
  20. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/cface.gif +0 -0
  21. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/fface.gif +0 -0
  22. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
  23. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
  24. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/tface.gif +0 -0
  25. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/wface.gif +0 -0
  26. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/yface.gif +0 -0
  27. data/vendor/assets/javascripts/ueditor/dialogs/image/image.css +69 -0
  28. data/vendor/assets/javascripts/ueditor/dialogs/image/image.html +204 -0
  29. data/vendor/assets/javascripts/ueditor/dialogs/image/image.js +712 -0
  30. data/vendor/assets/javascripts/ueditor/dialogs/image/imageUploader.swf +0 -0
  31. data/vendor/assets/javascripts/ueditor/dialogs/image/images/center_focus.jpg +0 -0
  32. data/vendor/assets/javascripts/ueditor/dialogs/image/images/left_focus.jpg +0 -0
  33. data/vendor/assets/javascripts/ueditor/dialogs/image/images/none_focus.jpg +0 -0
  34. data/vendor/assets/javascripts/ueditor/dialogs/image/images/right_focus.jpg +0 -0
  35. data/vendor/assets/javascripts/ueditor/dialogs/internal.js +79 -0
  36. data/vendor/assets/javascripts/ueditor/dialogs/tangram.js +1238 -0
  37. data/vendor/assets/javascripts/ueditor/dialogs/video/images/center_focus.jpg +0 -0
  38. data/vendor/assets/javascripts/ueditor/dialogs/video/images/left_focus.jpg +0 -0
  39. data/vendor/assets/javascripts/ueditor/dialogs/video/images/none_focus.jpg +0 -0
  40. data/vendor/assets/javascripts/ueditor/dialogs/video/images/right_focus.jpg +0 -0
  41. data/vendor/assets/javascripts/ueditor/dialogs/video/video.css +59 -0
  42. data/vendor/assets/javascripts/ueditor/dialogs/video/video.html +67 -0
  43. data/vendor/assets/javascripts/ueditor/dialogs/video/video.js +402 -0
  44. data/vendor/assets/javascripts/ueditor/editor_all.js +12437 -0
  45. data/vendor/assets/javascripts/ueditor/editor_all_min.js +1 -0
  46. data/vendor/assets/javascripts/ueditor/editor_config.js +209 -0
  47. data/vendor/assets/javascripts/ueditor/index.html +146 -0
  48. data/vendor/assets/javascripts/ueditor/lang/en/en.js +528 -0
  49. data/vendor/assets/javascripts/ueditor/lang/en/images/addimage.png +0 -0
  50. data/vendor/assets/javascripts/ueditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
  51. data/vendor/assets/javascripts/ueditor/lang/en/images/alldeletebtnupskin.png +0 -0
  52. data/vendor/assets/javascripts/ueditor/lang/en/images/background.png +0 -0
  53. data/vendor/assets/javascripts/ueditor/lang/en/images/button.png +0 -0
  54. data/vendor/assets/javascripts/ueditor/lang/en/images/copy.png +0 -0
  55. data/vendor/assets/javascripts/ueditor/lang/en/images/deletedisable.png +0 -0
  56. data/vendor/assets/javascripts/ueditor/lang/en/images/deleteenable.png +0 -0
  57. data/vendor/assets/javascripts/ueditor/lang/en/images/imglabel.png +0 -0
  58. data/vendor/assets/javascripts/ueditor/lang/en/images/listbackground.png +0 -0
  59. data/vendor/assets/javascripts/ueditor/lang/en/images/localimage.png +0 -0
  60. data/vendor/assets/javascripts/ueditor/lang/en/images/music.png +0 -0
  61. data/vendor/assets/javascripts/ueditor/lang/en/images/rotateleftdisable.png +0 -0
  62. data/vendor/assets/javascripts/ueditor/lang/en/images/rotateleftenable.png +0 -0
  63. data/vendor/assets/javascripts/ueditor/lang/en/images/rotaterightdisable.png +0 -0
  64. data/vendor/assets/javascripts/ueditor/lang/en/images/rotaterightenable.png +0 -0
  65. data/vendor/assets/javascripts/ueditor/lang/en/images/upload.png +0 -0
  66. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/copy.png +0 -0
  67. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/imglabel.png +0 -0
  68. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/localimage.png +0 -0
  69. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/music.png +0 -0
  70. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/upload.png +0 -0
  71. data/vendor/assets/javascripts/ueditor/lang/zh-cn/zh-cn.js +492 -0
  72. data/vendor/assets/javascripts/ueditor/php/.DS_Store +0 -0
  73. data/vendor/assets/javascripts/ueditor/php/Uploader.class.php +198 -0
  74. data/vendor/assets/javascripts/ueditor/php/fileUp.php +43 -0
  75. data/vendor/assets/javascripts/ueditor/php/getContent.php +21 -0
  76. data/vendor/assets/javascripts/ueditor/php/getMovie.php +13 -0
  77. data/vendor/assets/javascripts/ueditor/php/getRemoteImage.php +100 -0
  78. data/vendor/assets/javascripts/ueditor/php/imageManager.php +56 -0
  79. data/vendor/assets/javascripts/ueditor/php/imageUp.php +48 -0
  80. data/vendor/assets/javascripts/ueditor/php/scrawlUp.php +60 -0
  81. data/vendor/assets/javascripts/ueditor/themes/.DS_Store +0 -0
  82. data/vendor/assets/javascripts/ueditor/themes/default/.DS_Store +0 -0
  83. data/vendor/assets/javascripts/ueditor/themes/default/css/ueditor.css +1582 -0
  84. data/vendor/assets/javascripts/ueditor/themes/default/dialogbase.css +100 -0
  85. data/vendor/assets/javascripts/ueditor/themes/default/images/.DS_Store +0 -0
  86. data/vendor/assets/javascripts/ueditor/themes/default/images/anchor.gif +0 -0
  87. data/vendor/assets/javascripts/ueditor/themes/default/images/arrow.png +0 -0
  88. data/vendor/assets/javascripts/ueditor/themes/default/images/button-bg.gif +0 -0
  89. data/vendor/assets/javascripts/ueditor/themes/default/images/cancelbutton.gif +0 -0
  90. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_h.gif +0 -0
  91. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_h.png +0 -0
  92. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_v.gif +0 -0
  93. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_v.png +0 -0
  94. data/vendor/assets/javascripts/ueditor/themes/default/images/dialog-title-bg.png +0 -0
  95. data/vendor/assets/javascripts/ueditor/themes/default/images/filescan.png +0 -0
  96. data/vendor/assets/javascripts/ueditor/themes/default/images/highlighted.gif +0 -0
  97. data/vendor/assets/javascripts/ueditor/themes/default/images/icons-all.gif +0 -0
  98. data/vendor/assets/javascripts/ueditor/themes/default/images/icons.gif +0 -0
  99. data/vendor/assets/javascripts/ueditor/themes/default/images/icons.png +0 -0
  100. data/vendor/assets/javascripts/ueditor/themes/default/images/lock.gif +0 -0
  101. data/vendor/assets/javascripts/ueditor/themes/default/images/neweditor-tab-bg.png +0 -0
  102. data/vendor/assets/javascripts/ueditor/themes/default/images/pagebreak.gif +0 -0
  103. data/vendor/assets/javascripts/ueditor/themes/default/images/scale.png +0 -0
  104. data/vendor/assets/javascripts/ueditor/themes/default/images/spacer.gif +0 -0
  105. data/vendor/assets/javascripts/ueditor/themes/default/images/sparator_v.png +0 -0
  106. data/vendor/assets/javascripts/ueditor/themes/default/images/toolbar_bg.png +0 -0
  107. data/vendor/assets/javascripts/ueditor/themes/default/images/unhighlighted.gif +0 -0
  108. data/vendor/assets/javascripts/ueditor/themes/default/images/upload.png +0 -0
  109. data/vendor/assets/javascripts/ueditor/themes/default/images/videologo.gif +0 -0
  110. data/vendor/assets/javascripts/ueditor/themes/default/images/word.gif +0 -0
  111. data/vendor/assets/javascripts/ueditor/themes/default/images/wordpaste.png +0 -0
  112. data/vendor/assets/javascripts/ueditor/themes/iframe.css +1 -0
  113. data/vendor/assets/javascripts/ueditor/uparse.js +358 -0
  114. metadata +159 -0
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ueditor-rails.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 daveliu
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,49 @@
1
+ ueditor-rails
2
+ ======
3
+
4
+ Ueditor is a great rich text editor from [Baidu Ueditor ](http://ueditor.baidu.com/website/). This gem integrates Ueditor for Rails project.
5
+
6
+
7
+ Installation
8
+ ------------
9
+
10
+ Add `ueditor-rails` to you Gemfile.
11
+
12
+ ``` ruby
13
+ gem 'ueditor-rails'
14
+ ```
15
+
16
+ **Sync ueditor**
17
+
18
+ Ueditor has many js, css, image files, so this gem doesn't follow the Rails 3.1 Asset Pipeline design, it will just copy Ueditor to your public directory with `rake ueditor` in your app.
19
+
20
+ ``` ruby
21
+ # Rakefile
22
+ load 'tasks/ueditor.rake'
23
+ ```
24
+
25
+ ```
26
+ $ rake ueditor
27
+ ```
28
+
29
+
30
+ Example Rails Helper
31
+ --------------------
32
+
33
+ This would allow emojifying content such as: `it's raining :cats: and :dogs:!`
34
+
35
+ See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.
36
+
37
+ ```ruby
38
+ module EmojiHelper
39
+ def emojify(content)
40
+ h(content).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
41
+ if Emoji.names.include?($1)
42
+ '<img alt="' + $1 + '" height="20" src="' + asset_path("emoji/#{$1}.png") + '" style="vertical-align:middle" width="20" />'
43
+ else
44
+ match
45
+ end
46
+ end.html_safe if content.present?
47
+ end
48
+ end
49
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ //= require ueditor/editor_config.js
2
+ //= require ueditor/editor_all.js
3
+
@@ -0,0 +1,12 @@
1
+ desc "Copy ueditor to the Rails `public/ueditor` directory"
2
+ task :ueditor do
3
+ require 'ueditor-rails'
4
+
5
+ target = "#{Rake.original_dir}/public/ueditor"
6
+
7
+ mkdir_p "#{target}"
8
+
9
+ files = Dir.glob("#{Ueditor::Rails.ueditor_path}/")
10
+ FileUtils.cp_r files, "#{target}"
11
+
12
+ end
@@ -0,0 +1 @@
1
+ require "ueditor/rails"
@@ -0,0 +1,9 @@
1
+ module Ueditor
2
+ module Rails
3
+ require 'ueditor/rails/engine'
4
+ require 'ueditor/rails/version'
5
+ require "ueditor/rails/configuration"
6
+ require "ueditor/rails/helper"
7
+
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ module Ueditor::Rails
2
+ class Engine < ::Rails::Engine
3
+ config.ueditor = ActiveSupport::OrderedOptions.new
4
+
5
+ # Set an explicit base path for ueditor assets (usually defaults to /assets/ueditor)
6
+ config.ueditor.base = nil
7
+
8
+ initializer "precompile", :group => :all do |app|
9
+ app.config.assets.precompile << "ueditor.js"
10
+ end
11
+
12
+ def self.base
13
+ config.ueditor.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 || "/", "ueditor")
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,6 @@
1
+ module Ueditor
2
+ module Rails
3
+ VERSION = "1.2.5.1"
4
+ TINYMCE_VERSION = "1.2.5.0"
5
+ end
6
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require File.expand_path('../lib/ueditor/rails/version', __FILE__)
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "ueditor-rails"
8
+ gem.version = Ueditor::Rails::VERSION
9
+ gem.authors = ["daveliu"]
10
+ gem.email = ["dave@liageren.com"]
11
+ gem.description = %q{Seamlessly integrates Ueditor into the Rails asset pipeline introduced in Rails 3.1.}
12
+ gem.summary = %q{Rails asset pipeline integration for Ueditor.}
13
+ gem.homepage = ""
14
+
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+ end
@@ -0,0 +1,43 @@
1
+ .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
+ .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
+ .ldw img{
10
+ background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
11
+ cursor:pointer;width:35px;height:35px;display:block;
12
+ }
13
+ .tsj img{
14
+ background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
15
+ cursor:pointer;width:35px;height:35px;display:block;
16
+ }
17
+ .cat img{
18
+ background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
19
+ cursor:pointer;width:35px;height:35px;display:block;
20
+ }
21
+ .bb img{
22
+ background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
23
+ cursor:pointer;width:35px;height:35px;display:block;
24
+ }
25
+ .youa img{
26
+ background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
27
+ cursor:pointer;width:35px;height:35px;display:block;
28
+ }
29
+
30
+ .smileytable td {height: 37px;}
31
+ #tabPanel{margin-left:5px;overflow: hidden;}
32
+ #tabContent {float:left;background:#FFFFFF;}
33
+ #tabContent div{display: none;width:480px;overflow:hidden;}
34
+ #tabIconReview.show{left:17px;display:block;}
35
+ .menuFocus{background:#ACCD3C;}
36
+ .menuDefault{background:#FFFFFF;}
37
+ #tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px;}
38
+ img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFFFFF;background-position:center;background-repeat:no-repeat;}
39
+
40
+ .wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width: 95%;}
41
+ .tabbody table{width: 100%;}
42
+ .tabbody td{border:1px solid #BAC498;}
43
+ .tabbody td span{display: block;zoom:1;padding:0 4px;}
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title></title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <meta name="robots" content="noindex, nofollow"/>
7
+ <script type="text/javascript" src="../internal.js"></script>
8
+ <link rel="stylesheet" type="text/css" href="emotion.css">
9
+ </head>
10
+ <body>
11
+ <div id="tabPanel" class="wrapper">
12
+ <div id="tabHeads" class="tabhead">
13
+ <span><var id="lang_input_choice"></var></span>
14
+ <span><var id="lang_input_Tuzki"></var></span>
15
+ <span><var id="lang_input_lvdouwa"></var></span>
16
+ <span><var id="lang_input_BOBO"></var></span>
17
+ <span><var id="lang_input_babyCat"></var></span>
18
+ <span><var id="lang_input_bubble"></var></span>
19
+ <span><var id="lang_input_youa"></var></span>
20
+ </div>
21
+ <div id="tabBodys" class="tabbody">
22
+ <div id="tab0"></div>
23
+ <div id="tab1"></div>
24
+ <div id="tab2"></div>
25
+ <div id="tab3"></div>
26
+ <div id="tab4"></div>
27
+ <div id="tab5"></div>
28
+ <div id="tab6"></div>
29
+ </div>
30
+ </div>
31
+ <div id="tabIconReview">
32
+ <img id='faceReview' class='review'/>
33
+ </div>
34
+ <script type="text/javascript" src="emotion.js"></script>
35
+ <script type="text/javascript">
36
+ var emotion = {
37
+ tabNum:7, //切换面板数量
38
+ SmilmgName:{ tab0:['j_00', 84], tab1:['t_00', 40], tab2:['w_00', 52], tab3:['B_00', 63], tab4:['C_00', 20], tab5:['i_f', 50], tab6:['y_00', 40] }, //图片前缀名
39
+ imageFolders:{ tab0:'jx2/', tab1:'tsj/', tab2:'ldw/', tab3:'bobo/', tab4:'babycat/', tab5:'face/', tab6:'youa/'}, //图片对应文件夹路径
40
+ imageCss:{tab0:'jd', tab1:'tsj', tab2:'ldw', tab3:'bb', tab4:'cat', tab5:'pp', tab6:'youa'}, //图片css类名
41
+ imageCssOffset:{tab0:35, tab1:35, tab2:35, tab3:35, tab4:35, tab5:25, tab6:35}, //图片偏移
42
+ SmileyInfor:{
43
+ tab0:['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'],
44
+ tab1:['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'],
45
+ tab2:['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'],
46
+ tab3:['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'],
47
+ tab4:['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'],
48
+ tab5:['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'],
49
+ tab6:['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上']
50
+ }
51
+ };
52
+ </script>
53
+ </body>
54
+ </html>
@@ -0,0 +1,186 @@
1
+ window.onload = function () {
2
+ editor.setOpt({
3
+ emotionLocalization:false
4
+ });
5
+
6
+ emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "http://img.baidu.com/hi/";
7
+ emotion.SmileyBox = createTabList( emotion.tabNum );
8
+ emotion.tabExist = createArr( emotion.tabNum );
9
+
10
+ initImgName();
11
+ initEvtHandler( "tabHeads" );
12
+ };
13
+
14
+ function initImgName() {
15
+ for ( var pro in emotion.SmilmgName ) {
16
+ var tempName = emotion.SmilmgName[pro],
17
+ tempBox = emotion.SmileyBox[pro],
18
+ tempStr = "";
19
+
20
+ if ( tempBox.length ) return;
21
+ for ( var i = 1; i <= tempName[1]; i++ ) {
22
+ tempStr = tempName[0];
23
+ if ( i < 10 ) tempStr = tempStr + '0';
24
+ tempStr = tempStr + i + '.gif';
25
+ tempBox.push( tempStr );
26
+ }
27
+ }
28
+ }
29
+
30
+ function initEvtHandler( conId ) {
31
+ var tabHeads = $G( conId );
32
+ for ( var i = 0, j = 0; i < tabHeads.childNodes.length; i++ ) {
33
+ var tabObj = tabHeads.childNodes[i];
34
+ if ( tabObj.nodeType == 1 ) {
35
+ domUtils.on( tabObj, "click", (function ( index ) {
36
+ return function () {
37
+ switchTab( index );
38
+ };
39
+ })( j ) );
40
+ j++;
41
+ }
42
+ }
43
+ switchTab( 0 );
44
+ $G( "tabIconReview" ).style.display = 'none';
45
+ }
46
+
47
+ function InsertSmiley( url, evt ) {
48
+ var obj = {
49
+ src:editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url
50
+ };
51
+ obj.data_ue_src = obj.src;
52
+ editor.execCommand( 'insertimage', obj );
53
+ if ( !evt.ctrlKey ) {
54
+ dialog.popup.hide();
55
+ }
56
+ }
57
+
58
+ function switchTab( index ) {
59
+
60
+ autoHeight( index );
61
+ if ( emotion.tabExist[index] == 0 ) {
62
+ emotion.tabExist[index] = 1;
63
+ createTab( 'tab' + index );
64
+ }
65
+ //获取呈现元素句柄数组
66
+ var tabHeads = $G( "tabHeads" ).getElementsByTagName( "span" ),
67
+ tabBodys = $G( "tabBodys" ).getElementsByTagName( "div" ),
68
+ i = 0, L = tabHeads.length;
69
+ //隐藏所有呈现元素
70
+ for ( ; i < L; i++ ) {
71
+ tabHeads[i].className = "";
72
+ tabBodys[i].style.display = "none";
73
+ }
74
+ //显示对应呈现元素
75
+ tabHeads[index].className = "focus";
76
+ tabBodys[index].style.display = "block";
77
+ }
78
+
79
+ function autoHeight( index ) {
80
+ var iframe = dialog.getDom( "iframe" ),
81
+ parent = iframe.parentNode.parentNode;
82
+ switch ( index ) {
83
+ case 0:
84
+ iframe.style.height = "380px";
85
+ parent.style.height = "392px";
86
+ break;
87
+ case 1:
88
+ iframe.style.height = "220px";
89
+ parent.style.height = "232px";
90
+ break;
91
+ case 2:
92
+ iframe.style.height = "260px";
93
+ parent.style.height = "272px";
94
+ break;
95
+ case 3:
96
+ iframe.style.height = "300px";
97
+ parent.style.height = "312px";
98
+ break;
99
+ case 4:
100
+ iframe.style.height = "140px";
101
+ parent.style.height = "152px";
102
+ break;
103
+ case 5:
104
+ iframe.style.height = "260px";
105
+ parent.style.height = "272px";
106
+ break;
107
+ case 6:
108
+ iframe.style.height = "230px";
109
+ parent.style.height = "242px";
110
+ break;
111
+ default:
112
+
113
+ }
114
+ }
115
+
116
+
117
+ function createTab( tabName ) {
118
+ var faceVersion = "?v=1.1", //版本号
119
+ tab = $G( tabName ), //获取将要生成的Div句柄
120
+ imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径
121
+ positionLine = 11 / 2, //中间数
122
+ iWidth = iHeight = 35, //图片长宽
123
+ iColWidth = 3, //表格剩余空间的显示比例
124
+ tableCss = emotion.imageCss[tabName],
125
+ cssOffset = emotion.imageCssOffset[tabName],
126
+ textHTML = ['<table class="smileytable">'],
127
+ i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage,
128
+ sUrl, realUrl, posflag, offset, infor;
129
+
130
+ for ( ; i < imgNum; ) {
131
+ textHTML.push( '<tr>' );
132
+ for ( var j = 0; j < imgColNum; j++, i++ ) {
133
+ faceImage = emotion.SmileyBox[tabName][i];
134
+ if ( faceImage ) {
135
+ sUrl = imagePath + faceImage + faceVersion;
136
+ realUrl = imagePath + faceImage;
137
+ posflag = j < positionLine ? 0 : 1;
138
+ offset = cssOffset * i * (-1) - 1;
139
+ infor = emotion.SmileyInfor[tabName][i];
140
+
141
+ textHTML.push( '<td class="' + tableCss + '" border="1" width="' + iColWidth + '%" style="border-collapse:collapse;" align="center" bgcolor="transparent" onclick="InsertSmiley(\'' + realUrl.replace( /'/g, "\\'" ) + '\',event)" onmouseover="over(this,\'' + sUrl + '\',\'' + posflag + '\')" onmouseout="out(this)">' );
142
+ textHTML.push( '<span>' );
143
+ 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>' );
144
+ textHTML.push( '</span>' );
145
+ } else {
146
+ textHTML.push( '<td width="' + iColWidth + '%" bgcolor="#FFFFFF">' );
147
+ }
148
+ textHTML.push( '</td>' );
149
+ }
150
+ textHTML.push( '</tr>' );
151
+ }
152
+ textHTML.push( '</table>' );
153
+ textHTML = textHTML.join( "" );
154
+ tab.innerHTML = textHTML;
155
+ }
156
+
157
+ function over( td, srcPath, posFlag ) {
158
+ td.style.backgroundColor = "#ACCD3C";
159
+ $G( 'faceReview' ).style.backgroundImage = "url(" + srcPath + ")";
160
+ if ( posFlag == 1 ) $G( "tabIconReview" ).className = "show";
161
+ $G( "tabIconReview" ).style.display = 'block';
162
+ }
163
+
164
+ function out( td ) {
165
+ td.style.backgroundColor = "transparent";
166
+ var tabIconRevew = $G( "tabIconReview" );
167
+ tabIconRevew.className = "";
168
+ tabIconRevew.style.display = 'none';
169
+ }
170
+
171
+ function createTabList( tabNum ) {
172
+ var obj = {};
173
+ for ( var i = 0; i < tabNum; i++ ) {
174
+ obj["tab" + i] = [];
175
+ }
176
+ return obj;
177
+ }
178
+
179
+ function createArr( tabNum ) {
180
+ var arr = [];
181
+ for ( var i = 0; i < tabNum; i++ ) {
182
+ arr[i] = 0;
183
+ }
184
+ return arr;
185
+ }
186
+