Giter VIP home page Giter VIP logo

jquery-mobile's Introduction

jQuery Mobile Build Status Coverage Status

Note: jQuery Mobile is not maintained anymore. Please read the project status blog post for more information.

jQuery Mobile is a unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.

jQuery Mobile 1.4.x works with versions of jQuery core from 1.8.3 to 1.11.1 / 2.1.1. You can find more information about how the library works, and what it is capable of, by reading the documentation and exploring the demos. Alternatively, more information can also be found on the jquerymobile site.

Contributing

You can contribute to the project by reporting issues, suggesting new features, or submitting pull requests. Please read our Contributing Guidelines before submitting.

Build/Customization

Currently the library is shipped on the jQuery CDN/download as a single monolithic JavaScript file that depends on jQuery Core (not included) and a similarly bundled CSS file. For users we support the following build targets:

  • js - resolve dependencies, build, concat, and minify the JavaScript used for jQuery Mobile
  • css - resolve dependencies, build, concat, and minify all the css, just the structure css, and just the theme css
  • demos - build the js and css, and make the docs ready for static consumption
  • lint - Validates JavaScript files using JSHint

Download Builder

The easiest way to obtain a custom build is to use the download builder. With it, you can select the parts of the library you need and both the CSS and JavaScript dependencies will be resolved for you as a packaged/minified whole.

Requirements

Commands

With node and grunt installed you can run the default target by simply issuing the following from the project root:

npm install
grunt

JavaScript

As of version 1.1 the library uses dependency management in the JavaScript build by providing AMD modules which can be added or removed from the core mobile meta module js/jquery.mobile.js.

For example, if a user wished to exclude the form widgets to reduce the wire weight of their jQuery Mobile include they would first remove them from the meta module:

diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js
index 6200fe6..3a4625c 100644
--- a/js/jquery.mobile.js
+++ b/js/jquery.mobile.js
@@ -19,12 +19,6 @@ define([
        './jquery.mobile.listview.filter',
        './jquery.mobile.listview.autodividers',
        './jquery.mobile.nojs',
-       './jquery.mobile.forms.checkboxradio',
-       './jquery.mobile.forms.button',
-       './jquery.mobile.forms.slider',
-       './jquery.mobile.forms.textinput',
-       './jquery.mobile.forms.select.custom',
-       './jquery.mobile.forms.select',
        './jquery.mobile.buttonMarkup',
        './jquery.mobile.controlGroup',
        './jquery.mobile.links',

And then run the build:

grunt build:js

CSS

To create a new theme:

  1. Copy the default folder from CSS/Themes to a new folder named after your new theme (eg, my-theme).

  2. Add customizations to the jquery.mobile.theme.css file.

  3. From the project root run the following grunt command:

     THEME=my-theme grunt build:css
    
  4. The output will be available in the $PROJECT_ROOT/dist

Again this assumes the theme css files are available in the css/themes/$THEME/ directory relative to the project root, css/themes/my-theme/ in the example.

Development

The root of the repository is also the root of the documentation and, along with the test suite, acts as the test bed for bug fixes and features. You'll need to set up a server and get the test suite running before you can contribute patches.

Server

Most of the documentation and testing pages rely on PHP 5+, and as a result Apache and PHP are required for development. You can install them using one of the following methods:

  • one-click - MAMP for OSX, XAMP for OSX/Windows
  • existing web server - eg, ~/Sites directory on OSX.
  • virtual machine - If Vagrant is installed you can add this remote/branch and vagrant up

In addition to vanilla Apache the following modules are required:

  • Rewrite (mod_rewrite.so)
  • Expire (mod_expires.so)
  • Header (mod_headers.so)

Once you have your web server setup you can point it at the project directory.

Testing

Automated testing forms the backbone of the jQuery Mobile project's QA activities. As a contributor or patch submitter you will be expected to run the test suite for the code your patches affect. Our continuous integration server will address the remainder of the test suite.

You can run all the test suites by running the following command:

grunt test

You can choose to run only a subset of the tests by adding the --suites option like:

grunt test --suites=table,slider

will only run the tests under tests/unit/table/ and tests/unit/slider/.

You can also exclude some tests by using !. For instance:

grunt test --type=integration --suites=\!navigation

will run all the integration tests but the navigation suite.

You can also specify which versions of jQuery you want to test jQuery Mobile by using the --jqueries option:

grunt test --jqueries=1.11.1,git

Additionally, jQuery Mobile's test suite is split between integration and unit tests. Where the unit tests are meant to focus on a single piece of the library (eg, a widget) and the integration tests require multiple pieces of the library to function. You can target either type by including the --types option when testing:

grunt test --types=unit
grunt test --types=integration
grunt test --types=unit,integration # default, equivalent to 'grunt test'

jquery-mobile's People

Contributors

agcolom avatar ajkovar avatar apsdehal avatar arschmitz avatar cgack avatar chetankjain avatar eddiemonge avatar frequent avatar garann avatar gseguin avatar hpbuniat avatar jakeboone02 avatar jaspermdegroot avatar jblas avatar jefflembeck avatar jeresig avatar jgable avatar johnbender avatar jzaefferer avatar mauriceg avatar pattytoland avatar redaemn avatar rwaldron avatar scottgonzalez avatar scottjehl avatar toddparker avatar trott avatar tybenz avatar wilto avatar zachleat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-mobile's Issues

move tabs to globalnav plugin

tabs can possibly just be a simple styled list of links that sit in the header/footer, as a sibling to all .ui-page containers. Clicking them will be like clicking any other local or ajax link, except that the global nav tabs will persist while pages animate beneath it.
This approach would let us cut a lot of code, as tabs are quite complex when dealing with aria roles, focus and keyboard management, etc

maximum scale 1 in meta?

Ideally, let's get scale out of the meta viewport tag.
In testing, one of the devices was zooming when focusing on form controls, then not zooming back on blur. Sorry no detail on which device... :/

  • feedback from Paul Irish

Create toolbar examples

Static markup examples of:

  • Search bar (text input) -- do we need to consider adding auto-complete from UI? If so menu style vs. filter list style?
  • Button bar (maybe w and w/o button appearance), icon vs. text vs. both
  • Filter bar - custom select, toggle, etc.

Other ideas?

figure out a reasonable swipe distance and tolerance for swipe events

Currently, we have to move 180px horizontally, which is far more than other frameworks require.

jQtouch uses a horizontal distance of 35px. I found some native xcode examples that say 25px.
Maybe 30px ish would be nice?

Also, our vertical tolerance is probably a lot larger than necessary too (80px). Maybe closer to 20px would be reasonable.

Create navbar examples

Apple tab bar with small text labels and 3rd party icon setlike glyphish
http://glyphish.com/

Text only bar with depressed on state, same height as header bar

Also, we need a mechanism for showing only the # of tabs that can fit, add more button that slides bar open to show all.

Add transition shortcut methods

It might be cool if we added the ability to trigger CSS animations through familiar (and new) jQuery methods.

For example, $(el).slideDown() could replace core's slideDown method, and in this case it'd just do something like the following internally:

$.fn.slideDown = function(){
    return $(this).addClass('slidedown in');
};

Same for others like pop, fade, etc.

Thoughts?

Move Ajax Test to Core

The Ajax support test is pretty much taken care of in core, we should handle it there.

Idea: Icons based on CSS

Try and create some basic icons using CSS instead of bitmaps? We could inject the necessary markup with JS. These would be high res and scalable. Most core icons are very simple right now:

+, -, x (delete), arrow up/down/left/right, sort grippy bars

Ideally, we could use this for radiobuttons and checkboxes too. Since Doug's the master, maybe he can weigh in on whether this is feasible.

_t

Need Changes to BBQ

Right now we're using hashchange and using getters and setters for the state history - unfortunately we have to include the full BBQ for that. Any help in reducing the plugin down to just what we need would be appreciated. You can see what we're using it for in jquery.mobile.js.

Use history.pushState in our page loading logic

I ran some tests this morning for pushState support (see new test added to jQuery.support.js).

Looks like we might be able to use it in a few places (at least iPhone, iPad, lastest BB, desktop), to combat our non-js bookmarking issue.

!!history.pushState returns:

iPhone w/ iOS4: TRUE
Blackberry 6 (Torch device): TRUE
Stock iPad: FALSE (iPad with update should be TRUE)
Palm Pixi: FALSE
HTC Incredible w/ Android (not sure which version): FALSE
Windows Mobile (not sure which version): FALSE

Chrome 6 mac desktop: TRUE
Firefox 3.6: FALSE
Firefox 4: TRUE (unable to verify right now)
Safari 5 mac desktop: TRUE
Opera 10 desktop: FALSE

Force display pre-caching with -webkit-transform:translate3d(0,0,0)

Idea from this article:
http://cubiq.org/you-shall-not-flicker

apply:
-webkit-transform:translate3d(0,0,0) CSS style to all elements inside the scrolling area

We need to be careful because this uses memory

Why isn’t this going to be included in the main iScroll script? The answer is: memory allocation.

We do not have control over memory in mobile webkit. If we use too many resources the browser just crashes, and of course if you have thousands elements inside the scrolling area, forcing the browser to cache everything, would just make your application crash.

Dialog behavior: Create a page layout for ui-dialog using same markup from a ui-page

Dialogs can simply be ui-page divs with a different class applied to style them as an overlay. The link that references the dialog can just use either data-transition="pop" or "slideup"... or, we could add a data attribute like data-behavior="overlay" or something, that could use existing transitions in addition to adding the overlay class "ui-dialog" or "ui-overlay" to the loaded page.

Essentially, this would take the place of writing a dialog plugin at all.

The only logic it'd need is to decide if the page is short enough to overlay on the existing page, or if it should go to a new page for scrolling purposes.

For ajax navigation - maintain a basePath for relative URL loading and linking

Currently, pages that are loaded via ajax are loaded relative to the location.pathname of the first real URL visited. This works for the first requested page, but quickly falls apart when relative links on that page are clicked.

To fix this issue, we need to maintain a global base path variable for prepending to all new hash changes. This basepath should be an absolute path matching the location.pathname of the current file.

Figure out how to handle nested hash states in nested listview

Listview currently hogs the whole hash for state tracking, which is fine if you start on the page that contains a nested listview (like _listview.html), but not fine if you got to _listview.html through an ajax transition. If you did, the next level of the tree will be something like...
pagefoo.html#ui-listview-2

which of course doesn't exist on pagefoo.html.

Doug suggested using a slash to reach sub-page pages:
pagefoo.html#_listview.html/ui-listview-2

Another way we could try would be something like:
pagefoo.html#_listview.html&sublist=ui-listview-2

Either way, this would at least allow us to deep-link for JavaScript users. Non-JS linking is still unresolved.

Public methods from mobile core

So far, we've made these core methods public in the $ namespace:

  • $.ajaxClick (could probably use a better name... sometimes local,sometimes ajax)
  • $.fn.animationComplete (I think this should be moved into events and normalized for full animation event support)

I think these methods could be useful to plugin development as well:

  • hideBrowserChrome
  • mobilize
  • pageLoading
  • changePage

For example, it'd be very useful if selectmenu could use $.changePage to wrap its menu options in a ui-page div and do a normal page transition over to the menu, without having to trigger a hashchange to do so (as select menus shouldn't add to the urlStack).

Thoughts?

Figure out whether or not to keep tree plugin

good for nested lists, but simple lists of links behave in a similar way, with a lot less code. Maybe we don't need tree, or if we keep it, it'd be better if the leaf nodes end up going to a new page rather than loading it into the UL structure.

Global nav is broken

Clicking the page just produces a slicer bit no mac. When I hit back button, I saw mac appear on index page, then disappeared.

New feature idea: List search/filter client-side

The new AJAX form plugin is great if you're good with server-side tech, but since most mobile apps consist of lots of list views it would be cool to adapt the jQuery UI autocomplete plugin to search against the list markup so you could hand-write a list, add the auto-search plugin and as the user typed in the search box, the list would winnow down on the fly.

Supporting a way to filter against structured data would also be slick. For example I could add a toggle in the toolbar to only view flagged emails and, when pressed, it would look in the "aside" for the string 'flagged' and hide all items that dont' have this. This would require at least simple scoping to say where to look for the data -- could be any selector.

Adding client-side sorting of lists would be incredibly powerful. Anyone want to take a crack at this?

Base support divide on media queries?

something like...

$.support.media = $.media('screen and (min-width: 0)');

Also, investigate how MQ support aligns with our A / C browser divide. Perhaps we could require $.support.media for JS enhancements...?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.