/ember-preloader

A Preloader for ambitious web applications.

Primary LanguageCSSMIT LicenseMIT

Gemnasium Status

A Preloader for ambitious web applications.

Installation

Run bower install bitaculous/ember-preloader.

Run npm install bitaculous/ember-preloader.

Usage

  1. Include Ember Preloader Cascading Style Sheets

  2. Include Ember Preloader JavaScript

  3. Create a manifest, which specifies what and when to load

    manifest =
      files: [
        {
          'id': 'ambitious.css'
          'type': 'css'
          'src': '/assets/stylesheets/ambitious.css'
        }
    
        {
          'id': 'ambitious.png'
          'type': 'image'
          'src': '/assets/images/ambitious.png'
        }
    
        {
          'id': 'ambitious.js'
          'type': 'javascript'
          'src': '/assets/javascripts/ambitious.js'
        }
      ]
    
      media: [
        {
          # Small, beginning at 320 until 480px
          slug: 'small'
          query: '(min-width: 320px) and (max-width: 480px)'
          files: [
            {
              'id': 'ambitious.png'
              'type': 'image'
              'src': '/assets/images/small/ambitious.png'
            }
          ]
        }
    
        {
          # Large, beginning at 1024px
          slug: 'large'
          query: '(min-width: 1024px)'
          files: [
            {
              'id': 'ambitious.png'
              'type': 'image'
              'src': '/assets/images/large/ambitious.png'
            }
          ]
        }
      ]
  4. Configure and launch Ember Preloader

    selector = '.preloader'
    
    preloader = new Preloader selector, manifest,
      before: ->
        console.info 'Preloading application...'
    
        return
      complete: ->
        console.info 'Preloaded application.'
    
        return
      logging: true

    or

    selector = '.preloader'
    
    preloader = new Preloader selector, null,
      before: ->
        console.info 'Preloading application...'
    
        return
      complete: ->
        console.info 'Preloaded application.'
    
        return
      logging: true
    
    preloader.load manifest

Development

Prerequisites

Installation

  1. Run bundle to install all dependencies with Bundler

  2. Run bower install to install all dependencies with Bower

Usage

  1. Boot up Middleman
$ ./bin/middleman/server

or

$ middleman --verbose
  1. Open your Web browser at http://0.0.0.0:4567 and start hacking

Building Ember Preloader

Run middleman build or middleman build --verbose.

Bug Reports

Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems here.

Versioning

This library aims to adhere to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, that version should be immediately yanked and / or a new version should be immediately released that restores compatibility.

Credits

Ember Preloader uses the following libraries:

JavaScript

License

Ember Preloader is released under the MIT License (MIT), see LICENSE.