plugin.js 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or http://ckeditor.com/license
  4. */
  5. CKEDITOR.plugins.add( 'smiley', {
  6. requires: 'dialog',
  7. // jscs:disable maximumLineLength
  8. lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
  9. // jscs:enable maximumLineLength
  10. icons: 'smiley', // %REMOVE_LINE_CORE%
  11. hidpi: true, // %REMOVE_LINE_CORE%
  12. init: function( editor ) {
  13. editor.config.smiley_path = editor.config.smiley_path || ( this.path + 'images/' );
  14. editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley', {
  15. allowedContent: 'img[alt,height,!src,title,width]',
  16. requiredContent: 'img'
  17. } ) );
  18. editor.ui.addButton && editor.ui.addButton( 'Smiley', {
  19. label: editor.lang.smiley.toolbar,
  20. command: 'smiley',
  21. toolbar: 'insert,50'
  22. } );
  23. CKEDITOR.dialog.add( 'smiley', this.path + 'dialogs/smiley.js' );
  24. }
  25. } );
  26. /**
  27. * The base path used to build the URL for the smiley images. It must end with a slash.
  28. *
  29. * config.smiley_path = 'http://www.example.com/images/smileys/';
  30. *
  31. * config.smiley_path = '/images/smileys/';
  32. *
  33. * @cfg {String} [smiley_path=CKEDITOR.basePath + 'plugins/smiley/images/']
  34. * @member CKEDITOR.config
  35. */
  36. /**
  37. * The file names for the smileys to be displayed. These files must be
  38. * contained inside the URL path defined with the {@link #smiley_path} setting.
  39. *
  40. * // This is actually the default value.
  41. * config.smiley_images = [
  42. * 'regular_smile.png','sad_smile.png','wink_smile.png','teeth_smile.png','confused_smile.png','tongue_smile.png',
  43. * 'embarrassed_smile.png','omg_smile.png','whatchutalkingabout_smile.png','angry_smile.png','angel_smile.png','shades_smile.png',
  44. * 'devil_smile.png','cry_smile.png','lightbulb.png','thumbs_down.png','thumbs_up.png','heart.png',
  45. * 'broken_heart.png','kiss.png','envelope.png'
  46. * ];
  47. *
  48. * @cfg
  49. * @member CKEDITOR.config
  50. */
  51. CKEDITOR.config.smiley_images = [
  52. 'regular_smile.png', 'sad_smile.png', 'wink_smile.png', 'teeth_smile.png', 'confused_smile.png', 'tongue_smile.png',
  53. 'embarrassed_smile.png', 'omg_smile.png', 'whatchutalkingabout_smile.png', 'angry_smile.png', 'angel_smile.png', 'shades_smile.png',
  54. 'devil_smile.png', 'cry_smile.png', 'lightbulb.png', 'thumbs_down.png', 'thumbs_up.png', 'heart.png',
  55. 'broken_heart.png', 'kiss.png', 'envelope.png'
  56. ];
  57. /**
  58. * The description to be used for each of the smileys defined in the
  59. * {@link CKEDITOR.config#smiley_images} setting. Each entry in this array list
  60. * must match its relative pair in the {@link CKEDITOR.config#smiley_images}
  61. * setting.
  62. *
  63. * // Default settings.
  64. * config.smiley_descriptions = [
  65. * 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise',
  66. * 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no',
  67. * 'yes', 'heart', 'broken heart', 'kiss', 'mail'
  68. * ];
  69. *
  70. * // Use textual emoticons as description.
  71. * config.smiley_descriptions = [
  72. * ':)', ':(', ';)', ':D', ':/', ':P', ':*)', ':-o',
  73. * ':|', '>:(', 'o:)', '8-)', '>:-)', ';(', '', '', '',
  74. * '', '', ':-*', ''
  75. * ];
  76. *
  77. * @cfg
  78. * @member CKEDITOR.config
  79. */
  80. CKEDITOR.config.smiley_descriptions = [
  81. 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise',
  82. 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no',
  83. 'yes', 'heart', 'broken heart', 'kiss', 'mail'
  84. ];
  85. /**
  86. * The number of columns to be generated by the smilies matrix.
  87. *
  88. * config.smiley_columns = 6;
  89. *
  90. * @since 3.3.2
  91. * @cfg {Number} [smiley_columns=8]
  92. * @member CKEDITOR.config
  93. */