14 // TODO add back in as defaults once its possible to add other conversions, not just currencies
30 // TODO fallback to whatever else when localStorage isn't available
32 return JSON.parse( localStorage.getItem( "conversions" ) );
34 function set( value ) {
35 localStorage.setItem( "conversions", JSON.stringify( value ) );
38 var conversions = get( "conversions" );
40 conversions = defaults.slice();
43 window.conversions = {
51 conversions.length = 0;
55 conversions.length = 0;
56 $.extend( conversions, defaults );
59 remove: function( tofrom ) {
60 $.each( conversions, function( index, conversion ) {
61 if ( ( conversion.from + conversion.to ) === tofrom ) {
62 conversions.splice( index, 1 );