mix-rails-core 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +27 -0
- data/app/assets/images/colorbox/border.png +0 -0
- data/app/assets/images/colorbox/controls.png +0 -0
- data/app/assets/images/colorbox/ie6/borderBottomCenter.png +0 -0
- data/app/assets/images/colorbox/ie6/borderBottomLeft.png +0 -0
- data/app/assets/images/colorbox/ie6/borderBottomRight.png +0 -0
- data/app/assets/images/colorbox/ie6/borderMiddleLeft.png +0 -0
- data/app/assets/images/colorbox/ie6/borderMiddleRight.png +0 -0
- data/app/assets/images/colorbox/ie6/borderTopCenter.png +0 -0
- data/app/assets/images/colorbox/ie6/borderTopLeft.png +0 -0
- data/app/assets/images/colorbox/ie6/borderTopRight.png +0 -0
- data/app/assets/images/colorbox/loading.gif +0 -0
- data/app/assets/images/colorbox/loading_background.png +0 -0
- data/app/assets/images/colorbox/overlay.png +0 -0
- data/app/assets/images/jplayer/jplayer.pink.flag.jpg +0 -0
- data/app/assets/javascripts/colorbox.js +3 -0
- data/app/assets/javascripts/colorbox/jquery.colorbox-min.js +6 -0
- data/app/assets/javascripts/jplayer.js +3 -0
- data/app/assets/javascripts/jquery.jplayer/Jplayer.swf +0 -0
- data/app/assets/javascripts/jquery.jplayer/add-on/jplayer.playlist.min.js +30 -0
- data/app/assets/javascripts/jquery.jplayer/add-on/jquery.jplayer.inspector.js +331 -0
- data/app/assets/javascripts/jquery.jplayer/extras/jquery-1.8.2-ajax-deprecated.min.js +2 -0
- data/app/assets/javascripts/jquery.jplayer/extras/jquery.jplayer.combo.min.js +100 -0
- data/app/assets/javascripts/jquery.jplayer/extras/jquery.jplayer.playlist.combo.min.js +131 -0
- data/app/assets/javascripts/jquery.jplayer/extras/readme.txt +31 -0
- data/app/assets/javascripts/jquery.jplayer/jquery.jplayer.min.js +97 -0
- data/app/assets/javascripts/jquery.jplayer/popcorn/popcorn.jplayer.js +559 -0
- data/app/assets/javascripts/jquery/jquery.livequery.js +226 -0
- data/app/assets/javascripts/jquery/jquery.maskedinput-1.3.min.js +7 -0
- data/app/assets/javascripts/underscore.js +1221 -0
- data/app/assets/stylesheets/colorbox.css +3 -0
- data/app/assets/stylesheets/colorbox/colorbox.css.erb +86 -0
- data/app/assets/stylesheets/jplayer/jplayer.pink.flag.css +650 -0
- data/app/controllers/gridfs_controller.rb +34 -0
- data/app/controllers/mix_controller.rb +10 -0
- data/app/helpers/core_helper.rb +15 -0
- data/app/models/youtube_validator.rb +9 -0
- data/app/views/application/_title.html.haml +1 -0
- data/config/locales/core.pt-BR.yml +49 -0
- data/config/routes.rb +3 -0
- data/lib/mix-rails-core.rb +38 -0
- data/lib/mix-rails-core/concerns/engine.rb +16 -0
- data/lib/mix-rails-core/engine.rb +9 -0
- data/lib/mix-rails-core/railtie.rb +10 -0
- data/lib/mix-rails-core/version.rb +10 -0
- data/lib/tasks/mix-rails_tasks.rake +4 -0
- metadata +515 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'MixRails'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
Bundler::GemHelper.install_tasks
|
27
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*
|
2
|
+
ColorBox v1.3.23
|
3
|
+
(c) 2013 Jack Moore - jacklmoore.com
|
4
|
+
license: http://www.opensource.org/licenses/mit-license.php
|
5
|
+
*/
|
6
|
+
(function(e,t,i){function o(i,o,n){var h=t.createElement(i);return o&&(h.id=J+o),n&&(h.style.cssText=n),e(h)}function n(e){var t=b.length,i=(A+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?T.width():T.height())/100:1)*parseInt(e,10))}function r(e){return _.photo||/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(e)}function l(){var t,i=e.data(j,$);null==i?(_=e.extend({},X),console&&console.log&&console.log("Error: cboxElement missing settings object")):_=e.extend({},i);for(t in _)e.isFunction(_[t])&&"on"!==t.slice(0,2)&&(_[t]=_[t].call(j));_.rel=_.rel||j.rel||e(j).data("rel")||"nofollow",_.href=_.href||e(j).attr("href"),_.title=_.title||j.title,"string"==typeof _.href&&(_.href=e.trim(_.href))}function s(i,o){e(t).trigger(i),e("*",p).trigger(i),o&&o.call(j)}function a(){var e,t,i,o=J+"Slideshow_",n="click."+J;_.slideshow&&b[1]?(t=function(){I.html(_.slideshowStop).unbind(n).bind(Z,function(){(_.loop||b[A+1])&&(e=setTimeout(N.next,_.slideshowSpeed))}).bind(Y,function(){clearTimeout(e)}).one(n+" "+et,i),p.removeClass(o+"off").addClass(o+"on"),e=setTimeout(N.next,_.slideshowSpeed)},i=function(){clearTimeout(e),I.html(_.slideshowStart).unbind([Z,Y,et,n].join(" ")).one(n,function(){N.next(),t()}),p.removeClass(o+"on").addClass(o+"off")},_.slideshowAuto?t():i()):p.removeClass(o+"off "+o+"on")}function d(i){q||(j=i,l(),b=e(j),A=0,"nofollow"!==_.rel&&(b=e("."+U).filter(function(){var t,i=e.data(this,$);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===_.rel}),A=b.index(j),-1===A&&(b=b.add(j),A=b.length-1)),P||(P=R=!0,p.show(),_.returnFocus&&(e(j).blur(),e(t).one(tt,function(){e(j).focus()})),f.css({opacity:+_.opacity,cursor:_.overlayClose?"pointer":"auto"}).show(),_.w=h(_.initialWidth,"x"),_.h=h(_.initialHeight,"y"),N.position(),nt&&T.bind("resize."+ht+" scroll."+ht,function(){f.css({width:T.width(),height:T.height(),top:T.scrollTop(),left:T.scrollLeft()})}).trigger("resize."+ht),s(V,_.onOpen),F.add(k).hide(),S.html(_.close).show()),N.load(!0))}function c(){!p&&t.body&&(Q=!1,T=e(i),p=o(rt).attr({id:$,"class":ot?J+(nt?"IE6":"IE"):""}).hide(),f=o(rt,"Overlay",nt?"position:absolute":"").hide(),H=o(rt,"LoadingOverlay").add(o(rt,"LoadingGraphic")),w=o(rt,"Wrapper"),m=o(rt,"Content").append(C=o(rt,"LoadedContent","width:0; height:0; overflow:hidden"),k=o(rt,"Title"),E=o(rt,"Current"),L=o(rt,"Next"),M=o(rt,"Previous"),I=o(rt,"Slideshow").bind(V,a),S=o(rt,"Close")),w.append(o(rt).append(o(rt,"TopLeft"),g=o(rt,"TopCenter"),o(rt,"TopRight")),o(rt,!1,"clear:left").append(x=o(rt,"MiddleLeft"),m,y=o(rt,"MiddleRight")),o(rt,!1,"clear:left").append(o(rt,"BottomLeft"),v=o(rt,"BottomCenter"),o(rt,"BottomRight"))).find("div div").css({"float":"left"}),W=o(rt,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),F=L.add(M).add(E).add(I),e(t.body).append(f,p.append(w,W)))}function u(){return p?(Q||(Q=!0,K=g.height()+v.height()+m.outerHeight(!0)-m.height(),z=x.width()+y.width()+m.outerWidth(!0)-m.width(),D=C.outerHeight(!0),B=C.outerWidth(!0),L.click(function(){N.next()}),M.click(function(){N.prev()}),S.click(function(){N.close()}),f.click(function(){_.overlayClose&&N.close()}),e(t).bind("keydown."+J,function(e){var t=e.keyCode;P&&_.escKey&&27===t&&(e.preventDefault(),N.close()),P&&_.arrowKey&&b[1]&&(37===t?(e.preventDefault(),M.click()):39===t&&(e.preventDefault(),L.click()))}),e(t).delegate("."+U,"click",function(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),d(this))})),!0):!1}var f,p,w,m,g,x,y,v,b,T,C,W,H,k,E,I,L,M,S,F,_,K,z,D,B,j,A,O,P,R,q,G,N,Q,X={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0},$="colorbox",J="cbox",U=J+"Element",V=J+"_open",Y=J+"_load",Z=J+"_complete",et=J+"_cleanup",tt=J+"_closed",it=J+"_purge",ot=!e.support.leadingWhitespace,nt=ot&&!i.XMLHttpRequest,ht=J+"_IE6",rt="div";e.colorbox||(e(c),N=e.fn[$]=e[$]=function(t,i){var o=this;if(t=t||{},c(),u()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,$,e.extend({},e.data(this,$)||X,t))}).addClass(U),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&d(o[0])}return o},N.position=function(e,t){function i(e){g[0].style.width=v[0].style.width=m[0].style.width=parseInt(e.style.width,10)-z+"px",m[0].style.height=x[0].style.height=y[0].style.height=parseInt(e.style.height,10)-K+"px"}var o,n,r,l=0,s=0,a=p.offset();T.unbind("resize."+J),p.css({top:-9e4,left:-9e4}),n=T.scrollTop(),r=T.scrollLeft(),_.fixed&&!nt?(a.top-=n,a.left-=r,p.css({position:"fixed"})):(l=n,s=r,p.css({position:"absolute"})),s+=_.right!==!1?Math.max(T.width()-_.w-B-z-h(_.right,"x"),0):_.left!==!1?h(_.left,"x"):Math.round(Math.max(T.width()-_.w-B-z,0)/2),l+=_.bottom!==!1?Math.max(T.height()-_.h-D-K-h(_.bottom,"y"),0):_.top!==!1?h(_.top,"y"):Math.round(Math.max(T.height()-_.h-D-K,0)/2),p.css({top:a.top,left:a.left}),e=p.width()===_.w+B&&p.height()===_.h+D?0:e||0,w[0].style.width=w[0].style.height="9999px",o={width:_.w+B+z,height:_.h+D+K,top:l,left:s},0===e&&p.css(o),p.dequeue().animate(o,{duration:e,complete:function(){i(this),R=!1,w[0].style.width=_.w+B+z+"px",w[0].style.height=_.h+D+K+"px",_.reposition&&setTimeout(function(){T.bind("resize."+J,N.position)},1),t&&t()},step:function(){i(this)}})},N.resize=function(e){P&&(e=e||{},e.width&&(_.w=h(e.width,"x")-B-z),e.innerWidth&&(_.w=h(e.innerWidth,"x")),C.css({width:_.w}),e.height&&(_.h=h(e.height,"y")-D-K),e.innerHeight&&(_.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(C.css({height:"auto"}),_.h=C.height()),C.css({height:_.h}),N.position("none"===_.transition?0:_.speed))},N.prep=function(i){function h(){return _.w=_.w||C.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function l(){return _.h=_.h||C.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(P){var a,d="none"===_.transition?0:_.speed;C.remove(),C=o(rt,"LoadedContent").append(i),C.hide().appendTo(W.show()).css({width:h(),overflow:_.scrolling?"auto":"hidden"}).css({height:l()}).prependTo(m),W.hide(),e(O).css({"float":"none"}),a=function(){function i(){ot&&p[0].style.removeAttribute("filter")}var h,l,a=b.length,c="frameBorder",u="allowTransparency";P&&(l=function(){clearTimeout(G),H.detach().hide(),s(Z,_.onComplete)},ot&&O&&C.fadeIn(100),k.html(_.title).add(C).show(),a>1?("string"==typeof _.current&&E.html(_.current.replace("{current}",A+1).replace("{total}",a)).show(),L[_.loop||a-1>A?"show":"hide"]().html(_.next),M[_.loop||A?"show":"hide"]().html(_.previous),_.slideshow&&I.show(),_.preloading&&e.each([n(-1),n(1)],function(){var t,i,o=b[this],n=e.data(o,$);n&&n.href?(t=n.href,e.isFunction(t)&&(t=t.call(o))):t=o.href,r(t)&&(i=new Image,i.src=t)})):F.hide(),_.iframe?(h=o("iframe")[0],c in h&&(h[c]=0),u in h&&(h[u]="true"),_.scrolling||(h.scrolling="no"),e(h).attr({src:_.href,name:(new Date).getTime(),"class":J+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",l).appendTo(C),e(t).one(it,function(){h.src="//about:blank"}),_.fastIframe&&e(h).trigger("load")):l(),"fade"===_.transition?p.fadeTo(d,1,i):i())},"fade"===_.transition?p.fadeTo(d,0,function(){N.position(0,a)}):N.position(d,a)}},N.load=function(i){var n,a,d,c=N.prep;R=!0,O=!1,j=b[A],i||l(),s(it),s(Y,_.onLoad),_.h=_.height?h(_.height,"y")-D-K:_.innerHeight&&h(_.innerHeight,"y"),_.w=_.width?h(_.width,"x")-B-z:_.innerWidth&&h(_.innerWidth,"x"),_.mw=_.w,_.mh=_.h,_.maxWidth&&(_.mw=h(_.maxWidth,"x")-B-z,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.maxHeight&&(_.mh=h(_.maxHeight,"y")-D-K,_.mh=_.h&&_.h<_.mh?_.h:_.mh),n=_.href,G=setTimeout(function(){H.show().appendTo(m)},100),_.inline?(d=o(rt).hide().insertBefore(e(n)[0]),e(t).one(it,function(){d.replaceWith(C.children())}),c(e(n))):_.iframe?c(" "):_.html?c(_.html):r(n)?(e(O=new Image).addClass(J+"Photo").bind("error",function(){_.title=!1,c(o(rt,"Error").html(_.imgError))}).load(function(){var e;O.onload=null,_.scalePhotos&&(a=function(){O.height-=O.height*e,O.width-=O.width*e},_.mw&&O.width>_.mw&&(e=(O.width-_.mw)/O.width,a()),_.mh&&O.height>_.mh&&(e=(O.height-_.mh)/O.height,a())),_.h&&(O.style.marginTop=Math.max(_.h-O.height,0)/2+"px"),b[1]&&(_.loop||b[A+1])&&(O.style.cursor="pointer",O.onclick=function(){N.next()}),ot&&(O.style.msInterpolationMode="bicubic"),setTimeout(function(){c(O)},1)}),setTimeout(function(){O.src=n},1)):n&&W.load(n,_.data,function(t,i){c("error"===i?o(rt,"Error").html(_.xhrError):e(this).contents())})},N.next=function(){!R&&b[1]&&(_.loop||b[A+1])&&(A=n(1),N.load())},N.prev=function(){!R&&b[1]&&(_.loop||A)&&(A=n(-1),N.load())},N.close=function(){P&&!q&&(q=!0,P=!1,s(et,_.onCleanup),T.unbind("."+J+" ."+ht),f.fadeTo(200,0),p.stop().fadeTo(300,0,function(){p.add(f).css({opacity:1,cursor:"auto"}).hide(),s(it),C.remove(),setTimeout(function(){q=!1,s(tt,_.onClosed)},1)}))},N.remove=function(){e([]).add(p).add(f).remove(),p=null,e("."+U).removeData($).removeClass(U),e(t).undelegate("."+U)},N.element=function(){return e(j)},N.settings=X)})(jQuery,document,window);
|
Binary file
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*
|
2
|
+
* Playlist Object for the jPlayer Plugin
|
3
|
+
* http://www.jplayer.org
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
6
|
+
* Dual licensed under the MIT and GPL licenses.
|
7
|
+
* - http://www.opensource.org/licenses/mit-license.php
|
8
|
+
* - http://www.gnu.org/copyleft/gpl.html
|
9
|
+
*
|
10
|
+
* Author: Mark J Panaghiston
|
11
|
+
* Version: 2.1.0 (jPlayer 2.1.0)
|
12
|
+
* Date: 1st September 2011
|
13
|
+
*/
|
14
|
+
|
15
|
+
(function(b,f){jPlayerPlaylist=function(a,c,d){var e=this;this.current=0;this.removing=this.shuffled=this.loop=!1;this.cssSelector=b.extend({},this._cssSelector,a);this.options=b.extend(!0,{},this._options,d);this.playlist=[];this.original=[];this._initPlaylist(c);this.cssSelector.title=this.cssSelector.cssSelectorAncestor+" .jp-title";this.cssSelector.playlist=this.cssSelector.cssSelectorAncestor+" .jp-playlist";this.cssSelector.next=this.cssSelector.cssSelectorAncestor+" .jp-next";this.cssSelector.previous=
|
16
|
+
this.cssSelector.cssSelectorAncestor+" .jp-previous";this.cssSelector.shuffle=this.cssSelector.cssSelectorAncestor+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelector.cssSelectorAncestor+" .jp-shuffle-off";this.options.cssSelectorAncestor=this.cssSelector.cssSelectorAncestor;this.options.repeat=function(a){e.loop=a.jPlayer.options.loop};b(this.cssSelector.jPlayer).bind(b.jPlayer.event.ready,function(){e._init()});b(this.cssSelector.jPlayer).bind(b.jPlayer.event.ended,function(){e.next()});
|
17
|
+
b(this.cssSelector.jPlayer).bind(b.jPlayer.event.play,function(){b(this).jPlayer("pauseOthers")});b(this.cssSelector.jPlayer).bind(b.jPlayer.event.resize,function(a){a.jPlayer.options.fullScreen?b(e.cssSelector.title).show():b(e.cssSelector.title).hide()});b(this.cssSelector.previous).click(function(){e.previous();b(this).blur();return!1});b(this.cssSelector.next).click(function(){e.next();b(this).blur();return!1});b(this.cssSelector.shuffle).click(function(){e.shuffle(!0);return!1});b(this.cssSelector.shuffleOff).click(function(){e.shuffle(!1);
|
18
|
+
return!1}).hide();this.options.fullScreen||b(this.cssSelector.title).hide();b(this.cssSelector.playlist+" ul").empty();this._createItemHandlers();b(this.cssSelector.jPlayer).jPlayer(this.options)};jPlayerPlaylist.prototype={_cssSelector:{jPlayer:"#jquery_jplayer_1",cssSelectorAncestor:"#jp_container_1"},_options:{playlistOptions:{autoPlay:!1,loopOnPrevious:!1,shuffleOnLoop:!0,enableRemoveControls:!1,displayTime:"slow",addTime:"fast",removeTime:"fast",shuffleTime:"slow",itemClass:"jp-playlist-item",
|
19
|
+
freeGroupClass:"jp-free-media",freeItemClass:"jp-playlist-item-free",removeItemClass:"jp-playlist-item-remove"}},option:function(a,b){if(b===f)return this.options.playlistOptions[a];this.options.playlistOptions[a]=b;switch(a){case "enableRemoveControls":this._updateControls();break;case "itemClass":case "freeGroupClass":case "freeItemClass":case "removeItemClass":this._refresh(!0),this._createItemHandlers()}return this},_init:function(){var a=this;this._refresh(function(){a.options.playlistOptions.autoPlay?
|
20
|
+
a.play(a.current):a.select(a.current)})},_initPlaylist:function(a){this.current=0;this.removing=this.shuffled=!1;this.original=b.extend(!0,[],a);this._originalPlaylist()},_originalPlaylist:function(){var a=this;this.playlist=[];b.each(this.original,function(b){a.playlist[b]=a.original[b]})},_refresh:function(a){var c=this;if(a&&!b.isFunction(a))b(this.cssSelector.playlist+" ul").empty(),b.each(this.playlist,function(a){b(c.cssSelector.playlist+" ul").append(c._createListItem(c.playlist[a]))}),this._updateControls();
|
21
|
+
else{var d=b(this.cssSelector.playlist+" ul").children().length?this.options.playlistOptions.displayTime:0;b(this.cssSelector.playlist+" ul").slideUp(d,function(){var d=b(this);b(this).empty();b.each(c.playlist,function(a){d.append(c._createListItem(c.playlist[a]))});c._updateControls();b.isFunction(a)&&a();c.playlist.length?b(this).slideDown(c.options.playlistOptions.displayTime):b(this).show()})}},_createListItem:function(a){var c=this,d="<li><div>";d+="<a href='javascript:;' class='"+this.options.playlistOptions.removeItemClass+
|
22
|
+
"'>×</a>";if(a.free){var e=!0;d+="<span class='"+this.options.playlistOptions.freeGroupClass+"'>(";b.each(a,function(a,f){b.jPlayer.prototype.format[a]&&(e?e=!1:d+=" | ",d+="<a class='"+c.options.playlistOptions.freeItemClass+"' href='"+f+"' tabindex='1'>"+a+"</a>")});d+=")</span>"}d+="<a href='javascript:;' class='"+this.options.playlistOptions.itemClass+"' tabindex='1'>"+a.title+(a.artist?" <span class='jp-artist'>by "+a.artist+"</span>":"")+"</a>";d+="</div></li>";return d},_createItemHandlers:function(){var a=
|
23
|
+
this;b(this.cssSelector.playlist+" a."+this.options.playlistOptions.itemClass).die("click").live("click",function(){var c=b(this).parent().parent().index();a.current!==c?a.play(c):b(a.cssSelector.jPlayer).jPlayer("play");b(this).blur();return!1});b(a.cssSelector.playlist+" a."+this.options.playlistOptions.freeItemClass).die("click").live("click",function(){b(this).parent().parent().find("."+a.options.playlistOptions.itemClass).click();b(this).blur();return!1});b(a.cssSelector.playlist+" a."+this.options.playlistOptions.removeItemClass).die("click").live("click",
|
24
|
+
function(){var c=b(this).parent().parent().index();a.remove(c);b(this).blur();return!1})},_updateControls:function(){this.options.playlistOptions.enableRemoveControls?b(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).show():b(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).hide();this.shuffled?(b(this.cssSelector.shuffleOff).show(),b(this.cssSelector.shuffle).hide()):(b(this.cssSelector.shuffleOff).hide(),b(this.cssSelector.shuffle).show())},
|
25
|
+
_highlight:function(a){this.playlist.length&&a!==f&&(b(this.cssSelector.playlist+" .jp-playlist-current").removeClass("jp-playlist-current"),b(this.cssSelector.playlist+" li:nth-child("+(a+1)+")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current"),b(this.cssSelector.title+" li").html(this.playlist[a].title+(this.playlist[a].artist?" <span class='jp-artist'>by "+this.playlist[a].artist+"</span>":"")))},setPlaylist:function(a){this._initPlaylist(a);this._init()},
|
26
|
+
add:function(a,c){b(this.cssSelector.playlist+" ul").append(this._createListItem(a)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);this._updateControls();this.original.push(a);this.playlist.push(a);c?this.play(this.playlist.length-1):this.original.length===1&&this.select(0)},remove:function(a){var c=this;if(a===f)return this._initPlaylist([]),this._refresh(function(){b(c.cssSelector.jPlayer).jPlayer("clearMedia")}),!0;else if(this.removing)return!1;else{a=a<0?c.original.length+
|
27
|
+
a:a;if(0<=a&&a<this.playlist.length)this.removing=!0,b(this.cssSelector.playlist+" li:nth-child("+(a+1)+")").slideUp(this.options.playlistOptions.removeTime,function(){b(this).remove();if(c.shuffled){var d=c.playlist[a];b.each(c.original,function(a){if(c.original[a]===d)return c.original.splice(a,1),!1})}else c.original.splice(a,1);c.playlist.splice(a,1);c.original.length?a===c.current?(c.current=a<c.original.length?c.current:c.original.length-1,c.select(c.current)):a<c.current&&c.current--:(b(c.cssSelector.jPlayer).jPlayer("clearMedia"),
|
28
|
+
c.current=0,c.shuffled=!1,c._updateControls());c.removing=!1});return!0}},select:function(a){a=a<0?this.original.length+a:a;0<=a&&a<this.playlist.length?(this.current=a,this._highlight(a),b(this.cssSelector.jPlayer).jPlayer("setMedia",this.playlist[this.current])):this.current=0},play:function(a){a=a<0?this.original.length+a:a;0<=a&&a<this.playlist.length?this.playlist.length&&(this.select(a),b(this.cssSelector.jPlayer).jPlayer("play")):a===f&&b(this.cssSelector.jPlayer).jPlayer("play")},pause:function(){b(this.cssSelector.jPlayer).jPlayer("pause")},
|
29
|
+
next:function(){var a=this.current+1<this.playlist.length?this.current+1:0;this.loop?a===0&&this.shuffled&&this.options.playlistOptions.shuffleOnLoop&&this.playlist.length>1?this.shuffle(!0,!0):this.play(a):a>0&&this.play(a)},previous:function(){var a=this.current-1>=0?this.current-1:this.playlist.length-1;(this.loop&&this.options.playlistOptions.loopOnPrevious||a<this.playlist.length-1)&&this.play(a)},shuffle:function(a,c){var d=this;a===f&&(a=!this.shuffled);(a||a!==this.shuffled)&&b(this.cssSelector.playlist+
|
30
|
+
" ul").slideUp(this.options.playlistOptions.shuffleTime,function(){(d.shuffled=a)?d.playlist.sort(function(){return 0.5-Math.random()}):d._originalPlaylist();d._refresh(!0);c||!b(d.cssSelector.jPlayer).data("jPlayer").status.paused?d.play(0):d.select(0);b(this).slideDown(d.options.playlistOptions.shuffleTime)})}}})(jQuery);
|
@@ -0,0 +1,331 @@
|
|
1
|
+
/*
|
2
|
+
* jPlayerInspector Plugin for jPlayer (2.0.0+) Plugin for jQuery JavaScript Library
|
3
|
+
* http://www.happyworm.com/jquery/jplayer
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
6
|
+
* Dual licensed under the MIT and GPL licenses.
|
7
|
+
* - http://www.opensource.org/licenses/mit-license.php
|
8
|
+
* - http://www.gnu.org/copyleft/gpl.html
|
9
|
+
*
|
10
|
+
* Author: Mark J Panaghiston
|
11
|
+
* Version: 1.0.3
|
12
|
+
* Date: 7th August 2011
|
13
|
+
*
|
14
|
+
* For use with jPlayer Version: 2.0.29
|
15
|
+
*
|
16
|
+
* Note: Declare inspector instances after jPlayer instances. ie., Otherwise the jPlayer instance is nonsense.
|
17
|
+
*/
|
18
|
+
|
19
|
+
(function($, undefined) {
|
20
|
+
$.jPlayerInspector = {};
|
21
|
+
$.jPlayerInspector.i = 0;
|
22
|
+
$.jPlayerInspector.defaults = {
|
23
|
+
jPlayer: undefined, // The jQuery selector of the jPlayer instance to inspect.
|
24
|
+
idPrefix: "jplayer_inspector_",
|
25
|
+
visible: false
|
26
|
+
};
|
27
|
+
|
28
|
+
var methods = {
|
29
|
+
init: function(options) {
|
30
|
+
var self = this;
|
31
|
+
var $this = $(this);
|
32
|
+
|
33
|
+
var config = $.extend({}, $.jPlayerInspector.defaults, options);
|
34
|
+
$(this).data("jPlayerInspector", config);
|
35
|
+
|
36
|
+
config.id = $(this).attr("id");
|
37
|
+
config.jPlayerId = config.jPlayer.attr("id");
|
38
|
+
|
39
|
+
config.windowId = config.idPrefix + "window_" + $.jPlayerInspector.i;
|
40
|
+
config.statusId = config.idPrefix + "status_" + $.jPlayerInspector.i;
|
41
|
+
config.configId = config.idPrefix + "config_" + $.jPlayerInspector.i;
|
42
|
+
config.toggleId = config.idPrefix + "toggle_" + $.jPlayerInspector.i;
|
43
|
+
config.eventResetId = config.idPrefix + "event_reset_" + $.jPlayerInspector.i;
|
44
|
+
config.updateId = config.idPrefix + "update_" + $.jPlayerInspector.i;
|
45
|
+
config.eventWindowId = config.idPrefix + "event_window_" + $.jPlayerInspector.i;
|
46
|
+
|
47
|
+
config.eventId = {};
|
48
|
+
config.eventJq = {};
|
49
|
+
config.eventTimeout = {};
|
50
|
+
config.eventOccurrence = {};
|
51
|
+
|
52
|
+
$.each($.jPlayer.event, function(eventName,eventType) {
|
53
|
+
config.eventId[eventType] = config.idPrefix + "event_" + eventName + "_" + $.jPlayerInspector.i;
|
54
|
+
config.eventOccurrence[eventType] = 0;
|
55
|
+
});
|
56
|
+
|
57
|
+
var structure =
|
58
|
+
'<p><a href="#" id="' + config.toggleId + '">' + (config.visible ? "Hide" : "Show") + '</a> jPlayer Inspector</p>'
|
59
|
+
+ '<div id="' + config.windowId + '">'
|
60
|
+
+ '<div id="' + config.statusId + '"></div>'
|
61
|
+
+ '<div id="' + config.eventWindowId + '" style="padding:5px 5px 0 5px;background-color:#eee;border:1px dotted #000;">'
|
62
|
+
+ '<p style="margin:0 0 10px 0;"><strong>jPlayer events that have occurred over the past 1 second:</strong>'
|
63
|
+
+ '<br />(Backgrounds: <span style="padding:0 5px;background-color:#eee;border:1px dotted #000;">Never occurred</span> <span style="padding:0 5px;background-color:#fff;border:1px dotted #000;">Occurred before</span> <span style="padding:0 5px;background-color:#9f9;border:1px dotted #000;">Occurred</span> <span style="padding:0 5px;background-color:#ff9;border:1px dotted #000;">Multiple occurrences</span> <a href="#" id="' + config.eventResetId + '">reset</a>)</p>';
|
64
|
+
|
65
|
+
// MJP: Would use the next 3 lines for ease, but the events are just slapped on the page.
|
66
|
+
// $.each($.jPlayer.event, function(eventName,eventType) {
|
67
|
+
// structure += '<div id="' + config.eventId[eventType] + '" style="float:left;">' + eventName + '</div>';
|
68
|
+
// });
|
69
|
+
|
70
|
+
var eventStyle = "float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;";
|
71
|
+
// MJP: Doing it longhand so order and layout easier to control.
|
72
|
+
structure +=
|
73
|
+
'<div id="' + config.eventId[$.jPlayer.event.ready] + '" style="' + eventStyle + '"></div>'
|
74
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.flashreset] + '" style="' + eventStyle + '"></div>'
|
75
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.resize] + '" style="' + eventStyle + '"></div>'
|
76
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.repeat] + '" style="' + eventStyle + '"></div>'
|
77
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.click] + '" style="' + eventStyle + '"></div>'
|
78
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.error] + '" style="' + eventStyle + '"></div>'
|
79
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.warning] + '" style="' + eventStyle + '"></div>'
|
80
|
+
|
81
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.loadstart] + '" style="clear:left;' + eventStyle + '"></div>'
|
82
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.progress] + '" style="' + eventStyle + '"></div>'
|
83
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.timeupdate] + '" style="' + eventStyle + '"></div>'
|
84
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.volumechange] + '" style="' + eventStyle + '"></div>'
|
85
|
+
|
86
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.play] + '" style="clear:left;' + eventStyle + '"></div>'
|
87
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.pause] + '" style="' + eventStyle + '"></div>'
|
88
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.waiting] + '" style="' + eventStyle + '"></div>'
|
89
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.playing] + '" style="' + eventStyle + '"></div>'
|
90
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.seeking] + '" style="' + eventStyle + '"></div>'
|
91
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.seeked] + '" style="' + eventStyle + '"></div>'
|
92
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.ended] + '" style="' + eventStyle + '"></div>'
|
93
|
+
|
94
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.loadeddata] + '" style="clear:left;' + eventStyle + '"></div>'
|
95
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.loadedmetadata] + '" style="' + eventStyle + '"></div>'
|
96
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.canplay] + '" style="' + eventStyle + '"></div>'
|
97
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.canplaythrough] + '" style="' + eventStyle + '"></div>'
|
98
|
+
|
99
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.suspend] + '" style="clear:left;' + eventStyle + '"></div>'
|
100
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.abort] + '" style="' + eventStyle + '"></div>'
|
101
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.emptied] + '" style="' + eventStyle + '"></div>'
|
102
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.stalled] + '" style="' + eventStyle + '"></div>'
|
103
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.ratechange] + '" style="' + eventStyle + '"></div>'
|
104
|
+
+ '<div id="' + config.eventId[$.jPlayer.event.durationchange] + '" style="' + eventStyle + '"></div>'
|
105
|
+
|
106
|
+
+ '<div style="clear:both"></div>';
|
107
|
+
|
108
|
+
// MJP: Would like a check here in case we missed an event.
|
109
|
+
|
110
|
+
// MJP: Check fails, since it is not on the page yet.
|
111
|
+
/* $.each($.jPlayer.event, function(eventName,eventType) {
|
112
|
+
if($("#" + config.eventId[eventType])[0] === undefined) {
|
113
|
+
structure += '<div id="' + config.eventId[eventType] + '" style="clear:left;' + eventStyle + '">' + eventName + '</div>';
|
114
|
+
}
|
115
|
+
});
|
116
|
+
*/
|
117
|
+
structure +=
|
118
|
+
'</div>'
|
119
|
+
+ '<p><a href="#" id="' + config.updateId + '">Update</a> jPlayer Inspector</p>'
|
120
|
+
+ '<div id="' + config.configId + '"></div>'
|
121
|
+
+ '</div>';
|
122
|
+
$(this).html(structure);
|
123
|
+
|
124
|
+
config.windowJq = $("#" + config.windowId);
|
125
|
+
config.statusJq = $("#" + config.statusId);
|
126
|
+
config.configJq = $("#" + config.configId);
|
127
|
+
config.toggleJq = $("#" + config.toggleId);
|
128
|
+
config.eventResetJq = $("#" + config.eventResetId);
|
129
|
+
config.updateJq = $("#" + config.updateId);
|
130
|
+
|
131
|
+
$.each($.jPlayer.event, function(eventName,eventType) {
|
132
|
+
config.eventJq[eventType] = $("#" + config.eventId[eventType]);
|
133
|
+
config.eventJq[eventType].text(eventName + " (" + config.eventOccurrence[eventType] + ")"); // Sets the text to the event name and (0);
|
134
|
+
|
135
|
+
config.jPlayer.bind(eventType + ".jPlayerInspector", function(e) {
|
136
|
+
config.eventOccurrence[e.type]++;
|
137
|
+
if(config.eventOccurrence[e.type] > 1) {
|
138
|
+
config.eventJq[e.type].css("background-color","#ff9");
|
139
|
+
} else {
|
140
|
+
config.eventJq[e.type].css("background-color","#9f9");
|
141
|
+
}
|
142
|
+
config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")");
|
143
|
+
// The timer to handle the color
|
144
|
+
clearTimeout(config.eventTimeout[e.type]);
|
145
|
+
config.eventTimeout[e.type] = setTimeout(function() {
|
146
|
+
config.eventJq[e.type].css("background-color","#fff");
|
147
|
+
}, 1000);
|
148
|
+
// The timer to handle the occurences.
|
149
|
+
setTimeout(function() {
|
150
|
+
config.eventOccurrence[e.type]--;
|
151
|
+
config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")");
|
152
|
+
}, 1000);
|
153
|
+
if(config.visible) { // Update the status, if inspector open.
|
154
|
+
$this.jPlayerInspector("updateStatus");
|
155
|
+
}
|
156
|
+
});
|
157
|
+
});
|
158
|
+
|
159
|
+
config.jPlayer.bind($.jPlayer.event.ready + ".jPlayerInspector", function(e) {
|
160
|
+
$this.jPlayerInspector("updateConfig");
|
161
|
+
});
|
162
|
+
|
163
|
+
config.toggleJq.click(function() {
|
164
|
+
if(config.visible) {
|
165
|
+
$(this).text("Show");
|
166
|
+
config.windowJq.hide();
|
167
|
+
config.statusJq.empty();
|
168
|
+
config.configJq.empty();
|
169
|
+
} else {
|
170
|
+
$(this).text("Hide");
|
171
|
+
config.windowJq.show();
|
172
|
+
config.updateJq.click();
|
173
|
+
}
|
174
|
+
config.visible = !config.visible;
|
175
|
+
$(this).blur();
|
176
|
+
return false;
|
177
|
+
});
|
178
|
+
|
179
|
+
config.eventResetJq.click(function() {
|
180
|
+
$.each($.jPlayer.event, function(eventName,eventType) {
|
181
|
+
config.eventJq[eventType].css("background-color","#eee");
|
182
|
+
});
|
183
|
+
$(this).blur();
|
184
|
+
return false;
|
185
|
+
});
|
186
|
+
|
187
|
+
config.updateJq.click(function() {
|
188
|
+
$this.jPlayerInspector("updateStatus");
|
189
|
+
$this.jPlayerInspector("updateConfig");
|
190
|
+
return false;
|
191
|
+
});
|
192
|
+
|
193
|
+
if(!config.visible) {
|
194
|
+
config.windowJq.hide();
|
195
|
+
} else {
|
196
|
+
// config.updateJq.click();
|
197
|
+
}
|
198
|
+
|
199
|
+
$.jPlayerInspector.i++;
|
200
|
+
|
201
|
+
return this;
|
202
|
+
},
|
203
|
+
destroy: function() {
|
204
|
+
$(this).data("jPlayerInspector") && $(this).data("jPlayerInspector").jPlayer.unbind(".jPlayerInspector");
|
205
|
+
$(this).empty();
|
206
|
+
},
|
207
|
+
updateConfig: function() { // This displays information about jPlayer's configuration in inspector
|
208
|
+
|
209
|
+
var jPlayerInfo = "<p>This jPlayer instance is running in your browser where:<br />"
|
210
|
+
|
211
|
+
for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) {
|
212
|
+
var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i];
|
213
|
+
jPlayerInfo += " jPlayer's <strong>" + solution + "</strong> solution is";
|
214
|
+
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) {
|
215
|
+
jPlayerInfo += " being <strong>used</strong> and will support:<strong>";
|
216
|
+
for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) {
|
217
|
+
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]) {
|
218
|
+
jPlayerInfo += " " + format;
|
219
|
+
}
|
220
|
+
}
|
221
|
+
jPlayerInfo += "</strong><br />";
|
222
|
+
} else {
|
223
|
+
jPlayerInfo += " <strong>not required</strong><br />";
|
224
|
+
}
|
225
|
+
}
|
226
|
+
jPlayerInfo += "</p>";
|
227
|
+
|
228
|
+
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.active) {
|
229
|
+
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) {
|
230
|
+
jPlayerInfo += "<strong>Problem with jPlayer since both HTML5 and Flash are active.</strong>";
|
231
|
+
} else {
|
232
|
+
jPlayerInfo += "The <strong>HTML5 is active</strong>.";
|
233
|
+
}
|
234
|
+
} else {
|
235
|
+
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) {
|
236
|
+
jPlayerInfo += "The <strong>Flash is active</strong>.";
|
237
|
+
} else {
|
238
|
+
jPlayerInfo += "No solution is currently active. jPlayer needs a setMedia().";
|
239
|
+
}
|
240
|
+
}
|
241
|
+
jPlayerInfo += "</p>";
|
242
|
+
|
243
|
+
var formatType = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.formatType;
|
244
|
+
jPlayerInfo += "<p><code>status.formatType = '" + formatType + "'</code><br />";
|
245
|
+
if(formatType) {
|
246
|
+
jPlayerInfo += "<code>Browser canPlay('" + $.jPlayer.prototype.format[formatType].codec + "')</code>";
|
247
|
+
} else {
|
248
|
+
jPlayerInfo += "</p>";
|
249
|
+
}
|
250
|
+
|
251
|
+
jPlayerInfo += "<p><code>status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'</code></p>";
|
252
|
+
|
253
|
+
jPlayerInfo += "<p><code>status.media = {<br />";
|
254
|
+
for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media) {
|
255
|
+
jPlayerInfo += " " + prop + ": " + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop] + "<br />"; // Some are strings
|
256
|
+
}
|
257
|
+
jPlayerInfo += "};</code></p>"
|
258
|
+
|
259
|
+
+ "<p>Raw browser test for HTML5 support. Should equal a function if HTML5 is available.<br />";
|
260
|
+
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available) {
|
261
|
+
jPlayerInfo += "<code>htmlElement.audio.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType) +"</code><br />"
|
262
|
+
}
|
263
|
+
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available) {
|
264
|
+
jPlayerInfo += "<code>htmlElement.video.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType) +"</code>";
|
265
|
+
}
|
266
|
+
jPlayerInfo += "</p>";
|
267
|
+
|
268
|
+
jPlayerInfo += "<p>This instance is using the constructor options:<br />"
|
269
|
+
+ "<code>$('#" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id + "').jPlayer({<br />"
|
270
|
+
|
271
|
+
+ " swfPath: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "swfPath") + "',<br />"
|
272
|
+
|
273
|
+
+ " solution: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "solution") + "',<br />"
|
274
|
+
|
275
|
+
+ " supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',<br />"
|
276
|
+
|
277
|
+
+ " preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',<br />"
|
278
|
+
|
279
|
+
+ " volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",<br />"
|
280
|
+
|
281
|
+
+ " muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",<br />"
|
282
|
+
|
283
|
+
+ " backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',<br />"
|
284
|
+
|
285
|
+
+ " cssSelectorAncestor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelectorAncestor") + "',<br />"
|
286
|
+
|
287
|
+
+ " cssSelector: {";
|
288
|
+
|
289
|
+
var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector");
|
290
|
+
for(prop in cssSelector) {
|
291
|
+
|
292
|
+
// jPlayerInfo += "<br /> " + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys.
|
293
|
+
jPlayerInfo += "<br /> " + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "',"
|
294
|
+
}
|
295
|
+
|
296
|
+
jPlayerInfo = jPlayerInfo.slice(0, -1); // Because the sloppy comma was bugging me.
|
297
|
+
|
298
|
+
jPlayerInfo += "<br /> },<br />"
|
299
|
+
|
300
|
+
+ " errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",<br />"
|
301
|
+
|
302
|
+
+ " warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "<br />"
|
303
|
+
|
304
|
+
+ "});</code></p>";
|
305
|
+
$(this).data("jPlayerInspector").configJq.html(jPlayerInfo);
|
306
|
+
return this;
|
307
|
+
},
|
308
|
+
updateStatus: function() { // This displays information about jPlayer's status in the inspector
|
309
|
+
$(this).data("jPlayerInspector").statusJq.html(
|
310
|
+
"<p>jPlayer is " +
|
311
|
+
($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused ? "paused" : "playing") +
|
312
|
+
" at time: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10 + "s." +
|
313
|
+
" (d: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10 + "s" +
|
314
|
+
", sp: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent) + "%" +
|
315
|
+
", cpr: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative) + "%" +
|
316
|
+
", cpa: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute) + "%)</p>"
|
317
|
+
);
|
318
|
+
return this;
|
319
|
+
}
|
320
|
+
};
|
321
|
+
$.fn.jPlayerInspector = function( method ) {
|
322
|
+
// Method calling logic
|
323
|
+
if ( methods[method] ) {
|
324
|
+
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
|
325
|
+
} else if ( typeof method === 'object' || ! method ) {
|
326
|
+
return methods.init.apply( this, arguments );
|
327
|
+
} else {
|
328
|
+
$.error( 'Method ' + method + ' does not exist on jQuery.jPlayerInspector' );
|
329
|
+
}
|
330
|
+
};
|
331
|
+
})(jQuery);
|