This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!{ | |
//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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(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', |