From 8d750e0e62e06ba41021d8d58368fc565c329204 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 5 Apr 2020 12:19:32 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E7=BC=96=E8=BE=91=E5=99=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=9B=B4=E5=A4=9A=E8=A1=A8=E6=83=85=20#13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/b3log/symphony/util/Emotions.java | 878 +----------------- .../org/b3log/symphony/util/Markdowns.java | 17 +- src/main/resources/js/common.min.js | 2 +- 3 files changed, 17 insertions(+), 880 deletions(-) diff --git a/src/main/java/org/b3log/symphony/util/Emotions.java b/src/main/java/org/b3log/symphony/util/Emotions.java index b9baac720..b03f72a78 100644 --- a/src/main/java/org/b3log/symphony/util/Emotions.java +++ b/src/main/java/org/b3log/symphony/util/Emotions.java @@ -28,7 +28,7 @@ * @author Liang Ding * @author Zephyr * @author Vanessa - * @version 1.3.0.5, Jun 22, 2019 + * @version 1.3.0.6, Apr 5, 2020 * @since 0.2.0 */ public final class Emotions { @@ -108,8 +108,7 @@ public static String convert(final String content) { ret = toUnicode(ret); for (final String emojiCode : EMOJIS) { - String repl = "\"""; ret = ret.replace(":" + emojiCode + ":", repl); @@ -127,878 +126,7 @@ public static void main(String[] args) { * Emoji list. */ private static final String[] EMOJIS = { - "+1", - "-1", - "100", - "1234", - "8ball", - "a", - "ab", - "abc", - "abcd", - "accept", - "aerial_tramway", - "airplane", - "alarm_clock", - "alien", - "ambulance", - "anchor", - "angel", - "anger", - "angry", - "anguished", - "ant", - "apple", - "aquarius", - "aries", - "arrows_clockwise", - "arrows_counterclockwise", - "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_upper_left", - "arrow_upper_right", - "arrow_up_down", - "arrow_up_small", - "art", - "articulated_lorry", - "astonished", - "atm", - "b", - "baby", - "baby_bottle", - "baby_chick", - "baby_symbol", - "back", - "baggage_claim", - "balloon", - "ballot_box_with_check", - "bamboo", - "banana", - "bangbang", - "bank", - "barber", - "bar_chart", - "baseball", - "basketball", - "bath", - "bathtub", - "battery", - "bear", - "bee", - "beer", - "beers", - "beetle", - "beginner", - "bell", - "bento", - "bicyclist", - "bike", - "bikini", - "bird", - "birthday", - "black_circle", - "black_joker", - "black_large_square", - "black_medium_small_square", - "black_medium_square", - "black_nib", - "black_small_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", - "boy", - "bread", - "bride_with_veil", - "bridge_at_night", - "briefcase", - "broken_heart", - "bug", - "bulb", - "bullettrain_front", - "bullettrain_side", - "bus", - "busstop", - "busts_in_silhouette", - "bust_in_silhouette", - "c", - "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", - "couplekiss", - "couple_with_heart", - "cow", - "cow2", - "credit_card", - "crescent_moon", - "crocodile", - "crossed_flags", - "crown", - "cry", - "crying_cat_face", - "crystal_ball", - "cupid", - "curly_loop", - "currency_exchange", - "curry", - "custard", - "customs", - "cyclone", - "d", - "dancer", - "dancers", - "dango", - "dart", - "dash", - "date", - "de", - "deciduous_tree", - "department_store", - "diamonds", - "diamond_shape_with_a_dot_inside", - "disappointed", - "disappointed_relieved", - "dizzy", - "dizzy_face", - "dog", - "dog2", - "doge", - "dollar", - "dolls", - "dolphin", - "door", - "doughnut", - "do_not_litter", - "dragon", - "dragon_face", - "dress", - "dromedary_camel", - "droplet", - "dvd", - "e-mail", - "e50a", - "ear", - "earth_africa", - "earth_americas", - "earth_asia", - "ear_of_rice", - "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", - "f", - "facepunch", - "factory", - "fallen_leaf", - "family", - "fast_forward", - "fax", - "fearful", - "feet", - "ferris_wheel", - "file_folder", - "fire", - "fireworks", - "fire_engine", - "first_quarter_moon", - "first_quarter_moon_with_face", - "fish", - "fishing_pole_and_fish", - "fish_cake", - "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", - "fuelpump", - "full_moon", - "full_moon_with_face", - "g", - "game_die", - "gb", - "gem", - "gemini", - "ghost", - "gift", - "gift_heart", - "girl", - "globe_with_meridians", - "goat", - "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", - "heart", - "heartbeat", - "heartpulse", - "hearts", - "heart_decoration", - "heart_eyes", - "heart_eyes_cat", - "hear_no_evil", - "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", - "honeybee", - "honey_pot", - "horse", - "horse_racing", - "hospital", - "hotel", - "hotsprings", - "hourglass", - "hourglass_flowing_sand", - "house", - "house_with_garden", - "huaji", - "hushed", - "i", - "icecream", - "ice_cream", - "id", - "ideograph_advantage", - "imp", - "inbox_tray", - "incoming_envelope", - "information_desk_person", - "information_source", - "innocent", - "interrobang", - "iphone", - "it", - "izakaya_lantern", - "j", - "jack_o_lantern", - "japan", - "japanese_castle", - "japanese_goblin", - "japanese_ogre", - "jeans", - "joy", - "joy_cat", - "jp", - "k", - "key", - "keycap_ten", - "kimono", - "kiss", - "kissing", - "kissing_cat", - "kissing_closed_eyes", - "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", - "leftwards_arrow_with_hook", - "left_luggage", - "left_right_arrow", - "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", - "mans_shoe", - "man_with_gua_pi_mao", - "man_with_turban", - "maple_leaf", - "mask", - "massage", - "meat_on_bone", - "mega", - "melon", - "memo", - "mens", - "metro", - "microphone", - "microscope", - "milky_way", - "minibus", - "minidisc", - "mobile_phone_off", - "moneybag", - "money_with_wings", - "monkey", - "monkey_face", - "monorail", - "mortar_board", - "mountain_bicyclist", - "mountain_cableway", - "mountain_railway", - "mount_fuji", - "mouse", - "mouse2", - "movie_camera", - "moyai", - "muscle", - "mushroom", - "musical_keyboard", - "musical_note", - "musical_score", - "mute", - "nail_care", - "name_badge", - "necktie", - "negative_squared_cross_mark", - "neutral_face", - "new", - "newspaper", - "new_moon", - "new_moon_with_face", - "ng", - "nine", - "non-potable_water", - "nose", - "notebook", - "notebook_with_decorative_cover", - "notes", - "no_bell", - "no_bicycles", - "no_entry", - "no_entry_sign", - "no_good", - "no_mobile_phones", - "no_mouth", - "no_pedestrians", - "no_smoking", - "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", - "package", - "pager", - "page_facing_up", - "page_with_curl", - "palm_tree", - "panda_face", - "paperclip", - "parking", - "partly_sunny", - "part_alternation_mark", - "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", - "point_down", - "point_left", - "point_right", - "point_up", - "point_up_2", - "police_car", - "poodle", - "poop", - "postal_horn", - "postbox", - "potable_water", - "pouch", - "poultry_leg", - "pound", - "pouting_cat", - "pray", - "princess", - "punch", - "purple_heart", - "purse", - "pushpin", - "put_litter_in_its_place", - "question", - "r", - "rabbit", - "rabbit2", - "racehorse", - "radio", - "radio_button", - "rage", - "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", - "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", - "seedling", - "see_no_evil", - "seven", - "shaved_ice", - "sheep", - "shell", - "ship", - "shirt", - "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", - "smiley", - "smiley_cat", - "smile_cat", - "smiling_imp", - "smirk", - "smirk_cat", - "smoking", - "snail", - "snake", - "snowboarder", - "snowflake", - "snowman", - "sob", - "soccer", - "soon", - "sos", - "sound", - "space_invader", - "spades", - "spaghetti", - "sparkle", - "sparkler", - "sparkles", - "sparkling_heart", - "speaker", - "speak_no_evil", - "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", - "sunflower", - "sunglasses", - "sunny", - "sunrise", - "sunrise_over_mountains", - "sun_with_face", - "surfer", - "sushi", - "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", - "u", - "u5272", - "u5408", - "u55b6", - "u6307", - "u6708", - "u6709", - "u6e80", - "u7121", - "u7533", - "u7981", - "u7a7a", - "umbrella", - "unamused", - "underage", - "unicorn_face", - "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", - "watermelon", - "water_buffalo", - "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_medium_small_square", - "white_medium_square", - "white_small_square", - "white_square_button", - "wind_chime", - "wine_glass", - "wink", - "wolf", - "woman", - "womans_clothes", - "womans_hat", - "womens", - "worried", - "wrench", - "x", - "yellow_heart", - "yen", - "yum", - "zap", - "zero", - "zzz" + "100", "1234", "+1", "-1", "1st_place_medal", "2nd_place_medal", "3rd_place_medal", "8ball", "a", "ab", "abc", "abcd", "accept", "aerial_tramway", "afghanistan", "airplane", "aland_islands", "alarm_clock", "albania", "alembic", "algeria", "alien", "ambulance", "american_samoa", "amphora", "anchor", "andorra", "angel", "anger", "angola", "angry", "anguilla", "anguished", "ant", "antarctica", "antigua_barbuda", "apple", "aquarius", "argentina", "aries", "armenia", "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", "artificial_satellite", "aruba", "asterisk", "astonished", "athletic_shoe", "atm", "atom_symbol", "australia", "austria", "avocado", "azerbaijan", "b", "b3log", "baby", "baby_bottle", "baby_chick", "baby_symbol", "back", "bacon", "badminton", "baggage_claim", "baguette_bread", "bahamas", "bahrain", "balance_scale", "balloon", "ballot_box", "ballot_box_with_check", "bamboo", "banana", "bangbang", "bangladesh", "bank", "bar_chart", "barbados", "barber", "baseball", "basketball", "basketball_man", "basketball_woman", "bat", "bath", "bathtub", "battery", "beach_umbrella", "bear", "bed", "bee", "beer", "beers", "beetle", "beginner", "belarus", "belgium", "belize", "bell", "bellhop_bell", "benin", "bento", "bermuda", "bhutan", "bicyclist", "bike", "biking_man", "biking_woman", "bikini", "biohazard", "bird", "birthday", "black_circle", "black_flag", "black_heart", "black_joker", "black_large_square", "black_medium_small_square", "black_medium_square", "black_nib", "black_small_square", "black_square_button", "blonde_man", "blonde_woman", "blossom", "blowfish", "blue_book", "blue_car", "blue_heart", "blush", "boar", "boat", "bolivia", "bomb", "book", "bookmark", "bookmark_tabs", "books", "boom", "boot", "bosnia_herzegovina", "botswana", "bouquet", "bow", "bow_and_arrow", "bowing_man", "bowing_woman", "bowling", "boxing_glove", "boy", "brazil", "bread", "bride_with_veil", "bridge_at_night", "briefcase", "british_indian_ocean_territory", "british_virgin_islands", "broken_heart", "brunei", "bug", "building_construction", "bulb", "bulgaria", "bullettrain_front", "bullettrain_side", "burkina_faso", "burrito", "burundi", "bus", "business_suit_levitating", "busstop", "bust_in_silhouette", "busts_in_silhouette", "butterfly", "cactus", "cake", "calendar", "call_me_hand", "calling", "cambodia", "camel", "camera", "camera_flash", "cameroon", "camping", "canada", "canary_islands", "cancer", "candle", "candy", "canoe", "cape_verde", "capital_abcd", "capricorn", "car", "card_file_box", "card_index", "card_index_dividers", "caribbean_netherlands", "carousel_horse", "carrot", "cat", "cat2", "cayman_islands", "cd", "central_african_republic", "chad", "chainbook", "chains", "champagne", "chart", "chart_with_downwards_trend", "chart_with_upwards_trend", "checkered_flag", "cheese", "cherries", "cherry_blossom", "chestnut", "chicken", "children_crossing", "chile", "chipmunk", "chocolate_bar", "christmas_island", "christmas_tree", "church", "cinema", "circus_tent", "city_sunrise", "city_sunset", "cityscape", "cl", "clamp", "clap", "clapper", "classical_building", "clinking_glasses", "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", "cloud_with_lightning", "cloud_with_lightning_and_rain", "cloud_with_rain", "cloud_with_snow", "clown_face", "clubs", "cn", "cocktail", "cocos_islands", "coffee", "coffin", "cold_sweat", "collision", "colombia", "comet", "comoros", "computer", "computer_mouse", "confetti_ball", "confounded", "confused", "congo_brazzaville", "congo_kinshasa", "congratulations", "construction", "construction_worker", "construction_worker_man", "construction_worker_woman", "control_knobs", "convenience_store", "cook_islands", "cookie", "cool", "cop", "copyright", "corn", "costa_rica", "cote_divoire", "couch_and_lamp", "couple", "couple_with_heart", "couple_with_heart_man_man", "couple_with_heart_woman_man", "couple_with_heart_woman_woman", "couplekiss_man_man", "couplekiss_man_woman", "couplekiss_woman_woman", "cow", "cow2", "cowboy_hat_face", "crab", "crayon", "credit_card", "crescent_moon", "cricket", "croatia", "crocodile", "croissant", "crossed_fingers", "crossed_flags", "crossed_swords", "crown", "cry", "crying_cat_face", "crystal_ball", "cuba", "cucumber", "cupid", "curacao", "curly_loop", "currency_exchange", "curry", "custard", "customs", "cyclone", "cyprus", "czech_republic", "dagger", "dancer", "dancers", "dancing_men", "dancing_women", "dango", "dark_sunglasses", "dart", "dash", "date", "de", "deciduous_tree", "deer", "denmark", "department_store", "derelict_house", "desert", "desert_island", "desktop_computer", "detective", "diamond_shape_with_a_dot_inside", "diamonds", "disappointed", "disappointed_relieved", "dizzy", "dizzy_face", "djibouti", "do_not_litter", "dog", "dog2", "doge", "dollar", "dolls", "dolphin", "dominica", "dominican_republic", "door", "doughnut", "dove", "dragon", "dragon_face", "dress", "dromedary_camel", "drooling_face", "droplet", "drum", "duck", "dvd", "e-mail", "eagle", "ear", "ear_of_rice", "earth_africa", "earth_americas", "earth_asia", "ecuador", "egg", "eggplant", "egypt", "eight", "eight_pointed_black_star", "eight_spoked_asterisk", "el_salvador", "electric_plug", "elephant", "email", "end", "envelope", "envelope_with_arrow", "equatorial_guinea", "eritrea", "es", "estonia", "ethiopia", "eu", "euro", "european_castle", "european_post_office", "european_union", "evergreen_tree", "exclamation", "expressionless", "eye", "eye_speech_bubble", "eyeglasses", "eyes", "face_with_head_bandage", "face_with_thermometer", "facepunch", "factory", "falkland_islands", "fallen_leaf", "family", "family_man_boy", "family_man_boy_boy", "family_man_girl", "family_man_girl_boy", "family_man_girl_girl", "family_man_man_boy", "family_man_man_boy_boy", "family_man_man_girl", "family_man_man_girl_boy", "family_man_man_girl_girl", "family_man_woman_boy", "family_man_woman_boy_boy", "family_man_woman_girl", "family_man_woman_girl_boy", "family_man_woman_girl_girl", "family_woman_boy", "family_woman_boy_boy", "family_woman_girl", "family_woman_girl_boy", "family_woman_girl_girl", "family_woman_woman_boy", "family_woman_woman_boy_boy", "family_woman_woman_girl", "family_woman_woman_girl_boy", "family_woman_woman_girl_girl", "faroe_islands", "fast_forward", "fax", "fearful", "feet", "female_detective", "ferris_wheel", "ferry", "field_hockey", "fiji", "file_cabinet", "file_folder", "film_projector", "film_strip", "finland", "fire", "fire_engine", "fireworks", "first_quarter_moon", "first_quarter_moon_with_face", "fish", "fish_cake", "fishing_pole_and_fish", "fist", "fist_left", "fist_oncoming", "fist_raised", "fist_right", "five", "flags", "flashlight", "fleur_de_lis", "flight_arrival", "flight_departure", "flipper", "floppy_disk", "flower_playing_cards", "flushed", "fog", "foggy", "football", "footprints", "fork_and_knife", "fountain", "fountain_pen", "four", "four_leaf_clover", "fox_face", "fr", "framed_picture", "free", "french_guiana", "french_polynesia", "french_southern_territories", "fried_egg", "fried_shrimp", "fries", "frog", "frowning", "frowning_face", "frowning_man", "frowning_woman", "fu", "fuelpump", "full_moon", "full_moon_with_face", "funeral_urn", "gabon", "gambia", "game_die", "gb", "gear", "gem", "gemini", "georgia", "ghana", "ghost", "gibraltar", "gift", "gift_heart", "girl", "globe_with_meridians", "goal_net", "goat", "golf", "golfing_man", "golfing_woman", "gorilla", "grapes", "greece", "green_apple", "green_book", "green_heart", "green_salad", "greenland", "grenada", "grey_exclamation", "grey_question", "grimacing", "grin", "grinning", "guadeloupe", "guam", "guardsman", "guardswoman", "guatemala", "guernsey", "guinea", "guinea_bissau", "guitar", "gun", "guyana", "hacpai", "haircut", "haircut_man", "haircut_woman", "haiti", "hamburger", "hammer", "hammer_and_pick", "hammer_and_wrench", "hamster", "hand", "handbag", "handshake", "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_heart_exclamation", "heavy_minus_sign", "heavy_multiplication_x", "heavy_plus_sign", "helicopter", "herb", "hibiscus", "high_brightness", "high_heel", "hocho", "hole", "honduras", "honey_pot", "honeybee", "hong_kong", "horse", "horse_racing", "hospital", "hot_pepper", "hotdog", "hotel", "hotsprings", "hourglass", "hourglass_flowing_sand", "house", "house_with_garden", "houses", "huaji", "hugs", "hungary", "hushed", "ice_cream", "ice_hockey", "ice_skate", "icecream", "iceland", "id", "ideograph_advantage", "imp", "inbox_tray", "incoming_envelope", "india", "indonesia", "information_desk_person", "information_source", "innocent", "interrobang", "iphone", "iran", "iraq", "ireland", "isle_of_man", "israel", "it", "izakaya_lantern", "jack_o_lantern", "jamaica", "japan", "japanese_castle", "japanese_goblin", "japanese_ogre", "jeans", "jersey", "jordan", "joy", "joy_cat", "joystick", "jp", "kaaba", "kazakhstan", "kenya", "key", "keyboard", "keycap_ten", "kick_scooter", "kimono", "kiribati", "kiss", "kissing", "kissing_cat", "kissing_closed_eyes", "kissing_heart", "kissing_smiling_eyes", "kiwi_fruit", "knife", "koala", "koko", "kosovo", "kr", "kuwait", "kyrgyzstan", "label", "lantern", "laos", "large_blue_circle", "large_blue_diamond", "large_orange_diamond", "last_quarter_moon", "last_quarter_moon_with_face", "latin_cross", "latke", "latvia", "laughing", "leaves", "lebanon", "ledger", "left_luggage", "left_right_arrow", "leftwards_arrow_with_hook", "lemon", "leo", "leopard", "lesotho", "level_slider", "liberia", "libra", "libya", "liechtenstein", "light_rail", "link", "lion", "lips", "lipstick", "lithuania", "lizard", "lock", "lock_with_ink_pen", "lollipop", "loop", "loud_sound", "loudspeaker", "love_hotel", "love_letter", "low_brightness", "lute", "luxembourg", "lying_face", "m", "macau", "macedonia", "madagascar", "mag", "mag_right", "mahjong", "mailbox", "mailbox_closed", "mailbox_with_mail", "mailbox_with_no_mail", "malawi", "malaysia", "maldives", "male_detective", "mali", "malta", "man", "man_artist", "man_astronaut", "man_cartwheeling", "man_cook", "man_dancing", "man_facepalming", "man_factory_worker", "man_farmer", "man_firefighter", "man_health_worker", "man_in_tuxedo", "man_judge", "man_juggling", "man_mechanic", "man_office_worker", "man_pilot", "man_playing_handball", "man_playing_water_polo", "man_scientist", "man_shrugging", "man_singer", "man_student", "man_teacher", "man_technologist", "man_with_gua_pi_mao", "man_with_turban", "mandarin", "mans_shoe", "mantelpiece_clock", "maple_leaf", "marshall_islands", "martial_arts_uniform", "martinique", "mask", "massage", "massage_man", "massage_woman", "mauritania", "mauritius", "mayotte", "meat_on_bone", "medal_military", "medal_sports", "mega", "melon", "memo", "men_wrestling", "menorah", "mens", "metal", "metro", "mexico", "micronesia", "microphone", "microscope", "middle_finger", "milk_glass", "milky_way", "minibus", "minidisc", "mobile_phone_off", "moldova", "monaco", "money_mouth_face", "money_with_wings", "moneybag", "mongolia", "monkey", "monkey_face", "monorail", "montenegro", "montserrat", "moon", "morocco", "mortar_board", "mosque", "motor_boat", "motor_scooter", "motorcycle", "motorway", "mount_fuji", "mountain", "mountain_bicyclist", "mountain_biking_man", "mountain_biking_woman", "mountain_cableway", "mountain_railway", "mountain_snow", "mouse", "mouse2", "movie_camera", "moyai", "mozambique", "mrs_claus", "muscle", "mushroom", "musical_keyboard", "musical_note", "musical_score", "mute", "myanmar", "nail_care", "name_badge", "namibia", "national_park", "nauru", "nauseated_face", "necktie", "negative_squared_cross_mark", "nepal", "nerd_face", "netherlands", "neutral_face", "new", "new_caledonia", "new_moon", "new_moon_with_face", "new_zealand", "newspaper", "newspaper_roll", "next_track_button", "ng", "ng_man", "ng_woman", "nicaragua", "niger", "nigeria", "night_with_stars", "nine", "niue", "no_bell", "no_bicycles", "no_entry", "no_entry_sign", "no_good", "no_good_man", "no_good_woman", "no_mobile_phones", "no_mouth", "no_pedestrians", "no_smoking", "non-potable_water", "norfolk_island", "north_korea", "northern_mariana_islands", "norway", "nose", "notebook", "notebook_with_decorative_cover", "notes", "nut_and_bolt", "o", "o2", "ocean", "octocat", "octopus", "oden", "office", "oil_drum", "ok", "ok_hand", "ok_man", "ok_woman", "old_key", "older_man", "older_woman", "om", "oman", "on", "oncoming_automobile", "oncoming_bus", "oncoming_police_car", "oncoming_taxi", "one", "open_book", "open_file_folder", "open_hands", "open_mouth", "open_umbrella", "ophiuchus", "orange", "orange_book", "orthodox_cross", "outbox_tray", "owl", "ox", "package", "page_facing_up", "page_with_curl", "pager", "paintbrush", "pakistan", "palau", "palestinian_territories", "palm_tree", "panama", "pancakes", "panda_face", "paperclip", "paperclips", "papua_new_guinea", "paraguay", "parasol_on_ground", "parking", "part_alternation_mark", "partly_sunny", "passenger_ship", "passport_control", "pause_button", "paw_prints", "peace_symbol", "peach", "peanuts", "pear", "pen", "pencil", "pencil2", "penguin", "pensive", "performing_arts", "persevere", "person_fencing", "person_frowning", "person_with_blond_hair", "person_with_pouting_face", "peru", "philippines", "phone", "pick", "pig", "pig2", "pig_nose", "pill", "pineapple", "ping_pong", "pipe", "pisces", "pitcairn_islands", "pizza", "place_of_worship", "plate_with_cutlery", "play_or_pause_button", "point_down", "point_left", "point_right", "point_up", "point_up_2", "poland", "police_car", "policeman", "policewoman", "poodle", "poop", "popcorn", "portugal", "post_office", "postal_horn", "postbox", "potable_water", "potato", "pouch", "poultry_leg", "pound", "pout", "pouting_cat", "pouting_man", "pouting_woman", "pray", "prayer_beads", "pregnant_woman", "previous_track_button", "prince", "princess", "printer", "puerto_rico", "punch", "purple_heart", "purse", "pushpin", "put_litter_in_its_place", "qatar", "question", "rabbit", "rabbit2", "racehorse", "racing_car", "radio", "radio_button", "radioactive", "rage", "railway_car", "railway_track", "rainbow", "rainbow_flag", "raised_back_of_hand", "raised_hand", "raised_hand_with_fingers_splayed", "raised_hands", "raising_hand", "raising_hand_man", "raising_hand_woman", "ram", "ramen", "rat", "record_button", "recycle", "red_car", "red_circle", "registered", "relaxed", "relieved", "reminder_ribbon", "repeat", "repeat_one", "rescue_worker_helmet", "restroom", "reunion", "revolving_hearts", "rewind", "rhinoceros", "ribbon", "rice", "rice_ball", "rice_cracker", "rice_scene", "right_anger_bubble", "ring", "robot", "rocket", "rofl", "roll_eyes", "roller_coaster", "romania", "rooster", "rose", "rosette", "rotating_light", "round_pushpin", "rowboat", "rowing_man", "rowing_woman", "ru", "rugby_football", "runner", "running", "running_man", "running_shirt_with_sash", "running_woman", "rwanda", "sa", "sagittarius", "sailboat", "sake", "samoa", "san_marino", "sandal", "santa", "sao_tome_principe", "sassy_man", "sassy_woman", "satellite", "satisfied", "saudi_arabia", "saxophone", "school", "school_satchel", "scissors", "scorpion", "scorpius", "scream", "scream_cat", "scroll", "seat", "secret", "see_no_evil", "seedling", "selfie", "senegal", "serbia", "seven", "seychelles", "shallow_pan_of_food", "shamrock", "shark", "shaved_ice", "sheep", "shell", "shield", "shinto_shrine", "ship", "shirt", "shit", "shoe", "shopping", "shopping_cart", "shower", "shrimp", "sierra_leone", "signal_strength", "singapore", "sint_maarten", "six", "six_pointed_star", "ski", "skier", "skull", "skull_and_crossbones", "sleeping", "sleeping_bed", "sleepy", "slightly_frowning_face", "slightly_smiling_face", "slot_machine", "slovakia", "slovenia", "small_airplane", "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", "sneezing_face", "snowboarder", "snowflake", "snowman", "snowman_with_snow", "sob", "soccer", "solo", "solomon_islands", "somalia", "soon", "sos", "sound", "south_africa", "south_georgia_south_sandwich_islands", "south_sudan", "space_invader", "spades", "spaghetti", "sparkle", "sparkler", "sparkles", "sparkling_heart", "speak_no_evil", "speaker", "speaking_head", "speech_balloon", "speedboat", "spider", "spider_web", "spiral_calendar", "spiral_notepad", "spoon", "squid", "sri_lanka", "st_barthelemy", "st_helena", "st_kitts_nevis", "st_lucia", "st_pierre_miquelon", "st_vincent_grenadines", "stadium", "star", "star2", "star_and_crescent", "star_of_david", "stars", "station", "statue_of_liberty", "steam_locomotive", "stew", "stop_button", "stop_sign", "stopwatch", "straight_ruler", "strawberry", "stuck_out_tongue", "stuck_out_tongue_closed_eyes", "stuck_out_tongue_winking_eye", "studio_microphone", "stuffed_flatbread", "sudan", "sun_behind_large_cloud", "sun_behind_rain_cloud", "sun_behind_small_cloud", "sun_with_face", "sunflower", "sunglasses", "sunny", "sunrise", "sunrise_over_mountains", "surfer", "surfing_man", "surfing_woman", "suriname", "sushi", "suspension_railway", "swaziland", "sweat", "sweat_drops", "sweat_smile", "sweden", "sweet_potato", "swimmer", "swimming_man", "swimming_woman", "switzerland", "sym", "symbols", "synagogue", "syria", "syringe", "taco", "tada", "taiwan", "tajikistan", "tanabata_tree", "tangerine", "tanzania", "taurus", "taxi", "tea", "telephone", "telephone_receiver", "telescope", "tennis", "tent", "thailand", "thermometer", "thinking", "thought_balloon", "three", "thumbsdown", "thumbsup", "ticket", "tickets", "tiger", "tiger2", "timer_clock", "timor_leste", "tipping_hand_man", "tipping_hand_woman", "tired_face", "tm", "togo", "toilet", "tokelau", "tokyo_tower", "tomato", "tonga", "tongue", "top", "tophat", "tornado", "tr", "trackball", "tractor", "traffic_light", "train", "train2", "tram", "triangular_flag_on_post", "triangular_ruler", "trident", "trinidad_tobago", "triumph", "trolleybus", "trollface", "trophy", "tropical_drink", "tropical_fish", "truck", "trumpet", "tshirt", "tulip", "tumbler_glass", "tunisia", "turkey", "turkmenistan", "turks_caicos_islands", "turtle", "tuvalu", "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", "uganda", "uk", "ukraine", "umbrella", "unamused", "underage", "unicorn", "united_arab_emirates", "unlock", "up", "upside_down_face", "uruguay", "us", "us_virgin_islands", "uzbekistan", "v", "vanuatu", "vatican_city", "vditor", "venezuela", "vertical_traffic_light", "vhs", "vibration_mode", "video_camera", "video_game", "vietnam", "violin", "virgo", "volcano", "volleyball", "vs", "vulcan_salute", "walking", "walking_man", "walking_woman", "wallis_futuna", "waning_crescent_moon", "waning_gibbous_moon", "warning", "wastebasket", "watch", "water_buffalo", "watermelon", "wave", "wavy_dash", "waxing_crescent_moon", "waxing_gibbous_moon", "wc", "weary", "wedding", "weight_lifting_man", "weight_lifting_woman", "western_sahara", "whale", "whale2", "wheel_of_dharma", "wheelchair", "white_check_mark", "white_circle", "white_flag", "white_flower", "white_large_square", "white_medium_small_square", "white_medium_square", "white_small_square", "white_square_button", "wide", "wilted_flower", "wind_chime", "wind_face", "wine_glass", "wink", "wolf", "woman", "woman_artist", "woman_astronaut", "woman_cartwheeling", "woman_cook", "woman_facepalming", "woman_factory_worker", "woman_farmer", "woman_firefighter", "woman_health_worker", "woman_judge", "woman_juggling", "woman_mechanic", "woman_office_worker", "woman_pilot", "woman_playing_handball", "woman_playing_water_polo", "woman_scientist", "woman_shrugging", "woman_singer", "woman_student", "woman_teacher", "woman_technologist", "woman_with_turban", "womans_clothes", "womans_hat", "women_wrestling", "womens", "world_map", "worried", "wrench", "writing_hand", "wulian", "x", "yellow_heart", "yemen", "yen", "yin_yang", "yum", "zambia", "zap", "zero", "zimbabwe", "zipper_mouth_face", "zzz" }; /** diff --git a/src/main/java/org/b3log/symphony/util/Markdowns.java b/src/main/java/org/b3log/symphony/util/Markdowns.java index 4bf1167c3..63e14e58c 100644 --- a/src/main/java/org/b3log/symphony/util/Markdowns.java +++ b/src/main/java/org/b3log/symphony/util/Markdowns.java @@ -66,7 +66,7 @@ * @author Liang Ding * @author Zephyr * @author Vanessa - * @version 1.11.21.17, Sep 18, 2019 + * @version 1.11.21.18, Apr 5, 2020 * @since 0.2.0 */ public final class Markdowns { @@ -443,7 +443,8 @@ private static void putHTML(final String markdownText, final String html) { private static void inputWhitelist(final Whitelist whitelist) { whitelist.addTags("span", "hr", "kbd", "samp", "tt", "del", "s", "strike", "u", "details", "summary"). - addAttributes("iframe", "src", "width", "height", "border", "marginwidth", "marginheight"). + addAttributes("sup", "class", "id"). + addAttributes("iframe", "src", "sandbox", "width", "height", "border", "marginwidth", "marginheight"). addAttributes("audio", "controls", "src"). addAttributes("video", "controls", "src", "width", "height"). addAttributes("source", "src", "media", "type"). @@ -453,11 +454,19 @@ private static void inputWhitelist(final Whitelist whitelist) { addAttributes("embed", "src", "type", "width", "height", "wmode", "allowNetworking"). addAttributes("pre", "class"). addAttributes("code", "class"). + addAttributes("li", "class", "id"). addAttributes("div", "class"). addAttributes("span", "class"). - addAttributes("p", "align"); + addAttributes("img", "class"). + addAttributes("p", "align"). + addAttributes("th", "align"). + addAttributes("a", "class", "rel"). + addAttributes("td", "align"); + whitelist.addProtocols("a", "href", "#"); + whitelist.addProtocols("iframe", "src", "http", "https"); for (int i = 1; i <= 6; i++) { - whitelist.addAttributes("h" + i, "align"); + whitelist.addAttributes("h" + i, "align", "id"); } + whitelist.preserveRelativeLinks(true); } } diff --git a/src/main/resources/js/common.min.js b/src/main/resources/js/common.min.js index 4acfb0c77..18d2fc367 100644 --- a/src/main/resources/js/common.min.js +++ b/src/main/resources/js/common.min.js @@ -1 +1 @@ -var Util={LazyLoadImage:function(){function t(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){$(e).attr("style")||$(e).attr("class")||$(e).attr("width")||$(e).attr("height")||1!==$(e).closest(".vditor-reset").length||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<$(e).closest(".vditor-reset").width()/($(window).height()-40)&&t.naturalHeight>$(window).height()-40&&(e.style.height=$(window).height()-40+"px"),$(e).attr("class")||1!==$(e).closest(".vditor-reset").length||_processPreview($(e)),e.src=t.src,e.style.backgroundImage="none",e.style.backgroundColor="transparent"}),e.removeAttribute("data-src")}if(!("IntersectionObserver"in window))return $("img").each(function(){this.getAttribute("data-src")&&t(this)}),!1;window.imageIntersectionObserver?window.imageIntersectionObserver.disconnect():window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),$("img").each(function(){window.imageIntersectionObserver.observe(this)})},addStyle:function(e,t){if(!document.getElementById(t)){var a=document.createElement("link");a.id=t,a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(a)}},parseHljs:function(){Vditor.highlightRender({style:"github",enable:!Label.luteAvailable},document)},parseMarkdown:function(){Vditor.mermaidRender(document.body),Vditor.chartRender(),Vditor.mathRender(document.body),Vditor.codeRender(document.body,Label.langLabel),Vditor.abcRender(),Vditor.graphvizRender(this);var t=!1;if($(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this).attr("href");e&&".mov"===e.substr(e.length-4).toLowerCase()&&(t=!0)})}),t){function e(){$(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this),t=$(this).attr("href");if(t&&".mov"===t.substr(t.length-4).toLowerCase()){this.style.height="360px",this.style.width="270px",e.removeAttr("href");var a=LivePhotosKit.Player(this);a.photoSrc=Label.staticServePath+"/images/livephoto.png",a.videoSrc=t}})})}"undefined"!=typeof LivePhotosKit?e():$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/livephotoskit.js",dataType:"script",cache:!0}).done(function(){e()})}},prevKey:void 0,clipboard:function(e,t,a){e.click(function(e){t[0].select();try{document.execCommand("copy")?a():console.log("Copy command was unsuccessful")}catch(e){console.log("Oops, unable to copy")}window.getSelection().removeAllRanges()})},closeAlert:function(){var e=$("#alertDialogPanel");e.prev().remove(),e.remove()},alert:function(e){var t;t='
'+('
'+e+"
"),$("body").append(t),$("#alertDialogPanel").css({top:($(window).height()-$("#alertDialogPanel").height())/2+"px",left:($(window).width()-$("#alertDialogPanel").width())/2+"px",outline:"none"}).show().focus()},makeNotificationRead:function(e,a){return $.ajax({url:Label.servePath+"/notifications/read/"+e,type:"GET",cache:!1,success:function(e,t){e.sc&&(Util.setUnreadNotificationCount(!1),$(".notification li").addClass("read"),a&&($(a).prev().remove(),$(a).remove(),0===$(".home-menu .count").length&&$(".module-header:last > span").remove()))}}),!1},_initCommonHotKey:function(){if(!Label.userKeyboardShortcutsStatus||"1"===Label.userKeyboardShortcutsStatus)return!1;function i(e){var t=$(".list > ul > li.focus"),a=0===$(".radio-btn").length?0:48;if(1===t.length){if("top"===e||"bottom"===e)return $(window).scrollTop(t.offset().top-a),!1;($(window).height()+$(window).scrollTop()t.offset().top)&&("down"===e?$(window).scrollTop(t.offset().top-($(window).height()-t.outerHeight())):$(window).scrollTop(t.offset().top-a))}}0===$("#articleTitle").length&&$(document).bind("keydown","c",function(e){return Util.prevKey||(window.location=Label.servePath+"/post?type=0"),!1}),$(document).bind("keyup","g",function(){return Util.prevKey="g",setTimeout(function(){Util.prevKey=void 0},1e3),!1}).bind("keyup","s",function(){return $("#search").focus(),!1}).bind("keyup","t",function(){return void 0===Util.prevKey&&Util.goTop(),!1}).bind("keyup","n",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/notifications"),!1}).bind("keyup","h",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/hot"),!1}).bind("keyup","i",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath),!1}).bind("keyup","r",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/recent"),!1}).bind("keyup","p",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/perfect"),!1}).bind("keyup","Shift+/",function(e){return window.open(Label.servePath+"/about"),!1}).bind("keyup","j",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:first").addClass("focus"):1===a.next().length&&(a.next().addClass("focus"),a.removeClass("focus")),i("down"),!1}).bind("keyup","k",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:last").addClass("focus"):1===a.prev().length&&(a.prev().addClass("focus"),a.removeClass("focus")),i("up"),!1}).bind("keyup","f",function(e){var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:first").addClass("focus"),i("top"),!1}).bind("keyup","l",function(e){if(Util.prevKey)return!1;var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:last").addClass("focus"),i("bottom"),!1}).bind("keyup","o",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1}).bind("keyup","return",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1})},notifyMsg:function(t){if(!("Notification"in window))return!1;function a(e){var t=new Notification(Label.visionLabel,{body:Label.desktopNotificationTemplateLabel.replace("${count}",e),icon:Label.staticServePath+"/images/faviconH.png"});t.onclick=t.onerror=function(){window.location=Label.servePath+"/notifications"}}"granted"===Notification.permission?a(t):"denied"!==Notification.permission&&Notification.requestPermission(function(e){"granted"===e&&a(t)})},processClipBoard:function(e,i){if(""===e.getData("text/html")&&2===e.items.length)return"";var t=!1,a=toMarkdown(e.getData("text/html"),{converters:[{filter:"img",replacement:function(e,t){if(1===t.attributes.length)return"";var a={url:t.src};return $.ajax({url:Label.servePath+"/fetch-upload",type:"POST",data:JSON.stringify(a),cache:!1,success:function(e,t){if(e.sc){var a=i.getValue();a=a.replace(e.originalURL,e.url),i.setValue(a)}}}),"![]("+t.src+")"}},{filter:["pre","code"],replacement:function(e){return 1With ♥ from '}},[{source:function(e,a){i.search(e,{hitsPerPage:20},function(e,t){e?a([]):a(t.hits,t)})},displayKey:"name",templates:{suggestion:function(e){return e._highlightResult.articleTitle.value}}}]).on("autocomplete:selected",function(e,t,a){window.open(Label.servePath+"/article/"+t.oId)}).bind("keyup","esc",function(){$(this).blur()})},newVditor:function(e){Label.emoji||$.ajax({url:Label.servePath+"/users/emotions",type:"GET",cache:!0,async:!1,success:function(e){Label.emoji={},e.data.forEach(function(e){var t=Object.keys(e)[0];Label.emoji[t]=e[t]})}});var t={after:e.after||void 0,typewriterMode:e.typewriterMode||!1,cache:{enable:e.cache||!1},input:e.input,preview:{delay:500,mode:e.preview.mode,url:Label.servePath+"/markdown",parse:function(e){"none"!==e.style.display&&Util.LazyLoadImage()},hljs:{enable:!Label.luteAvailable}},upload:{max:Label.fileMaxSize,url:Label.servePath+"/upload",linkToImgUrl:Label.servePath+"/fetch-upload",filename:function(e){return e.replace(/\?|\\|\/|:|\||<|>|\*|\[|\]|\s+/g,"-")}},placeholder:e.placeholder,height:e.height,counter:e.counter,resize:{enable:e.resize.enable,position:e.resize.position},lang:Label.langLabel,hint:{emojiTail:'设置常用表情',emoji:Label.emoji,at:function(a){var i=[];return $.ajax({url:Label.servePath+"/users/names",type:"POST",async:!1,data:JSON.stringify({name:a}),success:function(e){if(0===e.code){for(var t=0;t'+e.data[t].userName});""===a&&i.push({html:' 参与者',value:"@participants"})}else alert(e.msg)}}),i}},esc:e.esc,ctrlEnter:e.ctrlEnter};return $(window).width()<768?(t.toolbar=["emoji","bold","italic","link","list","check","upload","edit-mode","preview","fullscreen","help"],t.resize.enable=!1):e.toolbar&&(t.toolbar=e.toolbar),new Vditor(e.id,t)},setUnreadNotificationCount:function(o){$.ajax({url:Label.servePath+"/notifications/unread/count",type:"GET",cache:!1,success:function(e,t){function a(e){var t="",a='';return 0'+Label.notificationCommentedLabel+' '+e.unreadCommentedNotificationCnt+""+a.replace("${markReadType}","commented")+""),0'+Label.notificationReplyLabel+' '+e.unreadReplyNotificationCnt+""+a.replace("${markReadType}","reply")+""),0'+Label.notificationAtLabel+' '+e.unreadAtNotificationCnt+""+a.replace("${markReadType}","at")+""),0'+Label.notificationFollowingLabel+' '+e.unreadFollowingNotificationCnt+""+a.replace("${markReadType}","following")+""),0'+Label.pointLabel+' '+e.unreadPointNotificationCnt+""),0'+Label.sameCityLabel+' '+e.unreadBroadcastNotificationCnt+""),0'+Label.systemLabel+' '+e.unreadSysAnnounceNotificationCnt+""),0'+Label.newFollowerLabel+' '+e.unreadNewFollowerNotificationCnt+""),t}var i=e.unreadNotificationCnt;if($.ua.set(navigator.userAgent),$.ua.device.type&&"mobile"===$.ua.device.type){if(0
    '+n+"
