Skip to content

Instantly share code, notes, and snippets.

;(function(d){
'use strict';
function init () {
// create h1 element and set some attributes to it
var h1 = FSP('h1', {
'id': 'main-h1',
'class': 'class_1 class_2',
function AudioWrapper(src){//Simple audio wrapper
var audio = new Audio(), self = this;//create the audio element
audio.src = src;//set the source...
['play','stop','pause'].forEach(function(item){//play stop and pause hookup
var actualCommand = item === 'stop'?'pause':item;//when stopping, use pause instead
self[item] = function(){//set the function...
audio[actualCommand]();//call the pause or play function
if(item === 'stop')//and if stop is called...
self.currentTime(0);//go back to the start
};
!{
//Typical API functions should go here
//func : function(){}....
//func2 : function(options){...}
//Object creation methods...
//convenience methods here for create and expose via this
createObject: function(options){
//constructor logic here
var created = Object.create(this.fn);