Skip to content

Instantly share code, notes, and snippets.

Shane Bill shaneonabike

Block or report user

Report or block shaneonabike

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View popup.js
jQuery(function($) {
// Scroll the popup with the user
$(window).scroll(function() {
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupWidth = $("#likeus").width();
var popupHeight = $("#likeus").height();
var topPopup = windowHeight * 2 / 3 + $(window).scrollTop();
var leftPopup = windowWidth - popupWidth;
View popup.css
* Like Us Popup CSS
#likeus {
border: 1px solid #666;
-webkit-box-shadow: 0 0 16px #666;
box-shadow: 0 0 16px #666;
shaneonabike / page.html
Last active Sep 11, 2018
Popup code body
View page.html
<div id="likeus"><div id="likeus-wrapper">
<div id="likeus-banner">&nbsp;</div>
<div id="likeus-inner">
<h2>Join us on Facebook</h2>
<div class="fb-like" width="300" data-href="" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div>
<div id="likeus-close-wrapper">
<a href="#likeus" class="close-like">Close</a> ·
<a href="#likeus"> class="close-forever">I already like Bees on a Bike</a>
shaneonabike / template.php
Created Sep 11, 2018
Drupal Timefield exposed filter integration (template.php)
View template.php
* Preprocess output of form element
function yourtheme_preprocess_form_element(&$vars) {
if (!empty($vars['element']['#id']) && ($vars['element']['#id'] == 'edit-hour')) {
// Add special class for JS to work properly but we need to edit the #children value :/
$children = $vars['element']['#children'];
if (!empty($children)) {
$vars['element']['#children'] = str_replace('form-text', 'form-text edit-timefield-timepicker filter-project-event-time', $children);
shaneonabike / yourmodule.module
Created Sep 11, 2018
Drupal Timefield exposed filter
View yourmodule.module
* Alter the exposed form for the projects view
* $form
* Relative form that is being created
* $form_state
* Existing statee
You can’t perform that action at this time.