Dynamic JavaScript loader test
Note: If you have a server with installed mod_rewrite, then filenames in firebug and other tools will be shown in normal mode
1. Windows library test
Open window
Show source <-- this is a test too ;)
Loader.loadClass("Windows", function() {
Loader.loadClass("Windows", function() {
if(Windows.getWindow('test')) {
alert('Window already created!');
return;
}
win = new Window('test', {
className: "alphacube",
title: "Sample",
height:150,
width: 300,
destroyOnClose: true,
recenterAuto:false
});
win.getContent().update("<h1>Hello world !!</h1>");
win.showCenter();
});
2. Tooltip library test
Hover here to load Ajax.Tooltip library
Show source
if(!window.tooltip) {
if(!tooltip) {
Loader.loadClass("Effect.Tooltip", function() {
tooltip = new Effect.Tooltip($("tooltip_div"), "Hey, it works!", {
'class': 'tooltip'
});
});
}
3. editableSelect test
Show source
if(!window.tooltip) {
var initHandler = function() {
Loader.loadClass('editableSelect', function() {
new editableSelect('test_select');
});
Event.stopObserving('test_select', 'mousemove', initHandler);
}
Event.observe('test_select', 'mousemove', initHandler);