"),$("#aNotifications").click(function(){$("#notificationsPanel").slideToggle()})}else window.localStorage.hadNotificate="false",$("#aNotifications").removeClass("msg").addClass("no-msg").text(i).attr("href",Label.servePath+"/notifications");return!1}if(0
    '+n+"
"),$("#aNotifications").click(function(){$("#notificationsPanel").show()}),$("body").click(function(e){"aNotifications"!==e.target.id&&"notificationsPanel"!==$(e.target).closest(".module").attr("id")&&$("#notificationsPanel").hide()})}else window.localStorage.hadNotificate="false",$("#notificationsPanel").remove(),$("#aNotifications").removeClass("msg").addClass("no-msg tooltipped tooltipped-w").text(i).attr("href",Label.servePath+"/notifications")}})},follow:function(a,i,n,o){if(!Label.isLoggedIn)return Util.needLogin(),!1;if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/follow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){e.sc&&($(a).removeClass("disabled"),void 0!==o?"article"===n||"tag"===n?$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.uncollectLabel).addClass("ft-red"):"article-watch"===n&&$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.unfollowLabel).addClass("ft-red"):$(a).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"')").text("article"===n?Label.uncollectLabel:Label.unfollowLabel))},complete:function(){$(a).removeClass("disabled")}})},unfollow:function(a,i,n,o){if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/unfollow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){e.sc&&(void 0!==o?"article"===n||"tag"===n?$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.collectLabel):"article-watch"===n&&$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.followLabel):$(a).attr("onclick","Util.follow(this, '"+i+"', '"+n+"')").text("article"===n?Label.collectLabel:Label.followLabel))},complete:function(){$(a).removeClass("disabled")}})},goTop:function(){$("html, body").animate({scrollTop:0},800)},goLogin:function(){if(-1===location.href.indexOf("/login")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/login?goto="+encodeURIComponent(e)}},needLogin:function(){Util.goLogin()},goRegister:function(){if(-1===location.href.indexOf("/register")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/register?goto="+encodeURIComponent(e)}},_kill:function(){"IE"===$.ua.browser.name&&parseInt($.ua.browser.version)<10&&$.ajax({url:Label.servePath+"/kill-browser",type:"GET",cache:!1,success:function(e,t){$("body").append(e),$("#killBrowser").dialog({modal:!0,hideFooter:!0,height:345,width:600}),$("#killBrowser").dialog("open")}})},_initActivity:function(){var e=$(".person-info"),t=e.data("percent"),a=0,i=0,n=0;t<=25?a=parseInt(t/.25):t<=75?(a=100,i=parseInt((t-25)/2/.25)):t<=100&&(i=a=100,n=parseInt((t-75)/.25)),e.find(".bottom").css({width:a+"%",left:(100-a)/2+"%"}),e.find(".top-left").css({width:parseInt(n/2)+"%",left:0}),e.find(".top-right").css({width:parseInt(n/2)+"%",right:0}),e.find(".left").css({height:i+"%",top:100-i+"%"}),e.find(".right").css({height:i+"%",top:100-i+"%"})},_initBreezemoon:function(t,e,a){0!==t.length&&(e.keypress(function(e){13===e.keyCode&&t.click()}),t.click(function(){a?"disabled"!==t.attr("disabled")&&(t.attr("disabled","disabled").css("opacity","0.3"),$.ajax({url:Label.servePath+"/breezemoon",type:"POST",cache:!1,headers:{csrfToken:$(this).data("csrf")},data:JSON.stringify({breezemoonContent:e.val()}),success:function(e){0===e.sc?window.location.reload():Util.alert(e.msg)},complete:function(){t.css("opacity",1).removeAttr("disabled")}})):Util.goLogin()}))},init:function(e){if(this._kill(),this._initNav(),this._initActivity(),1===$(".pagination select").length&&$(".pagination select").change(function(){var e=$(this).data("url")+"?p="+$(this).val();$(this).data("param")&&(e+="&"+$(this).data("param")),window.location.href=e}),$(".nav input.search").focus(function(){$(".nav .tags").css("visibility","hidden")}).blur(function(){$(".nav .tags").css("visibility","visible")}),$(window).scroll(function(){20<$(window).scrollTop()&&0===$(".radio-btn").length?$(".go-top").show():$(".go-top").hide()}),Util.parseMarkdown(),Util.parseHljs(),e&&(window.localStorage.hadNotificate||(window.localStorage.hadNotificate="false"),Util.setUnreadNotificationCount(!0)),$(window).keyup(function(e){27===e.keyCode&&Util.closeAlert()}),this._initBreezemoon($("#breezemoonPostBtn"),$("#breezemoonInput"),e),this._initCommonHotKey(),e)return!1;$("body").click(function(e){0===$(e.target).closest(".nav .form").length&&$(".nav .form").hide()})},initUserChannel:function(e){var t=new ReconnectingWebSocket(e);t.reconnectInterval=1e4,t.onopen=function(){setInterval(function(){t.send("-hb-")},3e5)},t.onmessage=function(e){switch(JSON.parse(e.data).command){case"refreshNotification":Util.setUnreadNotificationCount(!0)}},t.onclose=function(){t.close()},t.onerror=function(e){console.log("ERROR",e)}},_initNav:function(){var e=location.href;$(".user-nav > a").each(function(){0===e.indexOf($(this).attr("href"))?$(this).addClass("current"):"/register"===location.pathname?$(".user-nav a:last").addClass("current"):"/login"===location.pathname?$(".user-nav a:first").addClass("current"):0!==e.indexOf(Label.servePath+"/settings")&&0!==e.indexOf($("#aPersonListPanel").data("url"))||$("#aPersonListPanel").addClass("current")}),$(".nav .avatar-small").parent().click(function(){$("#personListPanel").show()}),$("body").click(function(e){"aPersonListPanel"!==$(e.target).closest("a").attr("id")&&"personListPanel"!==$(e.target).closest(".module").attr("id")&&$("#personListPanel").hide()}),1===$(".nav-tabs a:last").length&&0<$(".nav-tabs a:last")[0].offsetTop&&$(".nav-tabs").mouseover(function(){$(".user-nav").hide()}).mouseout(function(){$(".user-nav").show()})},logout:function(){window.localStorage&&(window.localStorage.clear(),window.localStorage.hadNotificate="false"),window.location.href=Label.servePath+"/logout?goto="+Label.servePath},startsWith:function(e,t){return e.match("^"+t)==t},mouseClickEffects:function(){var r=0;jQuery(document).ready(function(o){o("html").click(function(e){var t,a=18;10==++r?t=o("").text("OωO"):20===r?t=o("").text("(๑•́ ∀ •̀๑)"):30===r?t=o("").text("(๑•́ ₃ •̀๑)"):40===r?t=o("").text("(๑•̀_•́๑)"):50===r?t=o("").text("( ̄へ ̄)"):60===r?t=o("").text("(╯°口°)╯(┴—┴"):70===r?t=o("").text("૮( ᵒ̌皿ᵒ̌ )ა"):80===r?t=o("").text("╮(。>口<。)╭"):90===r?t=o("").text("( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃"):100<=r&&r<=105?t=o("").text("(ꐦ°᷄д°᷅)"):(t=o(''),a=Math.round(14*Math.random()+6));var i=e.pageX,n=e.pageY;t.css({"z-index":9999,top:n-20,left:i,position:"absolute",color:"#E94F06","font-size":a,"-moz-user-select":"none","-webkit-user-select":"none","-ms-user-select":"none"}),o("body").append(t),t.animate({top:n-180,opacity:0},1500,function(){t.remove()})})})}},Validate={goValidate:function(e){for(var t="
    ",a=0;a"+e.data[a].msg+"");return"
      "===t?(e.target.html(""),e.target.removeClass("error"),!0):(e.target.html(t+"
    "),e.target.addClass("error"),!1)},validate:function(e){var t=!0,a="";switch(a="editor"===e.type?e.target.getValue():"imgSrc"===e.type?e.target.attr("src"):"imgStyle"===e.type?e.target.data("imageurl"):e.target.val().toString().replace(/(^\s*)|(\s*$)/g,""),e.type){case"email":/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(e.target.val())||(t=!1);break;case"password":!(e.target.val().length<6||16=(e.min?e.min:0)}return t}},Label={},pngMagic=[137,80,78,71,13,10,26,10],jpeg_jfif=[74,70,73,70],jpeg_exif=[69,120,105,102],jpegMagic=[255,216,255,224],gifMagic0=[71,73,70,56,55,97],getGifMagic1=[71,73,70,56,57,97],wavMagic1=[82,73,70,70],wavMagic2=[87,65,86,69];function arraycopy(e,t,a,n,o){for(i=0;isuccess(): Unable to detect window audio context, cannot continue.")}var o=n.getWindowAudioContextMethod();Audio.recorderObj=new SoundRecorder(o,2048,a,i),Audio.recorderObj.init(e),Audio.recorderObj.recorder.onaudioprocess=function(e){if(Audio.recorderObj.isRecording()){var t=e.inputBuffer.getChannelData(0),a=e.inputBuffer.getChannelData(1);Audio.recorderObj.cloneChannelData(t,a)}},Audio.availabel=!0,r&&r()}},function(e){console.log("getUserMedia->failure(): ERROR: Microphone access request failed!");switch(e.name){case"PermissionDeniedError":Label.recordDeniedLabel;break;case"DevicesNotFoundError":Label.recordDeviceNotFoundLabel;break;default:"ERROR: The following unexpected error occurred while attempting to connect to your microphone: "+e.name}})):console.log("ERROR: getUserMedia not supported by browser.")},handleStartRecording:function(){Audio.recorderObj.startRecordingNewWavFile()},handleStopRecording:function(){Audio.recorderObj.stopRecording(),Audio.wavFileBlob=Audio.recorderObj.buildWavFileBlob()}}; \ No newline at end of file +var Util={LazyLoadImage:function(){function t(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){$(e).attr("style")||$(e).attr("class")||$(e).attr("width")||$(e).attr("height")||1!==$(e).closest(".vditor-reset").length||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<$(e).closest(".vditor-reset").width()/($(window).height()-40)&&t.naturalHeight>$(window).height()-40&&(e.style.height=$(window).height()-40+"px"),$(e).attr("class")||1!==$(e).closest(".vditor-reset").length||_processPreview($(e)),e.src=t.src,e.style.backgroundImage="none",e.style.backgroundColor="transparent"}),e.removeAttribute("data-src")}if(!("IntersectionObserver"in window))return $("img").each(function(){this.getAttribute("data-src")&&t(this)}),!1;window.imageIntersectionObserver?window.imageIntersectionObserver.disconnect():window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),$("img").each(function(){window.imageIntersectionObserver.observe(this)})},addStyle:function(e,t){if(!document.getElementById(t)){var a=document.createElement("link");a.id=t,a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(a)}},parseHljs:function(){Vditor.highlightRender({style:"github",enable:!Label.luteAvailable},document)},parseMarkdown:function(){Vditor.mermaidRender(document.body),Vditor.chartRender(),Vditor.mathRender(document.body),Vditor.codeRender(document.body,Label.langLabel),Vditor.abcRender(),Vditor.graphvizRender(document.body);var t=!1;if($(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this).attr("href");e&&".mov"===e.substr(e.length-4).toLowerCase()&&(t=!0)})}),t){function e(){$(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this),t=$(this).attr("href");if(t&&".mov"===t.substr(t.length-4).toLowerCase()){this.style.height="360px",this.style.width="270px",e.removeAttr("href");var a=LivePhotosKit.Player(this);a.photoSrc=Label.staticServePath+"/images/livephoto.png",a.videoSrc=t}})})}"undefined"!=typeof LivePhotosKit?e():$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/livephotoskit.js",dataType:"script",cache:!0}).done(function(){e()})}},prevKey:void 0,clipboard:function(e,t,a){e.click(function(e){t[0].select();try{document.execCommand("copy")?a():console.log("Copy command was unsuccessful")}catch(e){console.log("Oops, unable to copy")}window.getSelection().removeAllRanges()})},closeAlert:function(){var e=$("#alertDialogPanel");e.prev().remove(),e.remove()},alert:function(e){var t;t='
    '+('
    '+e+"
    "),$("body").append(t),$("#alertDialogPanel").css({top:($(window).height()-$("#alertDialogPanel").height())/2+"px",left:($(window).width()-$("#alertDialogPanel").width())/2+"px",outline:"none"}).show().focus()},makeNotificationRead:function(e,a){return $.ajax({url:Label.servePath+"/notifications/read/"+e,type:"GET",cache:!1,success:function(e,t){e.sc&&(Util.setUnreadNotificationCount(!1),$(".notification li").addClass("read"),a&&($(a).prev().remove(),$(a).remove(),0===$(".home-menu .count").length&&$(".module-header:last > span").remove()))}}),!1},_initCommonHotKey:function(){if(!Label.userKeyboardShortcutsStatus||"1"===Label.userKeyboardShortcutsStatus)return!1;function i(e){var t=$(".list > ul > li.focus"),a=0===$(".radio-btn").length?0:48;if(1===t.length){if("top"===e||"bottom"===e)return $(window).scrollTop(t.offset().top-a),!1;($(window).height()+$(window).scrollTop()t.offset().top)&&("down"===e?$(window).scrollTop(t.offset().top-($(window).height()-t.outerHeight())):$(window).scrollTop(t.offset().top-a))}}0===$("#articleTitle").length&&$(document).bind("keydown","c",function(e){return Util.prevKey||(window.location=Label.servePath+"/post?type=0"),!1}),$(document).bind("keyup","g",function(){return Util.prevKey="g",setTimeout(function(){Util.prevKey=void 0},1e3),!1}).bind("keyup","s",function(){return $("#search").focus(),!1}).bind("keyup","t",function(){return void 0===Util.prevKey&&Util.goTop(),!1}).bind("keyup","n",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/notifications"),!1}).bind("keyup","h",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/hot"),!1}).bind("keyup","i",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath),!1}).bind("keyup","r",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/recent"),!1}).bind("keyup","p",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/perfect"),!1}).bind("keyup","Shift+/",function(e){return window.open(Label.servePath+"/about"),!1}).bind("keyup","j",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:first").addClass("focus"):1===a.next().length&&(a.next().addClass("focus"),a.removeClass("focus")),i("down"),!1}).bind("keyup","k",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:last").addClass("focus"):1===a.prev().length&&(a.prev().addClass("focus"),a.removeClass("focus")),i("up"),!1}).bind("keyup","f",function(e){var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:first").addClass("focus"),i("top"),!1}).bind("keyup","l",function(e){if(Util.prevKey)return!1;var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:last").addClass("focus"),i("bottom"),!1}).bind("keyup","o",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1}).bind("keyup","return",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1})},notifyMsg:function(t){if(!("Notification"in window))return!1;function a(e){var t=new Notification(Label.visionLabel,{body:Label.desktopNotificationTemplateLabel.replace("${count}",e),icon:Label.staticServePath+"/images/faviconH.png"});t.onclick=t.onerror=function(){window.location=Label.servePath+"/notifications"}}"granted"===Notification.permission?a(t):"denied"!==Notification.permission&&Notification.requestPermission(function(e){"granted"===e&&a(t)})},processClipBoard:function(e,i){if(""===e.getData("text/html")&&2===e.items.length)return"";var t=!1,a=toMarkdown(e.getData("text/html"),{converters:[{filter:"img",replacement:function(e,t){if(1===t.attributes.length)return"";var a={url:t.src};return $.ajax({url:Label.servePath+"/fetch-upload",type:"POST",data:JSON.stringify(a),cache:!1,success:function(e,t){if(e.sc){var a=i.getValue();a=a.replace(e.originalURL,e.url),i.setValue(a)}}}),"![]("+t.src+")"}},{filter:["pre","code"],replacement:function(e){return 1With ♥ from '}},[{source:function(e,a){i.search(e,{hitsPerPage:20},function(e,t){e?a([]):a(t.hits,t)})},displayKey:"name",templates:{suggestion:function(e){return e._highlightResult.articleTitle.value}}}]).on("autocomplete:selected",function(e,t,a){window.open(Label.servePath+"/article/"+t.oId)}).bind("keyup","esc",function(){$(this).blur()})},newVditor:function(e){Label.emoji||$.ajax({url:Label.servePath+"/users/emotions",type:"GET",cache:!0,async:!1,success:function(e){Label.emoji={},e.data.forEach(function(e){var t=Object.keys(e)[0];Label.emoji[t]=e[t]})}});var t={after:e.after||void 0,typewriterMode:e.typewriterMode||!1,cache:{enable:e.cache||!1},input:e.input,preview:{delay:500,mode:e.preview.mode,url:Label.servePath+"/markdown",parse:function(e){"none"!==e.style.display&&Util.LazyLoadImage()},hljs:{enable:!Label.luteAvailable}},upload:{max:Label.fileMaxSize,url:Label.servePath+"/upload",linkToImgUrl:Label.servePath+"/fetch-upload",filename:function(e){return e.replace(/\?|\\|\/|:|\||<|>|\*|\[|\]|\s+/g,"-")}},placeholder:e.placeholder,height:e.height,counter:e.counter,resize:{enable:e.resize.enable,position:e.resize.position},lang:Label.langLabel,hint:{emojiTail:'设置常用表情',emoji:Label.emoji,at:function(a){var i=[];return $.ajax({url:Label.servePath+"/users/names",type:"POST",async:!1,data:JSON.stringify({name:a}),success:function(e){if(0===e.code){for(var t=0;t'+e.data[t].userName});""===a&&i.push({html:' 参与者',value:"@participants"})}else alert(e.msg)}}),i}},esc:e.esc,ctrlEnter:e.ctrlEnter};return $(window).width()<768?(t.toolbar=["emoji","bold","italic","link","list","check","upload","edit-mode","preview","fullscreen","help"],t.resize.enable=!1):e.toolbar&&(t.toolbar=e.toolbar),new Vditor(e.id,t)},setUnreadNotificationCount:function(o){$.ajax({url:Label.servePath+"/notifications/unread/count",type:"GET",cache:!1,success:function(e,t){function a(e){var t="",a='';return 0'+Label.notificationCommentedLabel+' '+e.unreadCommentedNotificationCnt+""+a.replace("${markReadType}","commented")+""),0'+Label.notificationReplyLabel+' '+e.unreadReplyNotificationCnt+""+a.replace("${markReadType}","reply")+""),0'+Label.notificationAtLabel+' '+e.unreadAtNotificationCnt+""+a.replace("${markReadType}","at")+""),0'+Label.notificationFollowingLabel+' '+e.unreadFollowingNotificationCnt+""+a.replace("${markReadType}","following")+""),0'+Label.pointLabel+' '+e.unreadPointNotificationCnt+""),0'+Label.sameCityLabel+' '+e.unreadBroadcastNotificationCnt+""),0'+Label.systemLabel+' '+e.unreadSysAnnounceNotificationCnt+""),0'+Label.newFollowerLabel+' '+e.unreadNewFollowerNotificationCnt+""),t}var i=e.unreadNotificationCnt;if($.ua.set(navigator.userAgent),$.ua.device.type&&"mobile"===$.ua.device.type){if(0
      '+n+"
    "),$("#aNotifications").click(function(){$("#notificationsPanel").slideToggle()})}else window.localStorage.hadNotificate="false",$("#aNotifications").removeClass("msg").addClass("no-msg").text(i).attr("href",Label.servePath+"/notifications");return!1}if(0
      '+n+"
    "),$("#aNotifications").click(function(){$("#notificationsPanel").show()}),$("body").click(function(e){"aNotifications"!==e.target.id&&"notificationsPanel"!==$(e.target).closest(".module").attr("id")&&$("#notificationsPanel").hide()})}else window.localStorage.hadNotificate="false",$("#notificationsPanel").remove(),$("#aNotifications").removeClass("msg").addClass("no-msg tooltipped tooltipped-w").text(i).attr("href",Label.servePath+"/notifications")}})},follow:function(a,i,n,o){if(!Label.isLoggedIn)return Util.needLogin(),!1;if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/follow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){e.sc&&($(a).removeClass("disabled"),void 0!==o?"article"===n||"tag"===n?$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.uncollectLabel).addClass("ft-red"):"article-watch"===n&&$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.unfollowLabel).addClass("ft-red"):$(a).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"')").text("article"===n?Label.uncollectLabel:Label.unfollowLabel))},complete:function(){$(a).removeClass("disabled")}})},unfollow:function(a,i,n,o){if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/unfollow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){e.sc&&(void 0!==o?"article"===n||"tag"===n?$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.collectLabel):"article-watch"===n&&$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.followLabel):$(a).attr("onclick","Util.follow(this, '"+i+"', '"+n+"')").text("article"===n?Label.collectLabel:Label.followLabel))},complete:function(){$(a).removeClass("disabled")}})},goTop:function(){$("html, body").animate({scrollTop:0},800)},goLogin:function(){if(-1===location.href.indexOf("/login")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/login?goto="+encodeURIComponent(e)}},needLogin:function(){Util.goLogin()},goRegister:function(){if(-1===location.href.indexOf("/register")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/register?goto="+encodeURIComponent(e)}},_kill:function(){"IE"===$.ua.browser.name&&parseInt($.ua.browser.version)<10&&$.ajax({url:Label.servePath+"/kill-browser",type:"GET",cache:!1,success:function(e,t){$("body").append(e),$("#killBrowser").dialog({modal:!0,hideFooter:!0,height:345,width:600}),$("#killBrowser").dialog("open")}})},_initActivity:function(){var e=$(".person-info"),t=e.data("percent"),a=0,i=0,n=0;t<=25?a=parseInt(t/.25):t<=75?(a=100,i=parseInt((t-25)/2/.25)):t<=100&&(i=a=100,n=parseInt((t-75)/.25)),e.find(".bottom").css({width:a+"%",left:(100-a)/2+"%"}),e.find(".top-left").css({width:parseInt(n/2)+"%",left:0}),e.find(".top-right").css({width:parseInt(n/2)+"%",right:0}),e.find(".left").css({height:i+"%",top:100-i+"%"}),e.find(".right").css({height:i+"%",top:100-i+"%"})},_initBreezemoon:function(t,e,a){0!==t.length&&(e.keypress(function(e){13===e.keyCode&&t.click()}),t.click(function(){a?"disabled"!==t.attr("disabled")&&(t.attr("disabled","disabled").css("opacity","0.3"),$.ajax({url:Label.servePath+"/breezemoon",type:"POST",cache:!1,headers:{csrfToken:$(this).data("csrf")},data:JSON.stringify({breezemoonContent:e.val()}),success:function(e){0===e.sc?window.location.reload():Util.alert(e.msg)},complete:function(){t.css("opacity",1).removeAttr("disabled")}})):Util.goLogin()}))},init:function(e){if(this._kill(),this._initNav(),this._initActivity(),1===$(".pagination select").length&&$(".pagination select").change(function(){var e=$(this).data("url")+"?p="+$(this).val();$(this).data("param")&&(e+="&"+$(this).data("param")),window.location.href=e}),$(".nav input.search").focus(function(){$(".nav .tags").css("visibility","hidden")}).blur(function(){$(".nav .tags").css("visibility","visible")}),$(window).scroll(function(){20<$(window).scrollTop()&&0===$(".radio-btn").length?$(".go-top").show():$(".go-top").hide()}),Util.parseMarkdown(),Util.parseHljs(),e&&(window.localStorage.hadNotificate||(window.localStorage.hadNotificate="false"),Util.setUnreadNotificationCount(!0)),$(window).keyup(function(e){27===e.keyCode&&Util.closeAlert()}),this._initBreezemoon($("#breezemoonPostBtn"),$("#breezemoonInput"),e),this._initCommonHotKey(),e)return!1;$("body").click(function(e){0===$(e.target).closest(".nav .form").length&&$(".nav .form").hide()})},initUserChannel:function(e){var t=new ReconnectingWebSocket(e);t.reconnectInterval=1e4,t.onopen=function(){setInterval(function(){t.send("-hb-")},3e5)},t.onmessage=function(e){switch(JSON.parse(e.data).command){case"refreshNotification":Util.setUnreadNotificationCount(!0)}},t.onclose=function(){t.close()},t.onerror=function(e){console.log("ERROR",e)}},_initNav:function(){var e=location.href;$(".user-nav > a").each(function(){0===e.indexOf($(this).attr("href"))?$(this).addClass("current"):"/register"===location.pathname?$(".user-nav a:last").addClass("current"):"/login"===location.pathname?$(".user-nav a:first").addClass("current"):0!==e.indexOf(Label.servePath+"/settings")&&0!==e.indexOf($("#aPersonListPanel").data("url"))||$("#aPersonListPanel").addClass("current")}),$(".nav .avatar-small").parent().click(function(){$("#personListPanel").show()}),$("body").click(function(e){"aPersonListPanel"!==$(e.target).closest("a").attr("id")&&"personListPanel"!==$(e.target).closest(".module").attr("id")&&$("#personListPanel").hide()}),1===$(".nav-tabs a:last").length&&0<$(".nav-tabs a:last")[0].offsetTop&&$(".nav-tabs").mouseover(function(){$(".user-nav").hide()}).mouseout(function(){$(".user-nav").show()})},logout:function(){window.localStorage&&(window.localStorage.clear(),window.localStorage.hadNotificate="false"),window.location.href=Label.servePath+"/logout?goto="+Label.servePath},startsWith:function(e,t){return e.match("^"+t)==t},mouseClickEffects:function(){var r=0;jQuery(document).ready(function(o){o("html").click(function(e){var t,a=18;10==++r?t=o("").text("OωO"):20===r?t=o("").text("(๑•́ ∀ •̀๑)"):30===r?t=o("").text("(๑•́ ₃ •̀๑)"):40===r?t=o("").text("(๑•̀_•́๑)"):50===r?t=o("").text("( ̄へ ̄)"):60===r?t=o("").text("(╯°口°)╯(┴—┴"):70===r?t=o("").text("૮( ᵒ̌皿ᵒ̌ )ა"):80===r?t=o("").text("╮(。>口<。)╭"):90===r?t=o("").text("( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃"):100<=r&&r<=105?t=o("").text("(ꐦ°᷄д°᷅)"):(t=o(''),a=Math.round(14*Math.random()+6));var i=e.pageX,n=e.pageY;t.css({"z-index":9999,top:n-20,left:i,position:"absolute",color:"#E94F06","font-size":a,"-moz-user-select":"none","-webkit-user-select":"none","-ms-user-select":"none"}),o("body").append(t),t.animate({top:n-180,opacity:0},1500,function(){t.remove()})})})}},Validate={goValidate:function(e){for(var t="
      ",a=0;a"+e.data[a].msg+"");return"
        "===t?(e.target.html(""),e.target.removeClass("error"),!0):(e.target.html(t+"
      "),e.target.addClass("error"),!1)},validate:function(e){var t=!0,a="";switch(a="editor"===e.type?e.target.getValue():"imgSrc"===e.type?e.target.attr("src"):"imgStyle"===e.type?e.target.data("imageurl"):e.target.val().toString().replace(/(^\s*)|(\s*$)/g,""),e.type){case"email":/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(e.target.val())||(t=!1);break;case"password":!(e.target.val().length<6||16=(e.min?e.min:0)}return t}},Label={},pngMagic=[137,80,78,71,13,10,26,10],jpeg_jfif=[74,70,73,70],jpeg_exif=[69,120,105,102],jpegMagic=[255,216,255,224],gifMagic0=[71,73,70,56,55,97],getGifMagic1=[71,73,70,56,57,97],wavMagic1=[82,73,70,70],wavMagic2=[87,65,86,69];function arraycopy(e,t,a,n,o){for(i=0;isuccess(): Unable to detect window audio context, cannot continue.")}var o=n.getWindowAudioContextMethod();Audio.recorderObj=new SoundRecorder(o,2048,a,i),Audio.recorderObj.init(e),Audio.recorderObj.recorder.onaudioprocess=function(e){if(Audio.recorderObj.isRecording()){var t=e.inputBuffer.getChannelData(0),a=e.inputBuffer.getChannelData(1);Audio.recorderObj.cloneChannelData(t,a)}},Audio.availabel=!0,r&&r()}},function(e){console.log("getUserMedia->failure(): ERROR: Microphone access request failed!");switch(e.name){case"PermissionDeniedError":Label.recordDeniedLabel;break;case"DevicesNotFoundError":Label.recordDeviceNotFoundLabel;break;default:"ERROR: The following unexpected error occurred while attempting to connect to your microphone: "+e.name}})):console.log("ERROR: getUserMedia not supported by browser.")},handleStartRecording:function(){Audio.recorderObj.startRecordingNewWavFile()},handleStopRecording:function(){Audio.recorderObj.stopRecording(),Audio.wavFileBlob=Audio.recorderObj.buildWavFileBlob()}}; \ No newline at end of file