activeadmin_trumbowyg 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +3 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +20 -0
  5. data/README.md +60 -0
  6. data/Rakefile +3 -0
  7. data/activeadmin_trumbowyg.gemspec +19 -0
  8. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ar.min.js +11 -0
  9. data/app/assets/javascripts/activeadmin/trumbowyg/langs/bg.min.js +8 -0
  10. data/app/assets/javascripts/activeadmin/trumbowyg/langs/by.min.js +8 -0
  11. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ca.min.js +11 -0
  12. data/app/assets/javascripts/activeadmin/trumbowyg/langs/cs.min.js +8 -0
  13. data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.min.js +9 -0
  14. data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.min.js +9 -0
  15. data/app/assets/javascripts/activeadmin/trumbowyg/langs/el.min.js +12 -0
  16. data/app/assets/javascripts/activeadmin/trumbowyg/langs/es.min.js +9 -0
  17. data/app/assets/javascripts/activeadmin/trumbowyg/langs/es_ar.min.js +10 -0
  18. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.min.js +10 -0
  19. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fi.min.js +9 -0
  20. data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.min.js +10 -0
  21. data/app/assets/javascripts/activeadmin/trumbowyg/langs/he.min.js +9 -0
  22. data/app/assets/javascripts/activeadmin/trumbowyg/langs/hr.min.js +9 -0
  23. data/app/assets/javascripts/activeadmin/trumbowyg/langs/hu.min.js +10 -0
  24. data/app/assets/javascripts/activeadmin/trumbowyg/langs/id.min.js +11 -0
  25. data/app/assets/javascripts/activeadmin/trumbowyg/langs/it.min.js +8 -0
  26. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ja.min.js +10 -0
  27. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.min.js +10 -0
  28. data/app/assets/javascripts/activeadmin/trumbowyg/langs/mn.min.js +8 -0
  29. data/app/assets/javascripts/activeadmin/trumbowyg/langs/my.min.js +8 -0
  30. data/app/assets/javascripts/activeadmin/trumbowyg/langs/nl.min.js +9 -0
  31. data/app/assets/javascripts/activeadmin/trumbowyg/langs/no_nb.min.js +10 -0
  32. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ph.min.js +8 -0
  33. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pl.min.js +9 -0
  34. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt.min.js +11 -0
  35. data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt_br.min.js +11 -0
  36. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ro.min.js +12 -0
  37. data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs.min.js +8 -0
  38. data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs_latin.min.js +9 -0
  39. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ru.min.js +8 -0
  40. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sk.min.js +8 -0
  41. data/app/assets/javascripts/activeadmin/trumbowyg/langs/sv.min.js +12 -0
  42. data/app/assets/javascripts/activeadmin/trumbowyg/langs/tr.min.js +9 -0
  43. data/app/assets/javascripts/activeadmin/trumbowyg/langs/ua.min.js +8 -0
  44. data/app/assets/javascripts/activeadmin/trumbowyg/langs/vi.min.js +9 -0
  45. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_cn.min.js +11 -0
  46. data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.min.js +11 -0
  47. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +121 -0
  48. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -0
  49. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +179 -0
  50. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -0
  51. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +176 -0
  52. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -0
  53. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +49 -0
  54. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +43 -0
  55. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +2 -0
  56. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +965 -0
  57. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -0
  58. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +56 -0
  59. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +47 -0
  60. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +2 -0
  61. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +83 -0
  62. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +1 -0
  63. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +101 -0
  64. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -0
  65. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +41 -0
  66. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +1 -0
  67. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +123 -0
  68. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -0
  69. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +154 -0
  70. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -0
  71. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +58 -0
  72. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -0
  73. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +242 -0
  74. data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -0
  75. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.js +1688 -0
  76. data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.min.js +2 -0
  77. data/app/assets/javascripts/activeadmin/trumbowyg/ui/icons.svg +1 -0
  78. data/app/assets/javascripts/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +796 -0
  79. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.css +584 -0
  80. data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.min.css +2 -0
  81. data/app/assets/javascripts/activeadmin/trumbowyg_input.js +7 -0
  82. data/app/assets/stylesheets/activeadmin/_trumbowyg_input.sass +48 -0
  83. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ar.min.js +11 -0
  84. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/bg.min.js +8 -0
  85. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/by.min.js +8 -0
  86. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ca.min.js +11 -0
  87. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/cs.min.js +8 -0
  88. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/da.min.js +9 -0
  89. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/de.min.js +9 -0
  90. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/el.min.js +12 -0
  91. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es.min.js +9 -0
  92. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es_ar.min.js +10 -0
  93. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fa.min.js +10 -0
  94. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fi.min.js +9 -0
  95. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fr.min.js +10 -0
  96. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/he.min.js +9 -0
  97. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hr.min.js +9 -0
  98. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hu.min.js +10 -0
  99. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/id.min.js +11 -0
  100. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/it.min.js +8 -0
  101. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ja.min.js +10 -0
  102. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ko.min.js +10 -0
  103. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/mn.min.js +8 -0
  104. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/my.min.js +8 -0
  105. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/nl.min.js +9 -0
  106. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/no_nb.min.js +10 -0
  107. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ph.min.js +8 -0
  108. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pl.min.js +9 -0
  109. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt.min.js +11 -0
  110. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt_br.min.js +11 -0
  111. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ro.min.js +12 -0
  112. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs.min.js +8 -0
  113. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs_latin.min.js +9 -0
  114. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ru.min.js +8 -0
  115. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sk.min.js +8 -0
  116. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sv.min.js +12 -0
  117. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/tr.min.js +9 -0
  118. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ua.min.js +8 -0
  119. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/vi.min.js +9 -0
  120. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_cn.min.js +11 -0
  121. data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_tw.min.js +11 -0
  122. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +121 -0
  123. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -0
  124. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +179 -0
  125. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -0
  126. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +176 -0
  127. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -0
  128. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +49 -0
  129. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +43 -0
  130. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +2 -0
  131. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +965 -0
  132. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -0
  133. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +56 -0
  134. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +47 -0
  135. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +2 -0
  136. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +83 -0
  137. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +1 -0
  138. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +101 -0
  139. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -0
  140. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +41 -0
  141. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +1 -0
  142. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +123 -0
  143. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -0
  144. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +154 -0
  145. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -0
  146. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +58 -0
  147. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -0
  148. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +242 -0
  149. data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -0
  150. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.js +1688 -0
  151. data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.min.js +2 -0
  152. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/icons.svg +1 -0
  153. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +796 -0
  154. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.css +584 -0
  155. data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.min.css +2 -0
  156. data/lib/activeadmin/trumbowyg/engine.rb +9 -0
  157. data/lib/activeadmin/trumbowyg/version.rb +5 -0
  158. data/lib/activeadmin/trumbowyg.rb +1 -0
  159. data/lib/activeadmin_trumbowyg.rb +3 -0
  160. data/lib/formtastic/inputs/trumbowyg_input.rb +12 -0
  161. data/screenshot.jpg +0 -0
  162. metadata +217 -0
