Skip to content

Instantly share code, notes, and snippets.

@k88hudson
k88hudson / assets.php
Created March 30, 2012 20:22
Old Assets.php Example (the wrong way)
echo ("<table class='l1' id='".$str1."' width='650' height='62' onmouseover=showMe('".$str."','".$str1."') onmouseout=hideMe('".$str."','".$str1."') style='font-size:11px;'><tr>");
echo ("<td width='120' height='38' align='center'><strong>".$row3['title']."</strong></td>");
echo ("<td width='120'>".
@k88hudson
k88hudson / Project.getAssets
Created March 30, 2012 20:36
Example data returned by getAssets()
{
"permissions": 1,
"host": 1,
"assets": [
{
"thumbnail": "thumbnails/cat-thumbnail.jpg",
"author": "BobSmith",
"title": "Photo of a Cat",
"filename": "cat.jpg",
"downloadURL": "downloadToDesktop.php?filename=cat.jpg&downloads=Uploads/cat.jpg",
@k88hudson
k88hudson / gist:2360645
Created April 11, 2012 17:15
Making plugins idea
//Simple
Butter.makePlugin("supertext.js", {
shortName: "subtitle"
name: "Subtitles",
defaults: {
text: "This is my subtitle",
target: "subtitle-container",
},
validation: "html",
tooltipMessage: "Enter any HTML or text and it will appear as a subtitle!!!",
popcorn.toc({
start: 0,
end: 1000,
text: "Table of Poptents",
toc: [
{
timestamp: 0,
frameTime: 1,
title: "Intro to popcorn",
},
<style>
.container {
color: #444;
}
#container {
color: #444;
}
.red {
{
"name":"Track0",
"id":"Track5",
"trackEvents":[
{
"id":"TrackEvent0",
"type":"quiz",
"popcornOptions":{
"start":0,
"end":22.04,
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
//POPCORN SPEAK
popcorn.speak({
start: 1,
end: 5,
text: "How cool is this?",
pitch: 70,
showText: true,
pluginPath: "js/plugins/speak/",
target: "speak",
callback: function( container ) {
@k88hudson
k88hudson / gist:2760081
Created May 21, 2012 00:48
speech bubble example
speechBubble("somediv", {
shadow: 4, //Strength of the drop-shadow. Defaults to 0.
borderWidth: 0, //Border width. Defaults to 2
triangleHeight: 30, //Height of the triangle. Defaults to 30.
triangleWidth: 1.2, //A ratio defining the width of the triangle. Defaults to 1.
radius: 20, //Corner radius of the bubble
flipCode: 3 //Can be 1,2,3,4. Flips the bubble.
});
//Add speech bubble. Make sure your target div has relative or absolute positioning!!!
addSpeechBubble( "comic", {
text: "Have a <strong>great</strong> Victoria day",
style: "speech", //Speech, thought or nothing
classes: "fx top left long flip", //Positioning and extras
top: 20, //In percent
left: 60, //In percent
width: 120 //In pixels
});