FANDOM


//
var few = few || {};
(function(few){
	var removalList;
	few.init = function(){
		_initRemovalList();
		_updateNav();
		_removeShows();
		_addStyle();
	};
 
	function _initRemovalList() {
		removalList = [
			"zzzzzzzzzzzzzzzzz",
			"zzzzzzzzzzzzzzzzz",
			"zzzzzzzzzzzzzzzzz",
			"zzzzzzzzzzzzzzzzz",
			"zzzzzzzzzzzzzzzzz",
			"RENT",
			"A CHRISTMAS STORY",
			"LOVE CONNECTION",
			"KICKING AND SCREAMING",
			"KICKING & SCREAMING",
			"THE F WORD",
			"BEAT SHAZAM",
			"HYPNOTIZE ME",
			"KICKING & SCREAMING",
			"MY KITCHEN RULES",
			"American Country Countdown Awards",
			"The Following",
			"Cause For Paws",
			"MasterChef Junior",
			"Hotel Hell",
			"Hell's Kitchen",
			"World's Funniest Fails",
			"Kitchen Nightmares",
			"American Idol",
			"Sleepy Hollow",
			"Wayward Pines",
			"World's Funniest",
			"Bullseye",
			"So You Think You Can Dance",
			"MasterChef",
			"Are You Smarter Than A 5th Grader",
			"BOOM!",
			"Beat The Champions",
			"Home Free",
			"Knock Knock Live",
			"Teen Choice",
			"67th Emmy Awards",
			"Scream Queens",
			"The All-Star Dog Rescue Celebration",
			"Taraji and Terrence's White Hot Holidays",
			"American Country Countdown's Top 10 Stories of 2015",
			"Specials On FOX",
			"Miss Universe",
			"Superhuman",
			"MasterChef Celebrity Showdown",
			"Party Over Here",
			"Animation Domination High-Def",
			"The Passion",
			"American Grit",
			"Houdini And Doyle",
			"Coupled",
			"Megyn Kelly presents",
			"MISS USA",
			"STRIDE GUM PRESENTS HEAVEN SENT",
			"STAND UP TO CANCER",
			"THE EXORCIST",
			"THE ROCKY HORROR PICTURE SHOW",
			"NATIONAL GEOGRAPHIC PRESENTS - MARS",
			"NATIONAL GEOGRAPHIC PRESENTS - KILLING REAGAN",
			"SHOWTIME AT THE APOLLO",
			"NATIONAL GEOGRAPHIC PRESENTS - BEFORE THE FLOOD",
			"TARAJI'S WHITE HOT HOLIDAYS",
			"COMIC CON",
			"THE BREAKTHROUGH PRIZE",
 
			// Not bad, but just don't care enough
			"EMPIRE",
			"STAR",
			"SHOTS FIRED", // Based on the actors, likely as meh as above 2
			"zzzzzzzzzzzzzzzzz",
		];
		for (i = 0; i < removalList.length; i++) { removalList[i] = removalList[i].toLowerCase(); }
		Object.freeze(removalList);
	}
 
	function _addStyle() {
		few.$New("style", { innerHTML:""
			+".main-title, #fox-adobe-pass-mvpd, .main-footer { display:none !important; }"
			+".main-title, #fox-adobe-pass-mvpd, .main-footer { display:none !important; }"
			+".field-content>a { box-sizing: content-box; }"
			+".views-field-field-image-thumb a, .views-field-title:not(.show-title) a { border:5px solid orange; width: 100%; }"
			+".views-field-field-image-thumb a:visited, .views-field-title a:visited { border-color:#13181c; }" /* #1a84dd */
			+".video-lock { background:rgba(210,120,230,0.75); position: absolute !important; top: 0; left: 0; right: 0; width: calc(100% + 10px) !important; }"
			+".view-full-episodes-landing .track { height: auto !important; }"
			+".fox-now-devices { display:none !important; }"
		}, document.body);
	}
 
	function _updateNav() {
		// few.$Remove(few.$(".main-header"));
		few.$New("a", { innerHTML:"[Script]", href: "http://fewfre.wikia.com/wiki/Fox.com?action=edit" }, few.$New("li", {}, few.$("#block-system-main-menu .menu")));
	}
 
	function _removeShows() {
		var shows = few.$All(".view-content .views-row");
		for (i = 0; i < shows.length; i++) {
			var show = shows[i];
			var showH = few.$(".show-title", show);
			var showHa = few.$("a", showH);
 
			if(removalList.contains(showHa.innerHTML.toLowerCase())) {
				show.style.display = "none";
			}
		}
	}
 
	function _initShowData(pHref, pAppendLoc) {
		fetch(pHref, { method:"GET" })
		.then(function(response) { return response.text(); })
		.then(function(text){
			var episodes = few.$New("div", { innerHTML:text }).querySelectorAll(".view-content .views-row");
			var episodesTray = few.$New("div", { className:"few-episodes-cont" });
			for (i = 0; i < episodes.length; i++) {
				var episodeData = episodes[i].querySelector(".field-content");
				var href = episodeData.querySelector("a").href;
				var imgSrc = episodeData.querySelector("a img[typeof]").src;
				var epLocked = !!episodeData.querySelector(".video-lock");
 
				var episodeCont = few.$New("div", { className:"few-ep" }, episodesTray);
				var a = few.$New("a", { href:href }, episodeCont);
				few.$New("img", { src:imgSrc, width:50 }, a);
				if(epLocked) { few.$New("div", { className:"few-locked" }, episodeCont); }
			}
			pAppendLoc.appendChild(episodesTray);
		})
		;
	}
 
	/********************
	* Helper Methods
	*********************/
	few.$ = function(query, parent){ return (parent != undefined ? parent : document).querySelector(query); }
	few.$All = function(query, parent){ return (parent != undefined ? parent : document).querySelectorAll(query); }
	few.$Remove = function(elem){ return elem.parentNode.removeChild(elem); }
	few.$New = function(tag, attributes, parent) {
		var element = document.createElement(tag);
		if(attributes != undefined) {
			for(var key in attributes)
				element[key] = attributes[key];
		}
		if(parent != undefined) parent.appendChild(element);
		return element;
	}
 
	Array.prototype.contains = function(obj) {
		var i = this.length;
		while (i--) {
			if (this[i] === obj) {
				return true;
			}
		}
		return false;
	}
 
	few.init();
})(few);
//

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.