@@ -0,0 +1 @@
1
+ !function(e){"use strict";function a(a){var o=[];return e.each(a.o.plugins.emoji.emojiList,function(r,i){if(e.isArray(i)){var n=i[0],t=i[1],_='<img src="'+t+'" alt="'+n+'">',s="emoji-"+n.replace(/:/g,""),l={hasIcon:!1,text:_,fn:function(){return a.execCmd("insertImage",t,!1,!0),!0}};a.addBtnDef(s,l),o.push(s)}else{var c=i.replace(/:/g,""),u="emoji-"+c,h={text:i,fn:function(){return a.execCmd("insertText",i),!0}};a.addBtnDef(u,h),o.push(u)}}),o}var o={emojiList:[":bowtie:",":smile:",":laughing:",":blush:",":smiley:",":relaxed:",":smirk:",":heart_eyes:",":kissing_heart:",":kissing_closed_eyes:",":flushed:",":relieved:",":satisfied:",":grin:",":wink:",":stuck_out_tongue_winking_eye:",":stuck_out_tongue_closed_eyes:",":grinning:",":kissing:",":kissing_smiling_eyes:",":stuck_out_tongue:",":sleeping:",":worried:",":frowning:",":anguished:",":open_mouth:",":grimacing:",":confused:",":hushed:",":expressionless:",":unamused:",":sweat_smile:",":sweat:",":disappointed_relieved:",":weary:",":pensive:",":disappointed:",":confounded:",":fearful:",":cold_sweat:",":persevere:",":cry:",":sob:",":joy:",":astonished:",":scream:",":neckbeard:",":tired_face:",":angry:",":rage:",":triumph:",":sleepy:",":yum:",":mask:",":sunglasses:",":dizzy_face:",":imp:",":smiling_imp:",":neutral_face:",":no_mouth:",":innocent:",":alien:",":yellow_heart:",":blue_heart:",":purple_heart:",":heart:",":green_heart:",":broken_heart:",":heartbeat:",":heartpulse:",":two_hearts:",":revolving_hearts:",":cupid:",":sparkling_heart:",":sparkles:",":star:",":star2:",":dizzy:",":boom:",":collision:",":anger:",":exclamation:",":question:",":grey_exclamation:",":grey_question:",":zzz:",":dash:",":sweat_drops:",":notes:",":musical_note:",":fire:",":hankey:",":poop:",":shit:",":+1:",":thumbsup:",":-1:",":thumbsdown:",":ok_hand:",":punch:",":facepunch:",":fist:",":v:",":wave:",":hand:",":raised_hand:",":open_hands:",":point_up:",":point_down:",":point_left:",":point_right:",":raised_hands:",":pray:",":point_up_2:",":clap:",":muscle:",":metal:",":fu:",":runner:",":running:",":couple:",":family:",":two_men_holding_hands:",":two_women_holding_hands:",":dancer:",":dancers:",":ok_woman:",":no_good:",":information_desk_person:",":raising_hand:",":bride_with_veil:",":person_with_pouting_face:",":person_frowning:",":bow:",":couplekiss:",":couple_with_heart:",":massage:",":haircut:",":nail_care:",":boy:",":girl:",":woman:",":man:",":baby:",":older_woman:",":older_man:",":person_with_blond_hair:",":man_with_gua_pi_mao:",":man_with_turban:",":construction_worker:",":cop:",":angel:",":princess:",":smiley_cat:",":smile_cat:",":heart_eyes_cat:",":kissing_cat:",":smirk_cat:",":scream_cat:",":crying_cat_face:",":joy_cat:",":pouting_cat:",":japanese_ogre:",":japanese_goblin:",":see_no_evil:",":hear_no_evil:",":speak_no_evil:",":guardsman:",":skull:",":feet:",":lips:",":kiss:",":droplet:",":ear:",":eyes:",":nose:",":tongue:",":love_letter:",":bust_in_silhouette:",":busts_in_silhouette:",":speech_balloon:",":thought_balloon:",":feelsgood:",":finnadie:",":goberserk:",":godmode:",":hurtrealbad:",":rage1:",":rage2:",":rage3:",":rage4:",":suspect:",":trollface:",":sunny:",":umbrella:",":cloud:",":snowflake:",":snowman:",":zap:",":cyclone:",":foggy:",":ocean:",":cat:",":dog:",":mouse:",":hamster:",":rabbit:",":wolf:",":frog:",":tiger:",":koala:",":bear:",":pig:",":pig_nose:",":cow:",":boar:",":monkey_face:",":monkey:",":horse:",":racehorse:",":camel:",":sheep:",":elephant:",":panda_face:",":snake:",":bird:",":baby_chick:",":hatched_chick:",":hatching_chick:",":chicken:",":penguin:",":turtle:",":bug:",":honeybee:",":ant:",":beetle:",":snail:",":octopus:",":tropical_fish:",":fish:",":whale:",":whale2:",":dolphin:",":cow2:",":ram:",":rat:",":water_buffalo:",":tiger2:",":rabbit2:",":dragon:",":goat:",":rooster:",":dog2:",":pig2:",":mouse2:",":ox:",":dragon_face:",":blowfish:",":crocodile:",":dromedary_camel:",":leopard:",":cat2:",":poodle:",":paw_prints:",":bouquet:",":cherry_blossom:",":tulip:",":four_leaf_clover:",":rose:",":sunflower:",":hibiscus:",":maple_leaf:",":leaves:",":fallen_leaf:",":herb:",":mushroom:",":cactus:",":palm_tree:",":evergreen_tree:",":deciduous_tree:",":chestnut:",":seedling:",":blossom:",":ear_of_rice:",":shell:",":globe_with_meridians:",":sun_with_face:",":full_moon_with_face:",":new_moon_with_face:",":new_moon:",":waxing_crescent_moon:",":first_quarter_moon:",":waxing_gibbous_moon:",":full_moon:",":waning_gibbous_moon:",":last_quarter_moon:",":waning_crescent_moon:",":last_quarter_moon_with_face:",":first_quarter_moon_with_face:",":crescent_moon:",":earth_africa:",":earth_americas:",":earth_asia:",":volcano:",":milky_way:",":partly_sunny:",":octocat:",":squirrel:",":bamboo:",":gift_heart:",":dolls:",":school_satchel:",":mortar_board:",":flags:",":fireworks:",":sparkler:",":wind_chime:",":rice_scene:",":jack_o_lantern:",":ghost:",":santa:",":christmas_tree:",":gift:",":bell:",":no_bell:",":tanabata_tree:",":tada:",":confetti_ball:",":balloon:",":crystal_ball:",":cd:",":dvd:",":floppy_disk:",":camera:",":video_camera:",":movie_camera:",":computer:",":tv:",":iphone:",":phone:",":telephone:",":telephone_receiver:",":pager:",":fax:",":minidisc:",":vhs:",":sound:",":speaker:",":mute:",":loudspeaker:",":mega:",":hourglass:",":hourglass_flowing_sand:",":alarm_clock:",":watch:",":radio:",":satellite:",":loop:",":mag:",":mag_right:",":unlock:",":lock:",":lock_with_ink_pen:",":closed_lock_with_key:",":key:",":bulb:",":flashlight:",":high_brightness:",":low_brightness:",":electric_plug:",":battery:",":calling:",":email:",":mailbox:",":postbox:",":bath:",":bathtub:",":shower:",":toilet:",":wrench:",":nut_and_bolt:",":hammer:",":seat:",":moneybag:",":yen:",":dollar:",":pound:",":euro:",":credit_card:",":money_with_wings:",":e-mail:",":inbox_tray:",":outbox_tray:",":envelope:",":incoming_envelope:",":postal_horn:",":mailbox_closed:",":mailbox_with_mail:",":mailbox_with_no_mail:",":package:",":door:",":smoking:",":bomb:",":gun:",":hocho:",":pill:",":syringe:",":page_facing_up:",":page_with_curl:",":bookmark_tabs:",":bar_chart:",":chart_with_upwards_trend:",":chart_with_downwards_trend:",":scroll:",":clipboard:",":calendar:",":date:",":card_index:",":file_folder:",":open_file_folder:",":scissors:",":pushpin:",":paperclip:",":black_nib:",":pencil2:",":straight_ruler:",":triangular_ruler:",":closed_book:",":green_book:",":blue_book:",":orange_book:",":notebook:",":notebook_with_decorative_cover:",":ledger:",":books:",":bookmark:",":name_badge:",":microscope:",":telescope:",":newspaper:",":football:",":basketball:",":soccer:",":baseball:",":tennis:",":8ball:",":rugby_football:",":bowling:",":golf:",":mountain_bicyclist:",":bicyclist:",":horse_racing:",":snowboarder:",":swimmer:",":surfer:",":ski:",":spades:",":hearts:",":clubs:",":diamonds:",":gem:",":ring:",":trophy:",":musical_score:",":musical_keyboard:",":violin:",":space_invader:",":video_game:",":black_joker:",":flower_playing_cards:",":game_die:",":dart:",":mahjong:",":clapper:",":memo:",":pencil:",":book:",":art:",":microphone:",":headphones:",":trumpet:",":saxophone:",":guitar:",":shoe:",":sandal:",":high_heel:",":lipstick:",":boot:",":shirt:",":tshirt:",":necktie:",":womans_clothes:",":dress:",":running_shirt_with_sash:",":jeans:",":kimono:",":bikini:",":ribbon:",":tophat:",":crown:",":womans_hat:",":mans_shoe:",":closed_umbrella:",":briefcase:",":handbag:",":pouch:",":purse:",":eyeglasses:",":fishing_pole_and_fish:",":coffee:",":tea:",":sake:",":baby_bottle:",":beer:",":beers:",":cocktail:",":tropical_drink:",":wine_glass:",":fork_and_knife:",":pizza:",":hamburger:",":fries:",":poultry_leg:",":meat_on_bone:",":spaghetti:",":curry:",":fried_shrimp:",":bento:",":sushi:",":fish_cake:",":rice_ball:",":rice_cracker:",":rice:",":ramen:",":stew:",":oden:",":dango:",":egg:",":bread:",":doughnut:",":custard:",":icecream:",":ice_cream:",":shaved_ice:",":birthday:",":cake:",":cookie:",":chocolate_bar:",":candy:",":lollipop:",":honey_pot:",":apple:",":green_apple:",":tangerine:",":lemon:",":cherries:",":grapes:",":watermelon:",":strawberry:",":peach:",":melon:",":banana:",":pear:",":pineapple:",":sweet_potato:",":eggplant:",":tomato:",":corn:",":house:",":house_with_garden:",":school:",":office:",":post_office:",":hospital:",":bank:",":convenience_store:",":love_hotel:",":hotel:",":wedding:",":church:",":department_store:",":european_post_office:",":city_sunrise:",":city_sunset:",":japanese_castle:",":european_castle:",":tent:",":factory:",":tokyo_tower:",":japan:",":mount_fuji:",":sunrise_over_mountains:",":sunrise:",":stars:",":statue_of_liberty:",":bridge_at_night:",":carousel_horse:",":rainbow:",":ferris_wheel:",":fountain:",":roller_coaster:",":ship:",":speedboat:",":boat:",":sailboat:",":rowboat:",":anchor:",":rocket:",":airplane:",":helicopter:",":steam_locomotive:",":tram:",":mountain_railway:",":bike:",":aerial_tramway:",":suspension_railway:",":mountain_cableway:",":tractor:",":blue_car:",":oncoming_automobile:",":car:",":red_car:",":taxi:",":oncoming_taxi:",":articulated_lorry:",":bus:",":oncoming_bus:",":rotating_light:",":police_car:",":oncoming_police_car:",":fire_engine:",":ambulance:",":minibus:",":truck:",":train:",":station:",":train2:",":bullettrain_front:",":bullettrain_side:",":light_rail:",":monorail:",":railway_car:",":trolleybus:",":ticket:",":fuelpump:",":vertical_traffic_light:",":traffic_light:",":warning:",":construction:",":beginner:",":atm:",":slot_machine:",":busstop:",":barber:",":hotsprings:",":checkered_flag:",":crossed_flags:",":izakaya_lantern:",":moyai:",":circus_tent:",":performing_arts:",":round_pushpin:",":triangular_flag_on_post:",":jp:",":kr:",":cn:",":us:",":fr:",":es:",":it:",":ru:",":gb:",":uk:",":de:",":one:",":two:",":three:",":four:",":five:",":six:",":seven:",":eight:",":nine:",":keycap_ten:",":1234:",":zero:",":hash:",":symbols:",":arrow_backward:",":arrow_down:",":arrow_forward:",":arrow_left:",":capital_abcd:",":abcd:",":abc:",":arrow_lower_left:",":arrow_lower_right:",":arrow_right:",":arrow_up:",":arrow_upper_left:",":arrow_upper_right:",":arrow_double_down:",":arrow_double_up:",":arrow_down_small:",":arrow_heading_down:",":arrow_heading_up:",":leftwards_arrow_with_hook:",":arrow_right_hook:",":left_right_arrow:",":arrow_up_down:",":arrow_up_small:",":arrows_clockwise:",":arrows_counterclockwise:",":rewind:",":fast_forward:",":information_source:",":ok:",":twisted_rightwards_arrows:",":repeat:",":repeat_one:",":new:",":top:",":up:",":cool:",":free:",":ng:",":cinema:",":koko:",":signal_strength:",":u5272:",":u5408:",":u55b6:",":u6307:",":u6708:",":u6709:",":u6e80:",":u7121:",":u7533:",":u7a7a:",":u7981:",":sa:",":restroom:",":mens:",":womens:",":baby_symbol:",":no_smoking:",":parking:",":wheelchair:",":metro:",":baggage_claim:",":accept:",":wc:",":potable_water:",":put_litter_in_its_place:",":secret:",":congratulations:",":m:",":passport_control:",":left_luggage:",":customs:",":ideograph_advantage:",":cl:",":sos:",":id:",":no_entry_sign:",":underage:",":no_mobile_phones:",":do_not_litter:",":non-potable_water:",":no_bicycles:",":no_pedestrians:",":children_crossing:",":no_entry:",":eight_spoked_asterisk:",":sparkle:",":eight_pointed_black_star:",":heart_decoration:",":vs:",":vibration_mode:",":mobile_phone_off:",":chart:",":currency_exchange:",":aries:",":taurus:",":gemini:",":cancer:",":leo:",":virgo:",":libra:",":scorpius:",":sagittarius:",":capricorn:",":aquarius:",":pisces:",":ophiuchus:",":six_pointed_star:",":negative_squared_cross_mark:",":a:",":b:",":ab:",":o2:",":diamond_shape_with_a_dot_inside:",":recycle:",":end:",":back:",":on:",":soon:",":clock1:",":clock130:",":clock10:",":clock1030:",":clock11:",":clock1130:",":clock12:",":clock1230:",":clock2:",":clock230:",":clock3:",":clock330:",":clock4:",":clock430:",":clock5:",":clock530:",":clock6:",":clock630:",":clock7:",":clock730:",":clock8:",":clock830:",":clock9:",":clock930:",":heavy_dollar_sign:",":copyright:",":registered:",":tm:",":x:",":heavy_exclamation_mark:",":bangbang:",":interrobang:",":o:",":heavy_multiplication_x:",":heavy_plus_sign:",":heavy_minus_sign:",":heavy_division_sign:",":white_flower:",":100:",":heavy_check_mark:",":ballot_box_with_check:",":radio_button:",":link:",":curly_loop:",":wavy_dash:",":part_alternation_mark:",":trident:",":black_small_square:",":white_small_square:",":black_medium_small_square:",":white_medium_small_square:",":black_medium_square:",":white_medium_square:",":white_large_square:",":white_check_mark:",":black_square_button:",":white_square_button:",":black_circle:",":white_circle:",":red_circle:",":large_blue_circle:",":large_blue_diamond:",":large_orange_diamond:",":small_blue_diamond:",":small_orange_diamond:",":small_red_triangle:",":small_red_triangle_down:",":shipit:"]};e.extend(!0,e.trumbowyg,{langs:{en:{emoji:"Add an emoji"},fr:{emoji:"Ajouter un emoji"},zh_cn:{emoji:"添加表情"},ru:{emoji:"Вставить emoji"},ja:{emoji:"絵文字の挿入"}},plugins:{emoji:{init:function(e){e.o.plugins.emoji=e.o.plugins.emoji||o;var r={dropdown:a(e)};e.addBtnDef("emoji",r)}}}})}(jQuery);
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Trumbowyg v2.8.1 - A lightweight WYSIWYG editor
3
+ * Default stylesheet for Trumbowyg editor plugin
4
+ * ------------------------
5
+ * @link http://alex-d.github.io/Trumbowyg
6
+ * @license MIT
7
+ * @author Alexandre Demode (Alex-D)
8
+ * Twitter : @AlexandreDemode
9
+ * Website : alex-d.fr
10
+ */
11
+
12
+ .trumbowyg-dropdown-emoji {
13
+ width: 265px;
14
+ padding: 7px 0 7px 5px;
15
+ height: 200px;
16
+ overflow-y: scroll;
17
+ overflow-x: hidden;
18
+ }
19
+
20
+ .trumbowyg-dropdown-emoji svg {
21
+ display: none !important;
22
+ }
23
+
24
+ .trumbowyg-dropdown-emoji button {
25
+ display: block;
26
+ position: relative;
27
+ float: left;
28
+ height: 26px;
29
+ width: 26px;
30
+ padding: 0;
31
+ margin: 2px;
32
+ line-height: 24px;
33
+ text-align: center;
34
+
35
+ &:hover,
36
+ &:focus {
37
+ &::after {
38
+ display: block;
39
+ position: absolute;
40
+ top: -5px;
41
+ left: -5px;
42
+ height: 27px;
43
+ width: 27px;
44
+ background: inherit;
45
+ box-shadow: #000 0 0 2px;
46
+ z-index: 10;
47
+ background-color: transparent;
48
+ }
49
+ }
50
+ }
51
+
52
+ .trumbowyg .emoji {
53
+ width: 22px;
54
+ height: 22px;
55
+ display: inline-block;
56
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Trumbowyg v2.8.1 - A lightweight WYSIWYG editor
3
+ * Trumbowyg plugin stylesheet
4
+ * ------------------------
5
+ * @link http://alex-d.github.io/Trumbowyg
6
+ * @license MIT
7
+ * @author Alexandre Demode (Alex-D)
8
+ * Twitter : @AlexandreDemode
9
+ * Website : alex-d.fr
10
+ */
11
+
12
+ .trumbowyg-dropdown-emoji {
13
+ width: 265px;
14
+ padding: 7px 0 7px 5px;
15
+ height: 200px;
16
+ overflow-y: scroll;
17
+ overflow-x: hidden; }
18
+
19
+ .trumbowyg-dropdown-emoji svg {
20
+ display: none !important; }
21
+
22
+ .trumbowyg-dropdown-emoji button {
23
+ display: block;
24
+ position: relative;
25
+ float: left;
26
+ height: 26px;
27
+ width: 26px;
28
+ padding: 0;
29
+ margin: 2px;
30
+ line-height: 24px;
31
+ text-align: center; }
32
+ .trumbowyg-dropdown-emoji button:hover::after, .trumbowyg-dropdown-emoji button:focus::after {
33
+ display: block;
34
+ position: absolute;
35
+ top: -5px;
36
+ left: -5px;
37
+ height: 27px;
38
+ width: 27px;
39
+ background: inherit;
40
+ box-shadow: #000 0 0 2px;
41
+ z-index: 10;
42
+ background-color: transparent; }
43
+
44
+ .trumbowyg .emoji {
45
+ width: 22px;
46
+ height: 22px;
47
+ display: inline-block; }
@@ -0,0 +1,2 @@
1
+ /** Trumbowyg v2.8.1 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
2
+ .trumbowyg-dropdown-emoji{width:265px;padding:7px 0 7px 5px;height:200px;overflow-y:scroll;overflow-x:hidden}.trumbowyg-dropdown-emoji svg{display:none!important}.trumbowyg-dropdown-emoji button{display:block;position:relative;float:left;height:26px;width:26px;padding:0;margin:2px;line-height:24px;text-align:center}.trumbowyg-dropdown-emoji button:focus::after,.trumbowyg-dropdown-emoji button:hover::after{display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;box-shadow:#000 0 0 2px;z-index:10;background-color:transparent}.trumbowyg .emoji{width:22px;height:22px;display:inline-block}
@@ -0,0 +1,83 @@
1
+ /*/* ===========================================================
2
+ * trumbowyg.insertaudio.js v1.0
3
+ * InsertAudio plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Adam Hess (AdamHess)
7
+ */
8
+
9
+ (function ($) {
10
+ 'use strict';
11
+
12
+ var insertAudioOptions = {
13
+ src: {
14
+ label: 'URL',
15
+ required: true
16
+ },
17
+ autoplay: {
18
+ label: 'AutoPlay',
19
+ required: false,
20
+ type: 'checkbox'
21
+ },
22
+ muted: {
23
+ label: 'Muted',
24
+ required: false,
25
+ type: 'checkbox'
26
+ },
27
+ preload: {
28
+ label: 'preload options',
29
+ required: false
30
+ }
31
+ };
32
+
33
+
34
+ $.extend(true, $.trumbowyg, {
35
+ langs: {
36
+ en: {
37
+ insertAudio: 'Insert Audio'
38
+ },
39
+ ru: {
40
+ insertAudio: 'Вставить аудио'
41
+ },
42
+ ja: {
43
+ insertAudio: '音声の挿入'
44
+ }
45
+ },
46
+ plugins: {
47
+ insertAudio: {
48
+ init: function (trumbowyg) {
49
+ var btnDef = {
50
+ fn: function () {
51
+ var insertAudioCallback = function (v) {
52
+ // controls should always be show otherwise the audio will
53
+ // be invisible defeating the point of a wysiwyg
54
+ var html = '<audio controls';
55
+ if (v.src) {
56
+ html += ' src=\'' + v.src + '\'';
57
+ }
58
+ if (v.autoplay) {
59
+ html += ' autoplay';
60
+ }
61
+ if (v.muted) {
62
+ html += ' muted';
63
+ }
64
+ if (v.preload) {
65
+ html += ' preload=\'' + v + '\'';
66
+ }
67
+ html += '></audio>';
68
+ var node = $(html)[0];
69
+ trumbowyg.range.deleteContents();
70
+ trumbowyg.range.insertNode(node);
71
+ return true;
72
+ };
73
+
74
+ trumbowyg.openModalInsert(trumbowyg.lang.insertAudio, insertAudioOptions, insertAudioCallback);
75
+ }
76
+ };
77
+
78
+ trumbowyg.addBtnDef('insertAudio', btnDef);
79
+ }
80
+ }
81
+ }
82
+ });
83
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(e){"use strict";var r={src:{label:"URL",required:!0},autoplay:{label:"AutoPlay",required:!1,type:"checkbox"},muted:{label:"Muted",required:!1,type:"checkbox"},preload:{label:"preload options",required:!1}};e.extend(!0,e.trumbowyg,{langs:{en:{insertAudio:"Insert Audio"},ru:{insertAudio:"Вставить аудио"},ja:{insertAudio:"音声の挿入"}},plugins:{insertAudio:{init:function(t){var n={fn:function(){var n=function(r){var n="<audio controls";r.src&&(n+=" src='"+r.src+"'"),r.autoplay&&(n+=" autoplay"),r.muted&&(n+=" muted"),r.preload&&(n+=" preload='"+r+"'"),n+="></audio>";var o=e(n)[0];return t.range.deleteContents(),t.range.insertNode(o),!0};t.openModalInsert(t.lang.insertAudio,r,n)}};t.addBtnDef("insertAudio",n)}}}})}(jQuery);
@@ -0,0 +1,101 @@
1
+ /* ===========================================================
2
+ * trumbowyg.noembed.js v1.0
3
+ * noEmbed plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Jake Johns (jakejohns)
7
+ */
8
+
9
+ (function ($) {
10
+ 'use strict';
11
+
12
+ var defaultOptions = {
13
+ proxy: 'https://noembed.com/embed?nowrap=on',
14
+ urlFiled: 'url',
15
+ data: [],
16
+ success: undefined,
17
+ error: undefined
18
+ };
19
+
20
+ $.extend(true, $.trumbowyg, {
21
+ langs: {
22
+ en: {
23
+ noembed: 'Noembed',
24
+ noembedError: 'Error'
25
+ },
26
+ sk: {
27
+ noembedError: 'Chyba'
28
+ },
29
+ fr: {
30
+ noembedError: 'Erreur'
31
+ },
32
+ cs: {
33
+ noembedError: 'Chyba'
34
+ },
35
+ ru: {
36
+ noembedError: 'Ошибка'
37
+ },
38
+ ja: {
39
+ noembedError: 'エラー'
40
+ }
41
+ },
42
+
43
+ plugins: {
44
+ noembed: {
45
+ init: function (trumbowyg) {
46
+ trumbowyg.o.plugins.noembed = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.noembed || {});
47
+
48
+ var btnDef = {
49
+ fn: function () {
50
+ var $modal = trumbowyg.openModalInsert(
51
+ // Title
52
+ trumbowyg.lang.noembed,
53
+
54
+ // Fields
55
+ {
56
+ url: {
57
+ label: 'URL',
58
+ required: true
59
+ }
60
+ },
61
+
62
+ // Callback
63
+ function (data) {
64
+ $.ajax({
65
+ url: trumbowyg.o.plugins.noembed.proxy,
66
+ type: 'GET',
67
+ data: data,
68
+ cache: false,
69
+ dataType: 'json',
70
+
71
+ success: trumbowyg.o.plugins.noembed.success || function (data) {
72
+ if (data.html) {
73
+ trumbowyg.execCmd('insertHTML', data.html);
74
+ setTimeout(function () {
75
+ trumbowyg.closeModal();
76
+ }, 250);
77
+ } else {
78
+ trumbowyg.addErrorOnModalField(
79
+ $('input[type=text]', $modal),
80
+ data.error
81
+ );
82
+ }
83
+ },
84
+ error: trumbowyg.o.plugins.noembed.error || function () {
85
+ trumbowyg.addErrorOnModalField(
86
+ $('input[type=text]', $modal),
87
+ trumbowyg.lang.noembedError
88
+ );
89
+ }
90
+ });
91
+ }
92
+ );
93
+ }
94
+ };
95
+
96
+ trumbowyg.addBtnDef('noembed', btnDef);
97
+ }
98
+ }
99
+ }
100
+ });
101
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(e){"use strict";var r={proxy:"https://noembed.com/embed?nowrap=on",urlFiled:"url",data:[],success:void 0,error:void 0};e.extend(!0,e.trumbowyg,{langs:{en:{noembed:"Noembed",noembedError:"Error"},sk:{noembedError:"Chyba"},fr:{noembedError:"Erreur"},cs:{noembedError:"Chyba"},ru:{noembedError:"Ошибка"},ja:{noembedError:"エラー"}},plugins:{noembed:{init:function(o){o.o.plugins.noembed=e.extend(!0,{},r,o.o.plugins.noembed||{});var n={fn:function(){var r=o.openModalInsert(o.lang.noembed,{url:{label:"URL",required:!0}},function(n){e.ajax({url:o.o.plugins.noembed.proxy,type:"GET",data:n,cache:!1,dataType:"json",success:o.o.plugins.noembed.success||function(n){n.html?(o.execCmd("insertHTML",n.html),setTimeout(function(){o.closeModal()},250)):o.addErrorOnModalField(e("input[type=text]",r),n.error)},error:o.o.plugins.noembed.error||function(){o.addErrorOnModalField(e("input[type=text]",r),o.lang.noembedError)}})})}};o.addBtnDef("noembed",n)}}}})}(jQuery);
@@ -0,0 +1,41 @@
1
+ /* ===========================================================
2
+ * trumbowyg.pasteimage.js v1.0
3
+ * Basic base64 paste plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Alexandre Demode (Alex-D)
7
+ * Twitter : @AlexandreDemode
8
+ * Website : alex-d.fr
9
+ */
10
+
11
+ (function ($) {
12
+ 'use strict';
13
+
14
+ $.extend(true, $.trumbowyg, {
15
+ plugins: {
16
+ pasteImage: {
17
+ init: function (trumbowyg) {
18
+ trumbowyg.pasteHandlers.push(function (pasteEvent) {
19
+ try {
20
+ var items = (pasteEvent.originalEvent || pasteEvent).clipboardData.items,
21
+ reader;
22
+
23
+ for (var i = items.length -1; i >= 0; i += 1) {
24
+ if (items[i].type.match(/^image\//)) {
25
+ reader = new FileReader();
26
+ /* jshint -W083 */
27
+ reader.onloadend = function (event) {
28
+ trumbowyg.execCmd('insertImage', event.target.result, undefined, true);
29
+ };
30
+ /* jshint +W083 */
31
+ reader.readAsDataURL(items[i].getAsFile());
32
+ }
33
+ }
34
+ } catch (c) {
35
+ }
36
+ });
37
+ }
38
+ }
39
+ }
40
+ });
41
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{pasteImage:{init:function(e){e.pasteHandlers.push(function(t){try{for(var a,n=(t.originalEvent||t).clipboardData.items,i=n.length-1;i>=0;i+=1)n[i].type.match(/^image\//)&&(a=new FileReader,a.onloadend=function(t){e.execCmd("insertImage",t.target.result,void 0,!0)},a.readAsDataURL(n[i].getAsFile()))}catch(r){}})}}}})}(jQuery);
@@ -0,0 +1,123 @@
1
+ /* ===========================================================
2
+ * trumbowyg.preformatted.js v1.0
3
+ * Preformatted plugin for Trumbowyg
4
+ * http://alex-d.github.com/Trumbowyg
5
+ * ===========================================================
6
+ * Author : Casella Edoardo (Civile)
7
+ */
8
+
9
+
10
+ (function ($) {
11
+ 'use strict';
12
+
13
+ $.extend(true, $.trumbowyg, {
14
+ langs: {
15
+ // jshint camelcase:false
16
+ en: {
17
+ preformatted: 'Code sample <pre>'
18
+ },
19
+ fr: {
20
+ preformatted: 'Exemple de code'
21
+ },
22
+ it: {
23
+ preformatted: 'Codice <pre>'
24
+ },
25
+ zh_cn: {
26
+ preformatted: '代码示例 <pre>'
27
+ },
28
+ ru: {
29
+ preformatted: 'Пример кода <pre>'
30
+ },
31
+ ja: {
32
+ preformatted: 'コードサンプル <pre>'
33
+ }
34
+ },
35
+ // jshint camelcase:true
36
+
37
+ plugins: {
38
+ preformatted: {
39
+ init: function (trumbowyg) {
40
+ var btnDef = {
41
+ fn: function () {
42
+ trumbowyg.saveRange();
43
+ var text = trumbowyg.getRangeText();
44
+ if (text.replace(/\s/g, '') !== '') {
45
+ try {
46
+ var curtag = getSelectionParentElement().tagName.toLowerCase();
47
+ if (curtag === 'code' || curtag === 'pre') {
48
+ return unwrapCode();
49
+ }
50
+ else {
51
+ trumbowyg.execCmd('insertHTML', '<pre><code>' + strip(text) + '</code></pre>');
52
+ }
53
+ } catch (e) {
54
+ }
55
+ }
56
+ },
57
+ tag: 'pre'
58
+ };
59
+
60
+ trumbowyg.addBtnDef('preformatted', btnDef);
61
+ }
62
+ }
63
+ }
64
+ });
65
+
66
+ /*
67
+ * GetSelectionParentElement
68
+ */
69
+ function getSelectionParentElement() {
70
+ var parentEl = null,
71
+ selection;
72
+ if (window.getSelection) {
73
+ selection = window.getSelection();
74
+ if (selection.rangeCount) {
75
+ parentEl = selection.getRangeAt(0).commonAncestorContainer;
76
+ if (parentEl.nodeType !== 1) {
77
+ parentEl = parentEl.parentNode;
78
+ }
79
+ }
80
+ } else if ((selection = document.selection) && selection.type !== 'Control') {
81
+ parentEl = selection.createRange().parentElement();
82
+ }
83
+ return parentEl;
84
+ }
85
+
86
+ /*
87
+ * Strip
88
+ * returns a text without HTML tags
89
+ */
90
+ function strip(html) {
91
+ var tmp = document.createElement('DIV');
92
+ tmp.innerHTML = html;
93
+ return tmp.textContent || tmp.innerText || '';
94
+ }
95
+
96
+ /*
97
+ * UnwrapCode
98
+ * ADD/FIX: to improve, works but can be better
99
+ * "paranoic" solution
100
+ */
101
+ function unwrapCode() {
102
+ var container = null;
103
+ if (document.selection) { //for IE
104
+ container = document.selection.createRange().parentElement();
105
+ } else {
106
+ var select = window.getSelection();
107
+ if (select.rangeCount > 0) {
108
+ container = select.getRangeAt(0).startContainer.parentNode;
109
+ }
110
+ }
111
+ //'paranoic' unwrap
112
+ var ispre = $(container).contents().closest('pre').length;
113
+ var iscode = $(container).contents().closest('code').length;
114
+ if (ispre && iscode) {
115
+ $(container).contents().unwrap('code').unwrap('pre');
116
+ } else if (ispre) {
117
+ $(container).contents().unwrap('pre');
118
+ } else if (iscode) {
119
+ $(container).contents().unwrap('code');
120
+ }
121
+ }
122
+
123
+ })(jQuery);
@@ -0,0 +1 @@
1
+ !function(e){"use strict";function t(){var e,t=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(t=e.getRangeAt(0).commonAncestorContainer,1!==t.nodeType&&(t=t.parentNode))):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement()),t}function n(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function r(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var n=window.getSelection();n.rangeCount>0&&(t=n.getRangeAt(0).startContainer.parentNode)}var r=e(t).contents().closest("pre").length,o=e(t).contents().closest("code").length;r&&o?e(t).contents().unwrap("code").unwrap("pre"):r?e(t).contents().unwrap("pre"):o&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},fr:{preformatted:"Exemple de code"},it:{preformatted:"Codice <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},ru:{preformatted:"Пример кода <pre>"},ja:{preformatted:"コードサンプル <pre>"}},plugins:{preformatted:{init:function(e){var o={fn:function(){e.saveRange();var o=e.getRangeText();if(""!==o.replace(/\s/g,""))try{var a=t().tagName.toLowerCase();if("code"===a||"pre"===a)return r();e.execCmd("insertHTML","<pre><code>"+n(o)+"</code></pre>")}catch(c){}},tag:"pre"};e.addBtnDef("preformatted",o)}}}})}(jQuery);