-
-
Save chrisege/93b50d55fe3ace83b8ca68e8b65340c9 to your computer and use it in GitHub Desktop.
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(win, undefined) { | |
"use strict"; | |
var applicationName = "My Broken App"; | |
let raphaelLoaded = false; | |
const numLibs = 1; | |
libs = { one : 'jQuery', two : 'Underscore', three : 'Backbone' }; | |
BioSync.Common.loadLibs = function( libraries = {} ) { | |
var e = 0, r; | |
BioSync.Common.applicationName = applicationName; | |
delete applicationName; | |
Object.prototype.graphicsLib = 'raphael'; | |
for( library in libraries ) { | |
numLibs++; | |
BioSync.Common.loadScript( { name: library } ); | |
BioSync.Common.loadCSS( { name: library } ); | |
if( library === 'raphael' ) { | |
raphaelLoaded = true; | |
Raphael.fn.circlePath = (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 = (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