jquery-mobile/build.xml
Kin Blas 19c06952fd Changes to allow 3rd party transitions. Developers can now register a custom transition by adding their transition handler to the $.mobile.transitionHandlers dictionary. The name of the custom transition is used as the key within the transtionsHandlers dictionary, and should be the same name used within the @data-transtion attribute.
The expected prototype for a transitionHandler is as follows:

function handler(name, reverse, $to, $from)

The name parameter is the name of the transition as specified by @data-transition attribute, reverse is a boolean that is false for a normal transition, and true for a reverse transition. The $to param is a jQuery collection containing the page that is being transitioned "to", and $from is an optional collection that tells us what page we are transitioning "from". Because $from is optional, handler developers should take care and check $from to make sure it is not undefined before attempting to dereference it.

In addition to registering custom transition by name, developers can specify a handler to use in the case where a transition name is specified and does not exist within the $.mobile.transitionHanlders dictionary. Within jQuery Mobile, the default handler for unknown transition types is the $.mobile.css3Transition() handler. This handler always assumes that the transition name is to be used as a CSS class to be placed on the $to and $from elements. To change the default handler, simply set $.mobile.defaultTransitionHandler to you function handler:

$.mobile.defaultTransitionHandler = myTransitionHandler;

The changes to make all this necessary are as follows:

- Created $.mobile.noneTransitionHandler which is the default transitionHandler for the framework that simply adds and removes the page active class on the $from and $to pages with no animations.

- Moved class based transition code into a new plugin jquery.mobile.transition.js file. This plugin, when present, overrides the noneTransitionHandler as the defaultTranstionHandler for the framework so that CSS3 animation transitions are available.

- Removed code related to the setting/removal of the ui-mobile-viewport-perspective class. The css3TransitionHandler plugin takes care of automatically placing a "viewport-<transition name>" class on the viewport (body) element. This allows any other transition to specify properties on the viewport that are necessary to accomplish the transition.

- changed the CSS class ui-mobile-viewport-perspective to viewport-flip to match code changes. This makes it more apparent that setting -webkit-perspective is only used with the flip transition.

- Updated js/index.php, Makefile and build.xml to include the new jquery.mobile.transition.js file.
2011-04-26 14:06:10 -07:00

66 lines
1.9 KiB
XML

<?xml version="1.0"?>
<project name="jquery-mobile" basedir="." default="merge">
<property name="cssdir" location="themes/default"/>
<property name="jsdir" location="js"/>
<property name="css-sources" value="jquery.mobile.theme.css,
jquery.mobile.core.css,
jquery.mobile.transitions.css,
jquery.mobile.grids.css,
jquery.mobile.headerfooter.css,
jquery.mobile.navbar.css,
jquery.mobile.button.css,
jquery.mobile.collapsible.css,
jquery.mobile.controlgroup.css,
jquery.mobile.dialog.css,
jquery.mobile.forms.checkboxradio.css,
jquery.mobile.forms.fieldcontain.css,
jquery.mobile.forms.select.css,
jquery.mobile.forms.textinput.css,
jquery.mobile.listview.css,
jquery.mobile.forms.slider.css"/>
<property name="js-sources" value="jquery.ui.widget.js,
jquery.mobile.widget.js,
jquery.mobile.media.js,
jquery.mobile.support.js,
jquery.mobile.vmouse.js,
jquery.mobile.event.js,
jquery.mobile.hashchange.js,
jquery.mobile.page.js,
jquery.mobile.core.js,
jquery.mobile.navigation.js,
jquery.mobile.transition.js,
jquery.mobile.fixHeaderFooter.js,
jquery.mobile.forms.checkboxradio.js,
jquery.mobile.forms.textinput.js,
jquery.mobile.forms.select.js,
jquery.mobile.buttonMarkup.js,
jquery.mobile.forms.button.js,
jquery.mobile.forms.slider.js,
jquery.mobile.collapsible.js,
jquery.mobile.controlGroup.js,
jquery.mobile.fieldContain.js,
jquery.mobile.listview.js,
jquery.mobile.listview.filter.js,
jquery.mobile.dialog.js,
jquery.mobile.navbar.js,
jquery.mobile.grid.js,
jquery.mobile.init.js"/>
<target name="merge">
<antcall target="merge_css" />
<antcall target="merge_js" />
</target>
<target name="merge_css">
<concat destfile="combine/jquery.mobile.css">
<filelist dir="${cssdir}" files="${css-sources}"/>
</concat>
</target>
<target name="merge_js">
<concat destfile="combine/jquery.mobile.js">
<filelist dir="${jsdir}" files="${js-sources}"/>
</concat>
</target>
</project>