These are top level functions provided by the Authenteo framework. They are included as top level functions because of their frequent usage.
This function takes an element id as an argument and returns the corresponding DOM element. This is the same thing as calling:
document.getElementById(elementId)
This function causes the provided expression to run as a new thread. That is the expression can execute without blocking the current code if the called code suspends. For example:
spawn(function() {
sleep(1000);
debug("this message will come one second later");
});
debug("This message will come first");
This constructor function is used to create a notifier function to setup a continuation. This function will return a notifier function. Calling the notifier function will resume a thread. The returned notifier function will have a member function called wait, that when called will suspend the thread. For example, the sleep function above could be written:
function sleep(milliseconds){
var notifier = new Future();
// when the setTimeout is finished it will call the notifier to resume
setTimeout(notifier.fulfill,milliseconds);
// suspend the current thread and wait for setTimeout to trigger
notifier.result();
}
The notifier function can be called with a single argument that is the value that should be returned by the wait function when it is resumed. For example:
function waitForButtonClick(buttonId) {
var notifier = new Future();
events.addListener(byId(buttonId),"click", function(evt) {
notifier(evt);
});
var event = notifier.result();
// event will now hold the event object from the clicking of the button
}
This will function throw an error if the condition argument passed is false. If the condition is true it will return normally.
pjs.root?This is the root of the entire server persisted object graph. Every server persisted object is a descendent of this object.
website?this is a root of the current website object graph. This contains all the content, layout, and administrative information for a website.
Authenteo 1.1 is available.
Now with
Firebug integration
. Make changes to CSS and HTML with Firebug and save the changes
Check out press releases and the following articles on Authenteo: