lib/packages/parsers.js
function(raw_directive) {

		if (Lava.schema.DEBUG) {
			if (!raw_directive.attributes || !raw_directive.attributes.title) Lava.t("define: missing 'title' attribute");
			if (raw_directive.attributes.title.indexOf(' ') != -1) Lava.t("Widget title must not contain spaces");
			if ('resource_id' in raw_directive.attributes) Lava.t("resource_id is not allowed on define");
			if (this._current_widget_title) Lava.t("Nested defines are not allowed: " + raw_directive.attributes.title);
		}

		this._current_widget_title = raw_directive.attributes.title;
		var widget_config = this._parseWidgetDefinition(raw_directive);
		this._current_widget_title = null;
		widget_config.is_extended = false; // reserve it for serialization

		if (Lava.schema.DEBUG && ('class_locator' in widget_config)) Lava.t("Dynamic class names are allowed only in inline widgets, not in x:define");

		Lava.storeWidgetSchema(raw_directive.attributes.title, widget_config);

	}
function(raw_directive) {

		if (Lava.schema.DEBUG) {
			if (!raw_directive.attributes || !raw_directive.attributes.title) Lava.t("define: missing 'title' attribute");
			if (raw_directive.attributes.title.indexOf(' ') != -1) Lava.t("Widget title must not contain spaces");
			if ('resource_id' in raw_directive.attributes) Lava.t("resource_id is not allowed on define");
			if (this._current_widget_title) Lava.t("Nested defines are not allowed: " + raw_directive.attributes.title);
		}

		this._current_widget_title = raw_directive.attributes.title;
		var widget_config = this._parseWidgetDefinition(raw_directive);
		this._current_widget_title = null;
		widget_config.is_extended = false; // reserve it for serialization

		if (Lava.schema.DEBUG && ('class_locator' in widget_config)) Lava.t("Dynamic class names are allowed only in inline widgets, not in x:define");

		Lava.storeWidgetSchema(raw_directive.attributes.title, widget_config);

	}
function ( raw_directive ) { if ( Lava . schema . DEBUG ) { if ( ! raw_directive . attributes || ! raw_directive . attributes . title ) Lava . t ( "define: missing 'title' attribute" ) ; if ( raw_directive . attributes . title . indexOf ( ' ' ) != - 1 ) Lava . t ( "Widget title must not contain spaces" ) ; if ( 'resource_id' in raw_directive . attributes ) Lava . t ( "resource_id is not allowed on define" ) ; if ( this . _current_widget_title ) Lava . t ( "Nested defines are not allowed: " + raw_directive . attributes . title ) ; } this . _current_widget_title = raw_directive . attributes . title ; var widget_config = this . _parseWidgetDefinition ( raw_directive ) ; this . _current_widget_title = null ; widget_config . is_extended = false ; // reserve it for serialization if ( Lava . schema . DEBUG && ( 'class_locator' in widget_config ) ) Lava . t ( "Dynamic class names are allowed only in inline widgets, not in x:define" ) ; Lava . storeWidgetSchema ( raw_directive . attributes . title , widget_config ) ; }
Define a widget
@param {_cRawDirective} raw_directive
Define a widget