Skip to content

Instantly share code, notes, and snippets.

View jamesona's full-sized avatar

Jameson Aranda jamesona

View GitHub Profile
var Prompt = function(prompt){
var box = document.createElement('textarea');
box.placeholder = prompt;
box.style.width = "30vw";
box.style.height = "60vh";
box.style.marginTop = "20vh";
box.style.marginLeft = "35vw";
box.style.position = "fixed";
box.style.left = "0";
box.style.top = "0";
/*
This is a modal class that creates a js object containing:
- a parent div, to use for things like dimming the page behind the dialog
- a title H1 containing whatever is passed as the title argument
- a body div containing whatever is passed as the body argument
A callback function will fire when the html is ready, if passed as a third argument.
Built-in methods:
- destroy() removes the dialog from the dom; takes no arguments
- attach() injects html model into the document; accepts a target node as argument;
/*
This class defines a calendar factory.
Pass a dom node as an argument for the draw() method, to insert a
calendar as a child of the passed node (this replaces the node's contents).
Constructor parameters are month, year, and optional day data.
Valid JSON data is constructed as key-pairs of "mm/dd/yyyy: value"
EXAMPLE:
{ ...
mm/dd/yyyy: value,
mm/dd/yyyy: value,