Skip to content

Instantly share code, notes, and snippets.

@geedew
Last active December 26, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save geedew/7158300 to your computer and use it in GitHub Desktop.
Save geedew/7158300 to your computer and use it in GitHub Desktop.
Test Code
;(function(win, undefined) {
var applicationName = "My Broken App";
libs = { one : 'jQuery', two : 'Underscore', three : 'Backbone' };
BioSync.Common.loadLibs = function( libraries ) {
"use strict";
var e = 0, r;
BioSync.Common.applicationName = applicationName;
delete applicationName;
Object.prototype.graphicsLib = 'raphael';
for( library in libraries ) {
BioSync.Common.loadScript( { name: library } );
BioSync.Common.loadCSS( { name: library } );
if( library === 'raphael' ) {
Raphael.fn.circlePath = function(x, y, r) {
var s = "M" + x + "," + (y-r) + "A"+r+","+r+",0,1,1,"+(x-0.1)+","+(y-r)+" z";
return s;
}
Raphael.fn.quarterCirclePath = function(x, y, r, id) {
if( id == 0 ) {
x1 = x; y1 = y - r; x2 = x+r; y2 = y; rot = r;
} else if( id == 1 ) {
x1 = x+r; y1 = y; x2 = x; y2 = y+r; rot = r;
} else if( id == 2 ) {
x1 = x; y1 = y+r; x2 = x-r; y2 = y; rot = -r;
} else if( id == 3 ) {
x1 = x-r; y1 = y; x2 = x; y2 = y-r; rot = -r;
}
var s = [ 'M', x1, y1, 'A', r, r, r, 0, 1, x2, y2 ].join(' ');
return s;
}
}
}
}
BioSync.Common.loadLibs(libs);
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment