-
-
Save thedillonb/4a60deaeb1a3bf0f8c2e to your computer and use it in GitHub Desktop.
Euclid usage
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
euclid.start([{ | |
title: 'Home', | |
entry: function () { | |
return server.getDecks().then(function (decks) { | |
loginChanges(); | |
var data = {decks: decks}; | |
return [components.Home(data), data]; | |
}, function () { | |
return [components.NotAuthenticated(), {}]; | |
}); | |
}, | |
actions: { | |
importDemo: function () { | |
var props = this, | |
url = 'https://github.com/liammclennan/maths.wiki.git'; | |
return server.importGitWiki(url).then(function () { | |
euclid.navigate('Deck', {url: encodeURIComponent(btoa(url))}); | |
return props; | |
}); | |
} | |
} | |
}, | |
{ | |
title: 'Login', | |
entry: function () { | |
logoutChanges(); | |
var data = {}; | |
return [components.LoginPage(data), data]; | |
}, | |
actions: { | |
login: function (email) { | |
var props = this; | |
return server.login(email).then(function () { | |
props.message = "An login email has been sent to your email address " + email + '. Check your email and follow the login link.'; | |
return props; | |
}); | |
} | |
} | |
}]); |
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
moo moo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moo moo cow