Skip to content

Instantly share code, notes, and snippets.

View susanBuck's full-sized avatar

Susan Buck susanBuck

View GitHub Profile
@susanBuck
susanBuck / checkEnter
Created March 28, 2011 02:20
checkEnter
<a href='/classes/viewSource/?path=<?=$_SERVER['PHP_SELF']?>' target='_blank'>View Source</a><br/><br/><br/>
/*-------------------------------------------------------------------------------------------------
Check enter
-------------------------------------------------------------------------------------------------*/
function checkEnter(e,submitFunction){
// Put this in the last field of a form like this : <input type="text" onKeyPress="checkEnter(event,hey)">
// e is the event.. its passed in just as event... It looks like this : keyup charCode=0, keyCode=13
// submit function is the function we'll call, pass it in as a string!
// if params are needed for the submitFunction they get passed in too - as many as are needed. we'll invoke arguments to fetch all of them.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> The Big Type Experiment </title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
@susanBuck
susanBuck / gist:938923
Created April 23, 2011 20:05
loading alternative layout
<?php
class MembersController extends AppController {
var $name = 'Members';
var $helpers = array('Html','Javascript','Form','Time');
var $components = array('Session','RequestHandler');
var $uses = array();
function index() {
// Works, will load the ajax.ctp layout
<!DOCTYPE html>
<html>
<head>
<title>Random Drawing</title>
<style type='text/css'>
* {
font-family:Helvetica;
font-size:35pt;
@susanBuck
susanBuck / tom-mw-sept-27
Created September 28, 2011 02:35
rewrote slide function so that it works with jquery instead of mootools
<!DOCTYPE html>
<head>
<title>Tom McQuaid - Designer &amp; Illustrator</title>
<meta name="description" content="An online portfolio of creative work from Tom McQuaid, a designer working in Philadelphia, PA." />
<link rel="stylesheet" type="text/css" href="../../styles.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
@susanBuck
susanBuck / gist:1303026
Created October 21, 2011 03:25
Basic HTML template with JavaScript goodies
<!DOCTYPE html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
@susanBuck
susanBuck / gist:1303027
Created October 21, 2011 03:25
Basic HTML template with JavaScript goodies
<!DOCTYPE html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
// JS bits go here
function showContent(whichContent) {
/* Turn off all divs */
$('#content-Problem1').css('display','none');
$('#content-Problem2').css('display','none');
$('#content-Problem3').css('display','none');
$('#content-Problem4').css('display','none');
$('#content-Problem5').css('display','none');
/* Turn on just the one we want */
<!DOCTYPE html>
<head>
<title>NomNom iteration 1</title>
<!DOCTYPE html>
@susanBuck
susanBuck / gist:1367456
Created November 15, 2011 16:10
basic ajax
$.ajax({
url: 'ajax_page.php',
data: { foo:bar },
success: function(data) {
console.log("Done!");
}
});