easy-emoji 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +2 -0
- data/LICENSE +22 -0
- data/README.md +82 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/easy-emoji/config.js +30 -0
- data/app/assets/javascripts/easy-emoji/emoji.js +165 -0
- data/app/assets/javascripts/easy-emoji/emojify.js +4 -0
- data/app/assets/javascripts/easy-emoji/index.js +3 -0
- data/app/assets/javascripts/easy-emoji/textcomplete.js +744 -0
- data/app/assets/javascripts/emoji-normal.js +30 -0
- data/app/assets/javascripts/emoji-pjax.js +32 -0
- data/app/assets/javascripts/emoji-turbolinks.js +32 -0
- data/app/assets/stylesheets/easy-emoji.css +6 -0
- data/easy-emoji.gemspec +21 -0
- data/images/emoji/+1.png +0 -0
- data/images/emoji/-1.png +0 -0
- data/images/emoji/100.png +0 -0
- data/images/emoji/109.png +0 -0
- data/images/emoji/1234.png +0 -0
- data/images/emoji/8ball.png +0 -0
- data/images/emoji/a.png +0 -0
- data/images/emoji/ab.png +0 -0
- data/images/emoji/abc.png +0 -0
- data/images/emoji/abcd.png +0 -0
- data/images/emoji/accept.png +0 -0
- data/images/emoji/aerial_tramway.png +0 -0
- data/images/emoji/airplane.png +0 -0
- data/images/emoji/alarm_clock.png +0 -0
- data/images/emoji/alien.png +0 -0
- data/images/emoji/ambulance.png +0 -0
- data/images/emoji/anchor.png +0 -0
- data/images/emoji/angel.png +0 -0
- data/images/emoji/anger.png +0 -0
- data/images/emoji/angry.png +0 -0
- data/images/emoji/anguished.png +0 -0
- data/images/emoji/ant.png +0 -0
- data/images/emoji/apple.png +0 -0
- data/images/emoji/aquarius.png +0 -0
- data/images/emoji/aries.png +0 -0
- data/images/emoji/arrow_backward.png +0 -0
- data/images/emoji/arrow_double_down.png +0 -0
- data/images/emoji/arrow_double_up.png +0 -0
- data/images/emoji/arrow_down.png +0 -0
- data/images/emoji/arrow_down_small.png +0 -0
- data/images/emoji/arrow_forward.png +0 -0
- data/images/emoji/arrow_heading_down.png +0 -0
- data/images/emoji/arrow_heading_up.png +0 -0
- data/images/emoji/arrow_left.png +0 -0
- data/images/emoji/arrow_lower_left.png +0 -0
- data/images/emoji/arrow_lower_right.png +0 -0
- data/images/emoji/arrow_right.png +0 -0
- data/images/emoji/arrow_right_hook.png +0 -0
- data/images/emoji/arrow_up.png +0 -0
- data/images/emoji/arrow_up_down.png +0 -0
- data/images/emoji/arrow_up_small.png +0 -0
- data/images/emoji/arrow_upper_left.png +0 -0
- data/images/emoji/arrow_upper_right.png +0 -0
- data/images/emoji/arrows_clockwise.png +0 -0
- data/images/emoji/arrows_counterclockwise.png +0 -0
- data/images/emoji/art.png +0 -0
- data/images/emoji/articulated_lorry.png +0 -0
- data/images/emoji/astonished.png +0 -0
- data/images/emoji/atm.png +0 -0
- data/images/emoji/b.png +0 -0
- data/images/emoji/baby.png +0 -0
- data/images/emoji/baby_bottle.png +0 -0
- data/images/emoji/baby_chick.png +0 -0
- data/images/emoji/baby_symbol.png +0 -0
- data/images/emoji/baggage_claim.png +0 -0
- data/images/emoji/balloon.png +0 -0
- data/images/emoji/ballot_box_with_check.png +0 -0
- data/images/emoji/bamboo.png +0 -0
- data/images/emoji/banana.png +0 -0
- data/images/emoji/bangbang.png +0 -0
- data/images/emoji/bank.png +0 -0
- data/images/emoji/bar_chart.png +0 -0
- data/images/emoji/barber.png +0 -0
- data/images/emoji/baseball.png +0 -0
- data/images/emoji/basketball.png +0 -0
- data/images/emoji/bath.png +0 -0
- data/images/emoji/bathtub.png +0 -0
- data/images/emoji/battery.png +0 -0
- data/images/emoji/bear.png +0 -0
- data/images/emoji/bee.png +0 -0
- data/images/emoji/beer.png +0 -0
- data/images/emoji/beers.png +0 -0
- data/images/emoji/beetle.png +0 -0
- data/images/emoji/beginner.png +0 -0
- data/images/emoji/bell.png +0 -0
- data/images/emoji/bento.png +0 -0
- data/images/emoji/bicyclist.png +0 -0
- data/images/emoji/bike.png +0 -0
- data/images/emoji/bikini.png +0 -0
- data/images/emoji/bird.png +0 -0
- data/images/emoji/birthday.png +0 -0
- data/images/emoji/black_circle.png +0 -0
- data/images/emoji/black_joker.png +0 -0
- data/images/emoji/black_nib.png +0 -0
- data/images/emoji/black_square.png +0 -0
- data/images/emoji/black_square_button.png +0 -0
- data/images/emoji/blossom.png +0 -0
- data/images/emoji/blowfish.png +0 -0
- data/images/emoji/blue_book.png +0 -0
- data/images/emoji/blue_car.png +0 -0
- data/images/emoji/blue_heart.png +0 -0
- data/images/emoji/blush.png +0 -0
- data/images/emoji/boar.png +0 -0
- data/images/emoji/boat.png +0 -0
- data/images/emoji/bomb.png +0 -0
- data/images/emoji/book.png +0 -0
- data/images/emoji/bookmark.png +0 -0
- data/images/emoji/bookmark_tabs.png +0 -0
- data/images/emoji/books.png +0 -0
- data/images/emoji/boom.png +0 -0
- data/images/emoji/boot.png +0 -0
- data/images/emoji/bouquet.png +0 -0
- data/images/emoji/bow.png +0 -0
- data/images/emoji/bowling.png +0 -0
- data/images/emoji/bowtie.png +0 -0
- data/images/emoji/boy.png +0 -0
- data/images/emoji/bread.png +0 -0
- data/images/emoji/bride_with_veil.png +0 -0
- data/images/emoji/bridge_at_night.png +0 -0
- data/images/emoji/briefcase.png +0 -0
- data/images/emoji/broken_heart.png +0 -0
- data/images/emoji/bug.png +0 -0
- data/images/emoji/bulb.png +0 -0
- data/images/emoji/bullettrain_front.png +0 -0
- data/images/emoji/bullettrain_side.png +0 -0
- data/images/emoji/bus.png +0 -0
- data/images/emoji/busstop.png +0 -0
- data/images/emoji/bust_in_silhouette.png +0 -0
- data/images/emoji/busts_in_silhouette.png +0 -0
- data/images/emoji/cactus.png +0 -0
- data/images/emoji/cake.png +0 -0
- data/images/emoji/calendar.png +0 -0
- data/images/emoji/calling.png +0 -0
- data/images/emoji/camel.png +0 -0
- data/images/emoji/camera.png +0 -0
- data/images/emoji/cancer.png +0 -0
- data/images/emoji/candy.png +0 -0
- data/images/emoji/capital_abcd.png +0 -0
- data/images/emoji/capricorn.png +0 -0
- data/images/emoji/car.png +0 -0
- data/images/emoji/card_index.png +0 -0
- data/images/emoji/carousel_horse.png +0 -0
- data/images/emoji/cat.png +0 -0
- data/images/emoji/cat2.png +0 -0
- data/images/emoji/cd.png +0 -0
- data/images/emoji/chart.png +0 -0
- data/images/emoji/chart_with_downwards_trend.png +0 -0
- data/images/emoji/chart_with_upwards_trend.png +0 -0
- data/images/emoji/checkered_flag.png +0 -0
- data/images/emoji/cherries.png +0 -0
- data/images/emoji/cherry_blossom.png +0 -0
- data/images/emoji/chestnut.png +0 -0
- data/images/emoji/chicken.png +0 -0
- data/images/emoji/children_crossing.png +0 -0
- data/images/emoji/chocolate_bar.png +0 -0
- data/images/emoji/christmas_tree.png +0 -0
- data/images/emoji/church.png +0 -0
- data/images/emoji/cinema.png +0 -0
- data/images/emoji/circus_tent.png +0 -0
- data/images/emoji/city_sunrise.png +0 -0
- data/images/emoji/city_sunset.png +0 -0
- data/images/emoji/cl.png +0 -0
- data/images/emoji/clap.png +0 -0
- data/images/emoji/clapper.png +0 -0
- data/images/emoji/clipboard.png +0 -0
- data/images/emoji/clock1.png +0 -0
- data/images/emoji/clock10.png +0 -0
- data/images/emoji/clock1030.png +0 -0
- data/images/emoji/clock11.png +0 -0
- data/images/emoji/clock1130.png +0 -0
- data/images/emoji/clock12.png +0 -0
- data/images/emoji/clock1230.png +0 -0
- data/images/emoji/clock130.png +0 -0
- data/images/emoji/clock2.png +0 -0
- data/images/emoji/clock230.png +0 -0
- data/images/emoji/clock3.png +0 -0
- data/images/emoji/clock330.png +0 -0
- data/images/emoji/clock4.png +0 -0
- data/images/emoji/clock430.png +0 -0
- data/images/emoji/clock5.png +0 -0
- data/images/emoji/clock530.png +0 -0
- data/images/emoji/clock6.png +0 -0
- data/images/emoji/clock630.png +0 -0
- data/images/emoji/clock7.png +0 -0
- data/images/emoji/clock730.png +0 -0
- data/images/emoji/clock8.png +0 -0
- data/images/emoji/clock830.png +0 -0
- data/images/emoji/clock9.png +0 -0
- data/images/emoji/clock930.png +0 -0
- data/images/emoji/closed_book.png +0 -0
- data/images/emoji/closed_lock_with_key.png +0 -0
- data/images/emoji/closed_umbrella.png +0 -0
- data/images/emoji/cloud.png +0 -0
- data/images/emoji/clubs.png +0 -0
- data/images/emoji/cn.png +0 -0
- data/images/emoji/cocktail.png +0 -0
- data/images/emoji/coffee.png +0 -0
- data/images/emoji/cold_sweat.png +0 -0
- data/images/emoji/collision.png +0 -0
- data/images/emoji/computer.png +0 -0
- data/images/emoji/confetti_ball.png +0 -0
- data/images/emoji/confounded.png +0 -0
- data/images/emoji/confused.png +0 -0
- data/images/emoji/congratulations.png +0 -0
- data/images/emoji/construction.png +0 -0
- data/images/emoji/construction_worker.png +0 -0
- data/images/emoji/convenience_store.png +0 -0
- data/images/emoji/cookie.png +0 -0
- data/images/emoji/cool.png +0 -0
- data/images/emoji/cop.png +0 -0
- data/images/emoji/copyright.png +0 -0
- data/images/emoji/corn.png +0 -0
- data/images/emoji/couple.png +0 -0
- data/images/emoji/couple_with_heart.png +0 -0
- data/images/emoji/couplekiss.png +0 -0
- data/images/emoji/cow.png +0 -0
- data/images/emoji/cow2.png +0 -0
- data/images/emoji/credit_card.png +0 -0
- data/images/emoji/crocodile.png +0 -0
- data/images/emoji/crossed_flags.png +0 -0
- data/images/emoji/crown.png +0 -0
- data/images/emoji/cry.png +0 -0
- data/images/emoji/crying_cat_face.png +0 -0
- data/images/emoji/crystal_ball.png +0 -0
- data/images/emoji/cupid.png +0 -0
- data/images/emoji/curly_loop.png +0 -0
- data/images/emoji/currency_exchange.png +0 -0
- data/images/emoji/curry.png +0 -0
- data/images/emoji/custard.png +0 -0
- data/images/emoji/customs.png +0 -0
- data/images/emoji/cyclone.png +0 -0
- data/images/emoji/dancer.png +0 -0
- data/images/emoji/dancers.png +0 -0
- data/images/emoji/dango.png +0 -0
- data/images/emoji/dart.png +0 -0
- data/images/emoji/dash.png +0 -0
- data/images/emoji/date.png +0 -0
- data/images/emoji/de.png +0 -0
- data/images/emoji/deciduous_tree.png +0 -0
- data/images/emoji/department_store.png +0 -0
- data/images/emoji/diamond_shape_with_a_dot_inside.png +0 -0
- data/images/emoji/diamonds.png +0 -0
- data/images/emoji/disappointed.png +0 -0
- data/images/emoji/disappointed_relieved.png +0 -0
- data/images/emoji/dizzy.png +0 -0
- data/images/emoji/dizzy_face.png +0 -0
- data/images/emoji/do_not_litter.png +0 -0
- data/images/emoji/dog.png +0 -0
- data/images/emoji/dog2.png +0 -0
- data/images/emoji/dollar.png +0 -0
- data/images/emoji/dolls.png +0 -0
- data/images/emoji/dolphin.png +0 -0
- data/images/emoji/donut.png +0 -0
- data/images/emoji/door.png +0 -0
- data/images/emoji/doughnut.png +0 -0
- data/images/emoji/dragon.png +0 -0
- data/images/emoji/dragon_face.png +0 -0
- data/images/emoji/dress.png +0 -0
- data/images/emoji/dromedary_camel.png +0 -0
- data/images/emoji/droplet.png +0 -0
- data/images/emoji/dvd.png +0 -0
- data/images/emoji/e-mail.png +0 -0
- data/images/emoji/ear.png +0 -0
- data/images/emoji/ear_of_rice.png +0 -0
- data/images/emoji/earth_africa.png +0 -0
- data/images/emoji/earth_americas.png +0 -0
- data/images/emoji/earth_asia.png +0 -0
- data/images/emoji/egg.png +0 -0
- data/images/emoji/eggplant.png +0 -0
- data/images/emoji/eight.png +0 -0
- data/images/emoji/eight_pointed_black_star.png +0 -0
- data/images/emoji/eight_spoked_asterisk.png +0 -0
- data/images/emoji/electric_plug.png +0 -0
- data/images/emoji/elephant.png +0 -0
- data/images/emoji/email.png +0 -0
- data/images/emoji/emojify.css +1 -0
- data/images/emoji/end.png +0 -0
- data/images/emoji/envelope.png +0 -0
- data/images/emoji/es.png +0 -0
- data/images/emoji/euro.png +0 -0
- data/images/emoji/european_castle.png +0 -0
- data/images/emoji/european_post_office.png +0 -0
- data/images/emoji/evergreen_tree.png +0 -0
- data/images/emoji/exclamation.png +0 -0
- data/images/emoji/expressionless.png +0 -0
- data/images/emoji/eyeglasses.png +0 -0
- data/images/emoji/eyes.png +0 -0
- data/images/emoji/facepunch.png +0 -0
- data/images/emoji/factory.png +0 -0
- data/images/emoji/fallen_leaf.png +0 -0
- data/images/emoji/family.png +0 -0
- data/images/emoji/fast_forward.png +0 -0
- data/images/emoji/fax.png +0 -0
- data/images/emoji/fearful.png +0 -0
- data/images/emoji/feelsgood.png +0 -0
- data/images/emoji/feet.png +0 -0
- data/images/emoji/ferris_wheel.png +0 -0
- data/images/emoji/file_folder.png +0 -0
- data/images/emoji/finnadie.png +0 -0
- data/images/emoji/fire.png +0 -0
- data/images/emoji/fire_engine.png +0 -0
- data/images/emoji/fireworks.png +0 -0
- data/images/emoji/first_quarter_moon.png +0 -0
- data/images/emoji/first_quarter_moon_with_face.png +0 -0
- data/images/emoji/fish.png +0 -0
- data/images/emoji/fish_cake.png +0 -0
- data/images/emoji/fishing_pole_and_fish.png +0 -0
- data/images/emoji/fist.png +0 -0
- data/images/emoji/five.png +0 -0
- data/images/emoji/flags.png +0 -0
- data/images/emoji/flashlight.png +0 -0
- data/images/emoji/floppy_disk.png +0 -0
- data/images/emoji/flower_playing_cards.png +0 -0
- data/images/emoji/flushed.png +0 -0
- data/images/emoji/foggy.png +0 -0
- data/images/emoji/football.png +0 -0
- data/images/emoji/fork_and_knife.png +0 -0
- data/images/emoji/fountain.png +0 -0
- data/images/emoji/four.png +0 -0
- data/images/emoji/four_leaf_clover.png +0 -0
- data/images/emoji/fr.png +0 -0
- data/images/emoji/free.png +0 -0
- data/images/emoji/fried_shrimp.png +0 -0
- data/images/emoji/fries.png +0 -0
- data/images/emoji/frog.png +0 -0
- data/images/emoji/frowning.png +0 -0
- data/images/emoji/fu.png +0 -0
- data/images/emoji/fuelpump.png +0 -0
- data/images/emoji/full_moon.png +0 -0
- data/images/emoji/full_moon_with_face.png +0 -0
- data/images/emoji/game_die.png +0 -0
- data/images/emoji/gb.png +0 -0
- data/images/emoji/gem.png +0 -0
- data/images/emoji/gemini.png +0 -0
- data/images/emoji/ghost.png +0 -0
- data/images/emoji/gift.png +0 -0
- data/images/emoji/gift_heart.png +0 -0
- data/images/emoji/girl.png +0 -0
- data/images/emoji/globe_with_meridians.png +0 -0
- data/images/emoji/goat.png +0 -0
- data/images/emoji/goberserk.png +0 -0
- data/images/emoji/godmode.png +0 -0
- data/images/emoji/golf.png +0 -0
- data/images/emoji/grapes.png +0 -0
- data/images/emoji/green_apple.png +0 -0
- data/images/emoji/green_book.png +0 -0
- data/images/emoji/green_heart.png +0 -0
- data/images/emoji/grey_exclamation.png +0 -0
- data/images/emoji/grey_question.png +0 -0
- data/images/emoji/grimacing.png +0 -0
- data/images/emoji/grin.png +0 -0
- data/images/emoji/grinning.png +0 -0
- data/images/emoji/guardsman.png +0 -0
- data/images/emoji/guitar.png +0 -0
- data/images/emoji/gun.png +0 -0
- data/images/emoji/haircut.png +0 -0
- data/images/emoji/hamburger.png +0 -0
- data/images/emoji/hammer.png +0 -0
- data/images/emoji/hamster.png +0 -0
- data/images/emoji/hand.png +0 -0
- data/images/emoji/handbag.png +0 -0
- data/images/emoji/hankey.png +0 -0
- data/images/emoji/hash.png +0 -0
- data/images/emoji/hatched_chick.png +0 -0
- data/images/emoji/hatching_chick.png +0 -0
- data/images/emoji/headphones.png +0 -0
- data/images/emoji/hear_no_evil.png +0 -0
- data/images/emoji/heart.png +0 -0
- data/images/emoji/heart_decoration.png +0 -0
- data/images/emoji/heart_eyes.png +0 -0
- data/images/emoji/heart_eyes_cat.png +0 -0
- data/images/emoji/heartbeat.png +0 -0
- data/images/emoji/heartpulse.png +0 -0
- data/images/emoji/hearts.png +0 -0
- data/images/emoji/heavy_check_mark.png +0 -0
- data/images/emoji/heavy_division_sign.png +0 -0
- data/images/emoji/heavy_dollar_sign.png +0 -0
- data/images/emoji/heavy_exclamation_mark.png +0 -0
- data/images/emoji/heavy_minus_sign.png +0 -0
- data/images/emoji/heavy_multiplication_x.png +0 -0
- data/images/emoji/heavy_plus_sign.png +0 -0
- data/images/emoji/helicopter.png +0 -0
- data/images/emoji/herb.png +0 -0
- data/images/emoji/hibiscus.png +0 -0
- data/images/emoji/high_brightness.png +0 -0
- data/images/emoji/high_heel.png +0 -0
- data/images/emoji/hocho.png +0 -0
- data/images/emoji/honey_pot.png +0 -0
- data/images/emoji/honeybee.png +0 -0
- data/images/emoji/horse.png +0 -0
- data/images/emoji/horse_racing.png +0 -0
- data/images/emoji/hospital.png +0 -0
- data/images/emoji/hotel.png +0 -0
- data/images/emoji/hotsprings.png +0 -0
- data/images/emoji/hourglass.png +0 -0
- data/images/emoji/hourglass_flowing_sand.png +0 -0
- data/images/emoji/house.png +0 -0
- data/images/emoji/house_with_garden.png +0 -0
- data/images/emoji/hurtrealbad.png +0 -0
- data/images/emoji/hushed.png +0 -0
- data/images/emoji/ice_cream.png +0 -0
- data/images/emoji/icecream.png +0 -0
- data/images/emoji/id.png +0 -0
- data/images/emoji/ideograph_advantage.png +0 -0
- data/images/emoji/imp.png +0 -0
- data/images/emoji/inbox_tray.png +0 -0
- data/images/emoji/incoming_envelope.png +0 -0
- data/images/emoji/information_desk_person.png +0 -0
- data/images/emoji/information_source.png +0 -0
- data/images/emoji/innocent.png +0 -0
- data/images/emoji/interrobang.png +0 -0
- data/images/emoji/iphone.png +0 -0
- data/images/emoji/it.png +0 -0
- data/images/emoji/izakaya_lantern.png +0 -0
- data/images/emoji/jack_o_lantern.png +0 -0
- data/images/emoji/japan.png +0 -0
- data/images/emoji/japanese_castle.png +0 -0
- data/images/emoji/japanese_goblin.png +0 -0
- data/images/emoji/japanese_ogre.png +0 -0
- data/images/emoji/jeans.png +0 -0
- data/images/emoji/joy.png +0 -0
- data/images/emoji/joy_cat.png +0 -0
- data/images/emoji/jp.png +0 -0
- data/images/emoji/key.png +0 -0
- data/images/emoji/keycap_ten.png +0 -0
- data/images/emoji/kimono.png +0 -0
- data/images/emoji/kiss.png +0 -0
- data/images/emoji/kissing.png +0 -0
- data/images/emoji/kissing_cat.png +0 -0
- data/images/emoji/kissing_closed_eyes.png +0 -0
- data/images/emoji/kissing_face.png +0 -0
- data/images/emoji/kissing_heart.png +0 -0
- data/images/emoji/kissing_smiling_eyes.png +0 -0
- data/images/emoji/koala.png +0 -0
- data/images/emoji/koko.png +0 -0
- data/images/emoji/kr.png +0 -0
- data/images/emoji/large_blue_circle.png +0 -0
- data/images/emoji/large_blue_diamond.png +0 -0
- data/images/emoji/large_orange_diamond.png +0 -0
- data/images/emoji/last_quarter_moon.png +0 -0
- data/images/emoji/last_quarter_moon_with_face.png +0 -0
- data/images/emoji/laughing.png +0 -0
- data/images/emoji/leaves.png +0 -0
- data/images/emoji/ledger.png +0 -0
- data/images/emoji/left_luggage.png +0 -0
- data/images/emoji/left_right_arrow.png +0 -0
- data/images/emoji/leftwards_arrow_with_hook.png +0 -0
- data/images/emoji/lemon.png +0 -0
- data/images/emoji/leo.png +0 -0
- data/images/emoji/leopard.png +0 -0
- data/images/emoji/libra.png +0 -0
- data/images/emoji/light_rail.png +0 -0
- data/images/emoji/link.png +0 -0
- data/images/emoji/lips.png +0 -0
- data/images/emoji/lipstick.png +0 -0
- data/images/emoji/lock.png +0 -0
- data/images/emoji/lock_with_ink_pen.png +0 -0
- data/images/emoji/lollipop.png +0 -0
- data/images/emoji/loop.png +0 -0
- data/images/emoji/loudspeaker.png +0 -0
- data/images/emoji/love_hotel.png +0 -0
- data/images/emoji/love_letter.png +0 -0
- data/images/emoji/low_brightness.png +0 -0
- data/images/emoji/m.png +0 -0
- data/images/emoji/mag.png +0 -0
- data/images/emoji/mag_right.png +0 -0
- data/images/emoji/mahjong.png +0 -0
- data/images/emoji/mailbox.png +0 -0
- data/images/emoji/mailbox_closed.png +0 -0
- data/images/emoji/mailbox_with_mail.png +0 -0
- data/images/emoji/mailbox_with_no_mail.png +0 -0
- data/images/emoji/man.png +0 -0
- data/images/emoji/man_with_gua_pi_mao.png +0 -0
- data/images/emoji/man_with_turban.png +0 -0
- data/images/emoji/mans_shoe.png +0 -0
- data/images/emoji/maple_leaf.png +0 -0
- data/images/emoji/mask.png +0 -0
- data/images/emoji/massage.png +0 -0
- data/images/emoji/meat_on_bone.png +0 -0
- data/images/emoji/mega.png +0 -0
- data/images/emoji/melon.png +0 -0
- data/images/emoji/memo.png +0 -0
- data/images/emoji/mens.png +0 -0
- data/images/emoji/metal.png +0 -0
- data/images/emoji/metro.png +0 -0
- data/images/emoji/microphone.png +0 -0
- data/images/emoji/microscope.png +0 -0
- data/images/emoji/milky_way.png +0 -0
- data/images/emoji/minibus.png +0 -0
- data/images/emoji/minidisc.png +0 -0
- data/images/emoji/mobile_phone_off.png +0 -0
- data/images/emoji/money_with_wings.png +0 -0
- data/images/emoji/moneybag.png +0 -0
- data/images/emoji/monkey.png +0 -0
- data/images/emoji/monkey_face.png +0 -0
- data/images/emoji/monorail.png +0 -0
- data/images/emoji/moon.png +0 -0
- data/images/emoji/mortar_board.png +0 -0
- data/images/emoji/mount_fuji.png +0 -0
- data/images/emoji/mountain_bicyclist.png +0 -0
- data/images/emoji/mountain_cableway.png +0 -0
- data/images/emoji/mountain_railway.png +0 -0
- data/images/emoji/mouse.png +0 -0
- data/images/emoji/mouse2.png +0 -0
- data/images/emoji/movie_camera.png +0 -0
- data/images/emoji/moyai.png +0 -0
- data/images/emoji/muscle.png +0 -0
- data/images/emoji/mushroom.png +0 -0
- data/images/emoji/musical_keyboard.png +0 -0
- data/images/emoji/musical_note.png +0 -0
- data/images/emoji/musical_score.png +0 -0
- data/images/emoji/mute.png +0 -0
- data/images/emoji/nail_care.png +0 -0
- data/images/emoji/name_badge.png +0 -0
- data/images/emoji/neckbeard.png +0 -0
- data/images/emoji/necktie.png +0 -0
- data/images/emoji/negative_squared_cross_mark.png +0 -0
- data/images/emoji/neutral_face.png +0 -0
- data/images/emoji/new.png +0 -0
- data/images/emoji/new_moon.png +0 -0
- data/images/emoji/new_moon_with_face.png +0 -0
- data/images/emoji/newspaper.png +0 -0
- data/images/emoji/ng.png +0 -0
- data/images/emoji/nine.png +0 -0
- data/images/emoji/no_bell.png +0 -0
- data/images/emoji/no_bicycles.png +0 -0
- data/images/emoji/no_entry.png +0 -0
- data/images/emoji/no_entry_sign.png +0 -0
- data/images/emoji/no_good.png +0 -0
- data/images/emoji/no_mobile_phones.png +0 -0
- data/images/emoji/no_mouth.png +0 -0
- data/images/emoji/no_pedestrians.png +0 -0
- data/images/emoji/no_smoking.png +0 -0
- data/images/emoji/non-potable_water.png +0 -0
- data/images/emoji/nose.png +0 -0
- data/images/emoji/notebook.png +0 -0
- data/images/emoji/notebook_with_decorative_cover.png +0 -0
- data/images/emoji/notes.png +0 -0
- data/images/emoji/nut_and_bolt.png +0 -0
- data/images/emoji/o.png +0 -0
- data/images/emoji/o2.png +0 -0
- data/images/emoji/ocean.png +0 -0
- data/images/emoji/octocat.png +0 -0
- data/images/emoji/octopus.png +0 -0
- data/images/emoji/oden.png +0 -0
- data/images/emoji/office.png +0 -0
- data/images/emoji/ok.png +0 -0
- data/images/emoji/ok_hand.png +0 -0
- data/images/emoji/ok_woman.png +0 -0
- data/images/emoji/older_man.png +0 -0
- data/images/emoji/older_woman.png +0 -0
- data/images/emoji/on.png +0 -0
- data/images/emoji/oncoming_automobile.png +0 -0
- data/images/emoji/oncoming_bus.png +0 -0
- data/images/emoji/oncoming_police_car.png +0 -0
- data/images/emoji/oncoming_taxi.png +0 -0
- data/images/emoji/one.png +0 -0
- data/images/emoji/open_file_folder.png +0 -0
- data/images/emoji/open_hands.png +0 -0
- data/images/emoji/open_mouth.png +0 -0
- data/images/emoji/ophiuchus.png +0 -0
- data/images/emoji/orange_book.png +0 -0
- data/images/emoji/outbox_tray.png +0 -0
- data/images/emoji/ox.png +0 -0
- data/images/emoji/page_facing_up.png +0 -0
- data/images/emoji/page_with_curl.png +0 -0
- data/images/emoji/pager.png +0 -0
- data/images/emoji/palm_tree.png +0 -0
- data/images/emoji/panda_face.png +0 -0
- data/images/emoji/paperclip.png +0 -0
- data/images/emoji/parking.png +0 -0
- data/images/emoji/part_alternation_mark.png +0 -0
- data/images/emoji/partly_sunny.png +0 -0
- data/images/emoji/passport_control.png +0 -0
- data/images/emoji/paw_prints.png +0 -0
- data/images/emoji/peach.png +0 -0
- data/images/emoji/pear.png +0 -0
- data/images/emoji/pencil.png +0 -0
- data/images/emoji/pencil2.png +0 -0
- data/images/emoji/penguin.png +0 -0
- data/images/emoji/pensive.png +0 -0
- data/images/emoji/performing_arts.png +0 -0
- data/images/emoji/persevere.png +0 -0
- data/images/emoji/person_frowning.png +0 -0
- data/images/emoji/person_with_blond_hair.png +0 -0
- data/images/emoji/person_with_pouting_face.png +0 -0
- data/images/emoji/phone.png +0 -0
- data/images/emoji/pig.png +0 -0
- data/images/emoji/pig2.png +0 -0
- data/images/emoji/pig_nose.png +0 -0
- data/images/emoji/pill.png +0 -0
- data/images/emoji/pineapple.png +0 -0
- data/images/emoji/pisces.png +0 -0
- data/images/emoji/pizza.png +0 -0
- data/images/emoji/plus1.png +0 -0
- data/images/emoji/point_down.png +0 -0
- data/images/emoji/point_left.png +0 -0
- data/images/emoji/point_right.png +0 -0
- data/images/emoji/point_up.png +0 -0
- data/images/emoji/point_up_2.png +0 -0
- data/images/emoji/police_car.png +0 -0
- data/images/emoji/poodle.png +0 -0
- data/images/emoji/poop.png +0 -0
- data/images/emoji/post_office.png +0 -0
- data/images/emoji/postal_horn.png +0 -0
- data/images/emoji/postbox.png +0 -0
- data/images/emoji/potable_water.png +0 -0
- data/images/emoji/pouch.png +0 -0
- data/images/emoji/poultry_leg.png +0 -0
- data/images/emoji/pound.png +0 -0
- data/images/emoji/pouting_cat.png +0 -0
- data/images/emoji/pray.png +0 -0
- data/images/emoji/princess.png +0 -0
- data/images/emoji/punch.png +0 -0
- data/images/emoji/purple_heart.png +0 -0
- data/images/emoji/purse.png +0 -0
- data/images/emoji/pushpin.png +0 -0
- data/images/emoji/put_litter_in_its_place.png +0 -0
- data/images/emoji/question.png +0 -0
- data/images/emoji/rabbit.png +0 -0
- data/images/emoji/rabbit2.png +0 -0
- data/images/emoji/racehorse.png +0 -0
- data/images/emoji/radio.png +0 -0
- data/images/emoji/radio_button.png +0 -0
- data/images/emoji/rage.png +0 -0
- data/images/emoji/rage1.png +0 -0
- data/images/emoji/rage2.png +0 -0
- data/images/emoji/rage3.png +0 -0
- data/images/emoji/rage4.png +0 -0
- data/images/emoji/railway_car.png +0 -0
- data/images/emoji/rainbow.png +0 -0
- data/images/emoji/raised_hand.png +0 -0
- data/images/emoji/raised_hands.png +0 -0
- data/images/emoji/raising_hand.png +0 -0
- data/images/emoji/ram.png +0 -0
- data/images/emoji/ramen.png +0 -0
- data/images/emoji/rat.png +0 -0
- data/images/emoji/recycle.png +0 -0
- data/images/emoji/red_car.png +0 -0
- data/images/emoji/red_circle.png +0 -0
- data/images/emoji/registered.png +0 -0
- data/images/emoji/relaxed.png +0 -0
- data/images/emoji/relieved.png +0 -0
- data/images/emoji/repeat.png +0 -0
- data/images/emoji/repeat_one.png +0 -0
- data/images/emoji/restroom.png +0 -0
- data/images/emoji/revolving_hearts.png +0 -0
- data/images/emoji/rewind.png +0 -0
- data/images/emoji/ribbon.png +0 -0
- data/images/emoji/rice.png +0 -0
- data/images/emoji/rice_ball.png +0 -0
- data/images/emoji/rice_cracker.png +0 -0
- data/images/emoji/rice_scene.png +0 -0
- data/images/emoji/ring.png +0 -0
- data/images/emoji/rocket.png +0 -0
- data/images/emoji/roller_coaster.png +0 -0
- data/images/emoji/rooster.png +0 -0
- data/images/emoji/rose.png +0 -0
- data/images/emoji/rotating_light.png +0 -0
- data/images/emoji/round_pushpin.png +0 -0
- data/images/emoji/rowboat.png +0 -0
- data/images/emoji/ru.png +0 -0
- data/images/emoji/rugby_football.png +0 -0
- data/images/emoji/runner.png +0 -0
- data/images/emoji/running.png +0 -0
- data/images/emoji/running_shirt_with_sash.png +0 -0
- data/images/emoji/sa.png +0 -0
- data/images/emoji/sagittarius.png +0 -0
- data/images/emoji/sailboat.png +0 -0
- data/images/emoji/sake.png +0 -0
- data/images/emoji/sandal.png +0 -0
- data/images/emoji/santa.png +0 -0
- data/images/emoji/satellite.png +0 -0
- data/images/emoji/satisfied.png +0 -0
- data/images/emoji/saxophone.png +0 -0
- data/images/emoji/school.png +0 -0
- data/images/emoji/school_satchel.png +0 -0
- data/images/emoji/scissors.png +0 -0
- data/images/emoji/scorpius.png +0 -0
- data/images/emoji/scream.png +0 -0
- data/images/emoji/scream_cat.png +0 -0
- data/images/emoji/scroll.png +0 -0
- data/images/emoji/seat.png +0 -0
- data/images/emoji/secret.png +0 -0
- data/images/emoji/see_no_evil.png +0 -0
- data/images/emoji/seedling.png +0 -0
- data/images/emoji/seven.png +0 -0
- data/images/emoji/shaved_ice.png +0 -0
- data/images/emoji/sheep.png +0 -0
- data/images/emoji/shell.png +0 -0
- data/images/emoji/ship.png +0 -0
- data/images/emoji/shipit.png +0 -0
- data/images/emoji/shirt.png +0 -0
- data/images/emoji/shit.png +0 -0
- data/images/emoji/shoe.png +0 -0
- data/images/emoji/shower.png +0 -0
- data/images/emoji/signal_strength.png +0 -0
- data/images/emoji/six.png +0 -0
- data/images/emoji/six_pointed_star.png +0 -0
- data/images/emoji/ski.png +0 -0
- data/images/emoji/skull.png +0 -0
- data/images/emoji/sleeping.png +0 -0
- data/images/emoji/sleepy.png +0 -0
- data/images/emoji/slot_machine.png +0 -0
- data/images/emoji/small_blue_diamond.png +0 -0
- data/images/emoji/small_orange_diamond.png +0 -0
- data/images/emoji/small_red_triangle.png +0 -0
- data/images/emoji/small_red_triangle_down.png +0 -0
- data/images/emoji/smile.png +0 -0
- data/images/emoji/smile_cat.png +0 -0
- data/images/emoji/smiley.png +0 -0
- data/images/emoji/smiley_cat.png +0 -0
- data/images/emoji/smiling_imp.png +0 -0
- data/images/emoji/smirk.png +0 -0
- data/images/emoji/smirk_cat.png +0 -0
- data/images/emoji/smoking.png +0 -0
- data/images/emoji/snail.png +0 -0
- data/images/emoji/snake.png +0 -0
- data/images/emoji/snowboarder.png +0 -0
- data/images/emoji/snowflake.png +0 -0
- data/images/emoji/snowman.png +0 -0
- data/images/emoji/sob.png +0 -0
- data/images/emoji/soccer.png +0 -0
- data/images/emoji/soon.png +0 -0
- data/images/emoji/sos.png +0 -0
- data/images/emoji/sound.png +0 -0
- data/images/emoji/space_invader.png +0 -0
- data/images/emoji/spades.png +0 -0
- data/images/emoji/spaghetti.png +0 -0
- data/images/emoji/sparkler.png +0 -0
- data/images/emoji/sparkles.png +0 -0
- data/images/emoji/sparkling_heart.png +0 -0
- data/images/emoji/speak_no_evil.png +0 -0
- data/images/emoji/speaker.png +0 -0
- data/images/emoji/speech_balloon.png +0 -0
- data/images/emoji/speedboat.png +0 -0
- data/images/emoji/squirrel.png +0 -0
- data/images/emoji/star.png +0 -0
- data/images/emoji/star2.png +0 -0
- data/images/emoji/stars.png +0 -0
- data/images/emoji/station.png +0 -0
- data/images/emoji/statue_of_liberty.png +0 -0
- data/images/emoji/steam_locomotive.png +0 -0
- data/images/emoji/stew.png +0 -0
- data/images/emoji/straight_ruler.png +0 -0
- data/images/emoji/strawberry.png +0 -0
- data/images/emoji/stuck_out_tongue.png +0 -0
- data/images/emoji/stuck_out_tongue_closed_eyes.png +0 -0
- data/images/emoji/stuck_out_tongue_winking_eye.png +0 -0
- data/images/emoji/sun_with_face.png +0 -0
- data/images/emoji/sunflower.png +0 -0
- data/images/emoji/sunglasses.png +0 -0
- data/images/emoji/sunny.png +0 -0
- data/images/emoji/sunrise.png +0 -0
- data/images/emoji/sunrise_over_mountains.png +0 -0
- data/images/emoji/surfer.png +0 -0
- data/images/emoji/sushi.png +0 -0
- data/images/emoji/suspect.png +0 -0
- data/images/emoji/suspension_railway.png +0 -0
- data/images/emoji/sweat.png +0 -0
- data/images/emoji/sweat_drops.png +0 -0
- data/images/emoji/sweat_smile.png +0 -0
- data/images/emoji/sweet_potato.png +0 -0
- data/images/emoji/swimmer.png +0 -0
- data/images/emoji/symbols.png +0 -0
- data/images/emoji/syringe.png +0 -0
- data/images/emoji/tada.png +0 -0
- data/images/emoji/tanabata_tree.png +0 -0
- data/images/emoji/tangerine.png +0 -0
- data/images/emoji/taurus.png +0 -0
- data/images/emoji/taxi.png +0 -0
- data/images/emoji/tea.png +0 -0
- data/images/emoji/telephone.png +0 -0
- data/images/emoji/telephone_receiver.png +0 -0
- data/images/emoji/telescope.png +0 -0
- data/images/emoji/tennis.png +0 -0
- data/images/emoji/tent.png +0 -0
- data/images/emoji/thought_balloon.png +0 -0
- data/images/emoji/three.png +0 -0
- data/images/emoji/thumbsdown.png +0 -0
- data/images/emoji/thumbsup.png +0 -0
- data/images/emoji/ticket.png +0 -0
- data/images/emoji/tiger.png +0 -0
- data/images/emoji/tiger2.png +0 -0
- data/images/emoji/tired_face.png +0 -0
- data/images/emoji/tm.png +0 -0
- data/images/emoji/toilet.png +0 -0
- data/images/emoji/tokyo_tower.png +0 -0
- data/images/emoji/tomato.png +0 -0
- data/images/emoji/tongue.png +0 -0
- data/images/emoji/top.png +0 -0
- data/images/emoji/tophat.png +0 -0
- data/images/emoji/tractor.png +0 -0
- data/images/emoji/traffic_light.png +0 -0
- data/images/emoji/train.png +0 -0
- data/images/emoji/train2.png +0 -0
- data/images/emoji/tram.png +0 -0
- data/images/emoji/triangular_flag_on_post.png +0 -0
- data/images/emoji/triangular_ruler.png +0 -0
- data/images/emoji/trident.png +0 -0
- data/images/emoji/triumph.png +0 -0
- data/images/emoji/trolleybus.png +0 -0
- data/images/emoji/trollface.png +0 -0
- data/images/emoji/trophy.png +0 -0
- data/images/emoji/tropical_drink.png +0 -0
- data/images/emoji/tropical_fish.png +0 -0
- data/images/emoji/truck.png +0 -0
- data/images/emoji/trumpet.png +0 -0
- data/images/emoji/tshirt.png +0 -0
- data/images/emoji/tulip.png +0 -0
- data/images/emoji/turtle.png +0 -0
- data/images/emoji/tv.png +0 -0
- data/images/emoji/twisted_rightwards_arrows.png +0 -0
- data/images/emoji/two.png +0 -0
- data/images/emoji/two_hearts.png +0 -0
- data/images/emoji/two_men_holding_hands.png +0 -0
- data/images/emoji/two_women_holding_hands.png +0 -0
- data/images/emoji/u5272.png +0 -0
- data/images/emoji/u5408.png +0 -0
- data/images/emoji/u55b6.png +0 -0
- data/images/emoji/u6307.png +0 -0
- data/images/emoji/u6708.png +0 -0
- data/images/emoji/u6709.png +0 -0
- data/images/emoji/u6e80.png +0 -0
- data/images/emoji/u7121.png +0 -0
- data/images/emoji/u7533.png +0 -0
- data/images/emoji/u7981.png +0 -0
- data/images/emoji/u7a7a.png +0 -0
- data/images/emoji/uk.png +0 -0
- data/images/emoji/umbrella.png +0 -0
- data/images/emoji/unamused.png +0 -0
- data/images/emoji/underage.png +0 -0
- data/images/emoji/unlock.png +0 -0
- data/images/emoji/up.png +0 -0
- data/images/emoji/us.png +0 -0
- data/images/emoji/v.png +0 -0
- data/images/emoji/vertical_traffic_light.png +0 -0
- data/images/emoji/vhs.png +0 -0
- data/images/emoji/vibration_mode.png +0 -0
- data/images/emoji/video_camera.png +0 -0
- data/images/emoji/video_game.png +0 -0
- data/images/emoji/violin.png +0 -0
- data/images/emoji/virgo.png +0 -0
- data/images/emoji/volcano.png +0 -0
- data/images/emoji/vs.png +0 -0
- data/images/emoji/walking.png +0 -0
- data/images/emoji/waning_crescent_moon.png +0 -0
- data/images/emoji/waning_gibbous_moon.png +0 -0
- data/images/emoji/warning.png +0 -0
- data/images/emoji/watch.png +0 -0
- data/images/emoji/water_buffalo.png +0 -0
- data/images/emoji/watermelon.png +0 -0
- data/images/emoji/wave.png +0 -0
- data/images/emoji/wavy_dash.png +0 -0
- data/images/emoji/waxing_crescent_moon.png +0 -0
- data/images/emoji/waxing_gibbous_moon.png +0 -0
- data/images/emoji/wc.png +0 -0
- data/images/emoji/weary.png +0 -0
- data/images/emoji/wedding.png +0 -0
- data/images/emoji/whale.png +0 -0
- data/images/emoji/whale2.png +0 -0
- data/images/emoji/wheelchair.png +0 -0
- data/images/emoji/white_check_mark.png +0 -0
- data/images/emoji/white_circle.png +0 -0
- data/images/emoji/white_flower.png +0 -0
- data/images/emoji/white_large_square.png +0 -0
- data/images/emoji/white_square.png +0 -0
- data/images/emoji/white_square_button.png +0 -0
- data/images/emoji/wind_chime.png +0 -0
- data/images/emoji/wine_glass.png +0 -0
- data/images/emoji/wink.png +0 -0
- data/images/emoji/wink2.png +0 -0
- data/images/emoji/wolf.png +0 -0
- data/images/emoji/woman.png +0 -0
- data/images/emoji/womans_clothes.png +0 -0
- data/images/emoji/womans_hat.png +0 -0
- data/images/emoji/womens.png +0 -0
- data/images/emoji/worried.png +0 -0
- data/images/emoji/wrench.png +0 -0
- data/images/emoji/x.png +0 -0
- data/images/emoji/yellow_heart.png +0 -0
- data/images/emoji/yen.png +0 -0
- data/images/emoji/yum.png +0 -0
- data/images/emoji/zap.png +0 -0
- data/images/emoji/zero.png +0 -0
- data/images/emoji/zzz.png +0 -0
- data/lib/easy/emoji.rb +7 -0
- data/lib/easy/emoji/engine.rb +4 -0
- data/lib/easy/emoji/version.rb +3 -0
- data/lib/tasks/emoji.rake +6 -0
- metadata +939 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6ab5b17bc6c0bbbb5f02086e5543d6f54672ebfd
|
4
|
+
data.tar.gz: ea07a24b13b267acab78a79b2a1624fb1773fe58
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 51f6977927297e26fe7b31ac4592db5bcb6700e3416a5dcebdc2c692d21bfe5070dc9fb0210fc7b8ff1b2bdec04eca956ff91cd82189273cbd45bc83a0d21792
|
7
|
+
data.tar.gz: 4fca7035f43d41f75ca2b1743275b59d72d5c3a9af68e28319d90c29d5c150589b5bdae4aa864b9e826f67e56cefc6e0fe735241c962d46dee7ac71df31fe373
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Paul King
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# easy-emoji
|
2
|
+
|
3
|
+
easy-emoji give you a simple way to use emoji in your project.
|
4
|
+
|
5
|
+
## Features
|
6
|
+
* Auto complete emoji keywork when you are typing it on text area.
|
7
|
+
* one-line-code to generate images for emoji.
|
8
|
+
* Support turbolinks and pjax
|
9
|
+
* Easy to use.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'easy-emoji'
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install easy-emoji
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
You basically have to add the requires to the `application.js` file:
|
28
|
+
|
29
|
+
```javascript
|
30
|
+
//= require easy-emoji
|
31
|
+
//= require emoji-turbolinks
|
32
|
+
```
|
33
|
+
The `emoji-turbolinks` is required only if you use turbolinks. Using pjax rather than turbolinks? Simply require `emoji-pjax` instead, Otherwise, use require `emoji-normal` instead.
|
34
|
+
|
35
|
+
Also, into your `application.css` file:
|
36
|
+
|
37
|
+
```css
|
38
|
+
/*
|
39
|
+
*= require easy-emoji
|
40
|
+
*/
|
41
|
+
```
|
42
|
+
|
43
|
+
Something we need to do to generate images for emoji.
|
44
|
+
|
45
|
+
Just like this:
|
46
|
+
|
47
|
+
Into your `Rakefile` file:
|
48
|
+
|
49
|
+
``` ruby
|
50
|
+
load 'tasks/emoji.rake'
|
51
|
+
```
|
52
|
+
And then execute:
|
53
|
+
|
54
|
+
```
|
55
|
+
$ rake emoji
|
56
|
+
```
|
57
|
+
|
58
|
+
Now type in an emoji keyword in your HTML, for example:
|
59
|
+
|
60
|
+
easy-emoji is really easy-to-use. :smile:
|
61
|
+
|
62
|
+
It will show you some good stuff.
|
63
|
+
|
64
|
+
You can see the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.
|
65
|
+
|
66
|
+
## Plugins
|
67
|
+
|
68
|
+
easy-emoji contains two plugins, That's mean you can custom configuration.
|
69
|
+
|
70
|
+
### [Emojify](https://github.com/hassankhan/emojify.js)
|
71
|
+
A Javascript module to convert Emoji keywords to images.
|
72
|
+
|
73
|
+
### [textcomplete](https://github.com/yuku-t/jquery-textcomplete)
|
74
|
+
Introduces autocompleting power to textareas, like a GitHub comment form has.
|
75
|
+
|
76
|
+
## Contributing
|
77
|
+
|
78
|
+
1. Fork it
|
79
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
80
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
81
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
82
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
$(function(){
|
2
|
+
emojify.setConfig({
|
3
|
+
img_dir: '/images/emoji',
|
4
|
+
ignored_tags: {
|
5
|
+
'SCRIPT': 1,
|
6
|
+
'TEXTAREA': 1,
|
7
|
+
'A': 1,
|
8
|
+
'PRE': 1,
|
9
|
+
'CODE': 1
|
10
|
+
}
|
11
|
+
});
|
12
|
+
emojify.run();
|
13
|
+
|
14
|
+
$('textarea').textcomplete([{ // emoji strategy
|
15
|
+
match: /\B:([\-+\w]*)$/,
|
16
|
+
search: function(term, callback) {
|
17
|
+
callback($.map(emojies, function(emoji) {
|
18
|
+
return emoji.indexOf(term) === 0 ? emoji : null;
|
19
|
+
}));
|
20
|
+
},
|
21
|
+
template: function(value) {
|
22
|
+
return '<img src="/images/emoji/' + value + '.png" class="emoji"></img>' + value;
|
23
|
+
},
|
24
|
+
replace: function(value) {
|
25
|
+
return ':' + value + ': ';
|
26
|
+
},
|
27
|
+
index: 1,
|
28
|
+
maxCount: 5
|
29
|
+
}]);
|
30
|
+
});
|
@@ -0,0 +1,165 @@
|
|
1
|
+
|
2
|
+
var emojies = [
|
3
|
+
'+1', '-1', '100', '1234', '8ball', 'a', 'ab', 'abc', 'abcd', 'accept',
|
4
|
+
'aerial_tramway', 'airplane', 'alarm_clock', 'alien', 'ambulance', 'anchor',
|
5
|
+
'angel', 'anger', 'angry', 'anguished', 'ant', 'apple', 'aquarius', 'aries',
|
6
|
+
'arrow_backward', 'arrow_double_down', 'arrow_double_up', 'arrow_down',
|
7
|
+
'arrow_down_small', 'arrow_forward', 'arrow_heading_down',
|
8
|
+
'arrow_heading_up', 'arrow_left', 'arrow_lower_left', 'arrow_lower_right',
|
9
|
+
'arrow_right', 'arrow_right_hook', 'arrow_up', 'arrow_up_down',
|
10
|
+
'arrow_up_small', 'arrow_upper_left', 'arrow_upper_right',
|
11
|
+
'arrows_clockwise', 'arrows_counterclockwise', 'art', 'articulated_lorry',
|
12
|
+
'astonished', 'athletic_shoe', 'atm', 'b', 'baby', 'baby_bottle',
|
13
|
+
'baby_chick', 'baby_symbol', 'back', 'baggage_claim', 'balloon',
|
14
|
+
'ballot_box_with_check', 'bamboo', 'banana', 'bangbang', 'bank', 'bar_chart',
|
15
|
+
'barber', 'baseball', 'basketball', 'bath', 'bathtub', 'battery', 'bear',
|
16
|
+
'bee', 'beer', 'beers', 'beetle', 'beginner', 'bell', 'bento', 'bicyclist',
|
17
|
+
'bike', 'bikini', 'bird', 'birthday', 'black_circle', 'black_joker',
|
18
|
+
'black_large_square', 'black_medium_small_square', 'black_medium_square',
|
19
|
+
'black_nib', 'black_small_square', 'black_square_button', 'blossom',
|
20
|
+
'blowfish', 'blue_book', 'blue_car', 'blue_heart', 'blush', 'boar', 'boat',
|
21
|
+
'bomb', 'book', 'bookmark', 'bookmark_tabs', 'books', 'boom', 'boot',
|
22
|
+
'bouquet', 'bow', 'bowling', 'bowtie', 'boy', 'bread', 'bride_with_veil',
|
23
|
+
'bridge_at_night', 'briefcase', 'broken_heart', 'bug', 'bulb',
|
24
|
+
'bullettrain_front', 'bullettrain_side', 'bus', 'busstop',
|
25
|
+
'bust_in_silhouette', 'busts_in_silhouette', 'cactus', 'cake', 'calendar',
|
26
|
+
'calling', 'camel', 'camera', 'cancer', 'candy', 'capital_abcd', 'capricorn',
|
27
|
+
'car', 'card_index', 'carousel_horse', 'cat', 'cat2', 'cd', 'chart',
|
28
|
+
'chart_with_downwards_trend', 'chart_with_upwards_trend', 'checkered_flag',
|
29
|
+
'cherries', 'cherry_blossom', 'chestnut', 'chicken', 'children_crossing',
|
30
|
+
'chocolate_bar', 'christmas_tree', 'church', 'cinema', 'circus_tent',
|
31
|
+
'city_sunrise', 'city_sunset', 'cl', 'clap', 'clapper', 'clipboard',
|
32
|
+
'clock1', 'clock10', 'clock1030', 'clock11', 'clock1130', 'clock12',
|
33
|
+
'clock1230', 'clock130', 'clock2', 'clock230', 'clock3', 'clock330',
|
34
|
+
'clock4', 'clock430', 'clock5', 'clock530', 'clock6', 'clock630', 'clock7',
|
35
|
+
'clock730', 'clock8', 'clock830', 'clock9', 'clock930', 'closed_book',
|
36
|
+
'closed_lock_with_key', 'closed_umbrella', 'cloud', 'clubs', 'cn',
|
37
|
+
'cocktail', 'coffee', 'cold_sweat', 'collision', 'computer', 'confetti_ball',
|
38
|
+
'confounded', 'confused', 'congratulations', 'construction',
|
39
|
+
'construction_worker', 'convenience_store', 'cookie', 'cool', 'cop',
|
40
|
+
'copyright', 'corn', 'couple', 'couple_with_heart', 'couplekiss', 'cow',
|
41
|
+
'cow2', 'credit_card', 'crescent_moon', 'crocodile', 'crossed_flags',
|
42
|
+
'crown', 'cry', 'crying_cat_face', 'crystal_ball', 'cupid', 'curly_loop',
|
43
|
+
'currency_exchange', 'curry', 'custard', 'customs', 'cyclone', 'dancer',
|
44
|
+
'dancers', 'dango', 'dart', 'dash', 'date', 'de', 'deciduous_tree',
|
45
|
+
'department_store', 'diamond_shape_with_a_dot_inside', 'diamonds',
|
46
|
+
'disappointed', 'disappointed_relieved', 'dizzy', 'dizzy_face',
|
47
|
+
'do_not_litter', 'dog', 'dog2', 'dollar', 'dolls', 'dolphin', 'door',
|
48
|
+
'doughnut', 'dragon', 'dragon_face', 'dress', 'dromedary_camel', 'droplet',
|
49
|
+
'dvd', 'e-mail', 'ear', 'ear_of_rice', 'earth_africa', 'earth_americas',
|
50
|
+
'earth_asia', 'egg', 'eggplant', 'eight', 'eight_pointed_black_star',
|
51
|
+
'eight_spoked_asterisk', 'electric_plug', 'elephant', 'email', 'end',
|
52
|
+
'envelope', 'envelope_with_arrow', 'es', 'euro', 'european_castle',
|
53
|
+
'european_post_office', 'evergreen_tree', 'exclamation', 'expressionless',
|
54
|
+
'eyeglasses', 'eyes', 'facepunch', 'factory', 'fallen_leaf', 'family',
|
55
|
+
'fast_forward', 'fax', 'fearful', 'feelsgood', 'feet', 'ferris_wheel',
|
56
|
+
'file_folder', 'finnadie', 'fire', 'fire_engine', 'fireworks',
|
57
|
+
'first_quarter_moon', 'first_quarter_moon_with_face', 'fish', 'fish_cake',
|
58
|
+
'fishing_pole_and_fish', 'fist', 'five', 'flags', 'flashlight',
|
59
|
+
'floppy_disk', 'flower_playing_cards', 'flushed', 'foggy', 'football',
|
60
|
+
'footprints', 'fork_and_knife', 'fountain', 'four', 'four_leaf_clover', 'fr',
|
61
|
+
'free', 'fried_shrimp', 'fries', 'frog', 'frowning', 'fu', 'fuelpump',
|
62
|
+
'full_moon', 'full_moon_with_face', 'game_die', 'gb', 'gem', 'gemini',
|
63
|
+
'ghost', 'gift', 'gift_heart', 'girl', 'globe_with_meridians', 'goat',
|
64
|
+
'goberserk', 'godmode', 'golf', 'grapes', 'green_apple', 'green_book',
|
65
|
+
'green_heart', 'grey_exclamation', 'grey_question', 'grimacing', 'grin',
|
66
|
+
'grinning', 'guardsman', 'guitar', 'gun', 'haircut', 'hamburger', 'hammer',
|
67
|
+
'hamster', 'hand', 'handbag', 'hankey', 'hash', 'hatched_chick',
|
68
|
+
'hatching_chick', 'headphones', 'hear_no_evil', 'heart', 'heart_decoration',
|
69
|
+
'heart_eyes', 'heart_eyes_cat', 'heartbeat', 'heartpulse', 'hearts',
|
70
|
+
'heavy_check_mark', 'heavy_division_sign', 'heavy_dollar_sign',
|
71
|
+
'heavy_exclamation_mark', 'heavy_minus_sign', 'heavy_multiplication_x',
|
72
|
+
'heavy_plus_sign', 'helicopter', 'herb', 'hibiscus', 'high_brightness',
|
73
|
+
'high_heel', 'hocho', 'honey_pot', 'honeybee', 'horse', 'horse_racing',
|
74
|
+
'hospital', 'hotel', 'hotsprings', 'hourglass', 'hourglass_flowing_sand',
|
75
|
+
'house', 'house_with_garden', 'hurtrealbad', 'hushed', 'ice_cream',
|
76
|
+
'icecream', 'id', 'ideograph_advantage', 'imp', 'inbox_tray',
|
77
|
+
'incoming_envelope', 'information_desk_person', 'information_source',
|
78
|
+
'innocent', 'interrobang', 'iphone', 'it', 'izakaya_lantern',
|
79
|
+
'jack_o_lantern', 'japan', 'japanese_castle', 'japanese_goblin',
|
80
|
+
'japanese_ogre', 'jeans', 'joy', 'joy_cat', 'jp', 'key', 'keycap_ten',
|
81
|
+
'kimono', 'kiss', 'kissing', 'kissing_cat', 'kissing_closed_eyes',
|
82
|
+
'kissing_heart', 'kissing_smiling_eyes', 'koala', 'koko', 'kr', 'lantern',
|
83
|
+
'large_blue_circle', 'large_blue_diamond', 'large_orange_diamond',
|
84
|
+
'last_quarter_moon', 'last_quarter_moon_with_face', 'laughing', 'leaves',
|
85
|
+
'ledger', 'left_luggage', 'left_right_arrow', 'leftwards_arrow_with_hook',
|
86
|
+
'lemon', 'leo', 'leopard', 'libra', 'light_rail', 'link', 'lips', 'lipstick',
|
87
|
+
'lock', 'lock_with_ink_pen', 'lollipop', 'loop', 'loudspeaker', 'love_hotel',
|
88
|
+
'love_letter', 'low_brightness', 'm', 'mag', 'mag_right', 'mahjong',
|
89
|
+
'mailbox', 'mailbox_closed', 'mailbox_with_mail', 'mailbox_with_no_mail',
|
90
|
+
'man', 'man_with_gua_pi_mao', 'man_with_turban', 'mans_shoe', 'maple_leaf',
|
91
|
+
'mask', 'massage', 'meat_on_bone', 'mega', 'melon', 'memo', 'mens', 'metal',
|
92
|
+
'metro', 'microphone', 'microscope', 'milky_way', 'minibus', 'minidisc',
|
93
|
+
'mobile_phone_off', 'money_with_wings', 'moneybag', 'monkey', 'monkey_face',
|
94
|
+
'monorail', 'moon', 'mortar_board', 'mount_fuji', 'mountain_bicyclist',
|
95
|
+
'mountain_cableway', 'mountain_railway', 'mouse', 'mouse2', 'movie_camera',
|
96
|
+
'moyai', 'muscle', 'mushroom', 'musical_keyboard', 'musical_note',
|
97
|
+
'musical_score', 'mute', 'nail_care', 'name_badge', 'neckbeard', 'necktie',
|
98
|
+
'negative_squared_cross_mark', 'neutral_face', 'new', 'new_moon',
|
99
|
+
'new_moon_with_face', 'newspaper', 'ng', 'nine', 'no_bell', 'no_bicycles',
|
100
|
+
'no_entry', 'no_entry_sign', 'no_good', 'no_mobile_phones', 'no_mouth',
|
101
|
+
'no_pedestrians', 'no_smoking', 'non-potable_water', 'nose', 'notebook',
|
102
|
+
'notebook_with_decorative_cover', 'notes', 'nut_and_bolt', 'o', 'o2',
|
103
|
+
'ocean', 'octocat', 'octopus', 'oden', 'office', 'ok', 'ok_hand', 'ok_woman',
|
104
|
+
'older_man', 'older_woman', 'on', 'oncoming_automobile', 'oncoming_bus',
|
105
|
+
'oncoming_police_car', 'oncoming_taxi', 'one', 'open_book',
|
106
|
+
'open_file_folder', 'open_hands', 'open_mouth', 'ophiuchus', 'orange_book',
|
107
|
+
'outbox_tray', 'ox', 'package', 'page_facing_up', 'page_with_curl', 'pager',
|
108
|
+
'palm_tree', 'panda_face', 'paperclip', 'parking', 'part_alternation_mark',
|
109
|
+
'partly_sunny', 'passport_control', 'paw_prints', 'peach', 'pear', 'pencil',
|
110
|
+
'pencil2', 'penguin', 'pensive', 'performing_arts', 'persevere',
|
111
|
+
'person_frowning', 'person_with_blond_hair', 'person_with_pouting_face',
|
112
|
+
'phone', 'pig', 'pig2', 'pig_nose', 'pill', 'pineapple', 'pisces', 'pizza',
|
113
|
+
'point_down', 'point_left', 'point_right', 'point_up', 'point_up_2',
|
114
|
+
'police_car', 'poodle', 'poop', 'post_office', 'postal_horn', 'postbox',
|
115
|
+
'potable_water', 'pouch', 'poultry_leg', 'pound', 'pouting_cat', 'pray',
|
116
|
+
'princess', 'punch', 'purple_heart', 'purse', 'pushpin',
|
117
|
+
'put_litter_in_its_place', 'question', 'rabbit', 'rabbit2', 'racehorse',
|
118
|
+
'radio', 'radio_button', 'rage', 'rage1', 'rage2', 'rage3', 'rage4',
|
119
|
+
'railway_car', 'rainbow', 'raised_hand', 'raised_hands', 'raising_hand',
|
120
|
+
'ram', 'ramen', 'rat', 'recycle', 'red_car', 'red_circle', 'registered',
|
121
|
+
'relaxed', 'relieved', 'repeat', 'repeat_one', 'restroom',
|
122
|
+
'revolving_hearts', 'rewind', 'ribbon', 'rice', 'rice_ball', 'rice_cracker',
|
123
|
+
'rice_scene', 'ring', 'rocket', 'roller_coaster', 'rooster', 'rose',
|
124
|
+
'rotating_light', 'round_pushpin', 'rowboat', 'ru', 'rugby_football',
|
125
|
+
'runner', 'running', 'running_shirt_with_sash', 'sa', 'sagittarius',
|
126
|
+
'sailboat', 'sake', 'sandal', 'santa', 'satellite', 'satisfied', 'saxophone',
|
127
|
+
'school', 'school_satchel', 'scissors', 'scorpius', 'scream', 'scream_cat',
|
128
|
+
'scroll', 'seat', 'secret', 'see_no_evil', 'seedling', 'seven', 'shaved_ice',
|
129
|
+
'sheep', 'shell', 'ship', 'shipit', 'shirt', 'shit', 'shoe', 'shower',
|
130
|
+
'signal_strength', 'six', 'six_pointed_star', 'ski', 'skull', 'sleeping',
|
131
|
+
'sleepy', 'slot_machine', 'small_blue_diamond', 'small_orange_diamond',
|
132
|
+
'small_red_triangle', 'small_red_triangle_down', 'smile', 'smile_cat',
|
133
|
+
'smiley', 'smiley_cat', 'smiling_imp', 'smirk', 'smirk_cat', 'smoking',
|
134
|
+
'snail', 'snake', 'snowboarder', 'snowflake', 'snowman', 'sob', 'soccer',
|
135
|
+
'soon', 'sos', 'sound', 'space_invader', 'spades', 'spaghetti', 'sparkle',
|
136
|
+
'sparkler', 'sparkles', 'sparkling_heart', 'speak_no_evil', 'speaker',
|
137
|
+
'speech_balloon', 'speedboat', 'squirrel', 'star', 'star2', 'stars',
|
138
|
+
'station', 'statue_of_liberty', 'steam_locomotive', 'stew', 'straight_ruler',
|
139
|
+
'strawberry', 'stuck_out_tongue', 'stuck_out_tongue_closed_eyes',
|
140
|
+
'stuck_out_tongue_winking_eye', 'sun_with_face', 'sunflower', 'sunglasses',
|
141
|
+
'sunny', 'sunrise', 'sunrise_over_mountains', 'surfer', 'sushi', 'suspect',
|
142
|
+
'suspension_railway', 'sweat', 'sweat_drops', 'sweat_smile', 'sweet_potato',
|
143
|
+
'swimmer', 'symbols', 'syringe', 'tada', 'tanabata_tree', 'tangerine',
|
144
|
+
'taurus', 'taxi', 'tea', 'telephone', 'telephone_receiver', 'telescope',
|
145
|
+
'tennis', 'tent', 'thought_balloon', 'three', 'thumbsdown', 'thumbsup',
|
146
|
+
'ticket', 'tiger', 'tiger2', 'tired_face', 'tm', 'toilet', 'tokyo_tower',
|
147
|
+
'tomato', 'tongue', 'top', 'tophat', 'tractor', 'traffic_light', 'train',
|
148
|
+
'train2', 'tram', 'triangular_flag_on_post', 'triangular_ruler', 'trident',
|
149
|
+
'triumph', 'trolleybus', 'trollface', 'trophy', 'tropical_drink',
|
150
|
+
'tropical_fish', 'truck', 'trumpet', 'tshirt', 'tulip', 'turtle', 'tv',
|
151
|
+
'twisted_rightwards_arrows', 'two', 'two_hearts', 'two_men_holding_hands',
|
152
|
+
'two_women_holding_hands', 'u5272', 'u5408', 'u55b6', 'u6307', 'u6708',
|
153
|
+
'u6709', 'u6e80', 'u7121', 'u7533', 'u7981', 'u7a7a', 'uk', 'umbrella',
|
154
|
+
'unamused', 'underage', 'unlock', 'up', 'us', 'v', 'vertical_traffic_light',
|
155
|
+
'vhs', 'vibration_mode', 'video_camera', 'video_game', 'violin', 'virgo',
|
156
|
+
'volcano', 'vs', 'walking', 'waning_crescent_moon', 'waning_gibbous_moon',
|
157
|
+
'warning', 'watch', 'water_buffalo', 'watermelon', 'wave', 'wavy_dash',
|
158
|
+
'waxing_crescent_moon', 'waxing_gibbous_moon', 'wc', 'weary', 'wedding',
|
159
|
+
'whale', 'whale2', 'wheelchair', 'white_check_mark', 'white_circle',
|
160
|
+
'white_flower', 'white_large_square', 'white_medium_small_square',
|
161
|
+
'white_medium_square', 'white_small_square', 'white_square_button',
|
162
|
+
'wind_chime', 'wine_glass', 'wink', 'wolf', 'woman', 'womans_clothes',
|
163
|
+
'womans_hat', 'womens', 'worried', 'wrench', 'x', 'yellow_heart', 'yen',
|
164
|
+
'yum', 'zap', 'zero', 'zzz'
|
165
|
+
];
|
@@ -0,0 +1,4 @@
|
|
1
|
+
|
2
|
+
/*! emojify.js - v0.9.2 -
|
3
|
+
* Copyright (c) Hassan Khan 2014
|
4
|
+
*/!function(a){"use strict";var b=function(){function b(){var a={named:/:([a-z0-9A-Z_-]+):/,blush:/:-?\)/g,scream:/:-o/gi,smirk:/[:;]-?]/g,smiley:/[:;]-?d/gi,stuck_out_tongue_closed_eyes:/x-d/gi,stuck_out_tongue_winking_eye:/[:;]-?p/gi,rage:/:-?[\[@]/g,disappointed:/:-?\(/g,sob:/:['’]-?\(|:'\(/g,kissing_heart:/:-?\*/g,wink:/;-?\)/g,pensive:/:-?\//g,confounded:/:-?s/gi,flushed:/:-?\|/g,relaxed:/:-?\$/g,mask:/:-x/gi,heart:/<3|<3/g,broken_heart:/<\/3|</3/g,thumbsup:/:\+1:/g,thumbsdown:/:\-1:/g};return q.ignore_emoticons&&(a={named:/:([a-z0-9A-Z_-]+):/,thumbsup:/:\+1:/g,thumbsdown:/:\-1:/g}),Object.keys(a).map(function(b){return[a[b],b]})}function c(){var a=k.map(function(a){var b=a[0],c=b.source||b;return c=c.replace(/(^|[^\[])\^/g,"$1"),"("+c+")"}).join("|");return new RegExp(a,"gi")}function d(a){return" "===a||" "===a||"\r"===a||"\n"===a||""===a}function e(a,b,c){var d=m.createElement(q.emojify_tag_type||"img");q.emojify_tag_type?d.setAttribute("class","emoji emoji-"+c):(d.setAttribute("class","emoji"),d.setAttribute("src",q.img_dir+"/"+c+".png")),d.setAttribute("title",":"+c+":"),d.setAttribute("alt",":"+c+":"),d.setAttribute("align","absmiddle"),a.splitText(b.index),a.nextSibling.nodeValue=a.nextSibling.nodeValue.substr(b[0].length,a.nextSibling.nodeValue.length),d.appendChild(a.splitText(b.index)),a.parentNode.insertBefore(d,a.nextSibling)}function f(a){if(a[1]&&a[2]){var b=a[2];if(p[b])return b}else for(var c=3;c<a.length-1;c++)if(a[c])return k[c-2][1]}function g(a,b){return q.emojify_tag_type?"<"+q.emojify_tag_type+" title=':"+b+":' alt=':"+b+":' class='emoji emoji-"+b+"'> </"+q.emojify_tag_type+">":"<img title=':"+b+":' alt=':"+b+":' class='emoji' src='"+q.img_dir+"/"+b+".png' align='absmiddle' />"}function h(){this.lastEmojiTerminatedAt=-1}function i(a,d){if(!a)return a;d||(d=g),k=b(),l=c();var e=new h;return a.replace(l,function(){var a=Array.prototype.slice.call(arguments,0,-2),b=arguments[arguments.length-2],c=arguments[arguments.length-1],f=e.validate(a,b,c);return f?d(arguments[0],f):arguments[0]})}function j(a){k=b(),l=c(),"undefined"==typeof a&&(a=q.only_crawl_id?m.getElementById(q.only_crawl_id):m.body);for(var d,g=q.ignored_tags,i=m.createTreeWalker(a,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,function(a){return 1!==a.nodeType?NodeFilter.FILTER_ACCEPT:g[a.tagName]||a.classList.contains("no-emojify")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP},!1),j=[];null!==(d=i.nextNode());)j.push(d);j.forEach(function(a){for(var b,c=[],d=new h;null!==(b=l.exec(a.data));)d.validate(b,b.index,b.input)&&c.push(b);for(var g=c.length;g-->0;){var i=f(c[g]);e(a,c[g],i)}})}var k,l,m=a.window.document,n="+1,-1,100,109,1234,8ball,a,ab,abc,abcd,accept,aerial_tramway,airplane,alarm_clock,alien,ambulance,anchor,angel,anger,angry,anguished,ant,apple,aquarius,aries,arrow_backward,arrow_double_down,arrow_double_up,arrow_down,arrow_down_small,arrow_forward,arrow_heading_down,arrow_heading_up,arrow_left,arrow_lower_left,arrow_lower_right,arrow_right,arrow_right_hook,arrow_up,arrow_up_down,arrow_up_small,arrow_upper_left,arrow_upper_right,arrows_clockwise,arrows_counterclockwise,art,articulated_lorry,astonished,atm,b,baby,baby_bottle,baby_chick,baby_symbol,baggage_claim,balloon,ballot_box_with_check,bamboo,banana,bangbang,bank,bar_chart,barber,baseball,basketball,bath,bathtub,battery,bear,bee,beer,beers,beetle,beginner,bell,bento,bicyclist,bike,bikini,bird,birthday,black_circle,black_joker,black_nib,black_square,black_square_button,blossom,blowfish,blue_book,blue_car,blue_heart,blush,boar,boat,bomb,book,bookmark,bookmark_tabs,books,boom,boot,bouquet,bow,bowling,bowtie,boy,bread,bride_with_veil,bridge_at_night,briefcase,broken_heart,bug,bulb,bullettrain_front,bullettrain_side,bus,busstop,bust_in_silhouette,busts_in_silhouette,cactus,cake,calendar,calling,camel,camera,cancer,candy,capital_abcd,capricorn,car,card_index,carousel_horse,cat,cat2,cd,chart,chart_with_downwards_trend,chart_with_upwards_trend,checkered_flag,cherries,cherry_blossom,chestnut,chicken,children_crossing,chocolate_bar,christmas_tree,church,cinema,circus_tent,city_sunrise,city_sunset,cl,clap,clapper,clipboard,clock1,clock10,clock1030,clock11,clock1130,clock12,clock1230,clock130,clock2,clock230,clock3,clock330,clock4,clock430,clock5,clock530,clock6,clock630,clock7,clock730,clock8,clock830,clock9,clock930,closed_book,closed_lock_with_key,closed_umbrella,cloud,clubs,cn,cocktail,coffee,cold_sweat,collision,computer,confetti_ball,confounded,confused,congratulations,construction,construction_worker,convenience_store,cookie,cool,cop,copyright,corn,couple,couple_with_heart,couplekiss,cow,cow2,credit_card,crocodile,crossed_flags,crown,cry,crying_cat_face,crystal_ball,cupid,curly_loop,currency_exchange,curry,custard,customs,cyclone,dancer,dancers,dango,dart,dash,date,de,deciduous_tree,department_store,diamond_shape_with_a_dot_inside,diamonds,disappointed,disappointed_relieved,dizzy,dizzy_face,do_not_litter,dog,dog2,dollar,dolls,dolphin,donut,door,doughnut,dragon,dragon_face,dress,dromedary_camel,droplet,dvd,e-mail,ear,ear_of_rice,earth_africa,earth_americas,earth_asia,egg,eggplant,eight,eight_pointed_black_star,eight_spoked_asterisk,electric_plug,elephant,email,end,envelope,es,euro,european_castle,european_post_office,evergreen_tree,exclamation,expressionless,eyeglasses,eyes,facepunch,factory,fallen_leaf,family,fast_forward,fax,fearful,feelsgood,feet,ferris_wheel,file_folder,finnadie,fire,fire_engine,fireworks,first_quarter_moon,first_quarter_moon_with_face,fish,fish_cake,fishing_pole_and_fish,fist,five,flags,flashlight,floppy_disk,flower_playing_cards,flushed,foggy,football,fork_and_knife,fountain,four,four_leaf_clover,fr,free,fried_shrimp,fries,frog,frowning,fu,fuelpump,full_moon,full_moon_with_face,game_die,gb,gem,gemini,ghost,gift,gift_heart,girl,globe_with_meridians,goat,goberserk,godmode,golf,grapes,green_apple,green_book,green_heart,grey_exclamation,grey_question,grimacing,grin,grinning,guardsman,guitar,gun,haircut,hamburger,hammer,hamster,hand,handbag,hankey,hash,hatched_chick,hatching_chick,headphones,hear_no_evil,heart,heart_decoration,heart_eyes,heart_eyes_cat,heartbeat,heartpulse,hearts,heavy_check_mark,heavy_division_sign,heavy_dollar_sign,heavy_exclamation_mark,heavy_minus_sign,heavy_multiplication_x,heavy_plus_sign,helicopter,herb,hibiscus,high_brightness,high_heel,hocho,honey_pot,honeybee,horse,horse_racing,hospital,hotel,hotsprings,hourglass,hourglass_flowing_sand,house,house_with_garden,hurtrealbad,hushed,ice_cream,icecream,id,ideograph_advantage,imp,inbox_tray,incoming_envelope,information_desk_person,information_source,innocent,interrobang,iphone,it,izakaya_lantern,jack_o_lantern,japan,japanese_castle,japanese_goblin,japanese_ogre,jeans,joy,joy_cat,jp,key,keycap_ten,kimono,kiss,kissing,kissing_cat,kissing_closed_eyes,kissing_face,kissing_heart,kissing_smiling_eyes,koala,koko,kr,large_blue_circle,large_blue_diamond,large_orange_diamond,last_quarter_moon,last_quarter_moon_with_face,laughing,leaves,ledger,left_luggage,left_right_arrow,leftwards_arrow_with_hook,lemon,leo,leopard,libra,light_rail,link,lips,lipstick,lock,lock_with_ink_pen,lollipop,loop,loudspeaker,love_hotel,love_letter,low_brightness,m,mag,mag_right,mahjong,mailbox,mailbox_closed,mailbox_with_mail,mailbox_with_no_mail,man,man_with_gua_pi_mao,man_with_turban,mans_shoe,maple_leaf,mask,massage,meat_on_bone,mega,melon,memo,mens,metal,metro,microphone,microscope,milky_way,minibus,minidisc,mobile_phone_off,money_with_wings,moneybag,monkey,monkey_face,monorail,moon,mortar_board,mount_fuji,mountain_bicyclist,mountain_cableway,mountain_railway,mouse,mouse2,movie_camera,moyai,muscle,mushroom,musical_keyboard,musical_note,musical_score,mute,nail_care,name_badge,neckbeard,necktie,negative_squared_cross_mark,neutral_face,new,new_moon,new_moon_with_face,newspaper,ng,nine,no_bell,no_bicycles,no_entry,no_entry_sign,no_good,no_mobile_phones,no_mouth,no_pedestrians,no_smoking,non-potable_water,nose,notebook,notebook_with_decorative_cover,notes,nut_and_bolt,o,o2,ocean,octocat,octopus,oden,office,ok,ok_hand,ok_woman,older_man,older_woman,on,oncoming_automobile,oncoming_bus,oncoming_police_car,oncoming_taxi,one,open_file_folder,open_hands,open_mouth,ophiuchus,orange_book,outbox_tray,ox,page_facing_up,page_with_curl,pager,palm_tree,panda_face,paperclip,parking,part_alternation_mark,partly_sunny,passport_control,paw_prints,peach,pear,pencil,pencil2,penguin,pensive,performing_arts,persevere,person_frowning,person_with_blond_hair,person_with_pouting_face,phone,pig,pig2,pig_nose,pill,pineapple,pisces,pizza,plus1,point_down,point_left,point_right,point_up,point_up_2,police_car,poodle,poop,post_office,postal_horn,postbox,potable_water,pouch,poultry_leg,pound,pouting_cat,pray,princess,punch,purple_heart,purse,pushpin,put_litter_in_its_place,question,rabbit,rabbit2,racehorse,radio,radio_button,rage,rage1,rage2,rage3,rage4,railway_car,rainbow,raised_hand,raised_hands,raising_hand,ram,ramen,rat,recycle,red_car,red_circle,registered,relaxed,relieved,repeat,repeat_one,restroom,revolving_hearts,rewind,ribbon,rice,rice_ball,rice_cracker,rice_scene,ring,rocket,roller_coaster,rooster,rose,rotating_light,round_pushpin,rowboat,ru,rugby_football,runner,running,running_shirt_with_sash,sa,sagittarius,sailboat,sake,sandal,santa,satellite,satisfied,saxophone,school,school_satchel,scissors,scorpius,scream,scream_cat,scroll,seat,secret,see_no_evil,seedling,seven,shaved_ice,sheep,shell,ship,shipit,shirt,shit,shoe,shower,signal_strength,six,six_pointed_star,ski,skull,sleeping,sleepy,slot_machine,small_blue_diamond,small_orange_diamond,small_red_triangle,small_red_triangle_down,smile,smile_cat,smiley,smiley_cat,smiling_imp,smirk,smirk_cat,smoking,snail,snake,snowboarder,snowflake,snowman,sob,soccer,soon,sos,sound,space_invader,spades,spaghetti,sparkler,sparkles,sparkling_heart,speak_no_evil,speaker,speech_balloon,speedboat,squirrel,star,star2,stars,station,statue_of_liberty,steam_locomotive,stew,straight_ruler,strawberry,stuck_out_tongue,stuck_out_tongue_closed_eyes,stuck_out_tongue_winking_eye,sun_with_face,sunflower,sunglasses,sunny,sunrise,sunrise_over_mountains,surfer,sushi,suspect,suspension_railway,sweat,sweat_drops,sweat_smile,sweet_potato,swimmer,symbols,syringe,tada,tanabata_tree,tangerine,taurus,taxi,tea,telephone,telephone_receiver,telescope,tennis,tent,thought_balloon,three,thumbsdown,thumbsup,ticket,tiger,tiger2,tired_face,tm,toilet,tokyo_tower,tomato,tongue,top,tophat,tractor,traffic_light,train,train2,tram,triangular_flag_on_post,triangular_ruler,trident,triumph,trolleybus,trollface,trophy,tropical_drink,tropical_fish,truck,trumpet,tshirt,tulip,turtle,tv,twisted_rightwards_arrows,two,two_hearts,two_men_holding_hands,two_women_holding_hands,u5272,u5408,u55b6,u6307,u6708,u6709,u6e80,u7121,u7533,u7981,u7a7a,uk,umbrella,unamused,underage,unlock,up,us,v,vertical_traffic_light,vhs,vibration_mode,video_camera,video_game,violin,virgo,volcano,vs,walking,waning_crescent_moon,waning_gibbous_moon,warning,watch,water_buffalo,watermelon,wave,wavy_dash,waxing_crescent_moon,waxing_gibbous_moon,wc,weary,wedding,whale,whale2,wheelchair,white_check_mark,white_circle,white_flower,white_large_square,white_square,white_square_button,wind_chime,wine_glass,wink,wink2,wolf,woman,womans_clothes,womans_hat,womens,worried,wrench,x,yellow_heart,yen,yum,zap,zero,zzz",o=n.split(/,/),p=o.reduce(function(a,b){return a[b]=!0,a},{}),q={emojify_tag_type:null,only_crawl_id:null,img_dir:"images/emoji",ignore_emoticons:!1,ignored_tags:{SCRIPT:1,TEXTAREA:1,A:1,PRE:1,CODE:1}};return h.prototype={validate:function(a,b,c){function e(){return g.lastEmojiTerminatedAt=j+b,h}var g=this,h=f(a);if(h){var i=a[0],j=i.length;if(0===b)return e();if(c.length===i.length+b)return e();var k=this.lastEmojiTerminatedAt===b;if(k)return e();if(d(c.charAt(b-1)))return e();var l=d(c.charAt(i.length+b));return l&&k?e():void 0}}},{defaultConfig:q,emojiNames:o,setConfig:function(a){Object.keys(q).forEach(function(b){b in a&&(q[b]=a[b])})},replace:i,run:j}}();return a.emojify=b,"function"==typeof define&&define.amd&&define([],function(){return b}),b}(this);
|
@@ -0,0 +1,744 @@
|
|
1
|
+
|
2
|
+
/*!
|
3
|
+
* jQuery.textcomplete.js
|
4
|
+
*
|
5
|
+
* Repositiory: https://github.com/yuku-t/jquery-textcomplete
|
6
|
+
* License: MIT
|
7
|
+
* Author: Yuku Takahashi
|
8
|
+
*/
|
9
|
+
|
10
|
+
;(function ($) {
|
11
|
+
|
12
|
+
'use strict';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Exclusive execution control utility.
|
16
|
+
*/
|
17
|
+
var lock = function (func) {
|
18
|
+
var free, locked, queuedArgsToReplay;
|
19
|
+
free = function () { locked = false; };
|
20
|
+
return function () {
|
21
|
+
var args = toArray(arguments);
|
22
|
+
if (locked) {
|
23
|
+
// Keep a copy of this argument list to replay later.
|
24
|
+
// OK to overwrite a previous value because we only replay the last one.
|
25
|
+
queuedArgsToReplay = args;
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
locked = true;
|
29
|
+
var that = this;
|
30
|
+
args.unshift(function replayOrFree() {
|
31
|
+
if (queuedArgsToReplay) {
|
32
|
+
// Other request(s) arrived while we were locked.
|
33
|
+
// Now that the lock is becoming available, replay
|
34
|
+
// the latest such request, then call back here to
|
35
|
+
// unlock (or replay another request that arrived
|
36
|
+
// while this one was in flight).
|
37
|
+
var replayArgs = queuedArgsToReplay;
|
38
|
+
queuedArgsToReplay = undefined;
|
39
|
+
replayArgs.unshift(replayOrFree);
|
40
|
+
func.apply(that, replayArgs);
|
41
|
+
} else {
|
42
|
+
locked = false;
|
43
|
+
}
|
44
|
+
});
|
45
|
+
func.apply(this, args);
|
46
|
+
};
|
47
|
+
};
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Convert arguments into a real array.
|
51
|
+
*/
|
52
|
+
var toArray = function (args) {
|
53
|
+
var result;
|
54
|
+
result = Array.prototype.slice.call(args);
|
55
|
+
return result;
|
56
|
+
};
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Get the styles of any element from property names.
|
60
|
+
*/
|
61
|
+
var getStyles = (function () {
|
62
|
+
var color;
|
63
|
+
color = $('<div></div>').css(['color']).color;
|
64
|
+
if (typeof color !== 'undefined') {
|
65
|
+
return function ($el, properties) {
|
66
|
+
return $el.css(properties);
|
67
|
+
};
|
68
|
+
} else { // for jQuery 1.8 or below
|
69
|
+
return function ($el, properties) {
|
70
|
+
var styles;
|
71
|
+
styles = {};
|
72
|
+
$.each(properties, function (i, property) {
|
73
|
+
styles[property] = $el.css(property);
|
74
|
+
});
|
75
|
+
return styles;
|
76
|
+
};
|
77
|
+
}
|
78
|
+
})();
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Default template function.
|
82
|
+
*/
|
83
|
+
var identity = function (obj) { return obj; };
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Memoize a search function.
|
87
|
+
*/
|
88
|
+
var memoize = function (func) {
|
89
|
+
var memo = {};
|
90
|
+
return function (term, callback) {
|
91
|
+
if (memo[term]) {
|
92
|
+
callback(memo[term]);
|
93
|
+
} else {
|
94
|
+
func.call(this, term, function (data) {
|
95
|
+
memo[term] = (memo[term] || []).concat(data);
|
96
|
+
callback.apply(null, arguments);
|
97
|
+
});
|
98
|
+
}
|
99
|
+
};
|
100
|
+
};
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Determine if the array contains a given value.
|
104
|
+
*/
|
105
|
+
var include = function (array, value) {
|
106
|
+
var i, l;
|
107
|
+
if (array.indexOf) return array.indexOf(value) != -1;
|
108
|
+
for (i = 0, l = array.length; i < l; i++) {
|
109
|
+
if (array[i] === value) return true;
|
110
|
+
}
|
111
|
+
return false;
|
112
|
+
};
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Textarea manager class.
|
116
|
+
*/
|
117
|
+
var Completer = (function () {
|
118
|
+
var html, css, $baseList, _id;
|
119
|
+
|
120
|
+
html = {
|
121
|
+
list: '<ul class="dropdown-menu"></ul>'
|
122
|
+
};
|
123
|
+
css = {
|
124
|
+
// Removed the 'top' property to support the placement: 'top' option
|
125
|
+
list: {
|
126
|
+
position: 'absolute',
|
127
|
+
left: 0,
|
128
|
+
zIndex: '100',
|
129
|
+
display: 'none'
|
130
|
+
}
|
131
|
+
};
|
132
|
+
$baseList = $(html.list).css(css.list);
|
133
|
+
_id = 0;
|
134
|
+
|
135
|
+
function Completer($el, option) {
|
136
|
+
var focus;
|
137
|
+
this.el = $el.get(0); // textarea element
|
138
|
+
focus = this.el === document.activeElement;
|
139
|
+
this.$el = $el;
|
140
|
+
this.id = 'textComplete' + _id++;
|
141
|
+
this.strategies = [];
|
142
|
+
this.option = option;
|
143
|
+
if (focus) {
|
144
|
+
this.initialize();
|
145
|
+
this.$el.focus();
|
146
|
+
} else {
|
147
|
+
this.$el.one('focus.textComplete', $.proxy(this.initialize, this));
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Completer's public methods
|
153
|
+
*/
|
154
|
+
$.extend(Completer.prototype, {
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Prepare ListView and bind events.
|
158
|
+
*/
|
159
|
+
initialize: function () {
|
160
|
+
var $list, globalEvents, appendTo, height;
|
161
|
+
$list = $baseList.clone();
|
162
|
+
this.listView = new ListView($list, this);
|
163
|
+
this.$el.on({
|
164
|
+
'keyup.textComplete': $.proxy(this.onKeyup, this),
|
165
|
+
'keydown.textComplete': $.proxy(this.listView.onKeydown, this.listView)
|
166
|
+
});
|
167
|
+
appendTo = this.option.appendTo;
|
168
|
+
if (appendTo) {
|
169
|
+
// Append ListView to specified element.
|
170
|
+
this.listView.appendTo(appendTo instanceof $ ? appendTo : $(appendTo));
|
171
|
+
} else {
|
172
|
+
this.listView.appendTo($('body'));
|
173
|
+
}
|
174
|
+
height = this.option.height;
|
175
|
+
if (height) {
|
176
|
+
$list.css("overflow-y", "auto");
|
177
|
+
$list.height(height);
|
178
|
+
}
|
179
|
+
globalEvents = {};
|
180
|
+
globalEvents['click.' + this.id] = $.proxy(this.onClickDocument, this);
|
181
|
+
globalEvents['keyup.' + this.id] = $.proxy(this.onKeyupDocument, this);
|
182
|
+
$(document).on(globalEvents);
|
183
|
+
},
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Register strategies to the completer.
|
187
|
+
*/
|
188
|
+
register: function (strategies) {
|
189
|
+
this.strategies = this.strategies.concat(strategies);
|
190
|
+
},
|
191
|
+
|
192
|
+
/**
|
193
|
+
* Show autocomplete list next to the caret.
|
194
|
+
*/
|
195
|
+
renderList: function (data) {
|
196
|
+
if (this.clearAtNext) {
|
197
|
+
this.listView.clear();
|
198
|
+
this.clearAtNext = false;
|
199
|
+
}
|
200
|
+
if (data.length) {
|
201
|
+
this.listView.strategy = this.strategy;
|
202
|
+
if (!this.listView.shown) {
|
203
|
+
this.listView
|
204
|
+
.setPosition(this.getCaretPosition())
|
205
|
+
.clear()
|
206
|
+
.activate();
|
207
|
+
}
|
208
|
+
data = data.slice(0, this.strategy.maxCount);
|
209
|
+
this.listView.render(data);
|
210
|
+
}
|
211
|
+
|
212
|
+
if (!this.listView.data.length && this.listView.shown) {
|
213
|
+
this.listView.deactivate();
|
214
|
+
}
|
215
|
+
},
|
216
|
+
|
217
|
+
searchCallbackFactory: function (free) {
|
218
|
+
var self = this;
|
219
|
+
return function (data, keep) {
|
220
|
+
self.renderList(data);
|
221
|
+
if (!keep) {
|
222
|
+
// This is the last callback for this search.
|
223
|
+
free();
|
224
|
+
self.clearAtNext = true;
|
225
|
+
}
|
226
|
+
};
|
227
|
+
},
|
228
|
+
|
229
|
+
/**
|
230
|
+
* Keyup event handler.
|
231
|
+
*/
|
232
|
+
onKeyup: function (e) {
|
233
|
+
if (this.skipSearch(e)) { return; }
|
234
|
+
this.trigger(null, true);
|
235
|
+
},
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Public interface for invoking textcomplete.
|
239
|
+
*/
|
240
|
+
trigger: function (text, suppress) {
|
241
|
+
var searchQuery, term;
|
242
|
+
text || (text = this.getTextFromHeadToCaret());
|
243
|
+
searchQuery = this.extractSearchQuery(text);
|
244
|
+
if (searchQuery.length) {
|
245
|
+
term = searchQuery[1];
|
246
|
+
if (suppress && this.term === term) {
|
247
|
+
return; // Ignore shift-key or something.
|
248
|
+
}
|
249
|
+
this.term = term;
|
250
|
+
this.search(searchQuery);
|
251
|
+
} else {
|
252
|
+
this.term = null;
|
253
|
+
this.listView.deactivate();
|
254
|
+
}
|
255
|
+
},
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Suppress searching if it returns true.
|
259
|
+
*/
|
260
|
+
skipSearch: function (e) {
|
261
|
+
switch (e.keyCode) {
|
262
|
+
case 40: // DOWN
|
263
|
+
case 38: // UP
|
264
|
+
return true;
|
265
|
+
}
|
266
|
+
if (e.ctrlKey) switch (e.keyCode) {
|
267
|
+
case 78: // Ctrl-N
|
268
|
+
case 80: // Ctrl-P
|
269
|
+
return true;
|
270
|
+
}
|
271
|
+
},
|
272
|
+
|
273
|
+
onSelect: function (value) {
|
274
|
+
var pre, post, newSubStr, sel, range, selection, remainder;
|
275
|
+
pre = this.getTextFromHeadToCaret();
|
276
|
+
remainder = pre.length;
|
277
|
+
|
278
|
+
if (this.el.isContentEditable) {
|
279
|
+
sel = window.getSelection();
|
280
|
+
range = sel.getRangeAt(0);
|
281
|
+
selection = range.cloneRange();
|
282
|
+
selection.selectNodeContents(range.startContainer);
|
283
|
+
var content = selection.toString();
|
284
|
+
post = content.substring(range.startOffset);
|
285
|
+
} else {
|
286
|
+
post = this.el.value.substring(this.el.selectionEnd);
|
287
|
+
}
|
288
|
+
|
289
|
+
newSubStr = this.strategy.replace(value);
|
290
|
+
|
291
|
+
if ($.isArray(newSubStr)) {
|
292
|
+
post = newSubStr[1] + post;
|
293
|
+
newSubStr = newSubStr[0];
|
294
|
+
}
|
295
|
+
|
296
|
+
pre = pre.replace(this.strategy.match, newSubStr);
|
297
|
+
|
298
|
+
if (this.el.isContentEditable) {
|
299
|
+
range.selectNodeContents(range.startContainer);
|
300
|
+
range.deleteContents();
|
301
|
+
var node = document.createTextNode(pre + post);
|
302
|
+
range.insertNode(node);
|
303
|
+
range.setStart(node, pre.length);
|
304
|
+
range.collapse(true);
|
305
|
+
sel.removeAllRanges();
|
306
|
+
sel.addRange(range);
|
307
|
+
} else {
|
308
|
+
this.$el.val(pre + post);
|
309
|
+
this.el.selectionStart = this.el.selectionEnd = pre.length;
|
310
|
+
}
|
311
|
+
|
312
|
+
this.$el.trigger('change')
|
313
|
+
.trigger('textComplete:select', value);
|
314
|
+
this.el.focus();
|
315
|
+
},
|
316
|
+
|
317
|
+
/**
|
318
|
+
* Global click event handler.
|
319
|
+
*/
|
320
|
+
onClickDocument: function (e) {
|
321
|
+
if (e.originalEvent && !e.originalEvent.keepTextCompleteDropdown) {
|
322
|
+
this.listView.deactivate();
|
323
|
+
}
|
324
|
+
},
|
325
|
+
|
326
|
+
/**
|
327
|
+
* Global keyup event handler.
|
328
|
+
*/
|
329
|
+
onKeyupDocument: function (e) {
|
330
|
+
if (this.listView.shown && e.keyCode === 27) { // ESC
|
331
|
+
this.listView.deactivate();
|
332
|
+
this.$el.focus();
|
333
|
+
}
|
334
|
+
},
|
335
|
+
|
336
|
+
/**
|
337
|
+
* Remove all event handlers.
|
338
|
+
*/
|
339
|
+
destroy: function () {
|
340
|
+
this.$el.off('.textComplete');
|
341
|
+
$(document).off('.' + this.id);
|
342
|
+
if (this.listView) { this.listView.destroy(); }
|
343
|
+
this.$el.removeData('textComplete');
|
344
|
+
this.$el = null;
|
345
|
+
},
|
346
|
+
|
347
|
+
// Helper methods
|
348
|
+
// ==============
|
349
|
+
|
350
|
+
getCaretPosition: function () {
|
351
|
+
var caretPosition, textareaOffset;
|
352
|
+
caretPosition = this.getCaretRelativePosition();
|
353
|
+
textareaOffset = this.$el.offset();
|
354
|
+
caretPosition.top += textareaOffset.top;
|
355
|
+
caretPosition.left += textareaOffset.left;
|
356
|
+
return caretPosition;
|
357
|
+
},
|
358
|
+
|
359
|
+
/**
|
360
|
+
* Returns caret's relative coordinates from textarea's left top corner.
|
361
|
+
*/
|
362
|
+
getCaretRelativePosition: function () {
|
363
|
+
var properties, css, $div, $span, position, dir, scrollbar, range, node, $node;
|
364
|
+
if (!this.el.isContentEditable) {
|
365
|
+
// Browser native API does not provide the way to know the position of
|
366
|
+
// caret in pixels, so that here we use a kind of hack to accomplish
|
367
|
+
// the aim. First of all it puts a div element and completely copies
|
368
|
+
// the textarea's style to the element, then it inserts the text and a
|
369
|
+
// span element into the textarea.
|
370
|
+
// Consequently, the span element's position is the thing what we want.
|
371
|
+
properties = ['border-width', 'font-family', 'font-size', 'font-style',
|
372
|
+
'font-variant', 'font-weight', 'height', 'letter-spacing',
|
373
|
+
'word-spacing', 'line-height', 'text-decoration', 'text-align',
|
374
|
+
'width', 'padding-top', 'padding-right', 'padding-bottom',
|
375
|
+
'padding-left', 'margin-top', 'margin-right', 'margin-bottom',
|
376
|
+
'margin-left', 'border-style', 'box-sizing'
|
377
|
+
];
|
378
|
+
scrollbar = this.$el[0].scrollHeight > this.$el[0].offsetHeight;
|
379
|
+
css = $.extend({
|
380
|
+
position: 'absolute',
|
381
|
+
overflow: scrollbar ? 'scroll' : 'auto',
|
382
|
+
'white-space': 'pre-wrap',
|
383
|
+
top: 0,
|
384
|
+
left: -9999,
|
385
|
+
direction: dir
|
386
|
+
}, getStyles(this.$el, properties));
|
387
|
+
|
388
|
+
$div = $('<div></div>').css(css).text(this.getTextFromHeadToCaret());
|
389
|
+
$span = $('<span></span>').text('.').appendTo($div);
|
390
|
+
this.$el.before($div);
|
391
|
+
position = $span.position();
|
392
|
+
position.top += $span.height() - this.$el.scrollTop();
|
393
|
+
$div.remove();
|
394
|
+
} else {
|
395
|
+
range = window.getSelection().getRangeAt(0).cloneRange();
|
396
|
+
node = document.createElement('span');
|
397
|
+
range.insertNode(node);
|
398
|
+
range.selectNodeContents(node);
|
399
|
+
range.deleteContents();
|
400
|
+
$node = $(node);
|
401
|
+
position = $node.offset();
|
402
|
+
position.left -= this.$el.offset().left;
|
403
|
+
position.top += $node.height() - this.$el.offset().top;
|
404
|
+
}
|
405
|
+
dir = this.$el.attr('dir') || this.$el.css('direction');
|
406
|
+
if (dir === 'rtl') { position.left -= this.listView.$el.width(); }
|
407
|
+
return position;
|
408
|
+
},
|
409
|
+
|
410
|
+
getTextFromHeadToCaret: function () {
|
411
|
+
var text, selectionEnd, range;
|
412
|
+
if (this.el.isContentEditable) {
|
413
|
+
if (window.getSelection) {
|
414
|
+
// IE9+ and non-IE
|
415
|
+
var range = window.getSelection().getRangeAt(0);
|
416
|
+
var selection = range.cloneRange();
|
417
|
+
selection.selectNodeContents(range.startContainer);
|
418
|
+
text = selection.toString().substring(0, range.startOffset);
|
419
|
+
}
|
420
|
+
} else {
|
421
|
+
selectionEnd = this.el.selectionEnd;
|
422
|
+
if (typeof selectionEnd === 'number') {
|
423
|
+
text = this.el.value.substring(0, selectionEnd);
|
424
|
+
} else if (document.selection) {
|
425
|
+
range = this.el.createTextRange();
|
426
|
+
range.moveStart('character', 0);
|
427
|
+
range.moveEnd('textedit');
|
428
|
+
text = range.text;
|
429
|
+
}
|
430
|
+
}
|
431
|
+
return text;
|
432
|
+
},
|
433
|
+
|
434
|
+
/**
|
435
|
+
* Parse the value of textarea and extract search query.
|
436
|
+
*/
|
437
|
+
extractSearchQuery: function (text) {
|
438
|
+
var i, l, strategy, match;
|
439
|
+
for (i = 0, l = this.strategies.length; i < l; i++) {
|
440
|
+
strategy = this.strategies[i];
|
441
|
+
match = text.match(strategy.match);
|
442
|
+
if (match) { return [strategy, match[strategy.index]]; }
|
443
|
+
}
|
444
|
+
return [];
|
445
|
+
},
|
446
|
+
|
447
|
+
search: lock(function (free, searchQuery) {
|
448
|
+
var term;
|
449
|
+
this.strategy = searchQuery[0];
|
450
|
+
term = searchQuery[1];
|
451
|
+
this.strategy.search(term, this.searchCallbackFactory(free));
|
452
|
+
})
|
453
|
+
});
|
454
|
+
|
455
|
+
return Completer;
|
456
|
+
})();
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Dropdown menu manager class.
|
460
|
+
*/
|
461
|
+
var ListView = (function () {
|
462
|
+
|
463
|
+
function ListView($el, completer) {
|
464
|
+
this.data = [];
|
465
|
+
this.$el = $el;
|
466
|
+
this.index = 0;
|
467
|
+
this.completer = completer;
|
468
|
+
if (completer.option.listPosition) {
|
469
|
+
this.setPosition = completer.option.listPosition;
|
470
|
+
}
|
471
|
+
|
472
|
+
this.$el.on('mousedown.textComplete', 'li.textcomplete-item',
|
473
|
+
$.proxy(this.onClick, this));
|
474
|
+
this.$el.on('mouseover.textComplete', 'li.textcomplete-item',
|
475
|
+
$.proxy(this.onMouseover, this));
|
476
|
+
}
|
477
|
+
|
478
|
+
$.extend(ListView.prototype, {
|
479
|
+
shown: false,
|
480
|
+
|
481
|
+
render: function (data) {
|
482
|
+
var html, i, l, index, val, str;
|
483
|
+
|
484
|
+
html = '';
|
485
|
+
|
486
|
+
if(this.strategy.header) {
|
487
|
+
if ($.isFunction(this.strategy.header)) {
|
488
|
+
str = this.strategy.header(data);
|
489
|
+
} else {
|
490
|
+
str = this.strategy.header;
|
491
|
+
}
|
492
|
+
html += '<li class="textcomplete-header">' + str + '</li>';
|
493
|
+
}
|
494
|
+
|
495
|
+
for (i = 0, l = data.length; i < l; i++) {
|
496
|
+
val = data[i];
|
497
|
+
if (include(this.data, val)) continue;
|
498
|
+
index = this.data.length;
|
499
|
+
this.data.push(val);
|
500
|
+
html += '<li class="textcomplete-item" data-index="' + index + '"><a>';
|
501
|
+
html += this.strategy.template(val);
|
502
|
+
html += '</a></li>';
|
503
|
+
if (this.data.length === this.strategy.maxCount) break;
|
504
|
+
}
|
505
|
+
|
506
|
+
if(this.strategy.footer) {
|
507
|
+
if ($.isFunction(this.strategy.footer)) {
|
508
|
+
str = this.strategy.footer(data);
|
509
|
+
} else {
|
510
|
+
str = this.strategy.footer;
|
511
|
+
}
|
512
|
+
html += '<li class="textcomplete-footer">' + str + '</li>';
|
513
|
+
}
|
514
|
+
|
515
|
+
this.$el.append(html);
|
516
|
+
if (!this.data.length) {
|
517
|
+
this.deactivate();
|
518
|
+
} else {
|
519
|
+
this.activateIndexedItem();
|
520
|
+
this.setScroll();
|
521
|
+
}
|
522
|
+
},
|
523
|
+
|
524
|
+
clear: function () {
|
525
|
+
this.data = [];
|
526
|
+
this.$el.html('');
|
527
|
+
this.index = 0;
|
528
|
+
return this;
|
529
|
+
},
|
530
|
+
|
531
|
+
activateIndexedItem: function () {
|
532
|
+
this.$el.find('.active').removeClass('active');
|
533
|
+
this.getActiveItem().addClass('active');
|
534
|
+
},
|
535
|
+
|
536
|
+
getActiveItem: function () {
|
537
|
+
return $(this.$el.children('.textcomplete-item').get(this.index));
|
538
|
+
},
|
539
|
+
|
540
|
+
activate: function () {
|
541
|
+
if (!this.shown) {
|
542
|
+
this.$el.show();
|
543
|
+
this.completer.$el.trigger('textComplete:show');
|
544
|
+
this.shown = true;
|
545
|
+
}
|
546
|
+
return this;
|
547
|
+
},
|
548
|
+
|
549
|
+
deactivate: function () {
|
550
|
+
if (this.shown) {
|
551
|
+
this.$el.hide();
|
552
|
+
this.completer.$el.trigger('textComplete:hide');
|
553
|
+
this.shown = false;
|
554
|
+
this.data = [];
|
555
|
+
this.index = null;
|
556
|
+
}
|
557
|
+
return this;
|
558
|
+
},
|
559
|
+
|
560
|
+
setPosition: function (position) {
|
561
|
+
var fontSize;
|
562
|
+
// If the strategy has the 'placement' option set to 'top', move the
|
563
|
+
// position above the element
|
564
|
+
if(this.strategy.placement.indexOf('top') > -1) {
|
565
|
+
// Move it to be in line with the match character
|
566
|
+
fontSize = parseInt(this.$el.css('font-size'));
|
567
|
+
// Overwrite the position object to set the 'bottom' property instead of the top.
|
568
|
+
position = {
|
569
|
+
top: 'auto',
|
570
|
+
bottom: this.$el.parent().height() - position.top + fontSize,
|
571
|
+
left: position.left
|
572
|
+
};
|
573
|
+
} else {
|
574
|
+
// Overwrite 'bottom' property because once `placement: 'top'`
|
575
|
+
// strategy is shown, $el keeps the property.
|
576
|
+
position.bottom = 'auto';
|
577
|
+
}
|
578
|
+
|
579
|
+
if (this.strategy.placement.indexOf('absleft') > -1) {
|
580
|
+
position.left = 0;
|
581
|
+
}
|
582
|
+
|
583
|
+
if (this.strategy.placement.indexOf('absright') > -1) {
|
584
|
+
position.right = 0;
|
585
|
+
position.left = 'auto';
|
586
|
+
}
|
587
|
+
|
588
|
+
this.$el.css(position);
|
589
|
+
return this;
|
590
|
+
},
|
591
|
+
|
592
|
+
setScroll: function (e) {
|
593
|
+
var $activeItem = this.getActiveItem();
|
594
|
+
var itemTop = $activeItem.position().top;
|
595
|
+
var itemHeight = $activeItem.outerHeight();
|
596
|
+
var visibleHeight = this.$el.innerHeight();
|
597
|
+
var visibleTop = this.$el.scrollTop();
|
598
|
+
if (this.index === 0 || this.index === this.data.length - 1 || itemTop < 0) {
|
599
|
+
this.$el.scrollTop(itemTop + visibleTop);
|
600
|
+
} else if (itemTop + itemHeight > visibleHeight) {
|
601
|
+
this.$el.scrollTop(itemTop + itemHeight + visibleTop - visibleHeight);
|
602
|
+
}
|
603
|
+
},
|
604
|
+
|
605
|
+
select: function (index) {
|
606
|
+
var self = this;
|
607
|
+
this.completer.onSelect(this.data[index]);
|
608
|
+
// Deactive at next tick to allow other event handlers to know whether
|
609
|
+
// the dropdown has been shown or not.
|
610
|
+
setTimeout(function () { self.deactivate(); }, 0);
|
611
|
+
},
|
612
|
+
|
613
|
+
onKeydown: function (e) {
|
614
|
+
if (!this.shown) return;
|
615
|
+
var modifiers = e.ctrlKey || e.altKey || e.metaKey || e.shiftKey;
|
616
|
+
if (e.keyCode === 38 || (e.ctrlKey && e.keyCode === 80)) { // UP, or Ctrl-P
|
617
|
+
e.preventDefault();
|
618
|
+
if (this.index === 0) {
|
619
|
+
this.index = this.data.length-1;
|
620
|
+
} else {
|
621
|
+
this.index -= 1;
|
622
|
+
}
|
623
|
+
this.activateIndexedItem();
|
624
|
+
this.setScroll();
|
625
|
+
} else if (e.keyCode === 40 || (e.ctrlKey && e.keyCode === 78)) { // DOWN, or Ctrl-N
|
626
|
+
e.preventDefault();
|
627
|
+
if (this.index === this.data.length - 1) {
|
628
|
+
this.index = 0;
|
629
|
+
} else {
|
630
|
+
this.index += 1;
|
631
|
+
}
|
632
|
+
this.activateIndexedItem();
|
633
|
+
this.setScroll();
|
634
|
+
} else if (!modifiers && (e.keyCode === 13 || e.keyCode === 9)) { // ENTER or TAB
|
635
|
+
e.preventDefault();
|
636
|
+
this.select(parseInt(this.getActiveItem().data('index'), 10));
|
637
|
+
}
|
638
|
+
else if (e.keyCode === 33) { // PAGEUP
|
639
|
+
e.preventDefault();
|
640
|
+
var target = 0;
|
641
|
+
var threshold = this.getActiveItem().position().top - this.$el.innerHeight();
|
642
|
+
this.$el.children().each(function (i) {
|
643
|
+
if ($(this).position().top + $(this).outerHeight() > threshold) {
|
644
|
+
target = i;
|
645
|
+
return false;
|
646
|
+
}
|
647
|
+
});
|
648
|
+
this.index = target;
|
649
|
+
this.activateIndexedItem();
|
650
|
+
this.setScroll();
|
651
|
+
}
|
652
|
+
else if (e.keyCode === 34) { // PAGEDOWN
|
653
|
+
e.preventDefault();
|
654
|
+
var target = this.data.length - 1;
|
655
|
+
var threshold = this.getActiveItem().position().top + this.$el.innerHeight();
|
656
|
+
this.$el.children().each(function (i) {
|
657
|
+
if ($(this).position().top > threshold) {
|
658
|
+
target = i;
|
659
|
+
return false;
|
660
|
+
}
|
661
|
+
});
|
662
|
+
this.index = target;
|
663
|
+
this.activateIndexedItem();
|
664
|
+
this.setScroll();
|
665
|
+
}
|
666
|
+
},
|
667
|
+
|
668
|
+
onClick: function (e) {
|
669
|
+
var $e = $(e.target);
|
670
|
+
e.preventDefault();
|
671
|
+
e.originalEvent.keepTextCompleteDropdown = true;
|
672
|
+
if (!$e.hasClass('textcomplete-item')) {
|
673
|
+
$e = $e.parents('li.textcomplete-item');
|
674
|
+
}
|
675
|
+
this.select(parseInt($e.data('index'), 10));
|
676
|
+
},
|
677
|
+
|
678
|
+
onMouseover: function (e){
|
679
|
+
var $e = $(e.target);
|
680
|
+
e.preventDefault();
|
681
|
+
if(!$e.hasClass('textcomplete-item')) {
|
682
|
+
$e = $e.parents('li.textcomplete-item');
|
683
|
+
}
|
684
|
+
this.index = parseInt($e.data('index'), 10)
|
685
|
+
this.activateIndexedItem();
|
686
|
+
},
|
687
|
+
|
688
|
+
destroy: function () {
|
689
|
+
this.deactivate();
|
690
|
+
this.$el.off('click.textComplete').remove();
|
691
|
+
this.$el = null;
|
692
|
+
},
|
693
|
+
|
694
|
+
appendTo: function ($el) {
|
695
|
+
$el.css({ position: 'relative' }).append(this.$el)
|
696
|
+
}
|
697
|
+
});
|
698
|
+
|
699
|
+
return ListView;
|
700
|
+
})();
|
701
|
+
|
702
|
+
$.fn.textcomplete = function (strategies, option) {
|
703
|
+
var i, l, strategy, dataKey;
|
704
|
+
|
705
|
+
dataKey = 'textComplete';
|
706
|
+
option || (option = {});
|
707
|
+
|
708
|
+
if (strategies === 'destroy') {
|
709
|
+
return this.each(function () {
|
710
|
+
var completer = $(this).data(dataKey);
|
711
|
+
if (completer) { completer.destroy(); }
|
712
|
+
});
|
713
|
+
}
|
714
|
+
|
715
|
+
for (i = 0, l = strategies.length; i < l; i++) {
|
716
|
+
strategy = strategies[i];
|
717
|
+
if (!strategy.template) {
|
718
|
+
strategy.template = identity;
|
719
|
+
}
|
720
|
+
if (strategy.index == null) {
|
721
|
+
strategy.index = 2;
|
722
|
+
}
|
723
|
+
if (strategy.placement == null) {
|
724
|
+
strategy.placement = '';
|
725
|
+
}
|
726
|
+
if (strategy.cache) {
|
727
|
+
strategy.search = memoize(strategy.search);
|
728
|
+
}
|
729
|
+
strategy.maxCount || (strategy.maxCount = 10);
|
730
|
+
}
|
731
|
+
|
732
|
+
return this.each(function () {
|
733
|
+
var $this, completer;
|
734
|
+
$this = $(this);
|
735
|
+
completer = $this.data(dataKey);
|
736
|
+
if (!completer) {
|
737
|
+
completer = new Completer($this, option);
|
738
|
+
$this.data(dataKey, completer);
|
739
|
+
}
|
740
|
+
completer.register(strategies);
|
741
|
+
});
|
742
|
+
};
|
743
|
+
|
744
|
+
})(window.jQuery || window.Zepto);
|