xmt_froala 0.3.1

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.
Files changed (203) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +2 -0
  5. data/app/assets/javascripts/xmt_froala.js +31 -0
  6. data/app/assets/stylesheets/xmt_froala.css +17 -0
  7. data/app/controllers/xmt_froala/application_controller.rb +5 -0
  8. data/app/controllers/xmt_froala/assets_controller.rb +94 -0
  9. data/app/models/xmt_froala/asset_uploader.rb +107 -0
  10. data/app/models/xmt_froala/file_uploader.rb +10 -0
  11. data/app/models/xmt_froala/flash_uploader.rb +10 -0
  12. data/app/models/xmt_froala/image_uploader.rb +10 -0
  13. data/app/models/xmt_froala/media_uploader.rb +10 -0
  14. data/config/routes.rb +6 -0
  15. data/lib/generators/xmt_froala/install/USAGE +10 -0
  16. data/lib/generators/xmt_froala/install/install_generator.rb +23 -0
  17. data/lib/generators/xmt_froala/install/templates/application.js +17 -0
  18. data/lib/generators/xmt_froala/install/templates/xmt_froala.rb +29 -0
  19. data/lib/generators/xmt_froala/migration/USAGE +14 -0
  20. data/lib/generators/xmt_froala/migration/migration_generator.rb +36 -0
  21. data/lib/generators/xmt_froala/migration/templates/migration/migration.rb +18 -0
  22. data/lib/generators/xmt_froala/migration/templates/models/active_record/xmt_froala/asset.rb +14 -0
  23. data/lib/generators/xmt_froala/migration/templates/models/active_record/xmt_froala/file.rb +3 -0
  24. data/lib/generators/xmt_froala/migration/templates/models/active_record/xmt_froala/flash.rb +3 -0
  25. data/lib/generators/xmt_froala/migration/templates/models/active_record/xmt_froala/image.rb +3 -0
  26. data/lib/generators/xmt_froala/migration/templates/models/active_record/xmt_froala/media.rb +3 -0
  27. data/lib/generators/xmt_froala/migration/templates/models/mongoid/xmt_froala/asset.rb +27 -0
  28. data/lib/generators/xmt_froala/migration/templates/models/mongoid/xmt_froala/file.rb +3 -0
  29. data/lib/generators/xmt_froala/migration/templates/models/mongoid/xmt_froala/flash.rb +3 -0
  30. data/lib/generators/xmt_froala/migration/templates/models/mongoid/xmt_froala/image.rb +3 -0
  31. data/lib/generators/xmt_froala/migration/templates/models/mongoid/xmt_froala/media.rb +3 -0
  32. data/lib/tasks/xmt_froala_tasks.rake +9 -0
  33. data/lib/xmt_froala.rb +65 -0
  34. data/lib/xmt_froala/active_record.rb +14 -0
  35. data/lib/xmt_froala/engine.rb +32 -0
  36. data/lib/xmt_froala/formtastic.rb +12 -0
  37. data/lib/xmt_froala/helper.rb +105 -0
  38. data/lib/xmt_froala/simple_form.rb +11 -0
  39. data/lib/xmt_froala/version.rb +3 -0
  40. data/vendor/assets/javascripts/xmt_froala/froala_editor.js +0 -0
  41. data/vendor/assets/javascripts/xmt_froala/languages/ar.js +318 -0
  42. data/vendor/assets/javascripts/xmt_froala/languages/bs.js +318 -0
  43. data/vendor/assets/javascripts/xmt_froala/languages/cs.js +318 -0
  44. data/vendor/assets/javascripts/xmt_froala/languages/da.js +318 -0
  45. data/vendor/assets/javascripts/xmt_froala/languages/de.js +318 -0
  46. data/vendor/assets/javascripts/xmt_froala/languages/en_ca.js +262 -0
  47. data/vendor/assets/javascripts/xmt_froala/languages/en_gb.js +262 -0
  48. data/vendor/assets/javascripts/xmt_froala/languages/es.js +318 -0
  49. data/vendor/assets/javascripts/xmt_froala/languages/et.js +318 -0
  50. data/vendor/assets/javascripts/xmt_froala/languages/fa.js +318 -0
  51. data/vendor/assets/javascripts/xmt_froala/languages/fi.js +318 -0
  52. data/vendor/assets/javascripts/xmt_froala/languages/fr.js +318 -0
  53. data/vendor/assets/javascripts/xmt_froala/languages/he.js +318 -0
  54. data/vendor/assets/javascripts/xmt_froala/languages/hr.js +318 -0
  55. data/vendor/assets/javascripts/xmt_froala/languages/hu.js +318 -0
  56. data/vendor/assets/javascripts/xmt_froala/languages/id.js +319 -0
  57. data/vendor/assets/javascripts/xmt_froala/languages/it.js +318 -0
  58. data/vendor/assets/javascripts/xmt_froala/languages/ja.js +318 -0
  59. data/vendor/assets/javascripts/xmt_froala/languages/ko.js +318 -0
  60. data/vendor/assets/javascripts/xmt_froala/languages/me.js +318 -0
  61. data/vendor/assets/javascripts/xmt_froala/languages/nb.js +318 -0
  62. data/vendor/assets/javascripts/xmt_froala/languages/nl.js +318 -0
  63. data/vendor/assets/javascripts/xmt_froala/languages/pl.js +318 -0
  64. data/vendor/assets/javascripts/xmt_froala/languages/pt_br.js +318 -0
  65. data/vendor/assets/javascripts/xmt_froala/languages/pt_pt.js +318 -0
  66. data/vendor/assets/javascripts/xmt_froala/languages/ro.js +319 -0
  67. data/vendor/assets/javascripts/xmt_froala/languages/ru.js +318 -0
  68. data/vendor/assets/javascripts/xmt_froala/languages/sk.js +318 -0
  69. data/vendor/assets/javascripts/xmt_froala/languages/sr.js +318 -0
  70. data/vendor/assets/javascripts/xmt_froala/languages/sv.js +318 -0
  71. data/vendor/assets/javascripts/xmt_froala/languages/th.js +318 -0
  72. data/vendor/assets/javascripts/xmt_froala/languages/tr.js +318 -0
  73. data/vendor/assets/javascripts/xmt_froala/languages/uk.js +318 -0
  74. data/vendor/assets/javascripts/xmt_froala/languages/vi.js +258 -0
  75. data/vendor/assets/javascripts/xmt_froala/languages/zh_cn.js +320 -0
  76. data/vendor/assets/javascripts/xmt_froala/languages/zh_tw.js +318 -0
  77. data/vendor/assets/javascripts/xmt_froala/plugins/align.js +139 -0
  78. data/vendor/assets/javascripts/xmt_froala/plugins/align.min.js +7 -0
  79. data/vendor/assets/javascripts/xmt_froala/plugins/char_counter.js +154 -0
  80. data/vendor/assets/javascripts/xmt_froala/plugins/char_counter.min.js +7 -0
  81. data/vendor/assets/javascripts/xmt_froala/plugins/code_beautifier.js +3270 -0
  82. data/vendor/assets/javascripts/xmt_froala/plugins/code_beautifier.min.js +7 -0
  83. data/vendor/assets/javascripts/xmt_froala/plugins/code_view.js +393 -0
  84. data/vendor/assets/javascripts/xmt_froala/plugins/code_view.min.js +7 -0
  85. data/vendor/assets/javascripts/xmt_froala/plugins/colors.js +492 -0
  86. data/vendor/assets/javascripts/xmt_froala/plugins/colors.min.js +7 -0
  87. data/vendor/assets/javascripts/xmt_froala/plugins/draggable.js +459 -0
  88. data/vendor/assets/javascripts/xmt_froala/plugins/draggable.min.js +7 -0
  89. data/vendor/assets/javascripts/xmt_froala/plugins/emoticons.js +509 -0
  90. data/vendor/assets/javascripts/xmt_froala/plugins/emoticons.min.js +7 -0
  91. data/vendor/assets/javascripts/xmt_froala/plugins/entities.js +121 -0
  92. data/vendor/assets/javascripts/xmt_froala/plugins/entities.min.js +7 -0
  93. data/vendor/assets/javascripts/xmt_froala/plugins/file.js +736 -0
  94. data/vendor/assets/javascripts/xmt_froala/plugins/file.min.js +239 -0
  95. data/vendor/assets/javascripts/xmt_froala/plugins/font_family.js +182 -0
  96. data/vendor/assets/javascripts/xmt_froala/plugins/font_family.min.js +7 -0
  97. data/vendor/assets/javascripts/xmt_froala/plugins/font_size.js +118 -0
  98. data/vendor/assets/javascripts/xmt_froala/plugins/font_size.min.js +7 -0
  99. data/vendor/assets/javascripts/xmt_froala/plugins/forms.js +430 -0
  100. data/vendor/assets/javascripts/xmt_froala/plugins/forms.min.js +7 -0
  101. data/vendor/assets/javascripts/xmt_froala/plugins/fullscreen.js +274 -0
  102. data/vendor/assets/javascripts/xmt_froala/plugins/fullscreen.min.js +7 -0
  103. data/vendor/assets/javascripts/xmt_froala/plugins/help.js +216 -0
  104. data/vendor/assets/javascripts/xmt_froala/plugins/help.min.js +7 -0
  105. data/vendor/assets/javascripts/xmt_froala/plugins/image.js +3323 -0
  106. data/vendor/assets/javascripts/xmt_froala/plugins/image.min.js +7 -0
  107. data/vendor/assets/javascripts/xmt_froala/plugins/image_manager.js +1056 -0
  108. data/vendor/assets/javascripts/xmt_froala/plugins/image_manager.min.js +7 -0
  109. data/vendor/assets/javascripts/xmt_froala/plugins/inline_style.js +94 -0
  110. data/vendor/assets/javascripts/xmt_froala/plugins/inline_style.min.js +7 -0
  111. data/vendor/assets/javascripts/xmt_froala/plugins/line_breaker.js +537 -0
  112. data/vendor/assets/javascripts/xmt_froala/plugins/line_breaker.min.js +7 -0
  113. data/vendor/assets/javascripts/xmt_froala/plugins/link.js +1157 -0
  114. data/vendor/assets/javascripts/xmt_froala/plugins/link.min.js +7 -0
  115. data/vendor/assets/javascripts/xmt_froala/plugins/lists.js +462 -0
  116. data/vendor/assets/javascripts/xmt_froala/plugins/lists.min.js +7 -0
  117. data/vendor/assets/javascripts/xmt_froala/plugins/paragraph_format.js +290 -0
  118. data/vendor/assets/javascripts/xmt_froala/plugins/paragraph_format.min.js +7 -0
  119. data/vendor/assets/javascripts/xmt_froala/plugins/paragraph_style.js +144 -0
  120. data/vendor/assets/javascripts/xmt_froala/plugins/paragraph_style.min.js +7 -0
  121. data/vendor/assets/javascripts/xmt_froala/plugins/plain_paste.js +96 -0
  122. data/vendor/assets/javascripts/xmt_froala/plugins/print.js +137 -0
  123. data/vendor/assets/javascripts/xmt_froala/plugins/print.min.js +7 -0
  124. data/vendor/assets/javascripts/xmt_froala/plugins/quick_format.js +89 -0
  125. data/vendor/assets/javascripts/xmt_froala/plugins/quick_insert.js +478 -0
  126. data/vendor/assets/javascripts/xmt_froala/plugins/quick_insert.min.js +7 -0
  127. data/vendor/assets/javascripts/xmt_froala/plugins/quote.js +141 -0
  128. data/vendor/assets/javascripts/xmt_froala/plugins/quote.min.js +7 -0
  129. data/vendor/assets/javascripts/xmt_froala/plugins/save.js +189 -0
  130. data/vendor/assets/javascripts/xmt_froala/plugins/save.min.js +7 -0
  131. data/vendor/assets/javascripts/xmt_froala/plugins/special_characters.js +781 -0
  132. data/vendor/assets/javascripts/xmt_froala/plugins/special_characters.min.js +7 -0
  133. data/vendor/assets/javascripts/xmt_froala/plugins/table.js +4194 -0
  134. data/vendor/assets/javascripts/xmt_froala/plugins/table.min.js +7 -0
  135. data/vendor/assets/javascripts/xmt_froala/plugins/url.js +194 -0
  136. data/vendor/assets/javascripts/xmt_froala/plugins/url.min.js +7 -0
  137. data/vendor/assets/javascripts/xmt_froala/plugins/video.js +2342 -0
  138. data/vendor/assets/javascripts/xmt_froala/plugins/video.min.js +7 -0
  139. data/vendor/assets/javascripts/xmt_froala/plugins/word_paste.js +1403 -0
  140. data/vendor/assets/javascripts/xmt_froala/plugins/word_paste.min.js +7 -0
  141. data/vendor/assets/javascripts/xmt_froala/third_party/embedly.js +543 -0
  142. data/vendor/assets/javascripts/xmt_froala/third_party/embedly.min.js +7 -0
  143. data/vendor/assets/javascripts/xmt_froala/third_party/image_aviary.js +163 -0
  144. data/vendor/assets/javascripts/xmt_froala/third_party/image_aviary.min.js +7 -0
  145. data/vendor/assets/javascripts/xmt_froala/third_party/spell_checker.js +222 -0
  146. data/vendor/assets/javascripts/xmt_froala/third_party/spell_checker.min.js +7 -0
  147. data/vendor/assets/javascripts/xmt_froala/xmt_froala.js +15172 -0
  148. data/vendor/assets/stylesheets/xmt_froala/css/font-awesome.css +2546 -0
  149. data/vendor/assets/stylesheets/xmt_froala/css/froala_editor.min.css +7 -0
  150. data/vendor/assets/stylesheets/xmt_froala/css/froala_editor.pkgd.css +2902 -0
  151. data/vendor/assets/stylesheets/xmt_froala/css/froala_editor.pkgd.min.css +7 -0
  152. data/vendor/assets/stylesheets/xmt_froala/css/froala_style.css +413 -0
  153. data/vendor/assets/stylesheets/xmt_froala/css/froala_style.min.css +7 -0
  154. data/vendor/assets/stylesheets/xmt_froala/css/plugins/char_counter.css +57 -0
  155. data/vendor/assets/stylesheets/xmt_froala/css/plugins/char_counter.min.css +7 -0
  156. data/vendor/assets/stylesheets/xmt_froala/css/plugins/code_view.css +112 -0
  157. data/vendor/assets/stylesheets/xmt_froala/css/plugins/code_view.min.css +7 -0
  158. data/vendor/assets/stylesheets/xmt_froala/css/plugins/colors.css +155 -0
  159. data/vendor/assets/stylesheets/xmt_froala/css/plugins/colors.min.css +7 -0
  160. data/vendor/assets/stylesheets/xmt_froala/css/plugins/draggable.css +43 -0
  161. data/vendor/assets/stylesheets/xmt_froala/css/plugins/draggable.min.css +7 -0
  162. data/vendor/assets/stylesheets/xmt_froala/css/plugins/emoticons.css +42 -0
  163. data/vendor/assets/stylesheets/xmt_froala/css/plugins/emoticons.min.css +7 -0
  164. data/vendor/assets/stylesheets/xmt_froala/css/plugins/file.css +146 -0
  165. data/vendor/assets/stylesheets/xmt_froala/css/plugins/file.min.css +7 -0
  166. data/vendor/assets/stylesheets/xmt_froala/css/plugins/fullscreen.css +28 -0
  167. data/vendor/assets/stylesheets/xmt_froala/css/plugins/fullscreen.min.css +7 -0
  168. data/vendor/assets/stylesheets/xmt_froala/css/plugins/help.css +52 -0
  169. data/vendor/assets/stylesheets/xmt_froala/css/plugins/help.min.css +7 -0
  170. data/vendor/assets/stylesheets/xmt_froala/css/plugins/image.css +244 -0
  171. data/vendor/assets/stylesheets/xmt_froala/css/plugins/image.min.css +7 -0
  172. data/vendor/assets/stylesheets/xmt_froala/css/plugins/image_manager.css +266 -0
  173. data/vendor/assets/stylesheets/xmt_froala/css/plugins/image_manager.min.css +7 -0
  174. data/vendor/assets/stylesheets/xmt_froala/css/plugins/line_breaker.css +37 -0
  175. data/vendor/assets/stylesheets/xmt_froala/css/plugins/line_breaker.min.css +7 -0
  176. data/vendor/assets/stylesheets/xmt_froala/css/plugins/quick_insert.css +70 -0
  177. data/vendor/assets/stylesheets/xmt_froala/css/plugins/quick_insert.min.css +7 -0
  178. data/vendor/assets/stylesheets/xmt_froala/css/plugins/special_characters.css +51 -0
  179. data/vendor/assets/stylesheets/xmt_froala/css/plugins/special_characters.min.css +7 -0
  180. data/vendor/assets/stylesheets/xmt_froala/css/plugins/table.css +181 -0
  181. data/vendor/assets/stylesheets/xmt_froala/css/plugins/table.min.css +7 -0
  182. data/vendor/assets/stylesheets/xmt_froala/css/plugins/video.css +231 -0
  183. data/vendor/assets/stylesheets/xmt_froala/css/plugins/video.min.css +7 -0
  184. data/vendor/assets/stylesheets/xmt_froala/css/themes/dark.css +1281 -0
  185. data/vendor/assets/stylesheets/xmt_froala/css/themes/dark.min.css +7 -0
  186. data/vendor/assets/stylesheets/xmt_froala/css/themes/gray.css +1281 -0
  187. data/vendor/assets/stylesheets/xmt_froala/css/themes/gray.min.css +7 -0
  188. data/vendor/assets/stylesheets/xmt_froala/css/themes/red.css +1281 -0
  189. data/vendor/assets/stylesheets/xmt_froala/css/themes/red.min.css +7 -0
  190. data/vendor/assets/stylesheets/xmt_froala/css/themes/royal.css +1281 -0
  191. data/vendor/assets/stylesheets/xmt_froala/css/themes/royal.min.css +7 -0
  192. data/vendor/assets/stylesheets/xmt_froala/css/third_party/embedly.css +64 -0
  193. data/vendor/assets/stylesheets/xmt_froala/css/third_party/embedly.min.css +7 -0
  194. data/vendor/assets/stylesheets/xmt_froala/css/third_party/spell_checker.css +72 -0
  195. data/vendor/assets/stylesheets/xmt_froala/css/third_party/spell_checker.min.css +7 -0
  196. data/vendor/assets/stylesheets/xmt_froala/css/xmt_froala.css +1423 -0
  197. data/vendor/assets/stylesheets/xmt_froala/fonts/FontAwesome.otf +0 -0
  198. data/vendor/assets/stylesheets/xmt_froala/fonts/fontawesome-webfont.eot +0 -0
  199. data/vendor/assets/stylesheets/xmt_froala/fonts/fontawesome-webfont.svg +2671 -0
  200. data/vendor/assets/stylesheets/xmt_froala/fonts/fontawesome-webfont.ttf +0 -0
  201. data/vendor/assets/stylesheets/xmt_froala/fonts/fontawesome-webfont.woff +0 -0
  202. data/vendor/assets/stylesheets/xmt_froala/fonts/fontawesome-webfont.woff2 +0 -0
  203. metadata +273 -0
