Skip to content

Instantly share code, notes, and snippets.

View AllieRays's full-sized avatar

Allie Ray Jones AllieRays

View GitHub Profile
@AllieRays
AllieRays / js case switch example
Created August 3, 2014 21:51
EPT journery mega drawer menu can be seen when clicked on any navigation item
// EPT journery mega drawer menu can be seen when clicked on any navigation item
//http://eptfamily.com/
//Initiate Journey Nav Control
Drupal.behaviors.ept_menu_journey_behavior = {
attach: function(context, settings) {
$('#block-system-main-menu', context).once('journey-nav', function() {
$(this).find('a.mega-drawer').each(function() {
@AllieRays
AllieRays / php function to replace copyright information based on client criteria
Last active August 29, 2015 14:04
Replace copyright information base on database field entries
@AllieRays
AllieRays / php hook form alter
Last active August 29, 2015 14:04
Two different hook form alter
//example one
//using a session key profile to hide elements when credentials are already given from a different login account
function vod_oauth_medscape_user_insert(&$edit, $account, $category) {
// load frontend functions
module_load_include('inc', 'vod_oauth_medscape', 'vod_oauth_medscape.frontend');
// create authmap
$profile = vod_oauth_medscape_SESSION_GET(VOD_AUTH_MEDSCAPE_SESSION_KEY_PROFILE);
if ($profile) {
@AllieRays
AllieRays / Sass & Susy variables, responsive griding and Sass Mapping
Last active August 29, 2015 14:04
Creating file pathing variables, responsive griding and Sass Mapping with Susy 2.1.2
//Example one creating file pathing variables for loaded font paths (non cdns)
//Loaded Fonts
$fontPath: '/sites/all/themes/ept/libraries/_fonts';
//abel
$abelPath: 'abel';
@font-face {
font-family: 'abelregular';
src: url('#{$fontPath}/#{$abelPath}/abel-regular-webfont.eot');
src: url('#{$fontPath}/#{$abelPath}/abel-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('#{$fontPath}/#{$abelPath}/abel-regular-webfont.woff') format('woff'),
@AllieRays
AllieRays / Sass animation with Keyframes
Created August 3, 2014 22:24
animated Clouds as seen on allie-jones.com all done with sass
.cloud-one{
width: 200px;
height: 68px;
background: #f6ffff;
border-radius: 100px;
position: relative;
margin: 40px auto 20px;
&:after, &:before {
content: '';
position: absolute;
@AllieRays
AllieRays / PHP preprocess functions
Created August 3, 2014 22:27
Altering text on Drupal login pages
function vod_preprocess_page(&$variables) {
// dpm($variables);
if ($variables['is_front'] == TRUE || arg(0) == 'home') {
$variables['title'] = '';
}
if ($variables['logged_in'] == FALSE && arg(0) == 'user') {
$variables['title'] = 'Sign In';
$variables['login_link'] = '<a href="/user/password" class="return-text">Forgot password?</a>';
}
if ($variables['logged_in'] == FALSE && arg(1) == 'password') {
@AllieRays
AllieRays / JS reordering elements in the dom based on screen size
Created August 4, 2014 01:36
Dom manipulation for Drupal blocks based on screen size
swapper = function(arr, from, to) {
arr.splice(to, 0, arr.splice(from, 1)[0]);
return arr;
};
//setup our vars
var homeElements = new Array();
var mobileElements = new Array();
@AllieRays
AllieRays / JS fadeIn select options
Created August 4, 2014 01:43
fadeIn pdf documents based on select option
//http://documents.cellsearchctc.com/
//language
$('.all, .pt').hide();
$('#selectForm').change(function(event) {
$('.all, .language-list h1').hide();
toggleLanguage(this.value);
});
//country
@AllieRays
AllieRays / js pop up interstitial
Created June 8, 2015 17:30
js pop up interstitial for drupal custom module. See rest of module here, https://github.com/devupable/popup-interstitial-drupal
(function ($) {
Drupal.behaviors.idi_interstitial = {
attach: function (context, settings) {
$('.block--bean-interstitial a.external, .block--bean-interstitial-iframe a.external ').click(function () {
$.colorbox.close();
return true;
});
$('.block--bean-interstitial .internal, .block--bean-interstitial-iframe .internal').click(function () {
$.colorbox.close();
return false;
@AllieRays
AllieRays / php interstitial drupal module
Created June 8, 2015 17:32
a custom module for drupal that creates a popup interstitial. This module uses Drupal's entity metawrapper api, and dynamic db queries. See full module here https://github.com/devupable/popup-interstitial-drupal
<?php
/**
* @file
* Sample Bean Content to fill out icttemplate
*/
//http://www.pixelite.co.nz/article/how-use-entity-metadata-wrappers-drupal-7/
//https://www.drupal.org/dynamic-queries
//http://ovistaoa.dev/devel/php
include_once 'idi_interstitial.features.inc';
include_once 'idi_interstitial.features.field_base.inc';