(function($) {
$(function(){
function get_query_string() {
var result = {},
query_string = location.search.substring(1),
re = /([^&=]+)=([^&]*)/g,
m;
while(m = re.exec(query_string)) {
result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
}
return result;
}
var support_whyb = get_query_string()['support_whyb'] ? true : false;
var social = get_query_string()['social'] ? true : false;
if(support_whyb || (Drupal.settings.eff_whyb && Drupal.settings.eff_whyb.html)) {
var link;
if (social) {
link = 'https://supporters.eff.org/donate/who-has-your-back-s';
}
else if (support_whyb) {
link = 'https://supporters.eff.org/donate/who-has-your-back';
}
else {
link = Drupal.settings.eff_whyb.link;
}
var $bar = $('')
.attr('href', link)
.html(Drupal.settings.eff_whyb.html);
var $css = $('');
$('body').append($bar).append($css);
if ($('#support-whyb').is(':visible')) {
$('body').css('padding-top', $('#support-whyb').height()+'px');
}
}
});
})(jQuery);
;
;
(function ($) {
Drupal.behaviors.mytube = {
attach: function (context, settings) {
$('.mytubetrigger', context).once('mytubetrigger').click(function(){
$(this).hide();
$(this).after(unescape($('.mytubeembedcode', this).html()));
Drupal.attachBehaviors(this);
// If API usage is enabled, instantiate the API.
if ($(this).hasClass('mytube-js-api')) {
Drupal.behaviors.mytube.InitiateYouTubeAPI();
}
});
// Start the video when pressing the Enter button
$('.mytubetrigger', context).keypress(function(e){
if(e.which == 13){ // Enter key pressed
$(this).click(); // Trigger search button click event
}
});
}
};
/**
* If API usage is enabled, initalize the player once the API is ready.
*/
Drupal.behaviors.mytube.InitiateYouTubeAPI = function(context) {
if (typeof this.initialized === 'undefined') {
// Load the iFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
this.initialized = true;
}
};
})(jQuery);
;
/* eslint-disable no-multi-str */
(function ($) {
'use strict';
/**
* The recommended way for producing HTML markup through JavaScript is to write
* theming functions. These are similiar to the theming functions that you might
* know from 'phptemplate' (the default PHP templating engine used by most
* Drupal themes including Omega). JavaScript theme functions accept arguments
* and can be overriden by sub-themes.
*
* In most cases, there is no good reason to NOT wrap your markup producing
* JavaScript in a theme function.
*
* @param {string} path
* The link URL.
* @param {string} title
* The link title.
*
* @return {jQuery}
* The anchor element.
*/
Drupal.theme.prototype.badgerExampleButton = function (path, title) {
// Create an anchor element with jQuery.
return $('' + title + '');
};
// Anchor above the header, not at the FAQ item
function raiseAnchors() {
if (window.location.hash) {
window.scrollTo(window.scrollX, window.scrollY - 95);
}
}
$(window).on('hashchange', function () {
raiseAnchors();
});
/**
* Behaviors are Drupal's way of applying JavaScript to a page. In short, the
* advantage of Behaviors over a simple 'document.ready()' lies in how it
* interacts with content loaded through Ajax. Opposed to the
* 'document.ready()' event which is only fired once when the page is
* initially loaded, behaviors get re-executed whenever something is added to
* the page through Ajax.
*
* You can attach as many behaviors as you wish. In fact, instead of overloading
* a single behavior with multiple, completely unrelated tasks you should create
* a separate behavior for every separate task.
*
* In most cases, there is no good reason to NOT wrap your JavaScript code in a
* behavior.
*
* @param context
* The context for which the behavior is being executed. This is either the
* full page or a piece of HTML that was just added through Ajax.
* @param settings
* An array of settings (added through drupal_add_js()). Instead of accessing
* Drupal.settings directly you should use this because of potential
* modifications made by the Ajax callback that also produced 'context'.
*/
Drupal.behaviors.badgerDownload = {
attach: function (context, settings) {
// By using the 'context' variable we make sure that our code only runs on
// the relevant HTML. Furthermore, by using jQuery.once() we make sure that
// we don't run the same piece of code for an HTML snippet that we already
// processed previously. By using .once('foo') all processed elements will
// get tagged with a 'foo-processed' class, causing all future invocations
// of this behavior to ignore them.
$('#badger-download', context).once('badger-download', function () {
var firefox_url = $('#badger-firefox').attr('href');
var chrome_url = $('#badger-chrome').attr('href');
var opera_url = $('#badger-opera').attr('href');
// detect browser
var browser = 'other';
if (navigator && navigator.userAgent) {
if (navigator.userAgent.match(/Android/i)) {
browser = 'android';
}
else if (navigator.userAgent.match(/firefox/i)) {
browser = 'firefox';
}
else if (navigator.userAgent.match(/OPR|opera/i)) {
browser = 'opera';
}
else if (navigator.userAgent.match(/edge/i)) {
browser = 'edge';
}
else if (navigator.userAgent.match(/chrome/i)) {
browser = 'chrome';
}
else if (navigator.userAgent.match(/iPhone/i)) {
browser = 'iphone';
}
else {
browser = 'other';
}
}
// [Install Privacy Badger and enable do not track]
// build the links
function install_link(browser, url) {
var $install = $('')
.attr('href', url)
.html(Drupal.t('Install Privacy Badger') + '
)?\[caption([^\]]*)\]([\s\S]+?)\[\/caption\](?:<\/p>)?[\s\u00a0]*/g, function(a,b,c){ var id, cls, w, tempClass; b = b.replace(/\\?'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); id = b.match(/id=['"]([^'"]+)/i); cls = b.match(/align=['"]([^'"]+)/i); ct = b.match(/caption=['"]([^'"]+)/i); w = c.match(/width=['"]([0-9]+)/); id = ( id && id[1] ) ? id[1] : ''; cls = ( cls && cls[1] ) ? 'caption-' + cls[1] : ''; ct = ( ct && ct[1] ) ? ct[1].replace(/\\\\"/,'"') : ''; w = ( w && w[1] ) ? parseInt(w[1])+'px' : 'auto'; if (editor == 'tinymce') tempClass = (cls == 'caption-center') ? 'mceTemp mceIEcenter' : 'mceTemp'; else if (editor == 'ckeditor') tempClass = (cls == 'caption-center') ? 'mceTemp mceIEcenter' : 'mceTemp'; else tempClass = ''; if (ct) { return '