@@ -0,0 +1,14 @@
1
+ Description:
2
+ Copy model, migration and uploader to your application.
3
+
4
+ Example:
5
+ rails generate rails_kindeditor:migration
6
+
7
+ This will create:
8
+ app/models/kindeditor/asset.rb
9
+ app/models/kindeditor/file.rb
10
+ app/models/kindeditor/flash.rb
11
+ app/models/kindeditor/image.rb
12
+ app/models/kindeditor/media.rb
13
+ db/migrate/xxxxxxxxx_create_kindeditor_assets.rb
14
+
@@ -0,0 +1,36 @@
1
+ module XmtFroala
2
+ class MigrationGenerator < Rails::Generators::Base
3
+ include Rails::Generators::Migration
4
+ source_root File.expand_path('../templates', __FILE__)
5
+ desc "Copy model and migration to your application."
6
+ class_option :orm, :type => :string, :aliases => "-o", :default => "active_record", :desc => "ORM options: active_record or mongoid"
7
+
8
+ def copy_files
9
+ orm = options[:orm].to_s
10
+ orm = "active_record" unless %w{active_record mongoid}.include?(orm)
11
+ %w(asset file flash image media).each do |file|
12
+ copy_model(orm, file)
13
+ end
14
+ if Rails.version < '4.0.0' && Rails.version >= '3.0.0' # insert code for rails3
15
+ insert_into_file "app/models/xmt_froala/asset.rb", " attr_accessible :asset\n", :after => "before_save :update_asset_attributes\n"
16
+ end
17
+ if orm == "active_record"
18
+ migration_template "migration/migration.rb", "db/migrate/create_xmt_froala_assets.rb"
19
+ end
20
+ end
21
+
22
+ def self.next_migration_number(dirname)
23
+ if ActiveRecord::Base.timestamped_migrations
24
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
25
+ else
26
+ "%.3d" % (current_migration_number(dirname) + 1)
27
+ end
28
+ end
29
+
30
+ private
31
+ def copy_model(orm, name)
32
+ template "models/#{orm}/xmt_froala/#{name}.rb", "app/models/xmt_froala/#{name}.rb"
33
+ end
34
+ end
35
+ end
36
+
@@ -0,0 +1,18 @@
1
+ class CreateXmFroalaAssets < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :xmt_froala_assets do |t|
4
+ t.string :asset
5
+ t.integer :file_size
6
+ t.string :file_type
7
+ t.integer :owner_id
8
+ t.string :owner_type
9
+ t.string :asset_type # list by xmt_froala: image, file, media, flash
10
+ t.timestamps
11
+ end
12
+ end
13
+
14
+ def self.down
15
+ drop_table :xmt_froala_assets
16
+ end
17
+ end
18
+
@@ -0,0 +1,14 @@
1
+ class XmtFroala::Asset < ActiveRecord::Base
2
+ self.table_name = 'kindeditor_assets'
3
+ mount_uploader :asset, XmtFroala::AssetUploader
4
+ validates_presence_of :asset
5
+ before_save :update_asset_attributes
6
+
7
+ private
8
+ def update_asset_attributes
9
+ if asset.present? && asset_changed?
10
+ self.file_size = asset.file.size
11
+ self.file_type = asset.file.content_type
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::File < XmtFroala::Asset
2
+ mount_uploader :asset, XmtFroala::FileUploader
3
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::Flash < XmtFroala::Asset
2
+ mount_uploader :asset, XmtFroala::FlashUploader
3
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::Image < XmtFroala::Asset
2
+ mount_uploader :asset, XmtFroala::ImageUploader
3
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::Media < XmtFroala::Asset
2
+ mount_uploader :asset, XmtFroala::MediaUploader
3
+ end
@@ -0,0 +1,27 @@
1
+ require 'carrierwave/mongoid'
2
+
3
+ class XmtFroala::Asset
4
+ include Mongoid::Document
5
+ include Mongoid::Timestamps
6
+
7
+ field :file_size, :type => Integer
8
+ field :file_type, :type => String
9
+ field :owner_id, :type => Integer
10
+ field :asset_type, :type => String
11
+
12
+ mount_uploader :asset, XmtFroala::AssetUploader
13
+ validates_presence_of :asset
14
+ before_save :update_asset_attributes
15
+
16
+ def self.collection_name
17
+ :xmt_froala_assets
18
+ end
19
+
20
+ private
21
+ def update_asset_attributes
22
+ if asset.present? && asset_changed?
23
+ self.file_size = asset.file.size
24
+ self.file_type = asset.file.content_type
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::File < XmtFroala::Asset
2
+ mount_uploader :asset, XmtFroala::FileUploader
3
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::Flash < XmtFroala::Asset
2
+ mount_uploader :asset, XmtFroala::FlashUploader
3
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::Image < XmtFroala::Asset
2
+ mount_uploader :asset, XmtFroala::ImageUploader
3
+ end
@@ -0,0 +1,3 @@
1
+ class XmtFroala::Media < Xmt_froala::Asset
2
+ mount_uploader :asset, XmtFroala::MediaUploader
3
+ end
@@ -0,0 +1,9 @@
1
+ namespace :xmtfroala do
2
+ desc "copy froalaeditor into public folder"
3
+ task :assets do
4
+ puts "copying froalaeditor into public/assets folder ..."
5
+ dest_path = "#{Rails.root}/public/assets"
6
+ FileUtils.mkdir_p dest_path
7
+ FileUtils.cp_r "#{XmtFroala.root_path}/app/assets/javascripts/xmt_froala/", dest_path
8
+ end
9
+ end
@@ -0,0 +1,65 @@
1
+ require 'xmt_froala/engine'
2
+ require 'xmt_froala/helper'
3
+ require 'xmt_froala/active_record'
4
+ require 'carrierwave'
5
+ require 'mini_magick'
6
+
7
+ module XmtFroala
8
+
9
+ mattr_accessor :upload_dir
10
+ @@upload_dir = 'uploads'
11
+
12
+ mattr_accessor :upload_image_ext
13
+ @@upload_image_ext = %w[gif jpg jpeg png bmp]
14
+
15
+ mattr_accessor :upload_flash_ext
16
+ @@upload_flash_ext = %w[swf flv]
17
+
18
+ mattr_accessor :upload_media_ext
19
+ @@upload_media_ext = %w[f4v flv mp3 mp4 ogg webm]
20
+
21
+ mattr_accessor :upload_file_ext
22
+ @@upload_file_ext = %w[doc docx xls xlsx ppt htm html txt zip rar gz bz2]
23
+
24
+ mattr_accessor :image_resize_to_limit
25
+
26
+ mattr_accessor :asset_url_prefix
27
+
28
+ def self.base_path
29
+ self.asset_url_prefix ? "#{self.asset_url_prefix}/xmt_froala/" : '/assets/xmt_froala/'
30
+ end
31
+
32
+ def self.root_path
33
+ @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
34
+ end
35
+
36
+ def self.assets
37
+ Dir[root_path.join('vendor/assets/javascripts/xmt_froala/**', '*.js')].inject([]) do |assets, path|
38
+ assets << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/javascripts')).to_s
39
+ end
40
+
41
+ Dir[root_path.join('vendor/assets/stylesheets/xmt_froala/**', '*.css')].inject([]) do |assets, path|
42
+ assets << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/stylesheets')).to_s
43
+ end
44
+ end
45
+
46
+ def self.upload_store_dir
47
+ dirs = upload_dir.gsub(/^\/+/,'').gsub(/\/+$/,'').split('/')
48
+ dirs.each { |dir| dir.gsub!(/\W/, '') }
49
+ dirs.delete('')
50
+ dirs.join('/')
51
+ end
52
+
53
+ def self.resize_to_limit
54
+ if !image_resize_to_limit.nil? && image_resize_to_limit.is_a?(Array)
55
+ [image_resize_to_limit[0], image_resize_to_limit[1]]
56
+ else
57
+ [800, 800]
58
+ end
59
+ end
60
+
61
+ def self.setup
62
+ yield self
63
+ end
64
+
65
+ end
@@ -0,0 +1,14 @@
1
+ if defined?(ActiveRecord)
2
+ ActiveRecord::Base.class_eval do
3
+ def self.has_many_xmtfroala_assets(*args)
4
+ options = args.extract_options!
5
+ asset_name = args[0] ? args[0].to_s : 'assets'
6
+ has_many asset_name.to_sym, :class_name => 'XmtFroala::Asset', :as => :owner, :dependent => options[:dependent]
7
+
8
+ class_name = self.name
9
+ XmtFroala::Asset.class_eval do
10
+ belongs_to :owner, :polymorphic => true
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,32 @@
1
+ require "xmt_froala"
2
+ require "rails"
3
+ require "action_controller"
4
+ module XmtFroala
5
+ class Engine < ::Rails::Engine
6
+
7
+ initializer "xmt_froala.assets_precompile" do |app|
8
+ app.config.assets.precompile += XmtFroala.assets
9
+ end
10
+
11
+ initializer "xmt_froala.simple_form_and_formtastic" do
12
+ require "xmt_froala/simple_form" if Object.const_defined?("SimpleForm")
13
+ require "xmt_froala/formtastic" if Object.const_defined?("Formtastic")
14
+ end
15
+
16
+ initializer "xmt_froala.helper_and_builder" do
17
+ ActiveSupport.on_load :action_view do
18
+ ActionView::Base.send(:include, XmtFroala::Helper)
19
+ ActionView::Helpers::FormBuilder.send(:include, XmtFroala::Builder)
20
+ end
21
+ end
22
+
23
+ initializer "xmt_froala.image_process" do
24
+ unless XmtFroala.image_resize_to_limit.nil?
25
+ XmtFroala::ImageUploader.class_eval do
26
+ include CarrierWave::MiniMagick
27
+ process :resize_to_limit => XmtFroala.resize_to_limit
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,12 @@
1
+ require "formtastic"
2
+
3
+ class KindeditorInput
4
+ include ::Formtastic::Inputs::Base
5
+
6
+ def to_html
7
+ input_wrapping do
8
+ label_html <<
9
+ builder.froalaeditor(method, input_html_options)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,105 @@
1
+ module XmtFroala
2
+ module Helper
3
+ def froalaeditor_tag(name, content = nil, options = {})
4
+ id = sanitize_to_id(name)
5
+ input_html = { :id => id }.merge(options.delete(:input_html) || {})
6
+ input_html[:class] = "#{input_html[:class]} xmt_froala"
7
+ output = ActiveSupport::SafeBuffer.new
8
+ output << text_area_tag(name, content, input_html)
9
+ output << javascript_tag(js_replace(id, options))
10
+ end
11
+
12
+ def froalaeditor(name, method, options = {})
13
+ # TODO: Refactory options: 1. kindeditor_option 2. html_option
14
+ input_html = (options.delete(:input_html) || {}).stringify_keys
15
+ output_buffer = ActiveSupport::SafeBuffer.new
16
+ output_buffer << build_text_area_tag(name, method, self, merge_assets_info(options), input_html)
17
+ output_buffer << javascript_tag(js_replace(input_html['id'], options))
18
+ end
19
+
20
+ def merge_assets_info(options)
21
+ owner = options.delete(:owner)
22
+ options[:class] = "#{options[:class]} xmt_froala"
23
+ if (!owner.nil?) && (!owner.id.nil?)
24
+ begin
25
+ owner_id = owner.id
26
+ owner_type = owner.class.name
27
+ options.reverse_merge!(owner_id: owner_id, owner_type: owner_type, data: {upload: froalaeditor_upload_json_path(owner_id: owner_id, owner_type: owner_type), filemanager: froalaeditor_file_manager_json_path})
28
+ return options
29
+ end
30
+ else
31
+ options.reverse_merge!(data: {upload: froalaeditor_upload_json_path, filemanager: froalaeditor_file_manager_json_path})
32
+ end
33
+ end
34
+
35
+ def froalaeditor_upload_json_path(*args)
36
+ options = args.extract_options!
37
+ owner_id_query_string = options[:owner_id] ? "?owner_id=#{options[:owner_id]}" : ''
38
+ owner_type_query_string = options[:owner_type] ? "&owner_type=#{options[:owner_type]}" : ''
39
+ if owner_id_query_string == '' && owner_type_query_string == ''
40
+ "#{main_app_root_url}xmt_froala/upload"
41
+ else
42
+ "#{main_app_root_url}xmt_froala/upload#{owner_id_query_string}#{owner_type_query_string}"
43
+ end
44
+ end
45
+
46
+ def froalaeditor_file_manager_json_path
47
+ "#{main_app_root_url}xmt_froala/filemanager"
48
+ end
49
+
50
+ private
51
+
52
+ def main_app_root_url
53
+ begin
54
+ main_app.root_url.slice(0, main_app.root_url.rindex(main_app.root_path)) + '/'
55
+ rescue
56
+ '/'
57
+ end
58
+ end
59
+
60
+ def js_replace(dom_id, options = {})
61
+ editor_id = options[:editor_id].nil? ? '' : "#{options[:editor_id].to_s.downcase} = "
62
+ upload_url = froalaeditor_upload_json_path(:owner_id => options.delete(:owner_id), :owner_type => options.delete(:owner_type))
63
+ imageUploadURL = upload_url+'&dir=image'
64
+ fileUploadURL = upload_url+'&dir=file'
65
+ videoUploadURL = upload_url+'&dir=media'
66
+ imageManagerLoadURL = froalaeditor_file_manager_json_path+'?path=&order=datetime&dir=image'
67
+ require 'securerandom'
68
+ random_name = SecureRandom.hex;
69
+ "$('##{dom_id}').froalaEditor({
70
+ language: 'zh_cn',
71
+ imageUploadURL: '#{imageUploadURL}',
72
+ imageManagerLoadURL:'#{imageManagerLoadURL}',
73
+ fileUploadURL: '#{fileUploadURL}',
74
+ videoUploadURL: '#{videoUploadURL}'
75
+ });
76
+ "
77
+ end
78
+
79
+ def get_options(options)
80
+ upload_url = froalaeditor_upload_json_path(:owner_id => options.delete(:owner_id), :owner_type => options.delete(:owner_type))
81
+ end
82
+
83
+ def build_text_area_tag(name, method, template, options, input_html)
84
+ if Rails.version >= '4.0.0'
85
+ text_area_tag = ActionView::Helpers::Tags::TextArea.new(name, method, template, options)
86
+ text_area_tag.send(:add_default_name_and_id, input_html)
87
+ text_area_tag.render
88
+ elsif Rails.version >= '3.1.0'
89
+ text_area_tag = ActionView::Base::InstanceTag.new(name, method, template, options.delete(:object))
90
+ text_area_tag.send(:add_default_name_and_id, input_html)
91
+ text_area_tag.to_text_area_tag(input_html)
92
+ elsif Rails.version >= '3.0.0'
93
+ raise 'Please use xmt_froala v0.2.8 for Rails v3.0.x'
94
+ else
95
+ raise 'Please upgrade your Rails !'
96
+ end
97
+ end
98
+ end
99
+
100
+ module Builder
101
+ def froalaeditor(method, options = {})
102
+ @template.send("froalaeditor", @object_name, method, objectify_options(options))
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,11 @@
1
+ module XmtFroala
2
+ module SimpleForm
3
+ class XmtFroalaInput < ::SimpleForm::Inputs::Base
4
+ def input(wrapper_options)
5
+ @builder.froalaeditor(attribute_name, input_html_options)
6
+ end
7
+ end
8
+ end
9
+ end
10
+
11
+ ::SimpleForm::FormBuilder.map_type :froalaeditor, :to => XmtFroala::SimpleForm::XmtFroalaInput
@@ -0,0 +1,3 @@
1
+ module XmtFroala
2
+ VERSION = '0.3.1'
3
+ end
@@ -0,0 +1,318 @@
1
+ /*!
2
+ * froala_editor v2.8.1 (https://www.froala.com/wysiwyg-editor)
3
+ * License https://froala.com/wysiwyg-editor/terms/
4
+ * Copyright 2014-2018 Froala Labs
5
+ */
6
+
7
+ (function (factory) {
8
+ if (typeof define === 'function' && define.amd) {
9
+ // AMD. Register as an anonymous module.
10
+ define(['jquery'], factory);
11
+ } else if (typeof module === 'object' && module.exports) {
12
+ // Node/CommonJS
13
+ module.exports = function( root, jQuery ) {
14
+ if ( jQuery === undefined ) {
15
+ // require('jQuery') returns a factory that requires window to
16
+ // build a jQuery instance, we normalize how we use modules
17
+ // that require this pattern but the window provided is a noop
18
+ // if it's defined (how jquery works)
19
+ if ( typeof window !== 'undefined' ) {
20
+ jQuery = require('jquery');
21
+ }
22
+ else {
23
+ jQuery = require('jquery')(root);
24
+ }
25
+ }
26
+ return factory(jQuery);
27
+ };
28
+ } else {
29
+ // Browser globals
30
+ factory(window.jQuery);
31
+ }
32
+ }(function ($) {
33
+ /**
34
+ * Arabic
35
+ */
36
+
37
+ $.FE.LANGUAGE['ar'] = {
38
+ translation: {
39
+ // Place holder
40
+ "Type something": "\u0627\u0643\u062a\u0628 \u0634\u064a\u0626\u0627",
41
+
42
+ // Basic formatting
43
+ "Bold": "\u063a\u0627\u0645\u0642",
44
+ "Italic": "\u0645\u0627\u0626\u0644",
45
+ "Underline": "\u062a\u0633\u0637\u064a\u0631",
46
+ "Strikethrough": "\u064a\u062a\u0648\u0633\u0637 \u062e\u0637",
47
+
48
+ // Main buttons
49
+ "Insert": "\u0625\u062f\u0631\u0627\u062c",
50
+ "Delete": "\u062d\u0630\u0641",
51
+ "Cancel": "\u0625\u0644\u063a\u0627\u0621",
52
+ "OK": "\u0645\u0648\u0627\u0641\u0642",
53
+ "Back": "\u0638\u0647\u0631",
54
+ "Remove": "\u0625\u0632\u0627\u0644\u0629",
55
+ "More": "\u0623\u0643\u062b\u0631",
56
+ "Update": "\u0627\u0644\u062a\u062d\u062f\u064a\u062b",
57
+ "Style": "\u0623\u0633\u0644\u0648\u0628",
58
+
59
+ // Font
60
+ "Font Family": "\u0639\u0627\u0626\u0644\u0629 \u0627\u0644\u062e\u0637",
61
+ "Font Size": "\u062d\u062c\u0645 \u0627\u0644\u062e\u0637",
62
+
63
+ // Colors
64
+ "Colors": "\u0627\u0644\u0623\u0644\u0648\u0627\u0646",
65
+ "Background": "\u0627\u0644\u062e\u0644\u0641\u064a\u0629",
66
+ "Text": "\u0627\u0644\u0646\u0635",
67
+ "HEX Color": "عرافة اللون",
68
+
69
+ // Paragraphs
70
+ "Paragraph Format": "\u062a\u0646\u0633\u064a\u0642 \u0627\u0644\u0641\u0642\u0631\u0629",
71
+ "Normal": "\u0637\u0628\u064a\u0639\u064a",
72
+ "Code": "\u0643\u0648\u062f",
73
+ "Heading 1": "\u0627\u0644\u0639\u0646\u0627\u0648\u064a\u0646 1",
74
+ "Heading 2": "\u0627\u0644\u0639\u0646\u0627\u0648\u064a\u0646 2",
75
+ "Heading 3": "\u0627\u0644\u0639\u0646\u0627\u0648\u064a\u0646 3",
76
+ "Heading 4": "\u0627\u0644\u0639\u0646\u0627\u0648\u064a\u0646 4",
77
+
78
+ // Style
79
+ "Paragraph Style": "\u0646\u0645\u0637 \u0627\u0644\u0641\u0642\u0631\u0629",
80
+ "Inline Style": "\u0627\u0644\u0646\u0645\u0637 \u0627\u0644\u0645\u0636\u0645\u0646",
81
+
82
+ // Alignment
83
+ "Align": "\u0645\u062d\u0627\u0630\u0627\u0629",
84
+ "Align Left": "\u0645\u062d\u0627\u0630\u0627\u0629 \u0627\u0644\u0646\u0635 \u0644\u0644\u064a\u0633\u0627\u0631",
85
+ "Align Center": "\u062a\u0648\u0633\u064a\u0637",
86
+ "Align Right": "\u0645\u062d\u0627\u0630\u0627\u0629 \u0627\u0644\u0646\u0635 \u0644\u0644\u064a\u0645\u064a\u0646",
87
+ "Align Justify": "\u0636\u0628\u0637",
88
+ "None": "\u0644\u0627 \u0634\u064a\u0621",
89
+
90
+ // Lists
91
+ "Ordered List": "\u0642\u0627\u0626\u0645\u0629 \u0645\u0631\u062a\u0628\u0629",
92
+ "Unordered List": "\u0642\u0627\u0626\u0645\u0629 \u063a\u064a\u0631 \u0645\u0631\u062a\u0628\u0629",
93
+
94
+ // Indent
95
+ "Decrease Indent": "\u0627\u0646\u062e\u0641\u0627\u0636 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0627\u0644\u0628\u0627\u062f\u0626\u0629",
96
+ "Increase Indent": "\u0632\u064a\u0627\u062f\u0629 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0627\u0644\u0628\u0627\u062f\u0626\u0629",
97
+
98
+ // Links
99
+ "Insert Link": "\u0625\u062f\u0631\u0627\u062c \u0631\u0627\u0628\u0637",
100
+ "Open in new tab": "\u0641\u062a\u062d \u0641\u064a \u0639\u0644\u0627\u0645\u0629 \u062a\u0628\u0648\u064a\u0628 \u062c\u062f\u064a\u062f\u0629",
101
+ "Open Link": "\u0627\u0641\u062a\u062d \u0627\u0644\u0631\u0627\u0628\u0637",
102
+ "Edit Link": "\u0627\u0631\u062a\u0628\u0627\u0637 \u062a\u062d\u0631\u064a\u0631",
103
+ "Unlink": "\u062d\u0630\u0641 \u0627\u0644\u0631\u0627\u0628\u0637",
104
+ "Choose Link": "\u0627\u062e\u062a\u064a\u0627\u0631 \u0635\u0644\u0629",
105
+
106
+ // Images
107
+ "Insert Image": "\u0625\u062f\u0631\u0627\u062c \u0635\u0648\u0631\u0629",
108
+ "Upload Image": "\u062a\u062d\u0645\u064a\u0644 \u0635\u0648\u0631\u0629",
109
+ "By URL": "\u0628\u0648\u0627\u0633\u0637\u0629 URL",
110
+ "Browse": "\u062a\u0635\u0641\u062d",
111
+ "Drop image": "\u0625\u0633\u0642\u0627\u0637 \u0635\u0648\u0631\u0629",
112
+ "or click": "\u0623\u0648 \u0627\u0646\u0642\u0631 \u0641\u0648\u0642",
113
+ "Manage Images": "\u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0635\u0648\u0631",
114
+ "Loading": "\u062a\u062d\u0645\u064a\u0644",
115
+ "Deleting": "\u062d\u0630\u0641",
116
+ "Tags": "\u0627\u0644\u0643\u0644\u0645\u0627\u062a",
117
+ "Are you sure? Image will be deleted.": "\u0647\u0644 \u0623\u0646\u062a \u0645\u062a\u0623\u0643\u062f\u061f \u0633\u064a\u062a\u0645 \u062d\u0630\u0641 \u0627\u0644\u0635\u0648\u0631\u0629\u002e",
118
+ "Replace": "\u0627\u0633\u062a\u0628\u062f\u0627\u0644",
119
+ "Uploading": "\u062a\u062d\u0645\u064a\u0644",
120
+ "Loading image": "\u0635\u0648\u0631\u0629 \u062a\u062d\u0645\u064a\u0644",
121
+ "Display": "\u0639\u0631\u0636",
122
+ "Inline": "\u0641\u064a \u062e\u0637",
123
+ "Break Text": "\u0646\u0635 \u0627\u0633\u062a\u0631\u0627\u062d\u0629",
124
+ "Alternate Text": "\u0646\u0635 \u0628\u062f\u064a\u0644",
125
+ "Change Size": "\u062a\u063a\u064a\u064a\u0631 \u062d\u062c\u0645",
126
+ "Width": "\u0639\u0631\u0636",
127
+ "Height": "\u0627\u0631\u062a\u0641\u0627\u0639",
128
+ "Something went wrong. Please try again.": ".\u062d\u062f\u062b \u062e\u0637\u0623 \u0645\u0627. \u062d\u0627\u0648\u0644 \u0645\u0631\u0629 \u0627\u062e\u0631\u0649",
129
+ "Image Caption": "تعليق على الصورة",
130
+ "Advanced Edit": "تعديل متقدم",
131
+
132
+ // Video
133
+ "Insert Video": "\u0625\u062f\u0631\u0627\u062c \u0641\u064a\u062f\u064a\u0648",
134
+ "Embedded Code": "\u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629 \u0627\u0644\u0645\u0636\u0645\u0646\u0629",
135
+ "Paste in a video URL": "لصق في عنوان ورل للفيديو",
136
+ "Drop video": "انخفاض الفيديو",
137
+ "Your browser does not support HTML5 video.": "متصفحك لا يدعم فيديو HTML5.",
138
+ "Upload Video": "رفع فيديو",
139
+
140
+ // Tables
141
+ "Insert Table": "\u0625\u062f\u0631\u0627\u062c \u062c\u062f\u0648\u0644",
142
+ "Table Header": "\u0631\u0623\u0633 \u0627\u0644\u062c\u062f\u0648\u0644",
143
+ "Remove Table": "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u062c\u062f\u0648\u0644",
144
+ "Table Style": "\u0646\u0645\u0637 \u0627\u0644\u062c\u062f\u0648\u0644",
145
+ "Horizontal Align": "\u0645\u062d\u0627\u0630\u0627\u0629 \u0623\u0641\u0642\u064a\u0629",
146
+ "Row": "\u0635\u0641",
147
+ "Insert row above": "\u0625\u062f\u0631\u0627\u062c \u0635\u0641 \u0644\u0644\u0623\u0639\u0644\u0649",
148
+ "Insert row below": "\u0625\u062f\u0631\u0627\u062c \u0635\u0641 \u0644\u0644\u0623\u0633\u0641\u0644",
149
+ "Delete row": "\u062d\u0630\u0641 \u0635\u0641",
150
+ "Column": "\u0639\u0645\u0648\u062f",
151
+ "Insert column before": "\u0625\u062f\u0631\u0627\u062c \u0639\u0645\u0648\u062f \u0644\u0644\u064a\u0633\u0627\u0631",
152
+ "Insert column after": "\u0625\u062f\u0631\u0627\u062c \u0639\u0645\u0648\u062f \u0644\u0644\u064a\u0645\u064a\u0646",
153
+ "Delete column": "\u062d\u0630\u0641 \u0639\u0645\u0648\u062f",
154
+ "Cell": "\u062e\u0644\u064a\u0629",
155
+ "Merge cells": "\u062f\u0645\u062c \u062e\u0644\u0627\u064a\u0627",
156
+ "Horizontal split": "\u0627\u0646\u0642\u0633\u0627\u0645 \u0623\u0641\u0642\u064a",
157
+ "Vertical split": "\u0627\u0644\u0627\u0646\u0642\u0633\u0627\u0645 \u0627\u0644\u0639\u0645\u0648\u062f\u064a",
158
+ "Cell Background": "\u062e\u0644\u0641\u064a\u0629 \u0627\u0644\u062e\u0644\u064a\u0629",
159
+ "Vertical Align": "\u0645\u062d\u0627\u0630\u0627\u0629 \u0639\u0645\u0648\u062f\u064a\u0629",
160
+ "Top": "\u0623\u0639\u0644\u0649",
161
+ "Middle": "\u0648\u0633\u0637",
162
+ "Bottom": "\u0623\u0633\u0641\u0644",
163
+ "Align Top": "\u0645\u062d\u0627\u0630\u0627\u0629 \u0623\u0639\u0644\u0649",
164
+ "Align Middle": "\u0645\u062d\u0627\u0630\u0627\u0629 \u0648\u0633\u0637",
165
+ "Align Bottom": "\u0645\u062d\u0627\u0630\u0627\u0629 \u0627\u0644\u0623\u0633\u0641\u0644",
166
+ "Cell Style": "\u0646\u0645\u0637 \u0627\u0644\u062e\u0644\u064a\u0629",
167
+
168
+ // Files
169
+ "Upload File": "\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u0644\u0641",
170
+ "Drop file": "\u0627\u0646\u062e\u0641\u0627\u0636 \u0627\u0644\u0645\u0644\u0641",
171
+
172
+ // Emoticons
173
+ "Emoticons": "\u0627\u0644\u0645\u0634\u0627\u0639\u0631",
174
+ "Grinning face": "\u064a\u0643\u0634\u0631 \u0648\u062c\u0647\u0647",
175
+ "Grinning face with smiling eyes": "\u0645\u0628\u062a\u0633\u0645\u0627 \u0648\u062c\u0647 \u0645\u0639 \u064a\u0628\u062a\u0633\u0645 \u0627\u0644\u0639\u064a\u0646",
176
+ "Face with tears of joy": "\u0648\u062c\u0647 \u0645\u0639 \u062f\u0645\u0648\u0639 \u0627\u0644\u0641\u0631\u062d",
177
+ "Smiling face with open mouth": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0645\u0639 \u0641\u062a\u062d \u0627\u0644\u0641\u0645",
178
+ "Smiling face with open mouth and smiling eyes": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0645\u0639 \u0641\u062a\u062d \u0627\u0644\u0641\u0645 \u0648\u0627\u0644\u0639\u064a\u0646\u064a\u0646 \u064a\u0628\u062a\u0633\u0645",
179
+ "Smiling face with open mouth and cold sweat": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0645\u0639 \u0641\u062a\u062d \u0627\u0644\u0641\u0645 \u0648\u0627\u0644\u0639\u0631\u0642 \u0627\u0644\u0628\u0627\u0631\u062f",
180
+ "Smiling face with open mouth and tightly-closed eyes": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0645\u0639 \u0641\u062a\u062d \u0627\u0644\u0641\u0645 \u0648\u0627\u0644\u0639\u064a\u0646\u064a\u0646 \u0645\u063a\u0644\u0642\u0629 \u0628\u0625\u062d\u0643\u0627\u0645",
181
+ "Smiling face with halo": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0645\u0639 \u0647\u0627\u0644\u0629",
182
+ "Smiling face with horns": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0628\u0642\u0631\u0648\u0646",
183
+ "Winking face": "\u0627\u0644\u063a\u0645\u0632 \u0648\u062c\u0647",
184
+ "Smiling face with smiling eyes": "\u064a\u0628\u062a\u0633\u0645 \u0648\u062c\u0647 \u0645\u0639 \u0639\u064a\u0648\u0646 \u062a\u0628\u062a\u0633\u0645",
185
+ "Face savoring delicious food": "\u064a\u0648\u0627\u062c\u0647 \u0644\u0630\u064a\u0630 \u0627\u0644\u0645\u0630\u0627\u0642 \u0644\u0630\u064a\u0630 \u0627\u0644\u0637\u0639\u0627\u0645",
186
+ "Relieved face": "\u0648\u062c\u0647 \u0628\u0627\u0644\u0627\u0631\u062a\u064a\u0627\u062d",
187
+ "Smiling face with heart-shaped eyes": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0628\u0639\u064a\u0646\u064a\u0646 \u0639\u0644\u0649 \u0634\u0643\u0644 \u0642\u0644\u0628",
188
+ "Smiling face with sunglasses": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0628\u062a\u0633\u0645 \u0645\u0639 \u0627\u0644\u0646\u0638\u0627\u0631\u0627\u062a \u0627\u0644\u0634\u0645\u0633\u064a\u0629",
189
+ "Smirking face": "\u0633\u0645\u064a\u0631\u0643\u064a\u0646\u062c \u0627\u0644\u0648\u062c\u0647",
190
+ "Neutral face": "\u0645\u062d\u0627\u064a\u062f \u0627\u0644\u0648\u062c\u0647",
191
+ "Expressionless face": "\u0648\u062c\u0647 \u0627\u0644\u062a\u0639\u0627\u0628\u064a\u0631",
192
+ "Unamused face": "\u0644\u0627 \u0645\u0633\u0644\u064a\u0627 \u0627\u0644\u0648\u062c\u0647",
193
+ "Face with cold sweat": "\u0648\u062c\u0647 \u0645\u0639 \u0639\u0631\u0642 \u0628\u0627\u0631\u062f",
194
+ "Pensive face": "\u0648\u062c\u0647 \u0645\u062a\u0623\u0645\u0644",
195
+ "Confused face": "\u0648\u062c\u0647 \u0627\u0644\u062e\u0644\u0637",
196
+ "Confounded face": "\u0648\u062c\u0647 \u0645\u0631\u062a\u0628\u0643",
197
+ "Kissing face": "\u062a\u0642\u0628\u064a\u0644 \u0627\u0644\u0648\u062c\u0647",
198
+ "Face throwing a kiss": "\u0645\u0648\u0627\u062c\u0647\u0629 \u0631\u0645\u064a \u0642\u0628\u0644\u0629",
199
+ "Kissing face with smiling eyes": "\u062a\u0642\u0628\u064a\u0644 \u0648\u062c\u0647 \u0645\u0639 \u0639\u064a\u0648\u0646 \u062a\u0628\u062a\u0633\u0645",
200
+ "Kissing face with closed eyes": "\u062a\u0642\u0628\u064a\u0644 \u0648\u062c\u0647 \u0645\u0639 \u0639\u064a\u0648\u0646 \u0645\u063a\u0644\u0642\u0629",
201
+ "Face with stuck out tongue": "\u0627\u0644\u0648\u062c\u0647 \u0645\u0639 \u062a\u0645\u0633\u0643 \u0628\u0647\u0627 \u0627\u0644\u0644\u0633\u0627\u0646",
202
+ "Face with stuck out tongue and winking eye": "\u0627\u0644\u0648\u062c\u0647 \u0645\u0639 \u062a\u0645\u0633\u0643 \u0628\u0647\u0627 \u0627\u0644\u0644\u0633\u0627\u0646 \u0648\u0627\u0644\u0639\u064a\u0646 \u0627\u0644\u062a\u063a\u0627\u0636\u064a",
203
+ "Face with stuck out tongue and tightly-closed eyes": "\u0627\u0644\u0648\u062c\u0647 \u0645\u0639 \u062a\u0645\u0633\u0643 \u0628\u0647\u0627 \u0627\u0644\u0644\u0633\u0627\u0646 \u0648\u0627\u0644\u0639\u064a\u0648\u0646 \u0645\u063a\u0644\u0642\u0629 \u0628\u0623\u062d\u0643\u0627\u0645\u002d",
204
+ "Disappointed face": "\u0648\u062c\u0647\u0627 \u062e\u064a\u0628\u0629 \u0623\u0645\u0644",
205
+ "Worried face": "\u0648\u062c\u0647\u0627 \u0627\u0644\u0642\u0644\u0642\u0648\u0646",
206
+ "Angry face": "\u0648\u062c\u0647 \u063a\u0627\u0636\u0628",
207
+ "Pouting face": "\u0627\u0644\u0639\u0628\u0648\u0633 \u0648\u062c\u0647",
208
+ "Crying face": "\u0627\u0644\u0628\u0643\u0627\u0621 \u0627\u0644\u0648\u062c\u0647",
209
+ "Persevering face": "\u0627\u0644\u0645\u062b\u0627\u0628\u0631\u0629 \u0648\u062c\u0647\u0647",
210
+ "Face with look of triumph": "\u0648\u0627\u062c\u0647 \u0645\u0639 \u0646\u0638\u0631\u0629 \u0627\u0646\u062a\u0635\u0627\u0631",
211
+ "Disappointed but relieved face": "\u0628\u062e\u064a\u0628\u0629 \u0623\u0645\u0644 \u0648\u0644\u0643\u0646 \u064a\u0639\u0641\u0649 \u0648\u062c\u0647",
212
+ "Frowning face with open mouth": "\u0645\u0642\u0637\u0628 \u0627\u0644\u0648\u062c\u0647 \u0645\u0639 \u0641\u062a\u062d \u0627\u0644\u0641\u0645",
213
+ "Anguished face": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u0624\u0644\u0645",
214
+ "Fearful face": "\u0627\u0644\u0648\u062c\u0647 \u0627\u0644\u0645\u062e\u064a\u0641",
215
+ "Weary face": "\u0648\u062c\u0647\u0627 \u0628\u0627\u0644\u0636\u062c\u0631",
216
+ "Sleepy face": "\u0648\u062c\u0647 \u0646\u0639\u0633\u0627\u0646",
217
+ "Tired face": "\u0648\u062c\u0647 \u0645\u062a\u0639\u0628",
218
+ "Grimacing face": "\u0648\u062e\u0631\u062c \u0633\u064a\u0633 \u0627\u0644\u0648\u062c\u0647",
219
+ "Loudly crying face": "\u0627\u0644\u0628\u0643\u0627\u0621 \u0628\u0635\u0648\u062a \u0639\u0627\u0644 \u0648\u062c\u0647\u0647",
220
+ "Face with open mouth": "\u0648\u0627\u062c\u0647 \u0645\u0639 \u0641\u062a\u062d \u0627\u0644\u0641\u0645",
221
+ "Hushed face": "\u0648\u062c\u0647\u0627 \u0627\u0644\u062a\u0643\u062a\u0645",
222
+ "Face with open mouth and cold sweat": "\u0648\u0627\u062c\u0647 \u0645\u0639 \u0641\u062a\u062d \u0627\u0644\u0641\u0645 \u0648\u0627\u0644\u0639\u0631\u0642 \u0627\u0644\u0628\u0627\u0631\u062f",
223
+ "Face screaming in fear": "\u0648\u0627\u062c\u0647 \u064a\u0635\u0631\u062e \u0641\u064a \u062e\u0648\u0641",
224
+ "Astonished face": "\u0648\u062c\u0647\u0627 \u062f\u0647\u0634",
225
+ "Flushed face": "\u0627\u062d\u0645\u0631\u0627\u0631 \u0627\u0644\u0648\u062c\u0647",
226
+ "Sleeping face": "\u0627\u0644\u0646\u0648\u0645 \u0627\u0644\u0648\u062c\u0647",
227
+ "Dizzy face": "\u0648\u062c\u0647\u0627 \u0628\u0627\u0644\u062f\u0648\u0627\u0631",
228
+ "Face without mouth": "\u0648\u0627\u062c\u0647 \u062f\u0648\u0646 \u0627\u0644\u0641\u0645",
229
+ "Face with medical mask": "\u0648\u0627\u062c\u0647 \u0645\u0639 \u0642\u0646\u0627\u0639 \u0627\u0644\u0637\u0628\u064a\u0629",
230
+
231
+ // Line breaker
232
+ "Break": "\u0627\u0644\u0627\u0646\u0642\u0633\u0627\u0645",
233
+
234
+ // Math
235
+ "Subscript": "\u0645\u0646\u062e\u0641\u0636",
236
+ "Superscript": "\u062d\u0631\u0641 \u0641\u0648\u0642\u064a",
237
+
238
+ // Full screen
239
+ "Fullscreen": "\u0643\u0627\u0645\u0644 \u0627\u0644\u0634\u0627\u0634\u0629",
240
+
241
+ // Horizontal line
242
+ "Insert Horizontal Line": "\u0625\u062f\u0631\u0627\u062c \u062e\u0637 \u0623\u0641\u0642\u064a",
243
+
244
+ // Clear formatting
245
+ "Clear Formatting": "\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u062a\u0646\u0633\u064a\u0642",
246
+
247
+ // Undo, redo
248
+ "Undo": "\u062a\u0631\u0627\u062c\u0639",
249
+ "Redo": "\u0625\u0639\u0627\u062f\u0629",
250
+
251
+ // Select all
252
+ "Select All": "\u062a\u062d\u062f\u064a\u062f \u0627\u0644\u0643\u0644",
253
+
254
+ // Code view
255
+ "Code View": "\u0639\u0631\u0636 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629",
256
+
257
+ // Quote
258
+ "Quote": "\u0627\u0642\u062a\u0628\u0633",
259
+ "Increase": "\u0632\u064a\u0627\u062f\u0629",
260
+ "Decrease": "\u0627\u0646\u062e\u0641\u0627\u0636",
261
+
262
+ // Quick Insert
263
+ "Quick Insert": "\u0625\u062f\u0631\u0627\u062c \u0633\u0631\u064a\u0639",
264
+
265
+ // Spcial Characters
266
+ "Special Characters": "أحرف خاصة",
267
+ "Latin": "لاتينية",
268
+ "Greek": "الإغريقي",
269
+ "Cyrillic": "السيريلية",
270
+ "Punctuation": "علامات ترقيم",
271
+ "Currency": "دقة",
272
+ "Arrows": "السهام",
273
+ "Math": "الرياضيات",
274
+ "Misc": "متفرقات",
275
+
276
+ // Print.
277
+ "Print": "طباعة",
278
+
279
+ // Spell Checker.
280
+ "Spell Checker": "مدقق املائي",
281
+
282
+ // Help
283
+ "Help": "مساعدة",
284
+ "Shortcuts": "اختصارات",
285
+ "Inline Editor": "محرر مضمنة",
286
+ "Show the editor": "عرض المحرر",
287
+ "Common actions": "الإجراءات المشتركة",
288
+ "Copy": "نسخ",
289
+ "Cut": "يقطع",
290
+ "Paste": "معجون",
291
+ "Basic Formatting": "التنسيق الأساسي",
292
+ "Increase quote level": "زيادة مستوى الاقتباس",
293
+ "Decrease quote level": "انخفاض مستوى الاقتباس",
294
+ "Image / Video": "صورة / فيديو",
295
+ "Resize larger": "تغيير حجم أكبر",
296
+ "Resize smaller": "تغيير حجم أصغر",
297
+ "Table": "الطاولة",
298
+ "Select table cell": "حدد خلية الجدول",
299
+ "Extend selection one cell": "توسيع اختيار خلية واحدة",
300
+ "Extend selection one row": "تمديد اختيار صف واحد",
301
+ "Navigation": "التنقل",
302
+ "Focus popup / toolbar": "التركيز المنبثقة / شريط الأدوات",
303
+ "Return focus to previous position": "عودة التركيز إلى الموقف السابق",
304
+
305
+ // Embed.ly
306
+ "Embed URL": "تضمين عنوان ورل",
307
+ "Paste in a URL to embed": "الصق في عنوان ورل لتضمينه",
308
+
309
+ // Word Paste.
310
+ "The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?": "المحتوى الذي تم لصقه قادم من وثيقة كلمة ميكروسوفت. هل تريد الاحتفاظ بالتنسيق أو تنظيفه؟",
311
+ "Keep": "احتفظ",
312
+ "Clean": "نظيف",
313
+ "Word Paste Detected": "تم اكتشاف معجون الكلمات"
314
+ },
315
+ direction: "rtl"
316
+ };
317
+
318
+ }));