Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5f3db9b
Showing
157 changed files
with
11,394 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var requirejs = ({ | ||
shim: { | ||
'underscore': {exports: '_'}, | ||
'jquery.ui': {deps: ['jquery'],exports: 'jQuery'}, | ||
'jquery.scrollto': {deps: ['jquery'],exports: 'jQuery'} | ||
}, | ||
paths: { | ||
'jquery': 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min', | ||
'jquery.ui': 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min', | ||
'jquery.scrollto': 'lib/jquery/jquery.scrollTo.min', | ||
'underscore': 'http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.1/underscore-min', | ||
'knockout':'http://cdnjs.cloudflare.com/ajax/libs/knockout/2.1.0/knockout-min', | ||
|
||
'text': 'lib/require/text', | ||
'domready': 'lib/require/domready' | ||
}, | ||
config:{ | ||
'scm':{ | ||
playback:{ | ||
'youtube':'(youtube.com|youtu.be)', | ||
'soundcloud':'^http(s)?\:\/\/soundcloud.com', | ||
"exfm": "^( *)(http(s)?://)?(www.)?ex.fm", | ||
'soundmanager':'.*' | ||
}, | ||
playlist:{ | ||
'youtube':'(youtube.com|youtu.be)', | ||
'soundcloud':'^http(s)?\:\/\/soundcloud.com', | ||
'rss':'.*' | ||
} | ||
} | ||
}, | ||
waitSeconds: 900, | ||
baseUrl: 'js/' | ||
}); | ||
|
||
soundManager.preferFlash = false; | ||
soundManager.useHTML5Audio = true; | ||
soundManager.url = 'swf/'; | ||
soundManager.allowScriptAccess = 'always'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#player, #playlist{ | ||
position:relative; height:100%; width:100%; font-size:11px; | ||
font-family:Verdana,Arial,sans-serif; cursor:default; line-height:1.2; | ||
} | ||
|
||
#player .item, #player .mainImage, #player .ui-slider-handle, | ||
#player #seekerSlider,#player #seeker | ||
{ height:25px; top:0; position:absolute; } | ||
#player .text, #player #seekerBase, #player #seekerBuffered, #player{ position:absolute; } | ||
|
||
#player a{ text-decoration:none; } | ||
#player a:hover{ text-decoration:underline; } | ||
|
||
#player #baseLeft{ z-index:1; } | ||
#player #baseRight{ z-index:1; right:0; background-position:right top; } | ||
#player #play{ z-index:3; } | ||
#player .item{ z-index:2; } | ||
#player .bound{ position:relative;height:100%; } | ||
#player .text{ z-index:2; font-size:11px; height:20px; top:5px; cursor:default; } | ||
#player .button,#player .ui-slider-handle{cursor:pointer; } | ||
|
||
#player #seekerSliderBase{ z-index:3; margin-left:-3.5px; top:8px; width:7px; height:8px; } | ||
#player #seekerBuffered{ z-index:1; width:70%; top:8px; height:8px; left:0; } | ||
#player #seekerBase{ z-index:2; width:100%; border:1px solid; top:8px; height:6px; left:-1px; } | ||
|
||
#player #tooltip{ width:115px; text-align:center; } | ||
|
||
#playlist{ border-bottom:1px solid; } | ||
#playlist .module{ background:white; border:1px solid; border-bottom:none; } | ||
#playlistContainer{ position:absolute;top:20px;bottom:0;left:0;right:0;z-index:1; } | ||
#playlist h3{ border-bottom:1px solid; font-weight:bold; padding: 3px 5px;} | ||
|
||
#playlist li{ cursor:pointer; } | ||
#playlist .items{ | ||
overflow-x:hidden; overflow-y:auto; height:100%; | ||
list-style-type:decimal; | ||
list-style-position: inside; | ||
} | ||
#playlist .item{ cursor:pointer; padding: 3px 5px; width:1000px; } | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
define(['knockout','jquery'],function(ko,$){ | ||
ko.bindingHandlers.caption = { | ||
init: function(el, valueAccessor,allBindingsAccessor){ | ||
var options = allBindingsAccessor().captionOptions || {}; | ||
var value = ko.utils.unwrapObservable(valueAccessor()); | ||
$(el).data('captionTarget',options.target); | ||
$(el).data('captionText',value); | ||
$(el).data('originalText',$(options.target).text()); | ||
var caption = function(){ | ||
var target = $(el).data('captionTarget'); | ||
$(target).text($(el).data('captionText')); | ||
} | ||
var revert = function(){ | ||
var target = $(el).data('captionTarget'); | ||
$(target).text($(el).data('originalText')); | ||
} | ||
if(options.trigger=='hover'){ | ||
$(el) | ||
.on('mouseover',caption) | ||
.on('mouseleave',revert); | ||
}else if(options.trigger=='slide'){ | ||
$(el) | ||
.on('slidestart',function(){ | ||
caption(); | ||
$(el).on('slide',caption); | ||
}) | ||
.on('slidestop',function(){ | ||
$(el).off('slide',caption); | ||
revert(); | ||
}); | ||
} | ||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
$(el).off(); | ||
}); | ||
}, | ||
update:function(el, valueAccessor){ | ||
var value = ko.utils.unwrapObservable(valueAccessor()); | ||
$(el).data('captionText',value); | ||
} | ||
} | ||
return ko; | ||
}); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
define(['knockout','jquery'],function(ko,$){ | ||
var followLeft = function(el, valueAccessor,all){ | ||
var $target = $(ko.utils.unwrapObservable(valueAccessor())); | ||
function update(){ | ||
$target.css('left',($(el).position().left+$(el).width()+15)+'px'); | ||
} | ||
$(el).data('followUpdate',update); | ||
var interval = setInterval(update,100); | ||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
clearInterval(interval); | ||
}); | ||
} | ||
ko.bindingHandlers.followLeft = { | ||
init: followLeft, | ||
update:function(el){ | ||
setTimeout($(el).data('followUpdate'),0); | ||
} | ||
} | ||
return ko; | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
define(['knockout','jquery'],function(ko,$){ | ||
var innerBound = function(el, valueAccessor){ | ||
var options = ko.utils.unwrapObservable(valueAccessor()); | ||
var $bound = $(el).find(options.bound); | ||
var $handle = $(el).find(options.handle); | ||
var width = 0; | ||
function update(){ | ||
if(width==$handle.width()) return; | ||
width = $handle.width(); | ||
var halfWidth = width/2; | ||
$bound.css('width',$(el).width()-$handle.width()) | ||
.css('marginLeft',halfWidth) | ||
.css('marginRight',halfWidth); | ||
$handle.css('marginLeft',-halfWidth); | ||
} | ||
var interval = setInterval(update,100); | ||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
clearInterval(interval); | ||
}); | ||
update(); | ||
} | ||
ko.bindingHandlers.innerBound = { | ||
init:innerBound | ||
} | ||
}); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
define(['knockout','jquery','underscore'],function(ko,$){ | ||
ko.bindingHandlers.maskBtn = { | ||
init:function(el,valueAccessor){ | ||
var options = ko.utils.unwrapObservable(valueAccessor()); | ||
_.defaults(options,{ | ||
css:null, | ||
hasOffset:true, | ||
align:'left' | ||
}); | ||
//button setup | ||
var bgChange = function(pos){ | ||
if(options.hasOffset && pos=='top') | ||
$(this).removeClass(options.css); | ||
else{ | ||
$(this).addClass(options.css); | ||
var left = parseInt($(this).css("left")); | ||
var right = parseInt($(this).css("right")); | ||
var bgx = options.align=='left'? -left: right+$(this).width(); | ||
$(this).css("backgroundPosition", (options.hasOffset?bgx:0) + "px "+pos); | ||
} | ||
} | ||
$(el) | ||
.on("mousedown",_.bind(bgChange,el,'bottom')) | ||
.on("mouseup",_.bind(bgChange,el,'top')) | ||
.on("mouseleave",_.bind(bgChange,el,'top')); | ||
|
||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
$(el).off(); | ||
}); | ||
} | ||
} | ||
return ko; | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
define(['knockout','jquery','underscore'],function(ko,$){ | ||
//Mask Button | ||
ko.bindingHandlers.maskBtn = { | ||
init:function(el,valueAccessor){ | ||
var options = ko.utils.unwrapObservable(valueAccessor()); | ||
_.defaults(options,{ | ||
css:null, | ||
hasOffset:true, | ||
align:'left' | ||
}); | ||
//button setup | ||
var bgChange = function(pos){ | ||
if(options.hasOffset && pos=='top') | ||
$(this).removeClass(options.css); | ||
else{ | ||
$(this).addClass(options.css); | ||
var left = parseInt($(this).css("left")); | ||
var right = parseInt($(this).css("right")); | ||
var bgx = options.align=='left'? -left: right+$(this).width(); | ||
$(this).css("backgroundPosition", (options.hasOffset?bgx:0) + "px "+pos); | ||
} | ||
} | ||
$(el) | ||
.on("mousedown",_.bind(bgChange,el,'bottom')) | ||
.on("mouseup",_.bind(bgChange,el,'top')) | ||
.on("mouseleave",_.bind(bgChange,el,'top')); | ||
|
||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
$(el).off(); | ||
}); | ||
} | ||
}; | ||
//hover caption | ||
ko.bindingHandlers.caption = { | ||
init: function(el, valueAccessor,allBindingsAccessor){ | ||
var options = allBindingsAccessor().captionOptions || {}; | ||
var value = ko.utils.unwrapObservable(valueAccessor()); | ||
$(el).data('captionTarget',options.target); | ||
$(el).data('captionText',value); | ||
$(el).data('originalText',$(options.target).text()); | ||
var caption = function(){ | ||
var target = $(el).data('captionTarget'); | ||
$(target).text($(el).data('captionText')); | ||
} | ||
var revert = function(){ | ||
var target = $(el).data('captionTarget'); | ||
$(target).text($(el).data('originalText')); | ||
} | ||
if(options.trigger=='hover'){ | ||
$(el) | ||
.on('mouseover',caption) | ||
.on('mouseleave',revert); | ||
}else if(options.trigger=='slide'){ | ||
$(el) | ||
.on('slidestart',function(){ | ||
caption(); | ||
$(el).on('slide',caption); | ||
}) | ||
.on('slidestop',function(){ | ||
$(el).off('slide',caption); | ||
revert(); | ||
}); | ||
} | ||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
$(el).off(); | ||
}); | ||
}, | ||
update:function(el, valueAccessor){ | ||
var value = ko.utils.unwrapObservable(valueAccessor()); | ||
$(el).data('captionText',value); | ||
} | ||
} | ||
//seeker follow left | ||
ko.bindingHandlers.followLeft = { | ||
init: function(el, valueAccessor,all){ | ||
var $target = $(ko.utils.unwrapObservable(valueAccessor())); | ||
function update(){ | ||
$target.css('left',($(el).position().left+$(el).width()+15)+'px'); | ||
} | ||
$(el).data('followUpdate',update); | ||
var interval = setInterval(update,100); | ||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
clearInterval(interval); | ||
}); | ||
}, | ||
update:function(el){ | ||
setTimeout($(el).data('followUpdate'),0); | ||
} | ||
} | ||
//Volume Slider innerBound | ||
ko.bindingHandlers.innerBound = { | ||
init:function(el, valueAccessor){ | ||
var options = ko.utils.unwrapObservable(valueAccessor()); | ||
var $bound = $(el).find(options.bound); | ||
var $handle = $(el).find(options.handle); | ||
var width = 0; | ||
function update(){ | ||
if(width==$handle.width()) return; | ||
width = $handle.width(); | ||
var halfWidth = width/2; | ||
$bound.css('width',$(el).width()-$handle.width()) | ||
.css('marginLeft',halfWidth) | ||
.css('marginRight',halfWidth); | ||
$handle.css('marginLeft',-halfWidth); | ||
} | ||
var interval = setInterval(update,100); | ||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
clearInterval(interval); | ||
}); | ||
update(); | ||
} | ||
} | ||
return ko; | ||
}); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
define(['knockout','jquery','jquery.ui'],function(ko,$){ | ||
ko.bindingHandlers.slider = { | ||
//wrapper for jquery ui slider | ||
init: function(el, valueAccessor,allBindingsAccessor) { | ||
var options = allBindingsAccessor().sliderOptions || {}; | ||
//initialize the control | ||
$(el).slider(options); | ||
|
||
//handle the value changing in the UI | ||
var observable = valueAccessor(); | ||
var setObservable = function(){ | ||
var sliderValue = $(el).slider("value"); | ||
var step = options.step; | ||
if(Math.round(sliderValue/step) != Math.round(observable()/step)) | ||
observable(sliderValue); | ||
} | ||
if(options.liveUpdate) | ||
ko.utils.registerEventHandler(el, "slide", _.throttle(setObservable,50)); | ||
ko.utils.registerEventHandler(el, "slidechange", setObservable); | ||
|
||
if(options.pauseable){ | ||
ko.utils.registerEventHandler(el, "slidestart", function(){ | ||
observable.pause(); | ||
}); | ||
ko.utils.registerEventHandler(el, "slidestop", function(){ | ||
setTimeout(function(){ | ||
observable.resume(); | ||
},0); | ||
}); | ||
} | ||
|
||
//handle disposal (if KO removes by the template binding) | ||
ko.utils.domNodeDisposal.addDisposeCallback(el, function() { | ||
$(el).slider("destroy"); | ||
}); | ||
}, | ||
//handle the model value changing | ||
update: function(el, valueAccessor) { | ||
var value = valueAccessor(); | ||
$(el).slider("value",ko.utils.unwrapObservable(value)); | ||
} | ||
}; | ||
return ko; | ||
}); |
Oops, something went wrong.