THIS LIBRARY HAS BEEN DEPRECATED, PLEASE USE https://github.com/traitify/traitify-widgets
This package does not require jQuery, as it is a standalone encapsulated library. It does however require a browser with the ability to make cors requests (currently only supports ie10 and up, chrome, safari, and firefox).
For instructions on obtaining an assessment id and a public key visit: https://developer.traitify.com
For directions on using the latest traitify js scroll to the bottom
Include the Traitify.js library:
<script src="https://s3.amazonaws.com/traitify-cdn/lib/v1.js"></script>
You can initialize using an id or a class on any div tag:
<div class="traitify-widget"></div> <!-- Example Target Div for the widget -->
The following javascript will initialize with the above html:
<script>
Traitify.setPublicKey("8asdf8sda-f98as-df8ads-fadsf"); // Example Public Key
Traitify.setHost("api-sandbox.traitify.com"); // Example host url (Defaults to api.traitify.com)
Traitify.setVersion("v1"); // Example Version
var assessmentId = "34aeraw23-3a43a32-234a34as42"; // Example Assessment id
traitify = Traitify.ui.load(assessmentId, ".traitify-widget"); // Example selector for widget target
</script>
When you initialize the widget we return our widget builder to you (This is the same builder we use to construct the widget).
<script>
traitify = Traitify.ui.load(assessmentId, ".traitify-widget")
// This callback gives you the ability to trigger an event when
// the widget has finished loading
traitify.onInitialize(function(){
console.log(traitify.data);
console.log("Initialized");
})
// This callback gives you the ability to trigger an event when
// the user has finished playing the slide deck
traitify.onFinished(function(){
console.log(traitify.data);
console.log("Finished!");
})
</script>
===============
<script src="https://s3.amazonaws.com/traitify-cdn/lib/v1.js"></script>
Traitify.getDecks("assessment id", function(data){
console.log(data)
})
Traitify.getSlides("assessment id", function(data){
console.log(data)
})
Traitify.addSlide("assessment id", function(data){
console.log(data)
})
Traitify.getPersonalityTraits("assessment id", function(data){
console.log(data)
})
Traitify.getCareers("assessment id", function(data){
console.log(data)
})
Warning, things may break if you use edge, it is not stable, and is not intended to be. If you're looking for a stable deployment then use the v1 bundle from the above cdn.
<script src="https://cdn.traitify.com/lib/edge.js"></script>
<script>
Traitify.setPublicKey("8asdf8sda-f98as-df8ads-fadsf"); // Example Public Key
Traitify.setHost("api-sandbox.traitify.com"); // Example host url (Defaults to api.traitify.com)
Traitify.setVersion("v1"); // Example Version
var assessmentId = "34aeraw23-3a43a32-234a34as42"; // Example Assessment id
traitify = Traitify.ui.load(assessmentId, ".traitify-widget"); // Example selector for widget target
</script>
$ cake watch
$ cake build
$ cake bundle
$ cake test