Getting Started
Meteora is built on top of MooTools and the package comes with a full version of the 1.1 version of the framework. If you're already a MooTools user you may read Quick start for mootools users, if you have not used MooTools yet just keep reading.
After you have uncompressed Meteora, you'll notice that it's around 1.1M in size, this is mainly because of all the images it contains, also because it's distributed with a full version of the MooTools framework. But do not worry about loading times, with Meteora's automatic dependency resolution your browser will download only the javascript the page needs and nothing more.
We recommend you to use those files that are within src directory to develop your application, at least until it is ready for production then you should use compression along with the compact-source directory.
Loading the core
To include Meteora into your project you must add just one line,
the meteora.js script:
</script>
Meteora.uses('Plugin.Accordion');
When you want to use a control, you can use a line that should look like
this:
'objectId',
{
option1: 'value1',
option2: 'value2'
}
);
domNode,
{
option1: 'value1',
option2: 'value2'
}
);
function() {
new ControlName(
domNode,
{
option1: 'value1',
option2: 'value2'
}
);
}
);
HTML elements made easy
With Meteora you can create DOM nodes the easier way, you can even create a new node with
contents fetched from a local URL (AJAX).
Widget.elementName({'attr1': 'prop1', 'attr2': 'prop2'}, content);
var domNode = Widget.div({'class': 'my-div'}, 'Div\'s content');
var domNode = Widget.span(null, randomDomNode);
var domNode = Widget.div(null, {'url': '/ajax/content'});
var domNode = Widget.div(null, Widget.fromHTML('<b>bold text</b>'));
var domNode = Widget.fromHTML('We love to <b>code</b>');
'a', 'abbr', 'acronym', 'address', 'area', 'b', 'base', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'div', 'dfn', 'dl', 'dt', 'em', 'fieldset', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'head', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'map', 'meta', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'p', 'param', 'pre', 'q', 'samp', 'script', 'select', 'small', 'span', 'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'tt', 'ul', 'var'
To know how to use each control and its parameters read Meteora's documentation. If you're planning to hack in more deeply, you may read Mootool's documentation and then our Quick start for Mootools users.