blob: e46d3cf91b1a98c55a79ad6d875280b5b2b10b4a [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:variable name="tab"><xsl:text> </xsl:text></xsl:variable>
<xsl:variable name="newline"><xsl:text>
</xsl:text></xsl:variable>
<xsl:variable name="startup_page" select="//page[@startup='true']"/>
<xsl:template match="/">
<xsl:text>/*******************************************************************************
* This file was generated by Tizen Web UI Builder.
* This file will be auto-generated each and everytime you save your project.
* Do not hand edit this file.
********************************************************************************/
</xsl:text>
<xsl:text>
app.init = function() {
</xsl:text>
<xsl:value-of select="concat($tab, 'this.setStartPageId(&quot;', $startup_page/@name, '&quot;);', $newline)" />
<xsl:value-of select="concat($tab, 'this.setMasterPagePath(location.href);', $newline)" />
<xsl:text>
var rootDir = $.mobile.path.get(app.getMasterPagePath());
var newPage;
</xsl:text>
<xsl:apply-templates select="//page"/>
<xsl:text>
};
</xsl:text>
</xsl:template>
<xsl:template match="page">
<xsl:variable name="html_path" select="concat('&quot;', @htmlPath, '&quot;')"/>
<xsl:variable name="css_path" select="concat('&quot;', @cssPath, '&quot;')"/>
<xsl:variable name="managed_css_path" select="concat('&quot;', @managedCssPath, '&quot;')"/>
<xsl:value-of select="concat($tab, 'newPage = new _', @name, '_page();', $newline)"/>
<xsl:value-of select="concat($tab, 'newPage.init_page(', @startup, ', ', '$.mobile.path.makeUrlAbsolute(', $html_path, ', rootDir), $.mobile.path.makeUrlAbsolute(', $css_path, ', rootDir), $.mobile.path.makeUrlAbsolute(', $managed_css_path, ', rootDir));',$newline)"/>
<xsl:value-of select="concat($tab, 'pageManager.addPage(newPage);', $newline)"/>
</xsl:template>
</xsl:stylesheet>