Skip to content

Instantly share code, notes, and snippets.

View mraichelson's full-sized avatar
💻
clickety clackety...

Michael Raichelson mraichelson

💻
clickety clackety...
View GitHub Profile
<?php
// Coral Reef Seafood drupal theme
// Initial version 2010-08-05 by MRaichelson
// © 2010 Pixis Creative
// http://pixiscreative.com/
function coralreef_preprocess_search_theme_form(&$vars, $hook) {
// Modify elements of the search form
$vars['form']['search_theme_form']['#title'] = t('');
// Set a default value for the search box
$vars['form']['search_theme_form']['#value'] = t('');
@mraichelson
mraichelson / client.info
Created September 8, 2010 18:22
Example module for Drupal to add a Phone Number required field to the form from contact.module.
name = {Client} Customizations
description = Modifies the contact form to add a Phone number field and send the content via email when submitted.
core = 6.x
@mraichelson
mraichelson / foo.html
Created October 25, 2010 18:41
Demoing a couple of the options with Web Assembler
<!DOCTYPE html>
<w:script>
// we can create a reuseable PAGE javascript object for providing
// a common structure for holding page-level information
var page = {
title:'This is the Foo Page'
};
</w:script>
<html>
<head>
@mraichelson
mraichelson / mirror-site.sh
Created November 10, 2010 20:22
A shell script to mirror a website (typically dynamic) down to static files. Sort of a backwards way to doing static site publishing using a dynamic CMS (like Drupal).
wget \
--mirror \
--page-requisites \
--convert-links \
--adjust-extension \
--no-verbose \
--level=inf \
http://dynamic.hostname/
@mraichelson
mraichelson / ff-win.js
Created December 10, 2010 15:00
check for firefox on windows
// apply class for firefox
if($.browser.mozilla){
if(navigator.appVersion.indexOf("Win")!=-1){
$('body').addClass('moz-win');
}else{
$('body').addClass('moz');
}
}
@mraichelson
mraichelson / theme.info
Created January 27, 2011 15:46
an example .info file for a drupal theme.
; {XXX} theme by NavigationArts
; © 2011 NavigationArts
; http://www.navigationarts.com/
name = {XXX}
description = Theme for {XXX}
screenshot = theme.gif
core = 6.x
engine = phptemplate
version = "6.x-1.0"
//Run /jQuery in noconflict mode
jQuery.noConflict();
jQuery(function ($) {
//searchBar
//buttonSmall
/* 2011-02-14 MR: heavy rewrites [ */
$('div.moduleSearch .buttonSmall').click(function () {
var query = $('.searchBar').val();
if($.trim(query) != ''){
@mraichelson
mraichelson / templating.js
Created February 24, 2011 02:03
a few examples for how things can be added to a page using JS for part of a discussion of other ways to do so.
// a couple project examples of assembling stuff for display...
// example 1: (by Matt) assemble everything as a string and append that to a page...
$(".moduleBrowseProductTwo .productSetContainer").append('<div class="product" data-catid="'+ catId +'"> <img src="' + imageURL + '" /><p>' + categoryName + '</p></div>');
// example 2: (by Mike) create a single chunk of HTML in a string
// then use string.replace() to swap out specific tokens
var resultStructure = '<div class="product" data-brand="%productBrandName%"><div class="img"><img style="max-width:114px;max-height:114px;" src="%productImageUrl%" alt="" /></div><h6>%productName%</h6><div class="buttonSmallContainer"><div class="buttonSmallLeft"><div class="buttonSmallRight"><div class="buttonSmallInner"><a class="buttonSmall buttonNoArrow" href="%productUrl%">This is it</a></div></div></div></div></div>';
<?php
$var = <<<EOD
<h1>blerg</h1>
<p>All part of a single variable</p>
EOD;
?>