Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onTemplateLoad(a) {
- player = brightcove.api.getExperience(a), videoAPI = brightcove.api.modules.APIModules, "function" == typeof rdm_analytics_brightcove_load_handler && rdm_analytics_brightcove_load_handler(a), brightcoveResize()
- }
- function onTemplateReady() {
- videoPlayer = player.getModule(videoAPI.VIDEO_PLAYER), adModule = player.getModule(videoAPI.ADVERTISING), experienceModule = player.getModule(videoAPI.EXPERIENCE), videoPlayer.addEventListener(brightcove.api.events.MediaEvent.COMPLETE, onVideoCompletion), "false" != brightcoveComponent.disableSyndicated || adServerURLHasChanged || adModule.getAdPolicy(getAdPolicyHandler)
- }
- function getAdPolicyHandler(a) {
- var b = brightcoveComponent.syndicator;
- "" != brightcoveComponent.adServerURL && (a.adServerURL = brightcoveComponent.adServerURL), a.adServerURL = changeIUInAdServerURL(a.adServerURL, b, 5, "video"), adModule.setAdPolicy(a, setAdPolicyHandler)
- }
- function setAdPolicyHandler() {}
- function onComplete() {}
- function brightcoveResize() {
- if ("undefined" != typeof experienceModule && experienceModule) {
- var a = jQuery(".video-player-container").width(),
- b = jQuery(".video-player-container").outerHeight();
- "html" == experienceModule.experience.type && (experienceModule.setSize(a, b), jQuery(".video-player-container iframe").css("height", b + "px"))
- }
- }
- function changeIUInAdServerURL(a, b, c, d) {
- for (var e = a.split("?"), f = e[1], g = f.split("&"), h = "", i = 0, j = 0; j < g.length; j++)
- if (g[j].indexOf("iu") >= 0) {
- h = g[j].split("=")[1], i = j;
- break
- }
- h = decodeURIComponent(h), "/" == h.charAt(0) && (h = h.substring(1));
- var k = h.split("/");
- if (brightcoveComponent.iuOverride) {
- for (var l = brightcoveComponent.iuOverride.split("/"), m = [k[0]], j = 0; j < l.length; j++) m.push(l[j]);
- k = m
- }
- if ("" != brightcoveComponent.iu) {
- var n = brightcoveComponent.iu;
- n = n.split("/");
- for (var j = 0; j < n.length; j++) k.push(n[j])
- }
- if ("" != b && "" != d && k.length <= c) {
- for (var o = c - k.length, j = 0; o > j; j++) k.push(d);
- k.push(b)
- }
- var p = "/" + k.join("/");
- g[i] = "iu=" + encodeURIComponent(p);
- var q = g.join("&");
- return e[1] = q, adServerURLHasChanged = !0, e.join("?")
- }
- function rdm_curated_author_widget_get_content(a, b) {
- var c = rdm_curated_author_widget_number_of_pages;
- b && (c = Math.ceil(c / 2)), jQuery(".curated_author_total_page").html(c), jQuery(".author-list ul li").hide(), jQuery(".author-list ul li.page_" + a).show();
- var d = a;
- b && (d = Math.ceil(a / 2)), jQuery("div.author-list-controls span.curated_author_current_page").html(d), 1 >= a ? jQuery("div.author-list-controls span.left-arrow").addClass("disabled") : jQuery("div.author-list-controls span.left-arrow").removeClass("disabled"), a >= rdm_curated_author_widget_number_of_pages || b && a >= rdm_curated_author_widget_number_of_pages + 1 ? jQuery("div.author-list-controls span.right-arrow").addClass("disabled") : jQuery("div.author-list-controls span.right-arrow").removeClass("disabled")
- }
- function rdm_curated_author_widget_is_in_tablet() {
- return Modernizr.mq("only screen and (max-width: 1007px) and (min-width: 768px)")
- }
- function setContainerHeight() {
- var a = jQuery(".featured-stories-wrapper.fullwidth-container"),
- b = jQuery(".featured-stories-wrapper.fullwidth-container .slotholder img");
- jQuery(a).css("height", b.height())
- }
- function checkDisableScrolling() {
- var a = jQuery(".gallery-slide-container").data("disablescrolling");
- if (1 == a) {
- var b = jQuery(window.top).height() - 50;
- jQuery(".gallery-slide-content > img").css("max-height", b + "px"), jQuery(".gallery-slide-content > img").css("width", "auto")
- }
- }
- function toggleShareOverlay() {
- jQuery(".gallery-social-wrapper").hasClass("open") ? closeShare() : openShare()
- }
- function openShare() {
- jQuery(".gallery-social-wrapper .share-buttons").slideDown(), jQuery("a.gallery-icon.gallery-slide-share").css("display", "none"), jQuery("a.gallery-button.gallery-slides-share-close").css("display", "inline-block"), jQuery(".gallery-social-wrapper").addClass("open")
- }
- function setShareOverlayPosition() {
- jQuery(".gallery-social-wrapper").css("right", Math.round((jQuery(".gallery-slide-content").width() - jQuery(".gallery-slide-content img").width()) / 2) + "px")
- }
- function setCaptionPosition() {
- jQuery(".gallery-slide-information-slide-caption").css("right", Math.round((jQuery(".gallery-slide-content").width() - jQuery(".gallery-slide-content img").width()) / 2) + "px")
- }
- function closeShare() {
- jQuery(".gallery-social-wrapper .share-buttons").slideUp(), jQuery("a.gallery-button.gallery-slides-share-close").css("display", "none"), jQuery("a.gallery-icon.gallery-slide-share").css("display", "inline-block"), jQuery(".gallery-social-wrapper").removeClass("open")
- }
- function rdm_recipes_auto_update_search() {
- recipesFilterToolAjaxCall && 4 != recipesFilterToolAjaxCall.readystate && recipesFilterToolAjaxCall.abort();
- var a = (Date.now(), jQuery("#recipeFilterToolForm").serializeArray());
- a.push({
- name: "page",
- value: 1
- });
- var b = jQuery("input[name='template_directory_uri']").val(),
- c = b + "/ComponentControllers/RecipeSearchResultsComponent/ajax.getAllSearchInfo.php";
- recipesFilterToolAjaxCall = jQuery.ajax({
- url: c,
- type: "POST",
- data: a,
- success: function(a) {
- jQuery("#recipe_search_load_more").show(), a.indexOf("--hidebutton") >= 0 ? (jQuery("#recipe_search_load_more").hide(), a = a.replace("--hidebutton", "")) : jQuery("#recipe_search_load_more").show(), recipesFilterToolAjaxCall = !1, searchPaginationPage = 2;
- var b = JSON.parse(a),
- c = b.recipeCount,
- d = b.status,
- e = (b.hasSolrFilters, b.riverOfContent),
- f = b.keyword,
- g = "",
- h = !1;
- jQuery("#recipe_filter_tool_sponsor").show(), jQuery(".total_search_result_container").removeClass("recipe_result_error"), d > 0 ? 0 == c ? (g = 2 == d ? "Sorry we did not find results to match. Please refine your search below." : "Sorry we did not find results for <span class='total_search_result'>\"" + f + '"</span>. Please refine your search below.', h = !0) : c >= 1 && (g = "<span class='total_search_result'>" + c + "</span> recipe", c > 1 && (g += "s")) : 0 > d ? (g = "Error while searching, please come back later.", h = !0) : (g = "A search keyword must be entered", h = !0), h && (jQuery("#recipe_filter_tool_sponsor").hide(), jQuery(".total_search_result_container").addClass("recipe_result_error")), jQuery("#recipe_search_message").html(g), jQuery("#recipe_search_flex_grid").html(e)
- },
- error: function() {
- console.log("error")
- }
- })
- }
- function rdm_recipes_adjust_content_height() {
- jQuery("#main .content").height(jQuery(".filter_tool_container").height() + 250)
- }
- function rdm_recipes_add_filter(a, b, c, d) {
- return jQuery("#recipe_selected_filters").children("#" + a + "_selected").length > 0 ? !1 : (jQuery("#recipe_selected_filters").append("<div class='selected_filter " + b + "' id='" + a + "_selected'>" + c + " <span class='filter_remove'></span><input type='hidden' name='ids[]' value='" + a + "' /><input type='hidden' name='labels[]' value='" + c + "' /><input type='hidden' name='fq[]' value='" + d + "' /></div>"), !0)
- }
- function rdmRecipeSuggestionToolAssignIngredient() {
- var a = "ingredients:" + jQuery("#recipe_suggestion_tool_ingredient").val(),
- b = jQuery("#recipe_suggestion_tool_ingredient").val(),
- c = "ingredient_" + jQuery("#recipe_suggestion_tool_ingredient").val().replace(" ", "_");
- jQuery("#recipe_suggestion_tool_ingredient_id").val(c), jQuery("#recipe_suggestion_tool_ingredient_fq").val(a), jQuery("#recipe_suggestion_tool_ingredient_label").val(b)
- }
- function rdmRecipeSuggestionToolAssignMealType() {
- var a = jQuery("#recipe_suggestion_tool_meal_type").find("option:selected").attr("data-search"),
- b = jQuery("#recipe_suggestion_tool_meal_type").find("option:selected").text(),
- c = jQuery("#recipe_suggestion_tool_meal_type").find("option:selected").val(),
- d = jQuery("#recipe_suggestion_tool_meal_type").find("option:selected").attr("class"),
- e = "ul.recipe_suggestion_tool_meal_type_drop li#" + d;
- jQuery("ul.recipe_suggestion_tool_meal_type_drop").find("li").removeClass("checked"), jQuery(e).addClass("checked");
- var f = jQuery("div.recipe_suggestion_tool_meal_type_drop div");
- f.text(b), f.attr("data-value", c), f.attr("data-search", a), jQuery("#recipe_suggestion_tool_meal_type_id").val(c), jQuery("#recipe_suggestion_tool_meal_type_fq").val(a), jQuery("#recipe_suggestion_tool_meal_type_label").val(b)
- }
- function rdmRecipeSuggestionToolAssignMealTypeList(a, b, c) {
- jQuery("#recipe_suggestion_tool_meal_type_id").val(a), jQuery("#recipe_suggestion_tool_meal_type_fq").val(b), jQuery("#recipe_suggestion_tool_meal_type_label").val(c)
- }
- function rdmRecipeSuggestionToolInvalidateIngredient() {
- jQuery("#recipe_suggestion_tool_ingredient_id").remove(), jQuery("#recipe_suggestion_tool_ingredient_fq").remove(), jQuery("#recipe_suggestion_tool_ingredient_label").remove()
- }
- function rdmRecipeSuggestionToolInvalidateMealType() {
- jQuery("#recipe_suggestion_tool_meal_type_id").remove(), jQuery("#recipe_suggestion_tool_meal_type_fq").remove(), jQuery("#recipe_suggestion_tool_meal_type_label").remove()
- }
- function rdmRecipeMealTypeDropDownMenu(a) {
- var b = a("div.recipe_suggestion_tool_meal_type_drop div");
- a("ul.recipe_suggestion_tool_meal_type_drop li").click(function() {
- var c = a(this).attr("data-value"),
- d = a(this).attr("data-search"),
- e = a(this).text(),
- f = a(this).attr("id");
- a(this).siblings().removeClass("checked"), a("#recipe_suggestion_tool_meal_type").find("option:selected").removeAttr("selected"), a(this).addClass("checked");
- var g = "#recipe_suggestion_tool_meal_type option." + f;
- a(g).attr("selected", "selected"), b.text(e), b.attr("data-value", c), b.attr("data-search", d), rdmRecipeSuggestionToolAssignMealTypeList(c, d, e)
- })
- }
- function rdm_foundation_comment_button_click() {
- var a = jQuery;
- a("#comment-block, .comment-block").slideToggle(), a(".comment-block").toggleClass("display"), a(".lblShowComments").toggleClass("display"), a(".lblHideComments").toggleClass("display"), a("html, body").animate({
- scrollTop: a("#comment-block").offset().top
- }, 1e3), 0 == window.commentbool ? window.commentbool = !0 : 1 == window.commentbool && (window.commentbool = !1)
- }
- function updade_ads_positions(a) {
- for (var b = new Array, c = 0; c < oldTotalBoxes.length; c++) b.push(a[0] + oldTotalBoxes[c]), b.push(a[1] + oldTotalBoxes[c]);
- return b
- }
- function rdm_foundation_swap_boxes(a) {
- a = a || !1;
- var b, c = jQuery;
- if (b = rdm_foundation_store_content_boxes(), a || c(window).height() != parseInt(window.lastWindowHeight) || c(window).width() != parseInt(window.lastWindowWidth) || window.rdm_firstLoad) {
- window.lastWindowHeight = c(window).height(), window.lastWindowWidth = c(window).width(), window.rdm_firstLoad = !1;
- var d = new Array,
- e = 0,
- f = 0,
- g = 0,
- h = 0,
- i = c(".swap-box").length,
- j = 0;
- if ("undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 767px) and (min-width: 321px)") ? (d = [4, 7], d = updade_ads_positions(d)) : "undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 1007px) and (min-width: 768px)") ? (d = [4, 8], d = updade_ads_positions(d)) : "undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 1264px) and (min-width: 1008px)") || jQuery.browser.msie && parseInt(jQuery.browser.version) < 9 ? (d = [3, 9], d = updade_ads_positions(d)) : (d = [4, 10], d = updade_ads_positions(d)), c(".swap-box").each(function() {
- if (c(this).hasClass("ad-box")) {
- if (c(this).hasClass("multi")) {
- c(this).removeClass("multi-short"), c(this).removeClass("multi-long");
- for (var a = 0, k = 0, l = new Array("[id^=multi_ad_hp_bb]", "[id^=multi_ad_hp_bb] a", "[id^=multi_ad_hp_bb] iframe", "[id^=multi_ad_hp_bb] object", "[id^=multi_ad_hp_bb] ins", "[id^=multi_ad_hp_bb] img", "[id^=multi_ad_hp_bb] embed", "[id^=multi_ad_hp_bb] table", "[id^=multi_ad_hp_bb] div", "aside ins"), m = 0; m < l.length; m++) k = parseInt(c(this).find(l[m]).height()), isNaN(k) && (k = 0), k > a && (a = k);
- c(this).addClass(isNaN(a) || a > 305 ? "multi-long" : "multi-short")
- }
- lastAdBox = this;
- for (var n = d[e] - (f + 1 + h), o = 1; n >= o; o++) c(lastAdBox).before(b[f]), f++, j++;
- h++, e++, j++
- } else i > j && (c(this).remove(), g++)
- }), f < b.length)
- for (f; f < b.length; f++) c(".swap-box").last().after(b[f]);
- else f == b.length && (f + 1 == d[0] ? c("#ad-box-1+.box").remove() : c("#ad-box-2+.box").remove())
- }
- dfd.resolve()
- }
- jQuery(document).ready(function(a) {
- a("ul.breadcrumbs.dropdown li").not(".parent").not(".current").not(".current-menu-item").delay(200).animate({
- height: "toggle"
- }), a("ul.breadcrumbs.dropdown li.parent").click(function(b) {
- a(this).toggleClass("push"), a("ul.breadcrumbs.dropdown li").not(".parent").not(".current").not(".current-menu-item").animate({
- height: "toggle"
- }), b.preventDefault()
- }).delay(500).toggleClass("push", "slow")
- });
- var player, videoAPI, videoPlayer, experienceModule, adModule, adServerURLHasChanged = !1;
- jQuery(window).resize(function() {
- brightcoveResize()
- }),
- function(a) {
- "function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof exports ? require("jquery") : jQuery)
- }(function(a) {
- function b(a) {
- return h.raw ? a : encodeURIComponent(a)
- }
- function c(a) {
- return h.raw ? a : decodeURIComponent(a)
- }
- function d(a) {
- return b(h.json ? JSON.stringify(a) : String(a))
- }
- function e(a) {
- 0 === a.indexOf('"') && (a = a.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\"));
- try {
- return a = decodeURIComponent(a.replace(g, " ")), h.json ? JSON.parse(a) : a
- } catch (b) {}
- }
- function f(b, c) {
- var d = h.raw ? b : e(b);
- return a.isFunction(c) ? c(d) : d
- }
- var g = /\+/g,
- h = a.cookie = function(e, g, i) {
- if (void 0 !== g && !a.isFunction(g)) {
- if (i = a.extend({}, h.defaults, i), "number" == typeof i.expires) {
- var j = i.expires,
- k = i.expires = new Date;
- k.setTime(+k + 864e5 * j)
- }
- return document.cookie = [b(e), "=", d(g), i.expires ? "; expires=" + i.expires.toUTCString() : "", i.path ? "; path=" + i.path : "", i.domain ? "; domain=" + i.domain : "", i.secure ? "; secure" : ""].join("")
- }
- for (var l = e ? void 0 : {}, m = document.cookie ? document.cookie.split("; ") : [], n = 0, o = m.length; o > n; n++) {
- var p = m[n].split("="),
- q = c(p.shift()),
- r = p.join("=");
- if (e && e === q) {
- l = f(r, g);
- break
- }
- e || void 0 === (r = f(r)) || (l[q] = r)
- }
- return l
- };
- h.defaults = {}, a.removeCookie = function(b, c) {
- return void 0 === a.cookie(b) ? !1 : (a.cookie(b, "", a.extend({}, c, {
- expires: -1
- })), !a.cookie(b))
- }
- }), jQuery(document).ready(function() {
- var a = 1e3,
- b = 0;
- "undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 767px)") && (a = 200, jQuery("ul.related-videos-menu").prepend(jQuery(".related-videos-menu li.current"))), "undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 1007px) and (min-width:768px)") && (a = 450), ("undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 1264px) and (min-width:1008px)") || jQuery.browser.msie && 8 === parseInt(jQuery.browser.version, 10)) && (a = 800), jQuery(".related-videos-menu li").each(function() {
- b = b + jQuery(this).width() + 10, "undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 767px)") ? (jQuery(".subMenuTab").addClass("visible"), jQuery(this).addClass("subMenuCategory"), jQuery(this).hasClass("subMenuTab") || jQuery(this).appendTo(jQuery(".subMenuContainer")), jQuery("ul.related-videos-menu").prepend(jQuery(".related-videos-menu li.current"))) : b > a && (jQuery(".subMenuTab").addClass("visible"), jQuery(this).addClass("subMenuCategory"), jQuery(this).hasClass("subMenuTab") || jQuery(this).appendTo(jQuery(".subMenuContainer")))
- }), jQuery(".subMenuTab").click(function() {
- jQuery(this).hasClass("active") ? (jQuery(this).removeClass("active"), jQuery(".subMenuContainer").slideUp()) : (jQuery(this).addClass("active"), jQuery(".subMenuContainer").slideDown())
- })
- }), jQuery(document).ready(function(a) {
- a(".comment_bubble").click(function() {
- a("#comment-block, .comment-block").slideDown(), a(".comment-block").addClass("display"), 0 == window.commentbool && (a(".lblShowComments").removeClass("display"), a(".lblHideComments").addClass("display"));
- var b;
- return a("div[name='#comment-block']").each(function() {
- return a(this).is(":visible") ? (b = a(this), !1) : !0
- }), a("html, body").animate({
- scrollTop: a("#comment-block").offset().top
- }, 1e3), window.commentbool = !0, !1
- })
- });
- var rdm_curated_author_widget_number_of_pages = parseInt(jQuery(".curated_author_total_page").html());
- jQuery(document).ready(function() {
- var a = parseInt(jQuery(".curated_author_current_page").html()),
- b = rdm_curated_author_widget_is_in_tablet();
- rdm_curated_author_widget_get_content(a, b), jQuery(window).resize(function() {
- rdm_curated_author_widget_is_in_tablet() != b && (b = !b, b && a % 2 == 0 && a--, rdm_curated_author_widget_get_content(a, b))
- }), jQuery("div.author-list-controls span.left-arrow").click(function() {
- var c = a - 1;
- b && (c -= 1), 0 >= c || (a = c, rdm_curated_author_widget_get_content(a, b))
- }), jQuery("div.author-list-controls span.right-arrow").click(function() {
- var c = a + 1;
- b && (c += 1), c > rdm_curated_author_widget_number_of_pages || (a = c, rdm_curated_author_widget_get_content(a, b))
- })
- }), jQuery(document).ready(function() {
- Modernizr.mq("only screen and (min-width: 768px) and (max-width: 1007px)")
- }), jQuery(window).resize(function() {
- Modernizr.mq("only screen and (min-width: 768px) and (max-width: 1007px)")
- }),
- function(a, b, c) {
- "use strict";
- var d = c.body || c.documentElement,
- d = d.style;
- if ("" == d.webkitFlexWrap || "" == d.msFlexWrap || "" == d.flexWrap) return !0;
- var e = a(".rdm-featured-stories .secondary-featured-stories-wrapper"),
- f = e.find(".rdm-featured-stories .featured-stories-title"),
- g = function() {
- f.css("height", "auto");
- var b = Math.floor(e.width() / f.width());
- if (null == b || 2 > b) return !0;
- for (var c = 0, d = f.length; d > c; c += b) {
- var g = 0,
- h = f.slice(c, c + b);
- h.each(function() {
- var b = parseInt(a(this).outerHeight());
- b > g && (g = b)
- }), h.css("height", g)
- }
- };
- g(), a(b).on("resize", g), e.find("img").on("load", g)
- }(jQuery, window, document), jQuery(document).ready(function(a) {
- function b(b, c, d) {
- if (c != d) {
- var e = parseInt("previous" == b ? c - 1 : c + 1);
- a(".most_popular_current_page").html(e), a(".section-" + e).show(), a(".section-" + c).hide()
- }
- }
- a(".most_popular_next_section").click(function(c) {
- c.preventDefault();
- var d = parseInt(a(".most_popular_current_page").html()),
- e = parseInt(a(".most_popular_total_page").html());
- b("next", d, e), a(".most_popular_previous_section").hasClass("most_popular_nav_disabled") && a(".most_popular_previous_section").removeClass("most_popular_nav_disabled"), d + 1 == e && a(".most_popular_next_section").addClass("most_popular_nav_disabled")
- }), a(".most_popular_previous_section").click(function(c) {
- c.preventDefault(); {
- var d = parseInt(a(".most_popular_current_page").html());
- parseInt(a(".most_popular_total_page").html())
- }
- b("previous", d, 1), a(".most_popular_next_section").hasClass("most_popular_nav_disabled") && a(".most_popular_next_section").removeClass("most_popular_nav_disabled"), d - 1 == 1 && a(".most_popular_previous_section").addClass("most_popular_nav_disabled")
- })
- }), jQuery(document).ready(function(a) {
- a(".flex-grid .box.recipe_tile article h5.post_excerpt p").length > 0 && a(".flex-grid .box.recipe_tile article h5.post_excerpt p").dotdotdot()
- }), jQuery(document).ready(function() {
- jQuery(window).width() < 1008 && (jQuery(".rdm_recipes_plus_single #post-excerpt-toggle").text("More"), jQuery(".rdm_recipes_plus_single #post-excerpt-toggle").addClass("show"), jQuery(".rdm_recipes_plus_single h2#post-excerpt").hide()), jQuery("#post-excerpt-toggle").on("click", function(a) {
- a.preventDefault(), jQuery("h2#post-excerpt").is(":visible") ? (jQuery("#post-excerpt-toggle").addClass("show"), jQuery("h2#post-excerpt").hide(), ("More" == jQuery(this).html() || "Less" == jQuery(this).html()) && jQuery(this).html("More")) : (jQuery("#post-excerpt-toggle").removeClass("show"), jQuery("h2#post-excerpt").show(), ("More" == jQuery(this).html() || "Less" == jQuery(this).html()) && jQuery(this).html("Less"))
- })
- }), jQuery(document).ready(function(a) {
- a.browser.msie && parseInt(a.browser.version) <= 8 && a(".flex-grid .box.recipe_tile article h4.postTitle").length > 0 && a(".flex-grid .box.recipe_tile article h4.postTitle").dotdotdot()
- }), jQuery(document).ready(function(a) {
- a(".printButton").click(function() {
- window.print()
- })
- }),
- function(a) {
- "use strict";
- function b(b, c) {
- var d = this;
- d.defaults = {
- allowSwipe: !1,
- arrowNext: ".next-arrow",
- arrowPrevious: ".previous-arrow",
- slidesContainer: "li",
- slidesToSlideBy: "visible",
- thumbnailsContainer: "ul"
- }, d.initials = {
- activeSlide: 0,
- leftPosition: 0,
- leftPositionMax: 0,
- slidesMargin: 0,
- slidesMarginRight: 0,
- slidesTotalWidth: 0,
- slidesWidth: 0,
- slidesVisible: 0,
- slidesVisibleWidth: 0,
- thumbnailsWidth: 0,
- $activeSlide: null,
- $arrowNext: null,
- $arrowPrevious: null,
- $slidesContainer: null,
- $thumbnailsContainer: null
- }, a.extend(d, d.initials), d.$thumbnails = a(b), d.options = a.extend({}, d.defaults, c), d.moveSlides = a.proxy(d.moveSlides, d), d.getLeftPosition = a.proxy(d.getLeftPosition, d), d.setDimensions = a.proxy(d.setDimensions, d), d.setSlidesVisible = a.proxy(d.setSlidesVisible, d), d.init()
- }
- a.fn.RDMGalleryThumbnails = function(a) {
- var c = this;
- return c.each(function() {
- new b(c, a)
- })
- }, b.prototype.init = function() {
- var b = this;
- b.$thumbnailsContainer = b.$thumbnails.find(b.options.thumbnailsContainer), b.$slidesContainer = b.$thumbnails.find(b.options.slidesContainer), b.slideCount = b.$slidesContainer.length, b.$activeSlide = b.$slidesContainer.siblings(".active"), b.activeSlide = b.$slidesContainer.index(b.$activeSlide), b.setDimensions(), b.setSlidesVisible(), b.$previousArrow = b.$thumbnails.find(b.options.arrowPrevious), b.$previousArrow.on("click", {
- direction: "previous"
- }, b.moveSlides), b.$nextArrow = b.$thumbnails.find(b.options.arrowNext), b.$nextArrow.on("click", {
- direction: "next"
- }, b.moveSlides), a(window).on("resize", function() {
- b.setDimensions(), b.setSlidesVisible(), b.options.slidesToSlideBy = b.slidesVisible
- }), b.$slidesContainer.each(function(c, d) {
- var e = a(d).find("a");
- e.on("click", b.changeSlide)
- }), b.slidesTotalWidth <= b.slidesVisibleWidth && (a(".gallery-slide-thumbnails-next").addClass("disabled"), a(".gallery-slide-thumbnails-previous").addClass("disabled"))
- }, b.prototype.changeSlide = function(b) {
- var c = a(b.currentTarget);
- c.is("a") && b.preventDefault(), a(c).trigger("RDMGalleryChangeSlide")
- }, b.prototype.setDimensions = function() {
- var a = this;
- a.thumbnailsWidth = a.$thumbnailsContainer.parent().width(), a.thumbnailsHeight = a.$thumbnailsContainer.parent().height(), a.slidesWidth = a.$slidesContainer.width(), a.slidesMargin = a.$slidesContainer.outerWidth(!0) - a.slidesWidth, a.slidesMarginRight = a.$slidesContainer.css("marginRight").replace("px", ""), a.slidesTotalWidth = a.slideCount * a.$slidesContainer.outerWidth(!0)
- }, b.prototype.setSlidesVisible = function() {
- var a = this;
- a.slidesVisible = Math.floor((a.thumbnailsWidth + parseFloat(a.slidesMarginRight)) / a.$slidesContainer.outerWidth(!0)), a.slidesVisibleWidth = a.slidesVisible * a.slidesWidth + a.slidesVisible * a.slidesMargin, a.leftPositionMax = parseFloat(a.slidesTotalWidth) - parseFloat(a.slidesVisibleWidth), "visible" == a.options.slidesToSlideBy && (a.options.slidesToSlideBy = a.slidesVisible)
- }, b.prototype.moveSlides = function(b) {
- var c = this,
- d = 0,
- e = a(b.target);
- switch (e.is("a") && b.preventDefault(), b.data.direction) {
- case "previous":
- d = c.getLeftPosition("previous");
- break;
- case "next":
- d = c.getLeftPosition("next");
- break;
- default:
- return !1
- }
- c.$thumbnailsContainer.css("left", "-" + d + "px")
- }, b.prototype.getLeftPosition = function(b) {
- var c = this,
- d = 0,
- e = 0;
- return d = c.$thumbnailsContainer.css("left"), d = d.replace("px", "").replace("-", ""), parseFloat(d) || (d = 0), e = "previous" == b ? parseFloat(d) - parseFloat(c.slidesVisibleWidth) : parseFloat(d) + parseFloat(c.slidesVisibleWidth), 0 >= e ? (a(".gallery-slide-thumbnails-previous").addClass("disabled"), e = 0) : a(".gallery-slide-thumbnails-previous").removeClass("disabled"), e >= c.leftPositionMax ? (a(".gallery-slide-thumbnails-next").addClass("disabled"), e = c.leftPositionMax) : a(".gallery-slide-thumbnails-next").removeClass("disabled"), e
- }
- }(jQuery),
- function() {
- var a = 0;
- checkDisableScrolling(), jQuery(".gallery-slide-thumbnails-container").RDMGalleryThumbnails({
- arrowPrevious: ".gallery-slide-thumbnails-previous a",
- arrowNext: ".gallery-slide-thumbnails-next a"
- }), jQuery(".gallery-slide-thumbnails-container .gallery-slide-thumbnails ul li").each(function() {
- a += jQuery(this).outerWidth(!0)
- }), jQuery(".gallery-slide-thumbnails-container .gallery-slide-thumbnails ul").css("width", a + "px"), jQuery("#toggleGallerySlideCaption").on("click", function(a) {
- a.preventDefault(), jQuery(".gallery-slide-caption-container").is(":visible") ? (jQuery(".gallery-slide-caption-container").slideUp(), jQuery(this).html("Show"), jQuery(this).removeClass("clicked")) : (jQuery(".gallery-slide-caption-container").slideDown(), jQuery(this).html("Hide"), jQuery(this).addClass("clicked"))
- })
- }(jQuery), jQuery(document).ready(function(a) {
- jQuery(".gallery-social-wrapper").css("display", "block"), setShareOverlayPosition(), setCaptionPosition(), a("a.gallery-icon.gallery-slide-share, a.gallery-button.gallery-slides-share-close").click(function(a) {
- toggleShareOverlay(), a.preventDefault()
- }), jQuery(window).resize(function() {
- setShareOverlayPosition(), setCaptionPosition()
- })
- }), jQuery(document).ready(function(a) {
- a.browser.msie && parseInt(a.browser.version) <= 8 && (a(".recipe_additional_fields .recipe_additional_fields_separator:last-child").css({
- border: "none",
- padding: "0",
- margin: "0"
- }), a(".recipe_additional_fields .recipe_additional_fields_separator div:last-child").css({
- border: "none",
- padding: "0",
- margin: "0"
- }))
- });
- var recipesFilterToolAjaxCall = !1;
- jQuery(document).ready(function(a) {
- a("#open_filter_tool_button, .filter_tool_button").click(function() {
- var b = "";
- b = a(this).siblings(".filter_tool_container").length > 0 ? a(this).siblings(".filter_tool_container") : a(this).parents(".filter_tool_container"), b.is(":visible") ? (a("#main .content").height("auto"), b.hide(), a("#open_filter_tool_button").removeClass("selected")) : (rdm_recipes_adjust_content_height(), b.show(), a("#open_filter_tool_button").addClass("selected"))
- }), a(".filter_option").on("click", function() {
- a(this).parent().hasClass("single") && a(this).siblings().each(function() {
- a(this).removeClass("selected"), a("#" + a(this).attr("id") + "_selected").remove()
- }), a(this).hasClass("selected") ? (a(this).removeClass("selected"), a("#" + a(this).attr("id") + "_selected").remove(), a(this).siblings(".filter_option").hasClass("selected") || a(this).closest(".column_padding").find("p.filter_section_title").removeClass("selected")) : (a(this).addClass("selected"), rdm_recipes_add_filter(a(this).attr("id"), "", a(this).find("span.filter_label").text(), a(this).attr("data-search")), a(this).closest(".column_padding").find("p.filter_section_title").hasClass("selected") || a(this).closest(".column_padding").find("p.filter_section_title").addClass("selected")), rdm_recipes_auto_update_search()
- }), a("#filter_ingredient_input").keypress(function(b) {
- 13 == b.keyCode && (a("#filter_add_ingredients").trigger("click"), b.preventDefault())
- }), a(".selected_filter_container").on("click", ".selected_filter", function() {
- var b = a(this).attr("id");
- if ("undefined" != typeof b) {
- var c = b.split("_selected"),
- d = c[0];
- if ("undefined" != typeof d) {
- if (a(".filter_section #" + d).length > 0) a("#" + d).removeClass("selected"), a("#" + d).siblings(".filter_option").hasClass("selected") || a("#" + d).closest(".column_padding").find("p.filter_section_title").removeClass("selected");
- else {
- var e = d.split("_");
- if ("undefined" != typeof e[0] && (e.length > 1 || "issuedate" == e[0])) {
- var f = e[0],
- g = a("#" + b).siblings("." + f).length;
- 0 == g && a("div#" + f + "_filter_section p.filter_section_title").removeClass("selected")
- }
- }
- a(this).remove(), rdm_recipes_auto_update_search()
- }
- }
- }), a("p.filter_section_title").on("click", function() {
- if ("undefined" != Modernizr.mq && Modernizr.mq("only screen and (max-width: 767px)")) {
- var b = a(this).siblings("div.filter_option_container");
- rdm_recipes_adjust_content_height(), a(this).hasClass("opened") ? (a(this).removeClass("opened"), b.removeClass("show_mobile")) : (a(this).addClass("opened"), b.addClass("show_mobile"))
- }
- }), a("#filter_ingredient_input").focus(function() {
- if ("i.e. tofu, quinoa, kale" == a(this).val()) {
- a(this).val("");
- var b = "#000";
- "rgb(102, 102, 102)" != a(this).css("color") && "rgb(0, 0, 0)" != a(this).css("color") && (b = a(this).css("color")), a(this).css({
- "font-size": "16px",
- "font-weight": "normal",
- color: b,
- "font-style": "normal"
- })
- }
- }).blur(function() {
- if ("" == a(this).val()) {
- a(this).val("i.e. tofu, quinoa, kale");
- var b = "";
- "rgb(102, 102, 102)" != a(this).css("color") && "rgb(0, 0, 0)" != a(this).css("color") && (b = a(this).css("color")), a(this).removeAttr("style"), a(this).css("color", b)
- }
- }), a("#filter_add_ingredients").on("click", function(b) {
- a("#filter_ingredient_input").css("color", "#000000"), a("#recipe_filter_tool_ingredient_error").html("");
- var c = [",", "\\+", "&"],
- d = a("#filter_ingredient_input").val().toLowerCase();
- if ("i.e. tofu, quinoa, kale" == d && (d = ""), "" != a.trim(d)) {
- var e = d.split(new RegExp(c.join("|"))),
- f = "";
- for (i = 0; i < e.length; i++) {
- var g = a.trim(e[i]);
- if ("" != g) {
- var h = rdm_recipes_add_filter("ingredient_" + g.replace(" ", "_"), "ingredient", g, "ingredients:" + g);
- h ? rdm_recipes_auto_update_search() : f += "This ingredient has already been selected.<br />", !a(this).closest(".column_padding").find("p.filter_section_title").hasClass("selected") && h && a(this).closest(".column_padding").find("p.filter_section_title").addClass("selected")
- }
- }
- "" != f && a("#recipe_filter_tool_ingredient_error").html(f), a("#filter_ingredient_input").val("i.e. tofu, quinoa, kale"), a("#filter_ingredient_input").removeAttr("style")
- } else a("#filter_ingredient_input").css("color", "#EB008B"), a("#recipe_filter_tool_ingredient_error").text("Please type in an ingredient to add a recipe filter.");
- b.preventDefault()
- }), a("#filter_add_issuedate").on("click", function(b) {
- a("#filter_issuedate_month").css("color", "#000000"), a("#filter_issuedate_year").css("color", "#000000"), a("#recipe_filter_tool_issuedate_error").html("");
- var c = a("#filter_issuedate_month").val(),
- d = a("#filter_issuedate_year").val(),
- e = "",
- f = "";
- if ("" == c && "" == d ? (f = "Please select month and year to add a recipe filter", a("#filter_issuedate_month").css("color", "#EB008B"), a("#filter_issuedate_year").css("color", "#EB008B")) : "" == c ? (f = "Please select month to add a recipe filter", a("#filter_issuedate_month").css("color", "#EB008B")) : "" == d ? (f = "Please select year to add a recipe filter", a("#filter_issuedate_year").css("color", "#EB008B")) : (e = c + " " + d, recipe_filter_tool.issues.indexOf(e) < 0 && (f = "Please select another issue date, the one you chose does not exist")), "" != f) a("#recipe_filter_tool_issuedate_error").html(f);
- else {
- var g = rdm_recipes_add_filter("issuedate", "issuedate", e, "issue_date:" + e);
- g || a("#recipe_filter_tool_issuedate_error").text("There is already an issue date in the selected filters."), !a(this).closest(".column_padding").find("p.filter_section_title").hasClass("selected") && g && (a(this).closest(".column_padding").find("p.filter_section_title").addClass("selected"), rdm_recipes_auto_update_search())
- }
- b.preventDefault()
- })
- }), jQuery(document).ready(function(a) {
- a(".recipe_list_toggle").click(function(b) {
- a(this).siblings().removeClass("selected"), a(this).addClass("selected");
- var c = "#recipe_" + a(this).text().toLowerCase() + "_container";
- a(".recipe_toggle_display_container").hide(), a(c).show(), b.preventDefault()
- })
- });
- var searchPaginationPage = 2;
- jQuery(document).ready(function(a) {
- a("#recipe_search_load_more").click(function() {
- if (!a(this).hasClass("loading")) {
- var b = jQuery("#recipeFilterToolForm").serializeArray();
- b.push({
- name: "page",
- value: searchPaginationPage
- }), a(this).addClass("loading"), that = a(this), a.ajax({
- url: loop.parentThemeUrl + "/ComponentControllers/RecipeSearchResultsComponent/ajax.getSearchPost.php",
- data: b,
- type: "POST",
- success: function(b) {
- (b.indexOf("--hidebutton") >= 0 || "" == b) && (a("#recipe_search_load_more").hide(), b = b.replace("--hidebutton", "")), a("#recipe_search_flex_grid").append(b), that.removeClass("loading"), searchPaginationPage++
- },
- complete: function() {
- a("#recipe_search_flex_grid .box article h4.postTitle").dotdotdot(), a("#recipe_search_flex_grid .box article h5.post_excerpt p").dotdotdot()
- }
- })
- }
- })
- }), jQuery(document).ready(function(a) {
- a("#recipe_suggestion_tool_meal_type").change(function() {
- rdmRecipeSuggestionToolAssignMealType()
- }), a("form#recipe_suggestion_tool").submit(function() {
- 0 != a("#recipe_suggestion_tool_ingredient_id").length && 0 != a("#recipe_suggestion_tool_meal_type_id").length && ("" != a("#recipe_suggestion_tool_ingredient").val() && a("#recipe_suggestion_tool_ingredient").val() != a("#recipe_suggestion_tool_ingredient").attr("placeholder") ? rdmRecipeSuggestionToolAssignIngredient() : rdmRecipeSuggestionToolInvalidateIngredient())
- }), a("#recipe_suggestion_tool_see_all").click(function(b) {
- b.preventDefault(), b.stopPropagation(), rdmRecipeSuggestionToolInvalidateIngredient(), rdmRecipeSuggestionToolInvalidateMealType(), a("form#recipe_suggestion_tool").submit()
- }), a(".with-this-ingredient input").change(function() {
- "" == a(this).val() && a(this).parent().hasClass("focus_input") && a(this).parent().removeClass("focus_input"), "" == a(this).val() || a(this).parent().hasClass("focus_input") || a(this).parent().addClass("focus_input")
- }), a("#magnifying_glass").click(function() {
- var b = a("input#recipe_suggestion_tool_ingredient");
- b.val(""), a(".with-this-ingredient input").parent().removeClass("focus_input")
- }), rdmRecipeMealTypeDropDownMenu(a)
- }), jQuery(document).ready(function(a) {
- var b = a(".menu-resources-menu-container, .menu-ressources-menu-container");
- a(".resource-menu-toggle").click(function() {
- b.slideToggle(400, function() {
- b.is(":visible") ? a(".resource-menu-toggle").css("background-position", "-765px -816px") : a(".resource-menu-toggle").css("background-position", "-514px -816px")
- })
- })
- }), jQuery(document).ready(function(a) {
- a(".comment-button").click(function() {
- return rdm_foundation_comment_button_click(), !1
- })
- });
- var dfd = jQuery.Deferred(),
- oldTotalBoxes = [0];
- jQuery(document).ready(function(a) {
- var b = 1,
- c = 1,
- d = loopFooter.calledAds;
- a(".flex-grid .box article .text header .excerpt").each(function() {
- a(this).children("p").each(function(b) {
- 0 != b && a(this).remove()
- })
- }), a(".flex-grid .box article .text header h1").dotdotdot(), a(".flex-grid div.box:not(.featured) article .text header .excerpt p").dotdotdot(), a(".flex-grid div.box:not(.featured) article .text header .dek p").dotdotdot(), a(".river .type-post .text .excerpt").css("visibility", "visible"), a("body").hasClass("category") && a("article.rdm-brightcove").length > 0 || a(".content-box").length > 0 && a(".ad-box").length > 0 && (a("body").hasClass("single-post") || (window.rdm_firstLoad = !0, a(window).resize(rdm_foundation_swap_boxes(!0)))), "undefined" != typeof googletag && googletag.pubads().addEventListener("slotRenderEnded", function(a) {
- a.size[1] > 298 && rdm_foundation_swap_boxes(!0)
- }), a("#recipe_landing_load_more").on("click", function() {
- oldTotalBoxes.push(a(".swap-box").length), a(this).hasClass("loading") || (a(this).addClass("loading"), that = a(this), loop.queryArgs.paged = b, a.ajax({
- url: loop.parentThemeUrl + "/loop.php",
- data: {
- ajaxLoad: "true",
- queryArgs: loop.queryArgs,
- view: "recipe-landing",
- callId: c,
- calledAds: d
- },
- type: "POST",
- success: function(a) {
- a = JSON.parse(a), d = a.calledAds, (a.output.indexOf("--hidebutton") >= 0 || "" == a.output) && (that.remove(), a.output = a.output.replace("--hidebutton", "")), that.siblings(".flex-grid").children(".content-box").last().after(a.output), that.removeClass("loading"), "undefined" != typeof googletag && googletag.pubads().addEventListener("slotRenderEnded", function() {
- rdm_foundation_swap_boxes(!0)
- })
- },
- complete: function() {
- that.siblings(".flex-grid").children(".box article h4.postTitle").dotdotdot(), that.siblings(".flex-grid").children(".box article h5.post_excerpt p").dotdotdot()
- }
- }), b++, c++)
- })
- }), jQuery(document).ready(function(a) {
- a(".selectedPlaceholder").each(function() {
- a(this).text(a(this).siblings(".toggleButton.selected").text())
- }), a(".toggleButton").click(function(b) {
- a(this).siblings().removeClass("selected"), a(this).addClass("selected"), a(this).siblings(".selectedPlaceholder").text(a(this).text()), a(this).parent().siblings(".togglePlusSign").hasClass("open") && (a(this).parent().attr("style", ""), a(this).parent().siblings(".togglePlusSign").text("+"), a(this).parent().siblings(".togglePlusSign").removeClass("open"));
- var c = ".toggledDivContainer #" + a(this).text().toLowerCase().replace(new RegExp(" ", "g"), "_") + "_container";
- a(c).siblings().hide(), a(c).show({
- complete: function() {
- a(".toggledDivContainer h5.post_excerpt p").dotdotdot(), a(".toggledDivContainer h4.postTitle").dotdotdot()
- },
- duration: 0
- }), b.preventDefault()
- }), a(".togglePlusSign").click(function() {
- if (a(this).hasClass("open")) a(this).siblings(".toggleButtonContainer").attr("style", ""), a(this).text("+"), a(this).removeClass("open");
- else {
- var b = a(this).siblings(".toggleButtonContainer").css("height", "auto").height();
- a(this).siblings(".toggleButtonContainer").animate({
- height: b
- }, 100), a(this).text("-"), a(this).addClass("open")
- }
- })
- }), jQuery(document).ready(function(a) {
- a(".top-scroll, .back_to_top_button").click(function(b) {
- a("html, body").animate({
- scrollTop: 0
- }, "slow"), b.preventDefault()
- }), a(window).scroll(function() {
- a(this).scrollTop() > 200 && parseInt(a(".back_to_top_button").css("left")) < 0 && a(".back_to_top_button").animate({
- left: "0px"
- }, 500), a(this).scrollTop() <= 200 && parseInt(a(".back_to_top_button").css("left")) >= 0 && a(".back_to_top_button").animate({
- left: "-250px"
- }, 500)
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement