Giter Club home page Giter Club logo

app's Introduction

App.js - mobile webapps made easy

App.js is a lightweight JavaScript UI library for creating mobile webapps that behave like native apps, sacrificing neither performance nor polish.

  • cross-platform (Android 2.2+, iOS 4.3+)
  • themable platform-specific UI designs
  • configurable native-like transitions
  • automatically managed navigation stack
  • built-in widgets for general use-cases

The goal of App.js is to provide a robust starting point for mobile webapps, handling general scenarios, and maintaining compatiblity with other common JavaScript libraries.

Check out the documentation here

Usage

$ bower install kik-app --save

Reference kik-app.js from your application, f.ex from index.html

<script type="text/javascript" src="/bower_components/kik-app/kik-app.js"></script>

Also reference the styles like this:

<script type="text/javascript" src="/bower_components/kik-app/dist/app.css"></script>

Stylesheets

default.css (same as app.css), includes inline css images base.css excludes inline images and is useful for testing

Build

Simply concatenate all the files:

cat src/*.js src/lib/*.js > kik-app.js

Integration with popular Javascript MVC frameworks

To integrate with an MVC framework such as Ember.js or Angular.js:

Have your router (or some other "action controller" function or object) call the respective KikApp page controller to do a page transition.

Have a template of some sort

<div class="app-page" data-page="contact">
  <div class="app-topbar">
    <div class="app-title">Contact</div>
  </div>
  <div class="app-content">
    <div class="first-name">{{firstName}}</div>
    <div class="last-name">{{lastName}}</div>
  </div>
</div>
App.controller('contact', function (page) {
  // Leave it to Ember and handlebars to do the templating
  // $(page).find('.first-name').text(contact.firstName);
  // $(page).find('.last-name' ).text(contact.lastName );
});
From https://gist.github.com/cavneb/26c4a12b1f77ae868232

import Ember from 'ember';

export default Ember.Route.extend({
  model: function() {
    return this.store.find('contact');
  },

  actions: {
    refresh: function() {
      Ember.run.later(this, function() {
      	// get some data

        this.store.find('contact').then(function(data) {

          // will cause the template to be evaluate and the mustaches {{}} 
          // updated to reflect the incoming controller data
          this.controller.set('content', data); 

          // Transition to the page and make it visible (and on top?)!
          App.load('contact');

        }.bind(this));
      }, 100);
    }
  }
});

The above route should of course be generalized in some manner...

Easy as pie ;)

app's People

Contributors

chilibeck avatar jackread avatar jairajs89 avatar kristianmandrup avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.