This repository has been archived on 2023-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
mlp-episodes/js/episodes-generic.js

1027 lines
32 KiB
JavaScript

/* MLP-Episodes.tk - Written by LunaSquee - 2016 */
function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++) {
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam) {
return sParameterName[1];
}
}
}
console.log('%cStop!', "font-size:35px;color:red;")
console.log('%cHello, curious little foal c;', "font-size:25px;color:green;")
/* ALL EPISODES */
var episodes = [
[
{
"title": "Friendship is Magic - Part 1",
"dailymotion": "//www.dailymotion.com/video/x3syjbp",
"placeholder": null
},
{
"title": "Friendship is Magic - Part 2",
"dailymotion": "//www.dailymotion.com/video/xv3o78",
"placeholder": null
},
{
"title": "The Ticket Master",
"dailymotion": "//www.dailymotion.com/video/x3thnjx",
"placeholder": null
},
{
"title": "Applebuck Season",
"dailymotion": "//www.dailymotion.com/video/x3thnjy",
"placeholder": null
},
{
"title": "Griffon the Brush Off",
"dailymotion": "//www.dailymotion.com/video/x3thnjz",
"placeholder": null
},
{
"title": "Boast Busters",
"dailymotion": "//www.dailymotion.com/video/x3thnk0",
"placeholder": null
},
{
"title": "Dragonshy",
"dailymotion": "//www.dailymotion.com/video/x3thnk1",
"placeholder": null
},
{
"title": "Look Before You Sleep",
"dailymotion": "//www.dailymotion.com/video/x3vcf37",
"placeholder": null
},
{
"title": "Bridle Gossip",
"dailymotion": "//www.dailymotion.com/video/x3vcf38",
"placeholder": null
},
{
"title": "Swarm of the Century",
"dailymotion": "//www.dailymotion.com/video/x3vcf39",
"placeholder": null
},
{
"title": "Winter Wrap Up",
"dailymotion": "//www.dailymotion.com/video/x3vcf3a",
"placeholder": null
},
{
"title": "Call of the Cutie",
"dailymotion": "//www.dailymotion.com/video/x3vcf3b",
"placeholder": null
},
{
"title": "Fall Weather Friends",
"dailymotion": "//www.dailymotion.com/video/x3w2lfn",
"placeholder": null
},
{
"title": "Suited for Success",
"dailymotion": "//www.dailymotion.com/video/x3w2lfq",
"placeholder": null
},
{
"title": "Feeling Pinkie Keen",
"dailymotion": "//www.dailymotion.com/video/x3w2lfr",
"placeholder": null
},
{
"title": "Sonic Rainboom",
"dailymotion": "//www.dailymotion.com/video/x3w2lfs",
"placeholder": null
},
{
"title": "Stare Master",
"dailymotion": "//www.dailymotion.com/video/x3w2lft",
"placeholder": null
},
{
"title": "The Show Stoppers",
"dailymotion": "//www.dailymotion.com/video/x3ysro9",
"placeholder": null
},
{
"title": "A Dog and Pony Show",
"dailymotion": "//www.dailymotion.com/video/x3ysrod",
"placeholder": null
},
{
"title": "Green Isn't Your Color",
"dailymotion": "//www.dailymotion.com/video/x3ysrog",
"placeholder": null
},
{
"title": "Over a Barrel",
"dailymotion": "//www.dailymotion.com/video/x3ysroj",
"placeholder": null
},
{
"title": "A Bird in the Hoof",
"dailymotion": "//www.dailymotion.com/video/x3ysrom",
"placeholder": null
},
{
"title": "The Cutie Mark Chronicles",
"dailymotion": "//www.dailymotion.com/video/x3z34hz",
"placeholder": null
},
{
"title": "Owl's Well That Ends Well",
"dailymotion": "//www.dailymotion.com/video/x3z34i0",
"placeholder": null
},
{
"title": "Party of One",
"dailymotion": "//www.dailymotion.com/video/x3z34i2",
"placeholder": null
},
{
"title": "The Best Night Ever",
"dailymotion": "//www.dailymotion.com/video/x3z34i5",
"placeholder": null
}
],
[
{
"title": "The Return of Harmony - Part 1",
"dailymotion": "//www.dailymotion.com/video/x3nferb",
"placeholder": null
},
{
"title": "The Return of Harmony - Part 2",
"dailymotion": "//www.dailymotion.com/video/x2drdtm",
"placeholder": null
},
{
"title": "Lesson Zero",
"dailymotion": "//www.dailymotion.com/video/x3nferz",
"placeholder": null
},
{
"title": "Luna Eclipsed",
"dailymotion": "//www.dailymotion.com/video/x3nfes5",
"placeholder": null
},
{
"title": "Sisterhooves Social",
"dailymotion": "//www.dailymotion.com/video/x2dsviw",
"placeholder": null
},
{
"title": "The Cutie Pox",
"dailymotion": "//www.dailymotion.com/video/x3nuvs0",
"placeholder": null
},
{
"title": "May the Best Pet Win!",
"dailymotion": "//www.dailymotion.com/video/x3nuvtb",
"placeholder": null
},
{
"title": "The Mysterious Mare Do Well",
"dailymotion": "//www.dailymotion.com/video/x3nuvtd",
"placeholder": null
},
{
"title": "Sweet and Elite",
"dailymotion": "//www.dailymotion.com/video/x3nuvte",
"placeholder": null
},
{
"title": "Secret of My Excess",
"dailymotion": "//www.dailymotion.com/video/x3nuvtg",
"placeholder": null
},
{
"title": "Hearth's Warming Eve",
"dailymotion": "//www.dailymotion.com/video/x2duq0j",
"placeholder": null
},
{
"title": "Family Appreciation Day",
"dailymotion": "//www.dailymotion.com/video/x3p2jkp",
"placeholder": null
},
{
"title": "Baby Cakes",
"dailymotion": "//www.dailymotion.com/video/x3p2jkq",
"placeholder": null
},
{
"title": "The Last Roundup",
"dailymotion": "//www.dailymotion.com/video/x3p2jkr",
"placeholder": null
},
{
"title": "Super Speedy Cider Squeezy 6000",
"dailymotion": "//www.dailymotion.com/video/x3p2jks",
"placeholder": null
},
{
"title": "Read It and Weep",
"dailymotion": "//www.dailymotion.com/video/x3rngwu",
"placeholder": null
},
{
"title": "Hearts and Hooves Day",
"dailymotion": "//www.dailymotion.com/video/x4h818o",
"placeholder": null
},
{
"title": "A Friend in Deed",
"dailymotion": "//www.dailymotion.com/video/x3rngww",
"placeholder": null
},
{
"title": "Putting Your Hoof Down",
"dailymotion": "//www.dailymotion.com/video/x3rngwx",
"placeholder": null
},
{
"title": "It's About Time",
"dailymotion": "//www.dailymotion.com/video/x3rngwy",
"placeholder": null
},
{
"title": "Dragon Quest",
"dailymotion": "//www.dailymotion.com/video/x3s3w8b",
"placeholder": null
},
{
"title": "Hurricane Fluttershy",
"dailymotion": "//www.dailymotion.com/video/x3s3w8c",
"placeholder": null
},
{
"title": "Ponyville Confidential",
"dailymotion": "//www.dailymotion.com/video/x3s3w8d",
"placeholder": null
},
{
"title": "MMMystery on the Friendship Express ",
"dailymotion": "//www.dailymotion.com/video/x10zkem",
"placeholder": null
},
{
"title": "A Canterlot Wedding - Part 1",
"dailymotion": "//www.dailymotion.com/video/x3h0quv",
"placeholder": null
},
{
"title": "A Canterlot Wedding - Part 2",
"dailymotion": "//www.dailymotion.com/video/x10zkff",
"placeholder": null
}
],
[
{
"title": "The Crystal Empire - Part 1",
"dailymotion": "//www.dailymotion.com/video/x3h0qze",
"placeholder": null
},
{
"title": "The Crystal Empire - Part 2",
"dailymotion": "//www.dailymotion.com/video/x3odlr6",
"placeholder": null
},
{
"title": "Too Many Pinkie Pies",
"dailymotion": "//www.dailymotion.com/video/x3kgows",
"placeholder": null
},
{
"title": "One Bad Apple",
"dailymotion": "//www.dailymotion.com/video/x3kgowu",
"placeholder": null
},
{
"title": "Magic Duel",
"dailymotion": "//www.dailymotion.com/video/x3kgoww",
"placeholder": null
},
{
"title": "Sleepless in Ponyville",
"dailymotion": "//www.dailymotion.com/video/x11arm1",
"placeholder": null
},
{
"title": "Wonderbolts Academy",
"dailymotion": "//www.dailymotion.com/video/x3kwymi",
"placeholder": null
},
{
"title": "Apple Family Reunion",
"dailymotion": "//www.dailymotion.com/video/x3kwymk",
"placeholder": null
},
{
"title": "Spike at Your Service",
"dailymotion": "//www.dailymotion.com/video/x3kwyml",
"placeholder": null
},
{
"title": "Keep Calm and Flutter On",
"dailymotion": "//www.dailymotion.com/video/x3kwymn",
"placeholder": null
},
{
"title": "Just for Sidekicks",
"dailymotion": "//www.dailymotion.com/video/x3l5omj",
"placeholder": null
},
{
"title": "Games Ponies Play",
"dailymotion": "//www.dailymotion.com/video/x3l5oml",
"placeholder": null
},
{
"title": "Magical Mystery Cure",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
}
],
[
{
"title": "Princess Twilight Sparkle - Part 1",
"dailymotion": "//www.dailymotion.com/video/x4hyzil",
"placeholder": null
},
{
"title": "Princess Twilight Sparkle - Part 2",
"dailymotion": "//www.dailymotion.com/video/x25wqze",
"placeholder": null
},
{
"title": "Castle Mane-ia",
"dailymotion": "//www.dailymotion.com/video/x3irf8m",
"placeholder": null
},
{
"title": "Daring Don't",
"dailymotion": "//www.dailymotion.com/video/x3irf8s",
"placeholder": null
},
{
"title": "Flight to the Finish",
"dailymotion": "//www.dailymotion.com/video/x3irf8w",
"placeholder": null
},
{
"title": "Power Ponies",
"dailymotion": "//www.dailymotion.com/video/x3ixwti",
"placeholder": null
},
{
"title": "Bats!",
"dailymotion": "//www.dailymotion.com/video/x3ixwtx",
"placeholder": null
},
{
"title": "Rarity Takes Manehattan",
"dailymotion": "//www.dailymotion.com/video/x3ixwuc",
"placeholder": null
},
{
"title": "Pinkie Apple Pie",
"dailymotion": "//www.dailymotion.com/video/x19m4g4",
"placeholder": null
},
{
"title": "Rainbow Falls",
"dailymotion": "//www.dailymotion.com/video/x3ixwut",
"placeholder": null
},
{
"title": "Three's a Crowd",
"dailymotion": "//www.dailymotion.com/video/x3j57yc",
"placeholder": null
},
{
"title": "Pinkie Pride",
"dailymotion": "//www.dailymotion.com/video/x3j57zc",
"placeholder": null
},
{
"title": "Simple Ways",
"dailymotion": "//www.dailymotion.com/video/x3j57zg",
"placeholder": null
},
{
"title": "Filli Vanilli",
"dailymotion": "//www.dailymotion.com/video/x3j57zn",
"placeholder": null
},
{
"title": "Twilight Time",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "It Ain't Easy Being Breezies",
"dailymotion": "//www.dailymotion.com/video/x3ja12y",
"placeholder": null
},
{
"title": "Somepony to Watch Over Me",
"dailymotion": "//www.dailymotion.com/video/x3jf2ps",
"placeholder": null
},
{
"title": "Maud Pie",
"dailymotion": "//www.dailymotion.com/video/x2cdy7d",
"placeholder": null
},
{
"title": "For Whom the Sweetie Belle Toils",
"dailymotion": "//www.dailymotion.com/video/x3jf2qz",
"placeholder": null
},
{
"title": "Leap of Faith",
"dailymotion": "//www.dailymotion.com/video/x1kfwzs",
"placeholder": null
},
{
"title": "Testing, Testing, 1, 2, 3",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "Trade Ya",
"dailymotion": "//www.dailymotion.com/video/x3jqk2v",
"placeholder": null
},
{
"title": "Inspiration Manifestation",
"dailymotion": "//www.dailymotion.com/video/x3jqk3j",
"placeholder": null
},
{
"title": "Equestria Games",
"dailymotion": "//www.dailymotion.com/video/x3jqk58",
"placeholder": null
},
{
"title": "Twilight's Kingdom - Part 1",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "Twilight's Kingdom - Part 2",
"dailymotion": "//www.dailymotion.com/video/x2fykm4",
"placeholder": null
}
],
[
{
"title": "The Cutie Map - Part 1",
"dailymotion": "//www.dailymotion.com/video/k47jy3e8yKQr1WaImmK",
"placeholder": null
},
{
"title": "The Cutie Map - Part 2",
"dailymotion": "//www.dailymotion.com/video/k3h9UBZQl1e614aImmM",
"placeholder": null
},
{
"title": "Castle Sweet Castle",
"dailymotion": "//www.dailymotion.com/video/kc9qYARcGFsm8paNs6C",
"placeholder": null
},
{
"title": "Bloom and Gloom",
"dailymotion": "//www.dailymotion.com/video/kNGd3ZJ8qg1u1qbg9t2",
"placeholder": null
},
{
"title": "Thanks for the Memories",
"dailymotion": "//www.dailymotion.com/video/k3rc1wsQ5Ob83vaVUCz",
"placeholder": null
},
{
"title": "Appleoosa\u2019s Most Wanted",
"dailymotion": "//www.dailymotion.com/video/kJ0VIvMNTHRWT2b32iR",
"placeholder": null
},
{
"title": "Make New Friends But Keep Discord",
"dailymotion": "//www.dailymotion.com/video/k4y0WaMNmsPuQIbdy5t",
"placeholder": null
},
{
"title": "The Lost Treasure of Griffonstone",
"dailymotion": "//www.dailymotion.com/video/k2X2Ey1lRN7FxKbnVtB",
"placeholder": null
},
{
"title": "Slice of Life",
"dailymotion": "//www.dailymotion.com/video/k2JurOSJGh3NpwbEVwy",
"placeholder": null
},
{
"title": "Princess Spike",
"dailymotion": "//www.dailymotion.com/video/k2qzckblM62ZuXbOAPp",
"placeholder": null
},
{
"title": "Party Pooped",
"dailymotion": "//www.dailymotion.com/video/k6lZlf1UFUYqjebOAUN",
"placeholder": null
},
{
"title": "Amending Fences",
"dailymotion": "//www.dailymotion.com/video/kjL5SX9IpRLBtmcah2l",
"placeholder": null
},
{
"title": "Do Princesses Dream of Magic Sheep",
"dailymotion": "//www.dailymotion.com/video/k11Mr62oqQe7kAcah2n",
"placeholder": null
},
{
"title": "Canterlot Boutique",
"dailymotion": "//www.dailymotion.com/video/kpgqjlW6CAXo0gd4Zro",
"placeholder": null
},
{
"title": "Rarity Investigates!",
"dailymotion": "//www.dailymotion.com/video/k3CDWGypoF3Xced8bGZ",
"placeholder": null
},
{
"title": "Made in Manehattan",
"dailymotion": "//www.dailymotion.com/video/k6qBe7K31m2KSKdedIO",
"placeholder": null
},
{
"title": "Brotherhooves Social",
"dailymotion": "//www.dailymotion.com/video/k7b7UIyQ4pBNHUdk5C8",
"placeholder": null
},
{
"title": "Crusaders of the Lost Mark",
"dailymotion": "//www.dailymotion.com/video/k4zbJ1z2FZP6pmdndEN",
"placeholder": null
},
{
"title": "The One Where Pinkie Pie Knows",
"dailymotion": "//www.dailymotion.com/video/k7uBuf2MUKicisdw4z4",
"placeholder": null
},
{
"title": "Hearthbreakers",
"dailymotion": "//www.dailymotion.com/video/k43yRIRICIaiK8dK4VG",
"placeholder": null
},
{
"title": "Scare-Master",
"dailymotion": "//www.dailymotion.com/video/k6SW1twfUGQdhTd8bJJ",
"placeholder": null
},
{
"title": "What About Discord",
"dailymotion": "//www.dailymotion.com/video/k5VZ3flx4QtfYTdYlmh",
"placeholder": null
},
{
"title": "The Hooffields and McColts",
"dailymotion": "//www.dailymotion.com/video/kR3d45Gbk54ZE2dYlsH",
"placeholder": null
},
{
"title": "The Mane Attraction",
"dailymotion": "//www.dailymotion.com/video/k7w734dka5XKWJe5ZMN",
"placeholder": null
},
{
"title": "Cutie Re-Mark - Part 1",
"dailymotion": "//www.dailymotion.com/video/kY2kh1d2fsTOpyedxUy",
"placeholder": null
},
{
"title": "Cutie Re-Mark - Part 2",
"dailymotion": "//www.dailymotion.com/video/k3C52knCWURja7edxXS",
"placeholder": null
}
],
[
{
"title": "The Crystalling - Part 1",
"dailymotion": "//www.dailymotion.com/video/x40aup5",
"placeholder": null
},
{
"title": "The Crystalling - Part 2",
"dailymotion": "//www.dailymotion.com/video/x40g2n1",
"placeholder": null
},
{
"title": "The Gift of the Maud Pie",
"dailymotion": "//www.dailymotion.com/video/x41pgow",
"placeholder": null
},
{
"title": "On Your Marks",
"dailymotion": "//www.dailymotion.com/video/x43fzs1",
"placeholder": null
},
{
"title": "Gauntlet of Fire",
"dailymotion": "//www.dailymotion.com/video/x453h07",
"placeholder": null
},
{
"title": "No Second Prances",
"dailymotion": "//www.dailymotion.com/video/x482b93",
"placeholder": null
},
{
"title": "Newbie Dash",
"dailymotion": "//www.dailymotion.com/video/x497vee",
"placeholder": null
},
{
"title": "A Hearth's Warming Tail",
"dailymotion": "//www.dailymotion.com/video/x4algkv",
"placeholder": null
},
{
"title": "The Saddle Row Review",
"dailymotion": "//www.dailymotion.com/video/x4c14aw",
"placeholder": null
},
{
"title": "Applejack's \"Day\" Off",
"dailymotion": "//www.dailymotion.com/video/x4dbsn1",
"placeholder": null
},
{
"title": "Flutter Brutter",
"dailymotion": "//www.dailymotion.com/video/x4el9nu",
"placeholder": null
},
{
"title": "Spice Up Your Life",
"dailymotion": "//www.dailymotion.com/video/x4fybmg",
"placeholder": null
},
{
"title": "Stranger Than Fan Fiction",
"dailymotion": "//www.dailymotion.com/video/x4mjj85",
"placeholder": null
},
{
"title": "The Cart Before the Ponies",
"dailymotion": "//www.dailymotion.com/video/x59tp9i",
"placeholder": null
},
{
"title": "28 Pranks Later",
"dailymotion": "//www.dailymotion.com/video/x4oosal",
"placeholder": null
},
{
"title": "The Times They Are a Changeling",
"dailymotion": "//www.dailymotion.com/video/x4plsa8",
"placeholder": null
},
{
"title": "Dungeons & Discords",
"dailymotion": "//www.dailymotion.com/video/x4qohww",
"placeholder": null
},
{
"title": "Buckball Season",
"dailymotion": "//www.dailymotion.com/video/x4rsnah",
"placeholder": null
},
{
"title": "The Fault in Our Cutie Marks",
"dailymotion": "//www.dailymotion.com/video/x4sulgi",
"placeholder": null
},
{
"title": "Viva Las Pegasus",
"dailymotion": "//www.dailymotion.com/video/x4todiu",
"placeholder": null
},
{
"title": "Every Little Thing She Does",
"dailymotion": "//www.dailymotion.com/video/x4ul4tz",
"placeholder": null
},
{
"title": "P.P.O.V. (Pony Point of View)",
"dailymotion": "//www.dailymotion.com/video/x4vnoq2",
"placeholder": null
},
{
"title": "Where the Apple Lies",
"dailymotion": "//www.dailymotion.com/video/x5mplkn",
"placeholder": null
},
{
"title": "Top Bolt",
"dailymotion": "//www.dailymotion.com/video/x4xd1fi",
"placeholder": null
},
{
"title": "To Where and Back Again - Part 1",
"dailymotion": "//www.dailymotion.com/video/x4yo7al",
"placeholder": null
},
{
"title": "To Where and Back Again - Part 2",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
}
],
[
{
"title": "Celestial Advice",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "All Bottled Up",
"dailymotion": "//www.dailymotion.com/video/x5ifdyt",
"placeholder": null
},
{
"title": "A Flurry of Emotions",
"dailymotion": "//www.dailymotion.com/video/x5jcfjw",
"placeholder": null
},
{
"title": "Rock Solid Friendship",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "Fluttershy Leans In",
"dailymotion": "//www.dailymotion.com/video/x5lai79",
"placeholder": null
},
{
"title": "Forever Filly",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "Parental Glideance",
"dailymotion": "//www.dailymotion.com/video/x5n7hne",
"placeholder": null
},
{
"title": "Hard to Say Anything",
"dailymotion": "//www.dailymotion.com/video/x5o631v",
"placeholder": null
},
{
"title": "Honest Apple",
"dailymotion": "//www.dailymotion.com/video/x5p1f87",
"placeholder": null
},
{
"title": "A Royal Problem",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "Not Asking for Trouble",
"dailymotion": "//www.dailymotion.com/video/x5r2rcf",
"placeholder": null
},
{
"title": "Discordant Harmony",
"dailymotion": "//www.dailymotion.com/video/x5w3azj",
"placeholder": null
},
{
"title": "The Perfect Pear",
"dailymotion": "//www.dailymotion.com/video/x5w3d3z",
"placeholder": null
},
{
"title": "Fame and Misfortune",
"dailymotion": "//www.dailymotion.com/video/NotAvailable",
"available": false
},
{
"title": "Triple Threat",
"dailymotion": "//www.dailymotion.com/video/x5xf58q",
"placeholder": null
},
{
"title": "Campfire Tales",
"dailymotion": "//www.dailymotion.com/video/x5ye3nl",
"placeholder": null
},
{
"title": "Daring Done",
"dailymotion": "//www.dailymotion.com/video/x607x2m",
"placeholder": null
},
{
"title": "It Isn't the Mane Thing About You",
"dailymotion": "//www.dailymotion.com/video/x611xle",
"placeholder": null
},
{
"title": "A Health of Information",
"dailymotion": "//www.dailymotion.com/video/x61ti6o",
"placeholder": null
},
{
"title": "Marks and Recreation",
"dailymotion": "//www.dailymotion.com/video/x62rl1v",
"placeholder": null
},
{
"title": "Once Upon a Zeppelin",
"dailymotion": "//www.dailymotion.com/video/x63qhug",
"placeholder": null
},
{
"title": "Secrets and Pies",
"dailymotion": "//www.dailymotion.com/video/x64nhxg",
"placeholder": null
},
{
"title": "Uncommon Bond",
"dailymotion": "//www.dailymotion.com/video/x65orpc",
"placeholder": null
},
{
"title": "Shadow Play, Part I",
"dailymotion": "//www.dailymotion.com/video/x66r9jp",
"placeholder": null
},
{
"title": "Shadow Play, Part II",
"dailymotion": "//www.dailymotion.com/video/x66r9jp",
"placeholder": null
}
],
[
{
"title": "School Daze - Part 1",
"dailymotion": "//www.dailymotion.com/video/x6gsvg8",
"placeholder": null
},
{
"title": "School Daze - Part 2",
"dailymotion": "//www.dailymotion.com/video/x6gsvk9",
"placeholder": null
}
]
];
/* Utility functions */
function RLS_episode(season, episode) {
if(episodes[season-1] == null) {
return {error: "Invalid season!"};
}
if(episodes[season-1][episode-1]) {
return episodes[season-1][episode-1];
}
}
function RLS_getNext(season, episode) {
var ssNow = window.episodeMeta.season;
var epNow = window.episodeMeta.episode;
var seasonBox = episodes[ssNow-1];
if(seasonBox == null) return;
if(seasonBox.length < epNow + 1) {
if(episodes[ssNow] == null) {
ssNow = 1;
epNow = 1;
} else {
ssNow += 1;
epNow = 1;
}
} else {
epNow += 1;
}
return [ssNow, epNow];
}
function RLS_getPrev() {
var ssNow = window.episodeMeta.season;
var epNow = window.episodeMeta.episode;
var seasonBox = episodes[ssNow-1];
if(seasonBox == null) return;
if(epNow - 1 == 0) {
if(ssNow == 1) {
ssNow = episodes.length;
epNow = episodes[ssNow-1].length;
} else {
ssNow -= 1;
epNow = episodes[ssNow-1].length;
}
} else {
epNow -= 1;
}
return [ssNow, epNow];
}
function videoPopper(season, episode) {
var episodeinf = RLS_episode(season, episode);
if(episodeinf['error'])
return {}
return {embed: episodeinf.dailymotion.replace("/video/", "/embed/video/"), season: season, episode: episode, title: episodeinf.title};
}
function random_episode() {
var season_s = Math.floor(Math.random() * (episodes.length)) + 1;
var episode = Math.floor(Math.random() * (episodes[season_s-1].length)) + 1;
return videoPopper(season_s, episode);
}
function detectepisode() {
if(window.location.hash) {
var epis = window.location.hash.substring(1).match(/^epi([0-9]+)s([0-9]+)$/i);
if(epis) {
openEpisode(videoPopper(epis[2], epis[1]));
}
} else {
var se = getUrlParameter("s");
var ep = getUrlParameter("e");
var epid = getUrlParameter("episode");
if(se && ep) {
openEpisode(videoPopper(se, ep));
} else if(epid) {
var epis = epid.match(/^epi([0-9]+)s([0-9]+)$/i);
if(epis) {
openEpisode(videoPopper(epis[2], epis[1]));
}
}
}
}
function goNext() {
var eps = RLS_getNext();
openEpisode(videoPopper(eps[0], eps[1]));
}
function goPrev() {
var eps = RLS_getPrev();
openEpisode(videoPopper(eps[0], eps[1]));
}
$(window).on('hashchange', function() {
detectepisode();
});
$(document).ready(function() {
$('noscript').remove();
$('#randomepisode').click(function() {
openEpisode(random_episode());
});
$('.mlpepisode').click(function() {
openEpisode(videoPopper($(this).data("episode-season"), $(this).data("episode-number")));
return false;
});
$('.clickdel').click(function() {
$(this).fadeOut();
return false;
});
$('a').click(function() {
if($(this).attr("href") === "#"){
return false;
}
});
detectepisode();
});
// Tweet handler
function tweetEpisode() {
var link = "https://mlp.icynet.eu/?episode=epi"+window.episodeMeta.episode+"s"+window.episodeMeta.season;
var target = "https://twitter.com/intent/tweet?text="+window.episodeMeta.title+"&hashtags=mlpfim&url="+link;
window.open(target, "Share this Episode", "width=500,height=400");
}
// FB post handler
function sharefbEpisode() {
var link = "https://mlp.icynet.eu/?episode=epi"+window.episodeMeta.episode+"s"+window.episodeMeta.season;
var target = "https://www.facebook.com/sharer.php?u="+link;
window.open(target, "Share this Episode", "width=500,height=400");
}
function copyToClipboard() {
var link = "https://mlp.icynet.eu/?episode=epi"+window.episodeMeta.episode+"s"+window.episodeMeta.season;
window.prompt ("Copy to clipboard: Ctrl+C, Enter", link);
}