From 0858aae57d7fde146e40060244f4dd90d23a304c Mon Sep 17 00:00:00 2001 From: zombieFox Date: Mon, 11 Nov 2019 11:36:22 +0000 Subject: [PATCH] [feature] add random group name controls --- src/js/helper.js | 1321 ++++++++++++++++++++++++++++++++++++++++++++++ src/js/link.js | 21 + 2 files changed, 1342 insertions(+) diff --git a/src/js/helper.js b/src/js/helper.js index bb366bac..a752beee 100644 --- a/src/js/helper.js +++ b/src/js/helper.js @@ -20,6 +20,1326 @@ var helper = (function() { element.classList.remove(theClassName); }; + var randomString = function() { + var animals = [ + "Aardvark", + "Albatross", + "Alligator", + "Alpaca", + "Ant", + "Anteater", + "Antelope", + "Ape", + "Armadillo", + "Baboon", + "Badger", + "Barracuda", + "Bat", + "Bear", + "Beaver", + "Bee", + "Bison", + "Boar", + "Buffalo", + "Butterfly", + "Camel", + "Capybara", + "Caribou", + "Cassowary", + "Cat", + "Caterpillar", + "Cattle", + "Chamois", + "Cheetah", + "Chicken", + "Chimpanzee", + "Chinchilla", + "Chough", + "Clam", + "Cobra", + "Cockroach", + "Cod", + "Cormorant", + "Coyote", + "Crab", + "Crane", + "Crocodile", + "Crow", + "Curlew", + "Deer", + "Dinosaur", + "Dog", + "Dogfish", + "Dolphin", + "Donkey", + "Dotterel", + "Dove", + "Dragonfly", + "Duck", + "Dugong", + "Dunlin", + "Eagle", + "Echidna", + "Eel", + "Eland", + "Elephant", + "Elephant Seal", + "Elk", + "Emu", + "Falcon", + "Ferret", + "Finch", + "Fish", + "Flamingo", + "Fly", + "Fox", + "Frog", + "Gaur", + "Gazelle", + "Gerbil", + "Giant Panda", + "Giraffe", + "Gnat", + "Gnu", + "Goat", + "Goose", + "Goldfinch", + "Goldfish", + "Gorilla", + "Goshawk", + "Grasshopper", + "Grouse", + "Guanaco", + "Guinea Fowl", + "Guinea Pig", + "Gull", + "Hamster", + "Hare", + "Hawk", + "Hedgehog", + "Heron", + "Herring", + "Hippopotamus", + "Hornet", + "Horse", + "Human", + "Hummingbird", + "Hyena", + "Ibex", + "Ibis", + "Jackal", + "Jaguar", + "Jay", + "Jellyfish", + "Kangaroo", + "Kingfisher", + "Koala", + "Komodo Dragon", + "Kookabura", + "Kouprey", + "Kudu", + "Lapwing", + "Lark", + "Lemur", + "Leopard", + "Lima", + "Lion", + "Llama", + "Lobster", + "Locust", + "Loris", + "Louse", + "Lyrebird", + "Magpie", + "Mallard", + "Manatee", + "Mandrill", + "Mantis", + "Marten", + "Meerkat", + "Mink", + "Mole", + "Mongoose", + "Monkey", + "Moose", + "Mouse", + "Mosquito", + "Mule", + "Narwhal", + "Newt", + "Nightingale", + "Octopus", + "Okapi", + "Opossum", + "Oryx", + "Ostrich", + "Otter", + "Owl", + "Ox", + "Oyster", + "Panther", + "Parrot", + "Partridge", + "Peafowl", + "Pelican", + "Penguin", + "Pheasant", + "Pig", + "Pigeon", + "Polar Bear", + "Pony", + "Porcupine", + "Porpoise", + "Quail", + "Quelea", + "Quetzal", + "Rabbit", + "Raccoon", + "Rail", + "Ram", + "Rat", + "Raven", + "Red Deer", + "Red Panda", + "Reindeer", + "Rhinoceros", + "Rook", + "Salamander", + "Salmon", + "Sand Dollar", + "Sandpiper", + "Sardine", + "Scorpion", + "Sea Lion", + "Sea Urchin", + "Seahorse", + "Seal", + "Shark", + "Sheep", + "Shrew", + "Skunk", + "Snail", + "Snake", + "Sparrow", + "Spider", + "Spoonbill", + "Squid", + "Squirrel", + "Starling", + "Stingray", + "Stinkbug", + "Stork", + "Swallow", + "Swan", + "Tapir", + "Tarsier", + "Termite", + "Tiger", + "Toad", + "Trout", + "Turkey", + "Turtle", + "Vicuña", + "Viper", + "Vulture", + "Wallaby", + "Walrus", + "Wasp", + "Weasel", + "Whale", + "Wolf", + "Wolverine", + "Wombat", + "Woodcock", + "Woodpecker", + "Worm", + "Wren", + "Yak", + "Zebra" + ]; + var adjectives = [ + "Aback", + "Abaft", + "Abandoned", + "Abashed", + "Aberrant", + "Abhorrent", + "Abiding", + "Abject", + "Ablaze", + "Able", + "Abnormal", + "Aboriginal", + "Abortive", + "Abounding", + "Abrasive", + "Abrupt", + "Absent", + "Absorbed", + "Absorbing", + "Abstracted", + "Absurd", + "Abundant", + "Abusive", + "Acceptable", + "Accessible", + "Accidental", + "Accurate", + "Acid", + "Acidic", + "Acoustic", + "Acrid", + "Adamant", + "Adaptable", + "Addicted", + "Adhesive", + "Adjoining", + "Adorable", + "Adventurous", + "Afraid", + "Aggressive", + "Agonizing", + "Agreeable", + "Ahead", + "Ajar", + "Alert", + "Alike", + "Alive", + "Alleged", + "Alluring", + "Aloof", + "Amazing", + "Ambiguous", + "Ambitious", + "Amuck", + "Amused", + "Amusing", + "Ancient", + "Angry", + "Animated", + "Annoyed", + "Annoying", + "Anxious", + "Apathetic", + "Aquatic", + "Aromatic", + "Arrogant", + "Ashamed", + "Aspiring", + "Assorted", + "Astonishing", + "Attractive", + "Auspicious", + "Automatic", + "Available", + "Average", + "Aware", + "Awesome", + "Axiomatic", + "Bad", + "Barbarous", + "Bashful", + "Bawdy", + "Beautiful", + "Befitting", + "Belligerent", + "Beneficial", + "Bent", + "Berserk", + "Bewildered", + "Big", + "Billowy", + "Bitter", + "Bizarre", + "Black", + "Bloody", + "Blue", + "Blushing", + "Boiling", + "Boorish", + "Bored", + "Boring", + "Bouncy", + "Boundless", + "Brainy", + "Brash", + "Brave", + "Brawny", + "Breakable", + "Breezy", + "Brief", + "Bright", + "Broad", + "Broken", + "Brown", + "Bumpy", + "Burly", + "Bustling", + "Busy", + "Cagey", + "Calculating", + "Callous", + "Calm", + "Capable", + "Capricious", + "Careful", + "Careless", + "Caring", + "Cautious", + "Ceaseless", + "Certain", + "Changeable", + "Charming", + "Cheap", + "Cheerful", + "Chemical", + "Chief", + "Childlike", + "Chilly", + "Chivalrous", + "Chubby", + "Chunky", + "Clammy", + "Classy", + "Clean", + "Clear", + "Clever", + "Cloistered", + "Cloudy", + "Closed", + "Clumsy", + "Cluttered", + "Coherent", + "Cold", + "Colorful", + "Colossal", + "Combative", + "Comfortable", + "Common", + "Complete", + "Complex", + "Concerned", + "Condemned", + "Confused", + "Conscious", + "Cooing", + "Cool", + "Cooperative", + "Coordinated", + "Courageous", + "Cowardly", + "Crabby", + "Craven", + "Crazy", + "Creepy", + "Crooked", + "Crowded", + "Cruel", + "Cuddly", + "Cultured", + "Cumbersome", + "Curious", + "Curly", + "Curved", + "Curvy", + "Cut", + "Cute", + "Cynical", + "Daffy", + "Daily", + "Damaged", + "Damaging", + "Damp", + "Dangerous", + "Dapper", + "Dark", + "Dashing", + "Dazzling", + "Dead", + "Deadpan", + "Deafening", + "Dear", + "Debonair", + "Decisive", + "Decorous", + "Deep", + "Deeply", + "Defeated", + "Defective", + "Defiant", + "Delicate", + "Delicious", + "Delightful", + "Demonic", + "Delirious", + "Dependent", + "Depressed", + "Deranged", + "Descriptive", + "Deserted", + "Detailed", + "Determined", + "Devilish", + "Didactic", + "Different", + "Difficult", + "Diligent", + "Direful", + "Dirty", + "Disagreeable", + "Disastrous", + "Discreet", + "Disgusted", + "Disgusting", + "Disillusioned", + "Dispensable", + "Distinct", + "Disturbed", + "Divergent", + "Dizzy", + "Domineering", + "Doubtful", + "Drab", + "Draconian", + "Dramatic", + "Dreary", + "Drunk", + "Dry", + "Dull", + "Dusty", + "Dynamic", + "Dysfunctional", + "Eager", + "Early", + "Earsplitting", + "Earthy", + "Easy", + "Eatable", + "Economic", + "Educated", + "Efficacious", + "Efficient", + "Elastic", + "Elated", + "Elderly", + "Electric", + "Elegant", + "Elfin", + "Elite", + "Embarrassed", + "Eminent", + "Empty", + "Enchanted", + "Enchanting", + "Encouraging", + "Endurable", + "Energetic", + "Enormous", + "Entertaining", + "Enthusiastic", + "Envious", + "Equable", + "Equal", + "Erect", + "Erratic", + "Ethereal", + "Evanescent", + "Evasive", + "Even", + "Excellent", + "Excited", + "Exciting", + "Exclusive", + "Exotic", + "Expensive", + "Exuberant", + "Exultant", + "Fabulous", + "Faded", + "Faint", + "Fair", + "Faithful", + "Fallacious", + "False", + "Familiar", + "Famous", + "Fanatical", + "Fancy", + "Fantastic", + "Far", + "Fascinated", + "Fast", + "Fat", + "Faulty", + "Fearful", + "Fearless", + "Feeble", + "Feigned", + "Female", + "Fertile", + "Festive", + "Few", + "Fierce", + "Filthy", + "Fine", + "Finicky", + "First", + "Fixed", + "Flagrant", + "Flaky", + "Flashy", + "Flat", + "Flawless", + "Flimsy", + "Flippant", + "Flowery", + "Fluffy", + "Fluttering", + "Foamy", + "Foolish", + "Foregoing", + "Forgetful", + "Fortunate", + "Frail", + "Fragile", + "Frantic", + "Free", + "Freezing", + "Frequent", + "Fresh", + "Fretful", + "Friendly", + "Frightened", + "Frightening", + "Full", + "Fumbling", + "Functional", + "Funny", + "Furry", + "Furtive", + "Future", + "Futuristic", + "Fuzzy", + "Gabby", + "Gainful", + "Gamy", + "Gaping", + "Garrulous", + "Gaudy", + "General", + "Gentle", + "Giant", + "Giddy", + "Gifted", + "Gigantic", + "Glamorous", + "Gleaming", + "Glib", + "Glistening", + "Glorious", + "Glossy", + "Godly", + "Good", + "Goofy", + "Gorgeous", + "Graceful", + "Grandiose", + "Grateful", + "Gratis", + "Gray", + "Greasy", + "Great", + "Greedy", + "Green", + "Grey", + "Grieving", + "Groovy", + "Grotesque", + "Grouchy", + "Grubby", + "Gruesome", + "Grumpy", + "Guarded", + "Guiltless", + "Gullible", + "Gusty", + "Guttural", + "Habitual", + "Half", + "Hallowed", + "Halting", + "Handsome", + "Handy", + "Hanging", + "Hapless", + "Happy", + "Hard", + "Harmonious", + "Harsh", + "Hateful", + "Heady", + "Healthy", + "Heartbreaking", + "Heavenly", + "Heavy", + "Hellish", + "Helpful", + "Helpless", + "Hesitant", + "Hideous", + "High", + "Highfalutin", + "Hilarious", + "Hissing", + "Historical", + "Holistic", + "Hollow", + "Homeless", + "Homely", + "Honorable", + "Horrible", + "Hospitable", + "Hot", + "Huge", + "Hulking", + "Humdrum", + "Humorous", + "Hungry", + "Hurried", + "Hurt", + "Hushed", + "Husky", + "Hypnotic", + "Hysterical", + "Icky", + "Icy", + "Idiotic", + "Ignorant", + "Ill", + "Illegal", + "Illustrious", + "Imaginary", + "Immense", + "Imminent", + "Impartial", + "Imperfect", + "Impolite", + "Important", + "Imported", + "Impossible", + "Incandescent", + "Incompetent", + "Inconclusive", + "Industrious", + "Incredible", + "Inexpensive", + "Infamous", + "Innate", + "Innocent", + "Inquisitive", + "Insidious", + "Instinctive", + "Intelligent", + "Interesting", + "Internal", + "Invincible", + "Irate", + "Irritating", + "Itchy", + "Jaded", + "Jagged", + "Jazzy", + "Jealous", + "Jittery", + "Jobless", + "Jolly", + "Joyous", + "Judicious", + "Juicy", + "Jumbled", + "Jumpy", + "Juvenile", + "Keen", + "Kind", + "Kindhearted", + "Kindly", + "Knotty", + "Knowing", + "Knowledgeable", + "Known", + "Labored", + "Lackadaisical", + "Lacking", + "Lame", + "Lamentable", + "Languid", + "Large", + "Last", + "Late", + "Laughable", + "Lavish", + "Lazy", + "Lean", + "Learned", + "Left", + "Legal", + "Lethal", + "Level", + "Lewd", + "Light", + "Like", + "Likeable", + "Limping", + "Literate", + "Little", + "Lively", + "Living", + "Lonely", + "Long", + "Longing", + "Loose", + "Lopsided", + "Loud", + "Loutish", + "Lovely", + "Loving", + "Low", + "Lowly", + "Lucky", + "Ludicrous", + "Lumpy", + "Lush", + "Luxuriant", + "Lying", + "Lyrical", + "Macabre", + "Macho", + "Maddening", + "Madly", + "Magenta", + "Magical", + "Magnificent", + "Majestic", + "Makeshift", + "Male", + "Malicious", + "Mammoth", + "Maniacal", + "Many", + "Marked", + "Massive", + "Married", + "Marvelous", + "Material", + "Materialistic", + "Mature", + "Mean", + "Measly", + "Meaty", + "Medical", + "Meek", + "Mellow", + "Melodic", + "Melted", + "Merciful", + "Mere", + "Messy", + "Mighty", + "Military", + "Milky", + "Mindless", + "Miniature", + "Minor", + "Miscreant", + "Misty", + "Mixed", + "Moaning", + "Modern", + "Moldy", + "Momentous", + "Motionless", + "Mountainous", + "Muddled", + "Mundane", + "Murky", + "Mushy", + "Mute", + "Mysterious", + "Naive", + "Nappy", + "Narrow", + "Nasty", + "Natural", + "Naughty", + "Nauseating", + "Near", + "Neat", + "Nebulous", + "Necessary", + "Needless", + "Needy", + "Neighborly", + "Nervous", + "New", + "Next", + "Nice", + "Nifty", + "Nimble", + "Nippy", + "Noiseless", + "Noisy", + "Nonchalant", + "Nondescript", + "Nonstop", + "Normal", + "Nostalgic", + "Nosy", + "Noxious", + "Numberless", + "Numerous", + "Nutritious", + "Nutty", + "Oafish", + "Obedient", + "Obeisant", + "Obese", + "Obnoxious", + "Obscene", + "Obsequious", + "Observant", + "Obsolete", + "Obtainable", + "Oceanic", + "Odd", + "Offbeat", + "Old", + "Omniscient", + "Onerous", + "Open", + "Opposite", + "Optimal", + "Orange", + "Ordinary", + "Organic", + "Ossified", + "Outgoing", + "Outrageous", + "Outstanding", + "Oval", + "Overconfident", + "Overjoyed", + "Overrated", + "Overt", + "Overwrought", + "Painful", + "Painstaking", + "Pale", + "Paltry", + "Panicky", + "Panoramic", + "Parallel", + "Parched", + "Parsimonious", + "Past", + "Pastoral", + "Pathetic", + "Peaceful", + "Penitent", + "Perfect", + "Periodic", + "Permissible", + "Perpetual", + "Petite", + "Phobic", + "Physical", + "Picayune", + "Pink", + "Piquant", + "Placid", + "Plain", + "Plant", + "Plastic", + "Plausible", + "Pleasant", + "Plucky", + "Pointless", + "Poised", + "Polite", + "Political", + "Poor", + "Possessive", + "Possible", + "Powerful", + "Precious", + "Premium", + "Present", + "Pretty", + "Previous", + "Pricey", + "Prickly", + "Private", + "Probable", + "Productive", + "Profuse", + "Protective", + "Proud", + "Psychedelic", + "Psychotic", + "Public", + "Puffy", + "Pumped", + "Puny", + "Purple", + "Purring", + "Pushy", + "Puzzled", + "Puzzling", + "Quaint", + "Quarrelsome", + "Questionable", + "Quick", + "Quiet", + "Quirky", + "Quixotic", + "Quizzical", + "Rabid", + "Racial", + "Ragged", + "Rainy", + "Rambunctious", + "Rampant", + "Rapid", + "Rare", + "Raspy", + "Ratty", + "Ready", + "Real", + "Rebel", + "Receptive", + "Recondite", + "Red", + "Redundant", + "Reflective", + "Regular", + "Relieved", + "Remarkable", + "Reminiscent", + "Repulsive", + "Resolute", + "Resonant", + "Responsible", + "Rhetorical", + "Rich", + "Right", + "Righteous", + "Rightful", + "Rigid", + "Ripe", + "Ritzy", + "Roasted", + "Robust", + "Romantic", + "Roomy", + "Rotten", + "Rough", + "Round", + "Royal", + "Ruddy", + "Rude", + "Rural", + "Rustic", + "Ruthless", + "Sable", + "Sad", + "Safe", + "Salty", + "Same", + "Sassy", + "Satisfying", + "Savory", + "Scandalous", + "Scarce", + "Scared", + "Scary", + "Scattered", + "Scientific", + "Scintillating", + "Scrawny", + "Screeching", + "Second", + "Secret", + "Secretive", + "Sedate", + "Seemly", + "Selective", + "Selfish", + "Separate", + "Serious", + "Shaggy", + "Shaky", + "Shallow", + "Sharp", + "Shiny", + "Shivering", + "Shocking", + "Short", + "Shrill", + "Shut", + "Shy", + "Sick", + "Silent", + "Silky", + "Silly", + "Simple", + "Simplistic", + "Sincere", + "Skillful", + "Skinny", + "Sleepy", + "Slim", + "Slimy", + "Slippery", + "Sloppy", + "Slow", + "Small", + "Smart", + "Smelly", + "Smiling", + "Smoggy", + "Smooth", + "Sneaky", + "Snobbish", + "Snotty", + "Soft", + "Soggy", + "Solid", + "Somber", + "Sophisticated", + "Sordid", + "Sore", + "Sour", + "Sparkling", + "Special", + "Spectacular", + "Spicy", + "Spiffy", + "Spiky", + "Spiritual", + "Spiteful", + "Splendid", + "Spooky", + "Spotless", + "Spotted", + "Spotty", + "Spurious", + "Squalid", + "Square", + "Squealing", + "Squeamish", + "Staking", + "Stale", + "Standing", + "Statuesque", + "Steadfast", + "Steady", + "Steep", + "Stereotyped", + "Sticky", + "Stiff", + "Stimulating", + "Stingy", + "Stormy", + "Straight", + "Strange", + "Striped", + "Strong", + "Stupendous", + "Sturdy", + "Subdued", + "Subsequent", + "Substantial", + "Successful", + "Succinct", + "Sudden", + "Sulky", + "Super", + "Superb", + "Superficial", + "Supreme", + "Swanky", + "Sweet", + "Sweltering", + "Swift", + "Symptomatic", + "Synonymous", + "Taboo", + "Tacit", + "Tacky", + "Talented", + "Tall", + "Tame", + "Tan", + "Tangible", + "Tangy", + "Tart", + "Tasteful", + "Tasteless", + "Tasty", + "Tawdry", + "Tearful", + "Tedious", + "Teeny", + "Telling", + "Temporary", + "Ten", + "Tender", + "Tense", + "Tenuous", + "Terrific", + "Tested", + "Testy", + "Thankful", + "Therapeutic", + "Thick", + "Thin", + "Thinkable", + "Third", + "Thirsty", + "Thoughtful", + "Thoughtless", + "Threatening", + "Thundering", + "Tidy", + "Tight", + "Tightfisted", + "Tiny", + "Tired", + "Tiresome", + "Toothsome", + "Torpid", + "Tough", + "Towering", + "Tranquil", + "Trashy", + "Tremendous", + "Tricky", + "Trite", + "Troubled", + "Truculent", + "True", + "Truthful", + "Typical", + "Ubiquitous", + "Ultra", + "Unable", + "Unaccountable", + "Unadvised", + "Unarmed", + "Unbecoming", + "Unbiased", + "Uncovered", + "Understood", + "Undesirable", + "Unequal", + "Unequaled", + "Uneven", + "Unhealthy", + "Uninterested", + "Unique", + "Unkempt", + "Unknown", + "Unnatural", + "Unruly", + "Unsightly", + "Unsuitable", + "Untidy", + "Unused", + "Unusual", + "Unwieldy", + "Unwritten", + "Upbeat", + "Uppity", + "Upset", + "Uptight", + "Used", + "Useful", + "Useless", + "Utopian", + "Vacuous", + "Vagabond", + "Vague", + "Valuable", + "Various", + "Vast", + "Vengeful", + "Venomous", + "Verdant", + "Versed", + "Victorious", + "Vigorous", + "Violent", + "Violet", + "Vivacious", + "Voiceless", + "Volatile", + "Voracious", + "Vulgar", + "Wacky", + "Waggish", + "Waiting", + "Wakeful", + "Wandering", + "Wanting", + "Warlike", + "Warm", + "Wary", + "Wasteful", + "Watery", + "Weak", + "Wealthy", + "Weary", + "Wet", + "Whimsical", + "Whispering", + "White", + "Whole", + "Wholesale", + "Wicked", + "Wide", + "Wiggly", + "Wild", + "Willing", + "Windy", + "Wiry", + "Wise", + "Wistful", + "Witty", + "Woebegone", + "Womanly", + "Wonderful", + "Wooden", + "Woozy", + "Workable", + "Worried", + "Worthless", + "Wrathful", + "Wretched", + "Wrong", + "Wry", + "Yellow", + "Yielding", + "Young", + "Youthful", + "Yummy", + "Zany", + "Zealous", + "Zesty", + "Zippy", + "Zonked" + ]; + return adjectives[Math.floor(Math.random() * adjectives.length)] + " " + animals[Math.floor(Math.random() * animals.length)]; + }; + var getClosest = function(element, selector) { var firstChar = selector.charAt(0); // Get closest match @@ -580,6 +1900,7 @@ var helper = (function() { toggleClass: toggleClass, addClass: addClass, removeClass: removeClass, + randomString: randomString, getClosest: getClosest, allEqual: allEqual, getDateTime: getDateTime, diff --git a/src/js/link.js b/src/js/link.js index fee3a46f..5269cb9b 100644 --- a/src/js/link.js +++ b/src/js/link.js @@ -428,6 +428,8 @@ var link = (function() { var groupFormPositionInputWrap = helper.node("div|class:input-wrap"); var groupFormPositionLabel = helper.node("label:Position|for:group-form-position"); var groupFormPositionSelect = helper.node("select|id:group-form-position,class:group-form-position mb-0,tabindex:1"); + var groupFormRandomNameButtonWrap = helper.node("div|class:button-wrap"); + var groupFormRandomNameButton = helper.node("button:Random Group Name|class:button mb-0,type:button,tabindex:1"); // group name var groupFormNameInputWrap = helper.node("div|class:input-wrap"); @@ -436,9 +438,11 @@ var link = (function() { groupFormPositionInputWrap.appendChild(groupFormPositionLabel); groupFormPositionInputWrap.appendChild(groupFormPositionSelect); + groupFormRandomNameButtonWrap.appendChild(groupFormRandomNameButton); groupFormNameInputWrap.appendChild(groupFormInputLabel); groupFormNameInputWrap.appendChild(groupFormInputName); fieldset.appendChild(groupFormNameInputWrap); + fieldset.appendChild(groupFormRandomNameButtonWrap); fieldset.appendChild(groupFormPositionInputWrap); form.appendChild(fieldset); @@ -482,6 +486,11 @@ var link = (function() { groupFormInputName.addEventListener("input", function(event) { stagedGroup.group.name = this.value; }, false); + groupFormRandomNameButton.addEventListener("click", function(event) { + var randomName = helper.randomString(); + stagedGroup.group.name = randomName; + groupFormInputName.value = randomName; + }, false); return form; }, @@ -680,6 +689,8 @@ var link = (function() { var groupNewFormIndent = helper.node("div|class:form-indent"); var groupNewInputWrap = helper.node("div|class:input-wrap"); var groupNewInput = helper.node("input|type:text,class:link-form-input-new-group mb-0,id:link-form-input-new-group,placeholder:Example group,tabindex:1,autocomplete:off,autocorrect:off,autocapitalize:off,spellcheck:false,disabled"); + var groupNewRandomNameButtonWrap = helper.node("div|class:button-wrap"); + var groupNewRandomNameButton = helper.node("button:Random Group Name|class:button mb-0,type:button,tabindex:1,disabled"); // letter var displayLetterRadioWrap = helper.node("div|class:input-wrap"); @@ -760,7 +771,9 @@ var link = (function() { groupNewLable.appendChild(groupNewLableLableText); groupNewRadioWrap.appendChild(groupNewLable); groupNewInputWrap.appendChild(groupNewInput); + groupNewRandomNameButtonWrap.appendChild(groupNewRandomNameButton); groupNewFormIndent.appendChild(groupNewInputWrap); + groupNewFormIndent.appendChild(groupNewRandomNameButtonWrap); fieldset.appendChild(groupNewRadioWrap); fieldset.appendChild(groupNewFormIndent); fieldset.appendChild(helper.node("hr")); @@ -826,6 +839,7 @@ var link = (function() { helper.addClass(groupExistingPositionLabel, "disabled"); groupExistingPosition.setAttribute("disabled", ""); groupNewInput.removeAttribute("disabled"); + groupNewRandomNameButton.removeAttribute("disabled"); stagedLink.position.group.new = true; }; }; @@ -920,6 +934,7 @@ var link = (function() { groupExistingPosition.removeAttribute("disabled"); helper.removeClass(groupExistingPositionLabel, "disabled"); groupNewInput.setAttribute("disabled", ""); + groupNewRandomNameButton.setAttribute("disabled", ""); }, false); groupExistingGroup.addEventListener("change", function(event) { stagedLink.position.destination.group = this.selectedIndex; @@ -936,10 +951,16 @@ var link = (function() { groupExistingPosition.setAttribute("disabled", ""); helper.addClass(groupExistingPositionLabel, "disabled"); groupNewInput.removeAttribute("disabled"); + groupNewRandomNameButton.removeAttribute("disabled"); }, false); groupNewInput.addEventListener("input", function(event) { stagedLink.position.group.name = this.value; }, false); + groupNewRandomNameButton.addEventListener("click", function(event) { + var randomName = helper.randomString(); + stagedLink.position.group.name = randomName; + groupNewInput.value = randomName; + }, false); displayLetterRadio.addEventListener("change", function(event) { stagedLink.link.display = this.value; }, false);