Permalink
Browse files

Remove 1bit from my site, it's unsupported and hosted on github now. …

…Update links
  • Loading branch information...
1 parent 80076af commit 3d13afca2cdac542b9a73363790b07766233fa2f @dsingleton committed Mar 10, 2013
View
@@ -32,6 +32,7 @@
## Cool URLs don't change, but if they do, they should redirect
Redirect 301 /code/icon-selector/ http://dsingleton.github.com/icon-selector
+ Redirect 301 /code/1bit/ https://github.com/dsingleton/1bit-audio-player
## App routing
View
@@ -239,7 +239,7 @@
<h2>Other Interests</h2>
<h3>Projects &amp; Code</h3>
- <p>I have a collection of projects, including the source for this site available on <a rel="me" href="http://github.com/dsingleton">GitHub</a>. Another listing of <a href="/code/">code projects</a> is available on my site, including <a href="/code/1bit/">1bit</a> - a Flash/JS inline MP3 player. I've contributed code to <a href="http://www.playdar.org/">Playdar</a>; an open-source music content resolution service.</p>
+ <p>I have a collection of projects, including the source for this site available on <a rel="me" href="http://github.com/dsingleton">GitHub</a>. Another listing of <a href="/code/">code projects</a> is available on my site, including <a href="https://github.com/dsingleton/1bit-audio-player">1bit</a> - a Flash/JS inline MP3 player. I've contributed code to <a href="http://www.playdar.org/">Playdar</a>; an open-source music content resolution service.</p>
<!-- Playdar -->
<h3>Speaking &amp; Events</h3>
View
@@ -1,32 +0,0 @@
-span.onebit_mp3 .onebit_player {
- margin-right: 2px;
-}
-
-/* Styling Examples > Simon */
-
-ol.simon li {
- margin: .5em 0;
-}
-
-ol.simon span.onebit_mp3 {
-}
-
-ol.simon span.onebit_mp3 a {
- text-decoration: none;
- font-weight: bold;
-}
-
-ol.simon span.onebit_player {
- border: 1px solid #444;
- margin-right: 8px;
- padding: 1px 2px 0 3px;
-}
-
-ol.simon span.onebit_mp3 a.tea {
- color: #3DB213;
-}
-
-ol.simon a.tea span.onebit_player {
- background: #263B83;
-}
-
Binary file not shown.
View
@@ -1,101 +0,0 @@
-<?php require '../../../init.php'; ?>
-<?php
-
-$title = "1Bit Audio Player";
-
-$extra_js = array('js/1bit.js', 'js/swfobject.js');
-
-?>
-<?php require '../../_inc/header.inc.php'; ?>
-
- <script type="text/javascript">
- oneBit = new OneBit('flash/1bit.swf');
- oneBit.ready(function() {
- oneBit.apply('ol.simon a.tea', '#3DB213');
- oneBit.apply('a', '#263B83');
- });
- </script>
-
-<article>
- <h1>1Bit Audio Player</h1>
-
- <blockquote>&hellip; a simple and lightweight Adobe Flash MP3 player with automatic JavaScript insertion. It's main purpose is to act as a quick in-page preview for audio files you link to from your website or blog.</blockquote>
-
- <h2>Development</h2>
-
- <p>The current version can be found at <a href="http://1bit.markwheeler.net/">1bit.markwheeler.net</a>, while this is the development page.</p>
-
- <p>I've been re-writing the the Javascript to make 1Bit unobtrusive and generally improve it. The first version used <a href="jquery.com">jQuery</a>, but has since ben re-written to make it smaller and more portable.</p>
-
- <p>There's still some work to do, but the aim is to continue making 1bit easier to use; to play nice with other scripts and have smarter defaults so it needs less configuration.</p>
-
- <h3>Documentation</h3>
- <p><em>This is a little sparse at the moment, sorry.</em></p>
-
- <p>There are 4 options, only the first is required and the other 3 are optional. Though it is recomended setting a value for 'color' as it defaults to #111111</p>
- <pre><code class="js">oneBit.apply(selector, color[, background[, size])</code></pre>
-
- <dl>
- <dt>selector</dt>
- <dd>a CSS selector string to select the links you want to have a player. This supports <a href="http://www.openjs.com/scripts/dom/css_selector">most CSS2 and some CSS3 selectors</a>.</dd>
-
- <dt>color</dt>
- <dd>the color the player icons will be. Specified as a full hex color code, including the #.</dd>
-
- <dt>background</dt>
- <dd>The background color of the player. this defaults to transparent. Specified as a full hex color code, including the #.</dd>
-
- <dt>size</dt>
- <dd>The dimensions of of the player in pixels, by default 1bit will estimate the correct size. It's recommended you don't change this unless you encounter problems. There is only one value as height and width are the same.</dd>
- </dl>
-
- <h4>HTML Output</h4>
- <p>Once one bit has been applied to a link this is the markup, you can use these elements/classes to manipulate the style of 1bit.</p>
-
- <pre><code class="html">&lt;span class=&quot;onebit_mp3&quot;&gt;
-&lt;a href=&quot;file.mp3&quot;&gt;example&lt;/a&gt;
-&lt;span class=&quot;onebit_player&quot; id=&quot;oneBitInsert_1&quot;&gt;
-[Flash goes here]
-&lt;/span&gt;
-&lt;/span&gt;</code></pre>
-
- <h3>Notes</h3>
- <ol>
- <li>Improve documentation</li>
- <li>Hide the complexity of knowing if the DOM is loaded from the end user</li>
- <li>Use Dean Edward's <a href="http://dean.edwards.name/packer/">Packer</a> for script compression</li>
- <li>Add an option to make OneBit modal, so it can only play one MP3 at once</li>
- </ol>
-</article>
-
-<aside>
- <h3 id="examples">Demo</h3>
- <p>Here's an example MP3 that you can play. <a class="mp3" href="./mp3s/Emerald%20Get.mp3">Test Track</a> - taken from the classic Sonic the Hedgehog (it's also short and quick to load)</p>
-
- <h4>More example tracks</h4>
- <p>From Last.fm <a href="">free downloads</a></p>
- <ol>
- <li><a class"mp3" href="http://freedownloads.last.fm/download/149985970/Dance%2BDance%2BDance.mp3">Dance Dance Dance</a> (3:42) - Lykke Li</li>
- <li><a class"mp3" href="http://freedownloads.last.fm/download/192660296/Discipline.mp3">Discipline</a> (4:18) - Nine Inch Nails</li>
- <li><a class"mp3" href="http://freedownloads.last.fm/download/7032151/Space%2Band%2Bthe%2BWoods.mp3">Space and the Woods</a> (3:57) - Late of the Pier </li>
- </ol>
-
- <h4>Usage</h4>
- <p class="callout code">
- <a href="js/1bit.js">Download 1bit.js</a>
- </p>
-
- <p>You'll need <a href="js/1bit.js">1bit javascript</a> and <a href="flash/1bit.swf">1bit flash</a> files, as well as the <a href="js/swfobject.js">swfobject javascript</a>, which 1Bit requires.</p>
-
- <p>Then use like so (full documentation to come).</p>
-
- <pre><code>
-oneBit = new OneBit('flash/1bit.swf');
-
-oneBit.ready(function() {
-oneBit.apply('.content a', '#263B83');
-});
- </code></pre>
-</aside>
-
-<?php require '../../_inc/footer.inc.php'; ?>
View
@@ -1,225 +0,0 @@
-// 1bit Audio Player - 1bit.markwheeler.net
-// Development Version: dsingleton.co.uk/code/1bit
-
-function OneBit(pluginPath)
-{
- // Object Vars
-
- // Relative to calling path
- this.pluginPath = pluginPath || '1bit.swf';
-
- // Style Options
- this.defaultColor = '#111111';
- this.defaultBackground = 'transparent';
- this.defaultPlayerSize = false;
-
- // Semi Internal
- this.wrapperClass = 'onebit_mp3';
- this.playerClass = 'onebit_player';
-
- // Internal
- this.playerCount = 1;
- this.flashVersion = 6;
-
- // Methods
-
- // Run through each applicable link and add a player
-
- this.apply = function(selector, color, background, playerSize)
- {
- // These will apply to the next running too - losing the defaults
- this.color = color || this.defaultColor;
- this.background = background || this.defaultBackground;
- this.playerSize = playerSize || this.defaultPlayerSize;
-
- var links = this.getElementsBySelector(selector);
- var ext = '';
- for(var i = 0; i < links.length; i++) {
-
- // Avoid applying the player twice to the same link
- if (this.hasClass(links[i].parentNode, this.wrapperClass)) {
- continue;
- }
-
- // Avoid non .mp3 links
- ext = links[i].href.substr(links[i].href.length - 4);
- if (ext != '.mp3') {
- continue;
- }
-
- this.insertPlayer(links[i]);
- }
- };
-
- this.insertPlayer = function(elem)
- {
-
- if (!this.playerSize) {
- this.playerSize = Math.floor(elem.scrollHeight * 0.75);
- }
-
- // Make a span to encapsulate the link and flsh
- var playerWrapper = document.createElement('span');
- this.addClass(playerWrapper, this.wrapperClass);
-
- // Add an empty span to be replaced by the flash by it's ID
- var hook_id = 'oneBitInsert_' + this.playerCount;
- var span = document.createElement('span');
- span.setAttribute('id', hook_id);
- span.setAttribute('class', this.playerClass);
-
- // Add it in the wrapping span
- playerWrapper.appendChild(span);
-
- // Move the link inside the span we just made
- elem.parentNode.insertBefore(playerWrapper, elem);
- playerWrapper.appendChild(elem);
-
- // Insert the flash
- var so = new SWFObject(
- this.pluginPath,
- hook_id,
- this.playerSize,
- this.playerSize,
- this.flashVersion,
- this.background
- );
-
- if(this.background == 'transparent') {
- so.addParam('wmode', 'transparent');
- }
-
- // Quick fix to the color hex code, as the flash doesn't expect a #
- so.addVariable('foreColor', this.color.substr(1));
- so.addVariable('filename', elem.href);
-
- so.write(hook_id);
- this.playerCount++;
- };
-
- // Get DOM elements based on the given CSS Selector - V 1.00.A Beta
- // http://www.openjs.com/scripts/dom/css_selector/
- this.getElementsBySelector = function (all_selectors) {
- var selected = new Array();
- if(!document.getElementsByTagName) return selected;
- all_selectors = all_selectors.replace(/\s*([^\w])\s*/g,"$1");//Remove the 'beutification' spaces
- var selectors = all_selectors.split(",");
- // Grab all of the tagName elements within current context
- var getElements = function(context,tag) {
- if (!tag) tag = '*';
- // Get elements matching tag, filter them for class selector
- var found = new Array;
- for (var a=0,len=context.length; con=context[a],a<len; a++) {
- var eles;
- if (tag == '*') eles = con.all ? con.all : con.getElementsByTagName("*");
- else eles = con.getElementsByTagName(tag);
-
- for(var b=0,leng=eles.length;b<leng; b++) found.push(eles[b]);
- }
- return found;
- };
-
- COMMA:
- for(var i=0,len1=selectors.length; selector=selectors[i],i<len1; i++) {
- var context = new Array(document);
- var inheriters = selector.split(" ");
-
- SPACE:
- for(var j=0,len2=inheriters.length; element=inheriters[j],j<len2;j++) {
- //This part is to make sure that it is not part of a CSS3 Selector
- var left_bracket = element.indexOf("[");
- var right_bracket = element.indexOf("]");
- var pos = element.indexOf("#");//ID
- if(pos+1 && !(pos>left_bracket&&pos<right_bracket)) {
- var parts = element.split("#");
- var tag = parts[0];
- var id = parts[1];
- var ele = document.getElementById(id);
- if(!ele || (tag && ele.nodeName.toLowerCase() != tag)) { //Specified element not found
- continue COMMA;
- }
- context = new Array(ele);
- continue SPACE;
- }
-
- pos = element.indexOf(".");//Class
- if(pos+1 && !(pos>left_bracket&&pos<right_bracket)) {
- var parts = element.split('.');
- var tag = parts[0];
- var class_name = parts[1];
-
- var found = getElements(context,tag);
- context = new Array;
- for (var l=0,len=found.length; fnd=found[l],l<len; l++) {
- if(fnd.className && fnd.className.match(new RegExp('(^|\s)'+class_name+'(\s|$)'))) context.push(fnd);
- }
- continue SPACE;
- }
-
- if(element.indexOf('[')+1) {//If the char '[' appears, that means it needs CSS 3 parsing
- // Code to deal with attribute selectors
- if (element.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?['"]?([^\]'"]*)['"]?\]$/)) {
- var tag = RegExp.$1;
- var attr = RegExp.$2;
- var operator = RegExp.$3;
- var value = RegExp.$4;
- }
- var found = getElements(context,tag);
- context = new Array;
- for (var l=0,len=found.length; fnd=found[l],l<len; l++) {
- if(operator=='=' && fnd.getAttribute(attr) != value) continue;
- if(operator=='~' && !fnd.getAttribute(attr).match(new RegExp('(^|\\s)'+value+'(\\s|$)'))) continue;
- if(operator=='|' && !fnd.getAttribute(attr).match(new RegExp('^'+value+'-?'))) continue;
- if(operator=='^' && fnd.getAttribute(attr).indexOf(value)!=0) continue;
- if(operator=='$' && fnd.getAttribute(attr).lastIndexOf(value)!=(fnd.getAttribute(attr).length-value.length)) continue;
- if(operator=='*' && !(fnd.getAttribute(attr).indexOf(value)+1)) continue;
- else if(!fnd.getAttribute(attr)) continue;
- context.push(fnd);
- }
-
- continue SPACE;
- }
-
- //Tag selectors - no class or id specified.
- var found = getElements(context,element);
- context = found;
- }
- for (var o=0,len=context.length;o<len; o++) selected.push(context[o]);
- }
- return selected;
- };
-
-
- // Support Methods
-
- this.hasClass = function(elem, cls) {
- return elem.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
- };
-
- this.addClass = function(elem, cls) {
- if (!this.hasClass(elem, cls)) elem.className += " " + cls;
- };
-
- this.removeClass = function(elem, cls) {
- if (hasClass(elem ,cls)) {
- var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
- elem.className=ele.className.replace(reg ,' ')
- }
- };
-
- // Events
-
- this.ready = function(func) {
- var oldonload = window.onload;
- if (typeof window.onload != 'function') {
- window.onload = func;
- } else {
- window.onload = function() {
- if (oldonload) {
- oldonload();
- }
- func();
- }
- }
- }
-};
@@ -1 +0,0 @@
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('F 1N(C){5.1b=C||\'1F.1Y\';5.1p=\'#1R\';5.1e=\'11\';5.1a=1E;5.14=\'1X\';5.1r=\'1S\';5.12=1;5.1j=6;5.1P=F(a,b,c,d){5.16=b||5.1p;5.10=c||5.1e;5.S=d||5.1a;7 e=5.1t(a);J(7 i=0;i<e.G;i++){8(5.W(e[i].1l,5.14)){D}8(e[i].1i.1h(-4)!=\'.1Q\'){D}5.1d(e[i])}};5.1d=F(a){8(!5.S){5.S=1O.1M(a.1L*0.1K)}7 b=Q.19(\'18\');5.17(b,5.14);7 c=\'1G\'+5.12;7 d=Q.19(\'18\');d.1m(\'1D\',c);d.1m(\'1C\',5.1r);b.1g(d);a.1l.1A(b,a);b.1g(a);7 e=E 1w(5.1b,c,5.S,5.S,5.1j,5.10);8(5.10==\'11\'){e.1v(\'1W\',\'11\')}e.1u(\'1V\',5.16.1h(1));e.1u(\'1U\',a.1i);e.1T(c);5.12++};5.1t=F(g){7 h=E O();8(!Q.13)X h;g=g.1n(/\\s*([^\\w])\\s*/g,"$1");7 k=g.V(",");7 m=F(c,d){8(!d)d=\'*\';7 e=E O;J(7 a=0,K=c.G;R=c[a],a<K;a++){7 f;8(d==\'*\')f=R.1k?R.1k:R.13("*");15 f=R.13(d);J(7 b=0,1o=f.G;b<1o;b++)e.Y(f[b])}X e};1q:J(7 i=0,1f=k.G;1s=k[i],i<1f;i++){7 n=E O(Q);7 p=1s.V(" ");U:J(7 j=0,1c=p.G;H=p[j],j<1c;j++){7 q=H.M("[");7 r=H.M("]");7 s=H.M("#");8(s+1&&!(s>q&&s<r)){7 t=H.V("#");7 u=t[0];7 v=t[1];7 w=Q.1J(v);8(!w||(u&&w.1I.1H()!=u)){D 1q}n=E O(w);D U}s=H.M(".");8(s+1&&!(s>q&&s<r)){7 t=H.V(\'.\');7 u=t[0];7 x=t[1];7 y=m(n,u);n=E O;J(7 l=0,K=y.G;9=y[l],l<K;l++){8(9.N&&9.N.P(E I(\'(^|\\s)\'+x+\'(\\s|$)\')))n.Y(9)}D U}8(H.M(\'[\')+1){8(H.P(/^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?[\'"]?([^\\]\'"]*)[\'"]?\\]$/)){7 u=I.$1;7 z=I.$2;7 A=I.$3;7 B=I.$4}7 y=m(n,u);n=E O;J(7 l=0,K=y.G;9=y[l],l<K;l++){8(A==\'=\'&&9.L(z)!=B)D;8(A==\'~\'&&!9.L(z).P(E I(\'(^|\\\\s)\'+B+\'(\\\\s|$)\')))D;8(A==\'|\'&&!9.L(z).P(E I(\'^\'+B+\'-?\')))D;8(A==\'^\'&&9.L(z).M(B)!=0)D;8(A==\'$\'&&9.L(z).1B(B)!=(9.L(z).G-B.G))D;8(A==\'*\'&&!(9.L(z).M(B)+1))D;15 8(!9.L(z))D;n.Y(9)}D U}7 y=m(n,H);n=y}J(7 o=0,K=n.G;o<K;o++)h.Y(n[o])}X h};5.W=F(a,b){X a.N.P(E I(\'(\\\\s|^)\'+b+\'(\\\\s|$)\'))};5.17=F(a,b){8(!5.W(a,b))a.N+=" "+b};5.1z=F(a,b){8(W(a,b)){7 c=E I(\'(\\\\s|^)\'+b+\'(\\\\s|$)\');a.N=1y.N.1n(c,\' \')}};5.1x=F(a){7 b=Z.T;8(1Z Z.T!=\'F\'){Z.T=a}15{Z.T=F(){8(b){b()}a()}}}};',62,124,'|||||this||var|if|fnd||||||||||||||||||||||||||||||continue|new|function|length|element|RegExp|for|len|getAttribute|indexOf|className|Array|match|document|con|playerSize|onload|SPACE|split|hasClass|return|push|window|background|transparent|playerCount|getElementsByTagName|wrapperClass|else|color|addClass|span|createElement|defaultPlayerSize|pluginPath|len2|insertPlayer|defaultBackground|len1|appendChild|substr|href|flashVersion|all|parentNode|setAttribute|replace|leng|defaultColor|COMMA|playerClass|selector|getElementsBySelector|addVariable|addParam|SWFObject|ready|ele|removeClass|insertBefore|lastIndexOf|class|id|false|1bit|oneBitInsert_|toLowerCase|nodeName|getElementById|75|scrollHeight|floor|OneBit|Math|apply|mp3|111111|onebit_player|write|filename|foreColor|wmode|onebit_mp3|swf|typeof'.split('|'),0,{}))
Oops, something went wrong.

0 comments on commit 3d13afc

Please sign in to comment.