github.com/Azareal/Gosora@v0.0.0-20210729070923-553e66b59003/pubnot/trumbowyg/plugins/emoji/trumbowyg.emoji.js (about) 1 /* =========================================================== 2 * trumbowyg.emoji.js v0.1 3 * Emoji picker plugin for Trumbowyg 4 * http://alex-d.github.com/Trumbowyg 5 * =========================================================== 6 * Author : Nicolas Pion 7 * Twitter : @nicolas_pion 8 */ 9 10 (function ($) { 11 'use strict'; 12 13 var defaultOptions = { 14 emojiList: [ 15 ':bowtie:', 16 ':smile:', 17 ':laughing:', 18 ':blush:', 19 ':smiley:', 20 ':relaxed:', 21 ':smirk:', 22 ':heart_eyes:', 23 ':kissing_heart:', 24 ':kissing_closed_eyes:', 25 ':flushed:', 26 ':relieved:', 27 ':satisfied:', 28 ':grin:', 29 ':wink:', 30 ':stuck_out_tongue_winking_eye:', 31 ':stuck_out_tongue_closed_eyes:', 32 ':grinning:', 33 ':kissing:', 34 ':kissing_smiling_eyes:', 35 ':stuck_out_tongue:', 36 ':sleeping:', 37 ':worried:', 38 ':frowning:', 39 ':anguished:', 40 ':open_mouth:', 41 ':grimacing:', 42 ':confused:', 43 ':hushed:', 44 ':expressionless:', 45 ':unamused:', 46 ':sweat_smile:', 47 ':sweat:', 48 ':disappointed_relieved:', 49 ':weary:', 50 ':pensive:', 51 ':disappointed:', 52 ':confounded:', 53 ':fearful:', 54 ':cold_sweat:', 55 ':persevere:', 56 ':cry:', 57 ':sob:', 58 ':joy:', 59 ':astonished:', 60 ':scream:', 61 ':neckbeard:', 62 ':tired_face:', 63 ':angry:', 64 ':rage:', 65 ':triumph:', 66 ':sleepy:', 67 ':yum:', 68 ':mask:', 69 ':sunglasses:', 70 ':dizzy_face:', 71 ':imp:', 72 ':smiling_imp:', 73 ':neutral_face:', 74 ':no_mouth:', 75 ':innocent:', 76 ':alien:', 77 ':yellow_heart:', 78 ':blue_heart:', 79 ':purple_heart:', 80 ':heart:', 81 ':green_heart:', 82 ':broken_heart:', 83 ':heartbeat:', 84 ':heartpulse:', 85 ':two_hearts:', 86 ':revolving_hearts:', 87 ':cupid:', 88 ':sparkling_heart:', 89 ':sparkles:', 90 ':star:', 91 ':star2:', 92 ':dizzy:', 93 ':boom:', 94 ':collision:', 95 ':anger:', 96 ':exclamation:', 97 ':question:', 98 ':grey_exclamation:', 99 ':grey_question:', 100 ':zzz:', 101 ':dash:', 102 ':sweat_drops:', 103 ':notes:', 104 ':musical_note:', 105 ':fire:', 106 ':hankey:', 107 ':poop:', 108 ':shit:', 109 ':+1:', 110 ':thumbsup:', 111 ':-1:', 112 ':thumbsdown:', 113 ':ok_hand:', 114 ':punch:', 115 ':facepunch:', 116 ':fist:', 117 ':v:', 118 ':wave:', 119 ':hand:', 120 ':raised_hand:', 121 ':open_hands:', 122 ':point_up:', 123 ':point_down:', 124 ':point_left:', 125 ':point_right:', 126 ':raised_hands:', 127 ':pray:', 128 ':point_up_2:', 129 ':clap:', 130 ':muscle:', 131 ':metal:', 132 ':fu:', 133 ':runner:', 134 ':running:', 135 ':couple:', 136 ':family:', 137 ':two_men_holding_hands:', 138 ':two_women_holding_hands:', 139 ':dancer:', 140 ':dancers:', 141 ':ok_woman:', 142 ':no_good:', 143 ':information_desk_person:', 144 ':raising_hand:', 145 ':bride_with_veil:', 146 ':person_with_pouting_face:', 147 ':person_frowning:', 148 ':bow:', 149 ':couplekiss:', 150 ':couple_with_heart:', 151 ':massage:', 152 ':haircut:', 153 ':nail_care:', 154 ':boy:', 155 ':girl:', 156 ':woman:', 157 ':man:', 158 ':baby:', 159 ':older_woman:', 160 ':older_man:', 161 ':person_with_blond_hair:', 162 ':man_with_gua_pi_mao:', 163 ':man_with_turban:', 164 ':construction_worker:', 165 ':cop:', 166 ':angel:', 167 ':princess:', 168 ':smiley_cat:', 169 ':smile_cat:', 170 ':heart_eyes_cat:', 171 ':kissing_cat:', 172 ':smirk_cat:', 173 ':scream_cat:', 174 ':crying_cat_face:', 175 ':joy_cat:', 176 ':pouting_cat:', 177 ':japanese_ogre:', 178 ':japanese_goblin:', 179 ':see_no_evil:', 180 ':hear_no_evil:', 181 ':speak_no_evil:', 182 ':guardsman:', 183 ':skull:', 184 ':feet:', 185 ':lips:', 186 ':kiss:', 187 ':droplet:', 188 ':ear:', 189 ':eyes:', 190 ':nose:', 191 ':tongue:', 192 ':love_letter:', 193 ':bust_in_silhouette:', 194 ':busts_in_silhouette:', 195 ':speech_balloon:', 196 ':thought_balloon:', 197 ':feelsgood:', 198 ':finnadie:', 199 ':goberserk:', 200 ':godmode:', 201 ':hurtrealbad:', 202 ':rage1:', 203 ':rage2:', 204 ':rage3:', 205 ':rage4:', 206 ':suspect:', 207 ':trollface:', 208 ':sunny:', 209 ':umbrella:', 210 ':cloud:', 211 ':snowflake:', 212 ':snowman:', 213 ':zap:', 214 ':cyclone:', 215 ':foggy:', 216 ':ocean:', 217 ':cat:', 218 ':dog:', 219 ':mouse:', 220 ':hamster:', 221 ':rabbit:', 222 ':wolf:', 223 ':frog:', 224 ':tiger:', 225 ':koala:', 226 ':bear:', 227 ':pig:', 228 ':pig_nose:', 229 ':cow:', 230 ':boar:', 231 ':monkey_face:', 232 ':monkey:', 233 ':horse:', 234 ':racehorse:', 235 ':camel:', 236 ':sheep:', 237 ':elephant:', 238 ':panda_face:', 239 ':snake:', 240 ':bird:', 241 ':baby_chick:', 242 ':hatched_chick:', 243 ':hatching_chick:', 244 ':chicken:', 245 ':penguin:', 246 ':turtle:', 247 ':bug:', 248 ':honeybee:', 249 ':ant:', 250 ':beetle:', 251 ':snail:', 252 ':octopus:', 253 ':tropical_fish:', 254 ':fish:', 255 ':whale:', 256 ':whale2:', 257 ':dolphin:', 258 ':cow2:', 259 ':ram:', 260 ':rat:', 261 ':water_buffalo:', 262 ':tiger2:', 263 ':rabbit2:', 264 ':dragon:', 265 ':goat:', 266 ':rooster:', 267 ':dog2:', 268 ':pig2:', 269 ':mouse2:', 270 ':ox:', 271 ':dragon_face:', 272 ':blowfish:', 273 ':crocodile:', 274 ':dromedary_camel:', 275 ':leopard:', 276 ':cat2:', 277 ':poodle:', 278 ':paw_prints:', 279 ':bouquet:', 280 ':cherry_blossom:', 281 ':tulip:', 282 ':four_leaf_clover:', 283 ':rose:', 284 ':sunflower:', 285 ':hibiscus:', 286 ':maple_leaf:', 287 ':leaves:', 288 ':fallen_leaf:', 289 ':herb:', 290 ':mushroom:', 291 ':cactus:', 292 ':palm_tree:', 293 ':evergreen_tree:', 294 ':deciduous_tree:', 295 ':chestnut:', 296 ':seedling:', 297 ':blossom:', 298 ':ear_of_rice:', 299 ':shell:', 300 ':globe_with_meridians:', 301 ':sun_with_face:', 302 ':full_moon_with_face:', 303 ':new_moon_with_face:', 304 ':new_moon:', 305 ':waxing_crescent_moon:', 306 ':first_quarter_moon:', 307 ':waxing_gibbous_moon:', 308 ':full_moon:', 309 ':waning_gibbous_moon:', 310 ':last_quarter_moon:', 311 ':waning_crescent_moon:', 312 ':last_quarter_moon_with_face:', 313 ':first_quarter_moon_with_face:', 314 ':crescent_moon:', 315 ':earth_africa:', 316 ':earth_americas:', 317 ':earth_asia:', 318 ':volcano:', 319 ':milky_way:', 320 ':partly_sunny:', 321 ':octocat:', 322 ':squirrel:', 323 ':bamboo:', 324 ':gift_heart:', 325 ':dolls:', 326 ':school_satchel:', 327 ':mortar_board:', 328 ':flags:', 329 ':fireworks:', 330 ':sparkler:', 331 ':wind_chime:', 332 ':rice_scene:', 333 ':jack_o_lantern:', 334 ':ghost:', 335 ':santa:', 336 ':christmas_tree:', 337 ':gift:', 338 ':bell:', 339 ':no_bell:', 340 ':tanabata_tree:', 341 ':tada:', 342 ':confetti_ball:', 343 ':balloon:', 344 ':crystal_ball:', 345 ':cd:', 346 ':dvd:', 347 ':floppy_disk:', 348 ':camera:', 349 ':video_camera:', 350 ':movie_camera:', 351 ':computer:', 352 ':tv:', 353 ':iphone:', 354 ':phone:', 355 ':telephone:', 356 ':telephone_receiver:', 357 ':pager:', 358 ':fax:', 359 ':minidisc:', 360 ':vhs:', 361 ':sound:', 362 ':speaker:', 363 ':mute:', 364 ':loudspeaker:', 365 ':mega:', 366 ':hourglass:', 367 ':hourglass_flowing_sand:', 368 ':alarm_clock:', 369 ':watch:', 370 ':radio:', 371 ':satellite:', 372 ':loop:', 373 ':mag:', 374 ':mag_right:', 375 ':unlock:', 376 ':lock:', 377 ':lock_with_ink_pen:', 378 ':closed_lock_with_key:', 379 ':key:', 380 ':bulb:', 381 ':flashlight:', 382 ':high_brightness:', 383 ':low_brightness:', 384 ':electric_plug:', 385 ':battery:', 386 ':calling:', 387 ':email:', 388 ':mailbox:', 389 ':postbox:', 390 ':bath:', 391 ':bathtub:', 392 ':shower:', 393 ':toilet:', 394 ':wrench:', 395 ':nut_and_bolt:', 396 ':hammer:', 397 ':seat:', 398 ':moneybag:', 399 ':yen:', 400 ':dollar:', 401 ':pound:', 402 ':euro:', 403 ':credit_card:', 404 ':money_with_wings:', 405 ':e-mail:', 406 ':inbox_tray:', 407 ':outbox_tray:', 408 ':envelope:', 409 ':incoming_envelope:', 410 ':postal_horn:', 411 ':mailbox_closed:', 412 ':mailbox_with_mail:', 413 ':mailbox_with_no_mail:', 414 ':package:', 415 ':door:', 416 ':smoking:', 417 ':bomb:', 418 ':gun:', 419 ':hocho:', 420 ':pill:', 421 ':syringe:', 422 ':page_facing_up:', 423 ':page_with_curl:', 424 ':bookmark_tabs:', 425 ':bar_chart:', 426 ':chart_with_upwards_trend:', 427 ':chart_with_downwards_trend:', 428 ':scroll:', 429 ':clipboard:', 430 ':calendar:', 431 ':date:', 432 ':card_index:', 433 ':file_folder:', 434 ':open_file_folder:', 435 ':scissors:', 436 ':pushpin:', 437 ':paperclip:', 438 ':black_nib:', 439 ':pencil2:', 440 ':straight_ruler:', 441 ':triangular_ruler:', 442 ':closed_book:', 443 ':green_book:', 444 ':blue_book:', 445 ':orange_book:', 446 ':notebook:', 447 ':notebook_with_decorative_cover:', 448 ':ledger:', 449 ':books:', 450 ':bookmark:', 451 ':name_badge:', 452 ':microscope:', 453 ':telescope:', 454 ':newspaper:', 455 ':football:', 456 ':basketball:', 457 ':soccer:', 458 ':baseball:', 459 ':tennis:', 460 ':8ball:', 461 ':rugby_football:', 462 ':bowling:', 463 ':golf:', 464 ':mountain_bicyclist:', 465 ':bicyclist:', 466 ':horse_racing:', 467 ':snowboarder:', 468 ':swimmer:', 469 ':surfer:', 470 ':ski:', 471 ':spades:', 472 ':hearts:', 473 ':clubs:', 474 ':diamonds:', 475 ':gem:', 476 ':ring:', 477 ':trophy:', 478 ':musical_score:', 479 ':musical_keyboard:', 480 ':violin:', 481 ':space_invader:', 482 ':video_game:', 483 ':black_joker:', 484 ':flower_playing_cards:', 485 ':game_die:', 486 ':dart:', 487 ':mahjong:', 488 ':clapper:', 489 ':memo:', 490 ':pencil:', 491 ':book:', 492 ':art:', 493 ':microphone:', 494 ':headphones:', 495 ':trumpet:', 496 ':saxophone:', 497 ':guitar:', 498 ':shoe:', 499 ':sandal:', 500 ':high_heel:', 501 ':lipstick:', 502 ':boot:', 503 ':shirt:', 504 ':tshirt:', 505 ':necktie:', 506 ':womans_clothes:', 507 ':dress:', 508 ':running_shirt_with_sash:', 509 ':jeans:', 510 ':kimono:', 511 ':bikini:', 512 ':ribbon:', 513 ':tophat:', 514 ':crown:', 515 ':womans_hat:', 516 ':mans_shoe:', 517 ':closed_umbrella:', 518 ':briefcase:', 519 ':handbag:', 520 ':pouch:', 521 ':purse:', 522 ':eyeglasses:', 523 ':fishing_pole_and_fish:', 524 ':coffee:', 525 ':tea:', 526 ':sake:', 527 ':baby_bottle:', 528 ':beer:', 529 ':beers:', 530 ':cocktail:', 531 ':tropical_drink:', 532 ':wine_glass:', 533 ':fork_and_knife:', 534 ':pizza:', 535 ':hamburger:', 536 ':fries:', 537 ':poultry_leg:', 538 ':meat_on_bone:', 539 ':spaghetti:', 540 ':curry:', 541 ':fried_shrimp:', 542 ':bento:', 543 ':sushi:', 544 ':fish_cake:', 545 ':rice_ball:', 546 ':rice_cracker:', 547 ':rice:', 548 ':ramen:', 549 ':stew:', 550 ':oden:', 551 ':dango:', 552 ':egg:', 553 ':bread:', 554 ':doughnut:', 555 ':custard:', 556 ':icecream:', 557 ':ice_cream:', 558 ':shaved_ice:', 559 ':birthday:', 560 ':cake:', 561 ':cookie:', 562 ':chocolate_bar:', 563 ':candy:', 564 ':lollipop:', 565 ':honey_pot:', 566 ':apple:', 567 ':green_apple:', 568 ':tangerine:', 569 ':lemon:', 570 ':cherries:', 571 ':grapes:', 572 ':watermelon:', 573 ':strawberry:', 574 ':peach:', 575 ':melon:', 576 ':banana:', 577 ':pear:', 578 ':pineapple:', 579 ':sweet_potato:', 580 ':eggplant:', 581 ':tomato:', 582 ':corn:', 583 ':house:', 584 ':house_with_garden:', 585 ':school:', 586 ':office:', 587 ':post_office:', 588 ':hospital:', 589 ':bank:', 590 ':convenience_store:', 591 ':love_hotel:', 592 ':hotel:', 593 ':wedding:', 594 ':church:', 595 ':department_store:', 596 ':european_post_office:', 597 ':city_sunrise:', 598 ':city_sunset:', 599 ':japanese_castle:', 600 ':european_castle:', 601 ':tent:', 602 ':factory:', 603 ':tokyo_tower:', 604 ':japan:', 605 ':mount_fuji:', 606 ':sunrise_over_mountains:', 607 ':sunrise:', 608 ':stars:', 609 ':statue_of_liberty:', 610 ':bridge_at_night:', 611 ':carousel_horse:', 612 ':rainbow:', 613 ':ferris_wheel:', 614 ':fountain:', 615 ':roller_coaster:', 616 ':ship:', 617 ':speedboat:', 618 ':boat:', 619 ':sailboat:', 620 ':rowboat:', 621 ':anchor:', 622 ':rocket:', 623 ':airplane:', 624 ':helicopter:', 625 ':steam_locomotive:', 626 ':tram:', 627 ':mountain_railway:', 628 ':bike:', 629 ':aerial_tramway:', 630 ':suspension_railway:', 631 ':mountain_cableway:', 632 ':tractor:', 633 ':blue_car:', 634 ':oncoming_automobile:', 635 ':car:', 636 ':red_car:', 637 ':taxi:', 638 ':oncoming_taxi:', 639 ':articulated_lorry:', 640 ':bus:', 641 ':oncoming_bus:', 642 ':rotating_light:', 643 ':police_car:', 644 ':oncoming_police_car:', 645 ':fire_engine:', 646 ':ambulance:', 647 ':minibus:', 648 ':truck:', 649 ':train:', 650 ':station:', 651 ':train2:', 652 ':bullettrain_front:', 653 ':bullettrain_side:', 654 ':light_rail:', 655 ':monorail:', 656 ':railway_car:', 657 ':trolleybus:', 658 ':ticket:', 659 ':fuelpump:', 660 ':vertical_traffic_light:', 661 ':traffic_light:', 662 ':warning:', 663 ':construction:', 664 ':beginner:', 665 ':atm:', 666 ':slot_machine:', 667 ':busstop:', 668 ':barber:', 669 ':hotsprings:', 670 ':checkered_flag:', 671 ':crossed_flags:', 672 ':izakaya_lantern:', 673 ':moyai:', 674 ':circus_tent:', 675 ':performing_arts:', 676 ':round_pushpin:', 677 ':triangular_flag_on_post:', 678 ':jp:', 679 ':kr:', 680 ':cn:', 681 ':us:', 682 ':fr:', 683 ':es:', 684 ':it:', 685 ':ru:', 686 ':gb:', 687 ':uk:', 688 ':de:', 689 ':one:', 690 ':two:', 691 ':three:', 692 ':four:', 693 ':five:', 694 ':six:', 695 ':seven:', 696 ':eight:', 697 ':nine:', 698 ':keycap_ten:', 699 ':1234:', 700 ':zero:', 701 ':hash:', 702 ':symbols:', 703 ':arrow_backward:', 704 ':arrow_down:', 705 ':arrow_forward:', 706 ':arrow_left:', 707 ':capital_abcd:', 708 ':abcd:', 709 ':abc:', 710 ':arrow_lower_left:', 711 ':arrow_lower_right:', 712 ':arrow_right:', 713 ':arrow_up:', 714 ':arrow_upper_left:', 715 ':arrow_upper_right:', 716 ':arrow_double_down:', 717 ':arrow_double_up:', 718 ':arrow_down_small:', 719 ':arrow_heading_down:', 720 ':arrow_heading_up:', 721 ':leftwards_arrow_with_hook:', 722 ':arrow_right_hook:', 723 ':left_right_arrow:', 724 ':arrow_up_down:', 725 ':arrow_up_small:', 726 ':arrows_clockwise:', 727 ':arrows_counterclockwise:', 728 ':rewind:', 729 ':fast_forward:', 730 ':information_source:', 731 ':ok:', 732 ':twisted_rightwards_arrows:', 733 ':repeat:', 734 ':repeat_one:', 735 ':new:', 736 ':top:', 737 ':up:', 738 ':cool:', 739 ':free:', 740 ':ng:', 741 ':cinema:', 742 ':koko:', 743 ':signal_strength:', 744 ':u5272:', 745 ':u5408:', 746 ':u55b6:', 747 ':u6307:', 748 ':u6708:', 749 ':u6709:', 750 ':u6e80:', 751 ':u7121:', 752 ':u7533:', 753 ':u7a7a:', 754 ':u7981:', 755 ':sa:', 756 ':restroom:', 757 ':mens:', 758 ':womens:', 759 ':baby_symbol:', 760 ':no_smoking:', 761 ':parking:', 762 ':wheelchair:', 763 ':metro:', 764 ':baggage_claim:', 765 ':accept:', 766 ':wc:', 767 ':potable_water:', 768 ':put_litter_in_its_place:', 769 ':secret:', 770 ':congratulations:', 771 ':m:', 772 ':passport_control:', 773 ':left_luggage:', 774 ':customs:', 775 ':ideograph_advantage:', 776 ':cl:', 777 ':sos:', 778 ':id:', 779 ':no_entry_sign:', 780 ':underage:', 781 ':no_mobile_phones:', 782 ':do_not_litter:', 783 ':non-potable_water:', 784 ':no_bicycles:', 785 ':no_pedestrians:', 786 ':children_crossing:', 787 ':no_entry:', 788 ':eight_spoked_asterisk:', 789 ':sparkle:', 790 ':eight_pointed_black_star:', 791 ':heart_decoration:', 792 ':vs:', 793 ':vibration_mode:', 794 ':mobile_phone_off:', 795 ':chart:', 796 ':currency_exchange:', 797 ':aries:', 798 ':taurus:', 799 ':gemini:', 800 ':cancer:', 801 ':leo:', 802 ':virgo:', 803 ':libra:', 804 ':scorpius:', 805 ':sagittarius:', 806 ':capricorn:', 807 ':aquarius:', 808 ':pisces:', 809 ':ophiuchus:', 810 ':six_pointed_star:', 811 ':negative_squared_cross_mark:', 812 ':a:', 813 ':b:', 814 ':ab:', 815 ':o2:', 816 ':diamond_shape_with_a_dot_inside:', 817 ':recycle:', 818 ':end:', 819 ':back:', 820 ':on:', 821 ':soon:', 822 ':clock1:', 823 ':clock130:', 824 ':clock10:', 825 ':clock1030:', 826 ':clock11:', 827 ':clock1130:', 828 ':clock12:', 829 ':clock1230:', 830 ':clock2:', 831 ':clock230:', 832 ':clock3:', 833 ':clock330:', 834 ':clock4:', 835 ':clock430:', 836 ':clock5:', 837 ':clock530:', 838 ':clock6:', 839 ':clock630:', 840 ':clock7:', 841 ':clock730:', 842 ':clock8:', 843 ':clock830:', 844 ':clock9:', 845 ':clock930:', 846 ':heavy_dollar_sign:', 847 ':copyright:', 848 ':registered:', 849 ':tm:', 850 ':x:', 851 ':heavy_exclamation_mark:', 852 ':bangbang:', 853 ':interrobang:', 854 ':o:', 855 ':heavy_multiplication_x:', 856 ':heavy_plus_sign:', 857 ':heavy_minus_sign:', 858 ':heavy_division_sign:', 859 ':white_flower:', 860 ':100:', 861 ':heavy_check_mark:', 862 ':ballot_box_with_check:', 863 ':radio_button:', 864 ':link:', 865 ':curly_loop:', 866 ':wavy_dash:', 867 ':part_alternation_mark:', 868 ':trident:', 869 ':black_small_square:', 870 ':white_small_square:', 871 ':black_medium_small_square:', 872 ':white_medium_small_square:', 873 ':black_medium_square:', 874 ':white_medium_square:', 875 ':white_large_square:', 876 ':white_check_mark:', 877 ':black_square_button:', 878 ':white_square_button:', 879 ':black_circle:', 880 ':white_circle:', 881 ':red_circle:', 882 ':large_blue_circle:', 883 ':large_blue_diamond:', 884 ':large_orange_diamond:', 885 ':small_blue_diamond:', 886 ':small_orange_diamond:', 887 ':small_red_triangle:', 888 ':small_red_triangle_down:', 889 ':shipit:' 890 ] 891 }; 892 893 // Add all emoji in a dropdown 894 $.extend(true, $.trumbowyg, { 895 langs: { 896 // jshint camelcase:false 897 en: { 898 emoji: 'Add an emoji' 899 }, 900 fr: { 901 emoji: 'Ajouter un emoji' 902 }, 903 zh_cn: { 904 emoji: '添加表情' 905 }, 906 ru: { 907 emoji: 'Вставить emoji' 908 }, 909 ja: { 910 emoji: '絵文字の挿入' 911 } 912 }, 913 // jshint camelcase:true 914 plugins: { 915 emoji: { 916 init: function (trumbowyg) { 917 trumbowyg.o.plugins.emoji = trumbowyg.o.plugins.emoji || defaultOptions; 918 var emojiBtnDef = { 919 dropdown: buildDropdown(trumbowyg) 920 }; 921 trumbowyg.addBtnDef('emoji', emojiBtnDef); 922 } 923 } 924 } 925 }); 926 927 function buildDropdown(trumbowyg) { 928 var dropdown = []; 929 930 $.each(trumbowyg.o.plugins.emoji.emojiList, function (i, emoji) { 931 if ($.isArray(emoji)) { // Custom emoji behaviour 932 var emojiCode = emoji[0], 933 emojiUrl = emoji[1], 934 emojiHtml = '<img src="' + emojiUrl + '" alt="' + emojiCode + '">', 935 customEmojiBtnName = 'emoji-' + emojiCode.replace(/:/g, ''), 936 customEmojiBtnDef = { 937 hasIcon: false, 938 text: emojiHtml, 939 fn: function () { 940 trumbowyg.execCmd('insertImage', emojiUrl, false, true); 941 return true; 942 } 943 }; 944 945 trumbowyg.addBtnDef(customEmojiBtnName, customEmojiBtnDef); 946 dropdown.push(customEmojiBtnName); 947 } else { // Default behaviour 948 var btn = emoji.replace(/:/g, ''), 949 defaultEmojiBtnName = 'emoji-' + btn, 950 defaultEmojiBtnDef = { 951 text: emoji, 952 fn: function () { 953 trumbowyg.execCmd('insertText', emoji); 954 return true; 955 } 956 }; 957 958 trumbowyg.addBtnDef(defaultEmojiBtnName, defaultEmojiBtnDef); 959 dropdown.push(defaultEmojiBtnName); 960 } 961 }); 962 963 return dropdown; 964 } 965 })(jQuery);