diff --git a/.gitignore b/.gitignore index 31226a4..e125593 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ temp/ +*.DS_Store diff --git a/LICENSE b/LICENSE index 208b5c4..b6f6e27 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2013 Diego Netto +Copyright 2014 Diego Netto Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index 0c04ae1..73170f6 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,52 @@ -# generator-ionic [![Build Status](https://secure.travis-ci.org/diegonetto/generator-ionic.png?branch=master)](https://travis-ci.org/diegonetto/generator-ionic) +![](http://i.imgur.com/Cedw75X.png) -A generator for [Yeoman](http://yeoman.io). +# Ionic Framework generator +> Yeoman generator for Ionic - lets you quickly set up a hybrid mobile app project -## Getting Started - -### What is Yeoman? - -Trick question. It's not a thing. It's this guy: - -![](http://i.imgur.com/JHaAlBJ.png) - -Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create. - -Not every new computer comes with a Yeoman pre-installed. He lives in the [npm](https://npmjs.org) package repository. You only have to ask for him once, then he packs up and moves into your hard drive. *Make sure you clean up, he likes new and shiny things.* +**This is currently under active development.** +## Usage +Install [Cordova CLI](http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html) ``` -$ npm install -g yo +npm install -g cordova ``` -### Yeoman Generators - -Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension. - -To install generator-ionic from npm, run: - +Install `generator-ionic`: ``` -$ npm install -g generator-ionic +npm install -g generator-ionic ``` -Finally, initiate the generator: - +Make a new directory, and `cd` into it: ``` -$ yo ionic +mkdir my-ionic-project && cd $_ ``` -### Getting To Know Yeoman - -Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. +Run `yo ionic` +``` +yo ionic +``` -If you'd like to get to know Yeoman better and meet some of his friends, [Grunt](http://gruntjs.com) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started). +Spin up a `connect` server with `watch` and `livereload` for developing in a browser +``` +grunt serve +``` +## TODO +1. Building / Emulating doc section +2. Better starting app using SideBar and a few other components +3. Workflow doc section +4. SCSS / LESS support prompt options +5. Decide if we should use imagemin + svgmin +6. Add testing support using Karma and integrate with Grunt +7. Consider pulling in generator-angular as a subgenerator +8. Add Mocha generator unit tests +9. Contributing doc section + +## Thanks +Special thanks to the following projects for inspiration: +1. [AngularJS Generator](https://github.com/yeoman/generator-angular) +2. [Ionic Seed Project](https://github.com/driftyco/ionic-angular-cordova-seed) ## License diff --git a/app/index.js b/app/index.js index 6e60f90..502a4b3 100644 --- a/app/index.js +++ b/app/index.js @@ -1,12 +1,23 @@ 'use strict'; var util = require('util'); +var fs = require('fs'); var path = require('path'); +var spawn = require('child_process').spawn; var yeoman = require('yeoman-generator'); +var mout = require('mout').string; +var chalk = require('chalk'); +var xml2js = require('xml2js'); var IonicGenerator = module.exports = function IonicGenerator(args, options, config) { yeoman.generators.Base.apply(this, arguments); + this.argument('appName', { type: String, required: false }); + this.appName = this.appName || path.basename(process.cwd()); + this.appName = mout.pascalCase(this.appName); + this.appPath = 'app'; + this.root = process.cwd(); + this.on('end', function () { this.installDependencies({ skipInstall: options['skip-install'] }); }); @@ -16,35 +27,63 @@ var IonicGenerator = module.exports = function IonicGenerator(args, options, con util.inherits(IonicGenerator, yeoman.generators.Base); -IonicGenerator.prototype.askFor = function askFor() { - var cb = this.async(); +IonicGenerator.prototype.cordovaInit = function cordovaInit() { + var done = this.async(); - // have Yeoman greet the user. - console.log(this.yeoman); + var cordova = spawn('cordova', ['create', '.', 'com.ionicframework.' + mout.camelCase(this.appName), this.appName]) + cordova.stdout.on('data', function(data) { + console.log(chalk.yellow(data.toString('utf8'))); + }); + cordova.stderr.on('data', function(data) { + console.log(chalk.red(data.toString('utf8'))); + }); + cordova.on('close', function(code) { + done(); + }); +}; - var prompts = [{ - type: 'confirm', - name: 'someOption', - message: 'Would you like to enable this option?', - default: true - }]; +IonicGenerator.prototype.setupEnv = function setupEnv() { + // Copies the contents of the generator example app + // directory into your users new application path + this.sourceRoot(path.join(__dirname, '../templates/')); + this.directory('common/root', '.', true); +}; - this.prompt(prompts, function (props) { - this.someOption = props.someOption; +IonicGenerator.prototype.packageFiles = function packageFiles() { + this.template('common/_bower.json', 'bower.json'); + this.template('common/_bowerrc', '.bowerrc'); + this.template('common/_package.json', 'package.json'); + this.template('common/Gruntfile.js', 'Gruntfile.js'); + this.template('common/_gitignore', '.gitignore'); +}; - cb(); - }.bind(this)); +IonicGenerator.prototype.appFiles = function appFiles() { + this.template('javascript/app.js', 'app/scripts/app.js'); + this.template('javascript/controllers.js', 'app/scripts/controllers.js'); + this.template('javascript/services.js', 'app/scripts/services.js'); + this.template('views/index.html', 'app/index.html'); }; -IonicGenerator.prototype.app = function app() { - this.mkdir('app'); - this.mkdir('app/templates'); +IonicGenerator.prototype.updateCordovaConfig = function updateCordovaConfig() { + console.log(chalk.yellow('Attemping to overwrite Cordova generated files with example app skeleton.')); + console.log(chalk.yellow('Type "y" and hit Enter to confirm overwrites:')); + var parser = new xml2js.Parser({ normalize: true }); + var builder = new xml2js.Builder(); + var configPath = path.join(this.root, 'config.xml'); + var done = this.async(); - this.copy('_package.json', 'package.json'); - this.copy('_bower.json', 'bower.json'); + fs.readFile(configPath, function(err, data) { + parser.parseString(data, function(err, config) { + config.widget.preference = [ + { '$': { name: 'fullscreen', value: 'true' } }, + { '$': { name: 'webviewbounce', value: 'false' } }, + { '$': { name: 'UIWebViewBounce', value: 'false' } }, + { '$': { name: 'DisallowOverscroll', value: 'true' } } + ]; + this.write(configPath, builder.buildObject(config)); + done(); + }.bind(this)); + }.bind(this)); }; -IonicGenerator.prototype.projectfiles = function projectfiles() { - this.copy('editorconfig', '.editorconfig'); - this.copy('jshintrc', '.jshintrc'); -}; + diff --git a/app/templates/_bower.json b/app/templates/_bower.json deleted file mode 100644 index 2b4eb38..0000000 --- a/app/templates/_bower.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "package", - "version": "0.0.0", - "dependencies": {} -} - diff --git a/app/templates/_package.json b/app/templates/_package.json deleted file mode 100644 index fba8e01..0000000 --- a/app/templates/_package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "package", - "version": "0.0.0", - "dependencies": {} -} diff --git a/package.json b/package.json index e0c94d9..5d05117 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,16 @@ { "name": "generator-ionic", - "version": "0.0.0", - "description": "A generator for Yeoman", + "version": "0.0.1", + "description": "A generator for the Ionic Framework", "keywords": [ - "yeoman-generator" + "yeoman-generator", + "ionic", + "framework", + "ionicframework", + "angularjs", + "hybrid", + "mobile", + "app" ], "homepage": "https://github.com/diegonetto/generator-ionic", "bugs": "https://github.com/diegonetto/generator-ionic/issues", @@ -21,7 +28,10 @@ "test": "mocha" }, "dependencies": { - "yeoman-generator": "~0.14.0" + "yeoman-generator": "~0.14.0", + "xml2js": "~0.4.1", + "mout": "~0.9.0", + "chalk": "~0.4.0" }, "devDependencies": { "mocha": "~1.14.0" diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js new file mode 100644 index 0000000..01fb8df --- /dev/null +++ b/templates/common/Gruntfile.js @@ -0,0 +1,268 @@ +// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %> +'use strict'; + +module.exports = function (grunt) { + + // Load grunt tasks automatically + require('load-grunt-tasks')(grunt); + + // Time how long tasks take. Can help when optimizing build times + require('time-grunt')(grunt); + + // Define the configuration for all the tasks + grunt.initConfig({ + + // Project settings + yeoman: { + // configurable paths + app: 'app', + }, + + // Watches files for changes and runs tasks based on the changed files + watch: { + js: { + files: ['<%%= yeoman.app %>/scripts/{,*/}*.js'], + tasks: ['newer:jshint:all'], + options: { + livereload: true + } + }, + jsTest: { + files: ['test/spec/{,*/}*.js'], + tasks: ['newer:jshint:test', 'karma'] + }, + styles: { + files: ['<%%= yeoman.app %>/styles/{,*/}*.css'], + tasks: ['newer:copy:styles'] + }, + gruntfile: { + files: ['Gruntfile.js'] + }, + livereload: { + options: { + livereload: '<%%= connect.options.livereload %>' + }, + files: [ + '<%%= yeoman.app %>/{,*/}*.html', + '.tmp/styles/{,*/}*.css', + '<%%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' + ] + } + }, + + // The actual grunt server settings + connect: { + options: { + port: 9000, + // Change this to '0.0.0.0' to access the server from outside. + hostname: 'localhost', + livereload: 35729 + }, + livereload: { + options: { + open: true, + base: [ + '.tmp', + '<%%= yeoman.app %>' + ] + } + }, + dist: { + options: { + base: 'www' + } + } + }, + + // Make sure code styles are up to par and there are no obvious mistakes + jshint: { + options: { + jshintrc: '.jshintrc', + reporter: require('jshint-stylish') + }, + all: [ + 'Gruntfile.js' + ] + }, + + // Empties folders to start fresh + clean: { + dist: { + files: [{ + dot: true, + src: [ + '.tmp', + 'www/*', + '!www/.git*' + ] + }] + }, + server: '.tmp' + }, + + // Automatically inject Bower components into the app + 'bower-install': { + app: { + html: '<%%= yeoman.app %>/index.html', + ignorePath: '<%%= yeoman.app %>/' + } + }, + + // Reads HTML for usemin blocks to enable smart builds that automatically + // concat, minify and revision files. Creates configurations in memory so + // additional tasks can operate on them + useminPrepare: { + html: '<%%= yeoman.app %>/index.html', + options: { + dest: 'www', + flow: { + html: { + steps: { + js: ['concat', 'uglifyjs'], + css: ['cssmin'] + }, + post: {} + } + } + } + }, + + // Performs rewrites based on the useminPrepare configuration + usemin: { + html: ['www/{,*/}*.html'], + css: ['www/styles/{,*/}*.css'], + options: { + assetsDirs: ['www'] + } + }, + + // The following *-min tasks produce minified files in the dist folder + cssmin: { + options: { + root: '<%%= yeoman.app %>' + } + }, + htmlmin: { + dist: { + options: { + collapseWhitespace: true, + collapseBooleanAttributes: true, + removeCommentsFromCDATA: true, + removeOptionalTags: true + }, + files: [{ + expand: true, + cwd: 'www', + src: ['*.html', 'views/{,*/}*.html'], + dest: 'www' + }] + } + }, + + // Copies remaining files to places other tasks can use + copy: { + dist: { + files: [{ + expand: true, + dot: true, + cwd: '<%%= yeoman.app %>', + dest: 'www', + src: [ + '*.{ico,png,txt}', + '.htaccess', + '*.html', + 'views/{,*/}*.html', + 'bower_components/**/*', + 'images/{,*/}*.{webp}', + 'fonts/*' + ] + }, { + expand: true, + cwd: '.tmp/images', + dest: 'www/images', + src: ['generated/*'] + }] + }, + styles: { + expand: true, + cwd: '<%%= yeoman.app %>/styles', + dest: '.tmp/styles/', + src: '{,*/}*.css' + } + }, + + // By default, your `index.html`'s will take care of + // minification. These next options are pre-configured if you do not wish + // to use the Usemin blocks. + // cssmin: { + // dist: { + // files: { + // 'www/styles/main.css': [ + // '.tmp/styles/{,*/}*.css', + // '<%%= yeoman.app %>/styles/{,*/}*.css' + // ] + // } + // } + // }, + // uglify: { + // dist: { + // files: { + // 'www/scripts/scripts.js': [ + // 'www/scripts/scripts.js' + // ] + // } + // } + // }, + // concat: { + // dist: {} + // }, + + // ngmin tries to make the code safe for minification automatically by + // using the Angular long form for dependency injection. It doesn't work on + // things like resolve or inject so those have to be done manually. + ngmin: { + dist: { + files: [{ + expand: true, + cwd: '.tmp/concat/scripts', + src: '*.js', + dest: '.tmp/concat/scripts' + }] + } + } + + }); + + + grunt.registerTask('serve', function (target) { + if (target === 'dist') { + return grunt.task.run(['build', 'connect:dist:keepalive']); + } + + grunt.task.run([ + 'clean:server', + 'bower-install', + 'copy:styles', + 'connect:livereload', + 'watch' + ]); + }); + + grunt.registerTask('build', [ + 'clean:dist', + 'bower-install', + 'useminPrepare', + 'copy:styles', + 'concat', + 'copy:dist', + 'cssmin', + 'uglify', + 'usemin', + 'htmlmin' + ]); + + grunt.registerTask('default', [ + 'newer:jshint', + 'build' + ]); +}; diff --git a/templates/common/_bower.json b/templates/common/_bower.json new file mode 100644 index 0000000..3da90e8 --- /dev/null +++ b/templates/common/_bower.json @@ -0,0 +1,8 @@ +{ + "name": "<%= appName %>", + "version": "0.0.0", + "dependencies": { + "ionic": "~0.9.25" + } +} + diff --git a/templates/common/_bowerrc b/templates/common/_bowerrc new file mode 100644 index 0000000..acec9ae --- /dev/null +++ b/templates/common/_bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "<%= appPath %>/bower_components" +} diff --git a/templates/common/_gitignore b/templates/common/_gitignore new file mode 100644 index 0000000..bbd6a6f --- /dev/null +++ b/templates/common/_gitignore @@ -0,0 +1,6 @@ +node_modules +www +.tmp +.sass-cache +.DS_Store +<%= appPath %>/bower_components diff --git a/templates/common/_package.json b/templates/common/_package.json new file mode 100644 index 0000000..49ae22f --- /dev/null +++ b/templates/common/_package.json @@ -0,0 +1,27 @@ +{ + "name": "<%= appName %>", + "version": "0.0.0", + "dependencies": {}, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-bower-install": "~0.7.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-connect": "~0.5.0", + "grunt-contrib-copy": "~0.4.1", + "grunt-contrib-cssmin": "~0.7.0", + "grunt-contrib-htmlmin": "~0.1.3", + "grunt-contrib-jshint": "~0.7.1", + "grunt-contrib-uglify": "~0.2.0", + "grunt-contrib-watch": "~0.5.2", + "grunt-newer": "~0.6.1", + "grunt-usemin": "~2.0.0", + "grunt-ngmin": "~0.0.2", + "jshint-stylish": "~0.1.3", + "load-grunt-tasks": "~0.2.0", + "time-grunt": "~0.2.1" + }, + "engines": { + "node": ">=0.10.0" + } +} diff --git a/app/templates/editorconfig b/templates/common/root/.editorconfig similarity index 100% rename from app/templates/editorconfig rename to templates/common/root/.editorconfig diff --git a/app/templates/jshintrc b/templates/common/root/.jshintrc similarity index 95% rename from app/templates/jshintrc rename to templates/common/root/.jshintrc index fa51fc3..da64b6e 100644 --- a/app/templates/jshintrc +++ b/templates/common/root/.jshintrc @@ -6,7 +6,7 @@ "curly": true, "eqeqeq": true, "immed": true, - "indent": 4, + "indent": 2, "latedef": true, "newcap": true, "noarg": true, diff --git a/templates/common/root/app/img/ionic.png b/templates/common/root/app/img/ionic.png new file mode 100644 index 0000000..21c7f37 Binary files /dev/null and b/templates/common/root/app/img/ionic.png differ diff --git a/templates/common/root/app/res/icon/android/icon-36-ldpi.png b/templates/common/root/app/res/icon/android/icon-36-ldpi.png new file mode 100644 index 0000000..cd5032a Binary files /dev/null and b/templates/common/root/app/res/icon/android/icon-36-ldpi.png differ diff --git a/templates/common/root/app/res/icon/android/icon-48-mdpi.png b/templates/common/root/app/res/icon/android/icon-48-mdpi.png new file mode 100644 index 0000000..e79c606 Binary files /dev/null and b/templates/common/root/app/res/icon/android/icon-48-mdpi.png differ diff --git a/templates/common/root/app/res/icon/android/icon-72-hdpi.png b/templates/common/root/app/res/icon/android/icon-72-hdpi.png new file mode 100644 index 0000000..4d27634 Binary files /dev/null and b/templates/common/root/app/res/icon/android/icon-72-hdpi.png differ diff --git a/templates/common/root/app/res/icon/android/icon-96-xhdpi.png b/templates/common/root/app/res/icon/android/icon-96-xhdpi.png new file mode 100644 index 0000000..ec7ffbf Binary files /dev/null and b/templates/common/root/app/res/icon/android/icon-96-xhdpi.png differ diff --git a/templates/common/root/app/res/icon/bada-wac/icon-48-type5.png b/templates/common/root/app/res/icon/bada-wac/icon-48-type5.png new file mode 100644 index 0000000..8ad8bac Binary files /dev/null and b/templates/common/root/app/res/icon/bada-wac/icon-48-type5.png differ diff --git a/templates/common/root/app/res/icon/bada-wac/icon-50-type3.png b/templates/common/root/app/res/icon/bada-wac/icon-50-type3.png new file mode 100644 index 0000000..c6ddf84 Binary files /dev/null and b/templates/common/root/app/res/icon/bada-wac/icon-50-type3.png differ diff --git a/templates/common/root/app/res/icon/bada-wac/icon-80-type4.png b/templates/common/root/app/res/icon/bada-wac/icon-80-type4.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/templates/common/root/app/res/icon/bada-wac/icon-80-type4.png differ diff --git a/templates/common/root/app/res/icon/bada/icon-128.png b/templates/common/root/app/res/icon/bada/icon-128.png new file mode 100644 index 0000000..3516df3 Binary files /dev/null and b/templates/common/root/app/res/icon/bada/icon-128.png differ diff --git a/templates/common/root/app/res/icon/blackberry/icon-80.png b/templates/common/root/app/res/icon/blackberry/icon-80.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/templates/common/root/app/res/icon/blackberry/icon-80.png differ diff --git a/templates/common/root/app/res/icon/ios/icon-57-2x.png b/templates/common/root/app/res/icon/ios/icon-57-2x.png new file mode 100644 index 0000000..efd9c37 Binary files /dev/null and b/templates/common/root/app/res/icon/ios/icon-57-2x.png differ diff --git a/templates/common/root/app/res/icon/ios/icon-57.png b/templates/common/root/app/res/icon/ios/icon-57.png new file mode 100644 index 0000000..c795fc4 Binary files /dev/null and b/templates/common/root/app/res/icon/ios/icon-57.png differ diff --git a/templates/common/root/app/res/icon/ios/icon-72-2x.png b/templates/common/root/app/res/icon/ios/icon-72-2x.png new file mode 100644 index 0000000..dd819da Binary files /dev/null and b/templates/common/root/app/res/icon/ios/icon-72-2x.png differ diff --git a/templates/common/root/app/res/icon/ios/icon-72.png b/templates/common/root/app/res/icon/ios/icon-72.png new file mode 100644 index 0000000..b1cfde7 Binary files /dev/null and b/templates/common/root/app/res/icon/ios/icon-72.png differ diff --git a/templates/common/root/app/res/icon/tizen/icon-128.png b/templates/common/root/app/res/icon/tizen/icon-128.png new file mode 100644 index 0000000..3516df3 Binary files /dev/null and b/templates/common/root/app/res/icon/tizen/icon-128.png differ diff --git a/templates/common/root/app/res/icon/webos/icon-64.png b/templates/common/root/app/res/icon/webos/icon-64.png new file mode 100644 index 0000000..03b3849 Binary files /dev/null and b/templates/common/root/app/res/icon/webos/icon-64.png differ diff --git a/templates/common/root/app/res/icon/windows-phone/icon-173-tile.png b/templates/common/root/app/res/icon/windows-phone/icon-173-tile.png new file mode 100644 index 0000000..4f15e20 Binary files /dev/null and b/templates/common/root/app/res/icon/windows-phone/icon-173-tile.png differ diff --git a/templates/common/root/app/res/icon/windows-phone/icon-48.png b/templates/common/root/app/res/icon/windows-phone/icon-48.png new file mode 100644 index 0000000..8ad8bac Binary files /dev/null and b/templates/common/root/app/res/icon/windows-phone/icon-48.png differ diff --git a/templates/common/root/app/res/icon/windows-phone/icon-62-tile.png b/templates/common/root/app/res/icon/windows-phone/icon-62-tile.png new file mode 100644 index 0000000..aab6061 Binary files /dev/null and b/templates/common/root/app/res/icon/windows-phone/icon-62-tile.png differ diff --git a/templates/common/root/app/res/screen/android/screen-hdpi-landscape.png b/templates/common/root/app/res/screen/android/screen-hdpi-landscape.png new file mode 100644 index 0000000..a61e2b1 Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-hdpi-landscape.png differ diff --git a/templates/common/root/app/res/screen/android/screen-hdpi-portrait.png b/templates/common/root/app/res/screen/android/screen-hdpi-portrait.png new file mode 100644 index 0000000..5d6a28a Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-hdpi-portrait.png differ diff --git a/templates/common/root/app/res/screen/android/screen-ldpi-landscape.png b/templates/common/root/app/res/screen/android/screen-ldpi-landscape.png new file mode 100644 index 0000000..f3934cd Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-ldpi-landscape.png differ diff --git a/templates/common/root/app/res/screen/android/screen-ldpi-portrait.png b/templates/common/root/app/res/screen/android/screen-ldpi-portrait.png new file mode 100644 index 0000000..65ad163 Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-ldpi-portrait.png differ diff --git a/templates/common/root/app/res/screen/android/screen-mdpi-landscape.png b/templates/common/root/app/res/screen/android/screen-mdpi-landscape.png new file mode 100644 index 0000000..a1b697c Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-mdpi-landscape.png differ diff --git a/templates/common/root/app/res/screen/android/screen-mdpi-portrait.png b/templates/common/root/app/res/screen/android/screen-mdpi-portrait.png new file mode 100644 index 0000000..ea15693 Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-mdpi-portrait.png differ diff --git a/templates/common/root/app/res/screen/android/screen-xhdpi-landscape.png b/templates/common/root/app/res/screen/android/screen-xhdpi-landscape.png new file mode 100644 index 0000000..79f2f09 Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-xhdpi-landscape.png differ diff --git a/templates/common/root/app/res/screen/android/screen-xhdpi-portrait.png b/templates/common/root/app/res/screen/android/screen-xhdpi-portrait.png new file mode 100644 index 0000000..c2e8042 Binary files /dev/null and b/templates/common/root/app/res/screen/android/screen-xhdpi-portrait.png differ diff --git a/templates/common/root/app/res/screen/bada-wac/screen-type3.png b/templates/common/root/app/res/screen/bada-wac/screen-type3.png new file mode 100644 index 0000000..ea15693 Binary files /dev/null and b/templates/common/root/app/res/screen/bada-wac/screen-type3.png differ diff --git a/templates/common/root/app/res/screen/bada-wac/screen-type4.png b/templates/common/root/app/res/screen/bada-wac/screen-type4.png new file mode 100644 index 0000000..5d6a28a Binary files /dev/null and b/templates/common/root/app/res/screen/bada-wac/screen-type4.png differ diff --git a/templates/common/root/app/res/screen/bada-wac/screen-type5.png b/templates/common/root/app/res/screen/bada-wac/screen-type5.png new file mode 100644 index 0000000..bd64f76 Binary files /dev/null and b/templates/common/root/app/res/screen/bada-wac/screen-type5.png differ diff --git a/templates/common/root/app/res/screen/bada/screen-portrait.png b/templates/common/root/app/res/screen/bada/screen-portrait.png new file mode 100644 index 0000000..5d6a28a Binary files /dev/null and b/templates/common/root/app/res/screen/bada/screen-portrait.png differ diff --git a/templates/common/root/app/res/screen/blackberry/screen-225.png b/templates/common/root/app/res/screen/blackberry/screen-225.png new file mode 100644 index 0000000..29873e9 Binary files /dev/null and b/templates/common/root/app/res/screen/blackberry/screen-225.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-ipad-landscape-2x.png b/templates/common/root/app/res/screen/ios/screen-ipad-landscape-2x.png new file mode 100644 index 0000000..95c542d Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-ipad-landscape-2x.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-ipad-landscape.png b/templates/common/root/app/res/screen/ios/screen-ipad-landscape.png new file mode 100644 index 0000000..04be5ac Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-ipad-landscape.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-ipad-portrait-2x.png b/templates/common/root/app/res/screen/ios/screen-ipad-portrait-2x.png new file mode 100644 index 0000000..aae1862 Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-ipad-portrait-2x.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-ipad-portrait.png b/templates/common/root/app/res/screen/ios/screen-ipad-portrait.png new file mode 100644 index 0000000..41e839d Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-ipad-portrait.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-iphone-landscape-2x.png b/templates/common/root/app/res/screen/ios/screen-iphone-landscape-2x.png new file mode 100644 index 0000000..0165669 Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-iphone-landscape-2x.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-iphone-landscape.png b/templates/common/root/app/res/screen/ios/screen-iphone-landscape.png new file mode 100644 index 0000000..d154883 Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-iphone-landscape.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-iphone-portrait-2x.png b/templates/common/root/app/res/screen/ios/screen-iphone-portrait-2x.png new file mode 100644 index 0000000..bd24886 Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-iphone-portrait-2x.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-iphone-portrait-568h-2x.png b/templates/common/root/app/res/screen/ios/screen-iphone-portrait-568h-2x.png new file mode 100644 index 0000000..10ed683 Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-iphone-portrait-568h-2x.png differ diff --git a/templates/common/root/app/res/screen/ios/screen-iphone-portrait.png b/templates/common/root/app/res/screen/ios/screen-iphone-portrait.png new file mode 100644 index 0000000..6fcba56 Binary files /dev/null and b/templates/common/root/app/res/screen/ios/screen-iphone-portrait.png differ diff --git a/templates/common/root/app/res/screen/tizen/README.md b/templates/common/root/app/res/screen/tizen/README.md new file mode 100644 index 0000000..3a0d6fe --- /dev/null +++ b/templates/common/root/app/res/screen/tizen/README.md @@ -0,0 +1,3 @@ +# Tizen Splash Screen + +Splash screens are unsupported on the Tizen platform. diff --git a/templates/common/root/app/res/screen/webos/screen-64.png b/templates/common/root/app/res/screen/webos/screen-64.png new file mode 100644 index 0000000..03b3849 Binary files /dev/null and b/templates/common/root/app/res/screen/webos/screen-64.png differ diff --git a/templates/common/root/app/res/screen/windows-phone/screen-portrait.jpg b/templates/common/root/app/res/screen/windows-phone/screen-portrait.jpg new file mode 100644 index 0000000..479d3e4 Binary files /dev/null and b/templates/common/root/app/res/screen/windows-phone/screen-portrait.jpg differ diff --git a/templates/common/root/app/styles/main.css b/templates/common/root/app/styles/main.css new file mode 100644 index 0000000..d2783e4 --- /dev/null +++ b/templates/common/root/app/styles/main.css @@ -0,0 +1,8 @@ +/* Your app's CSS, go crazy, make it your own */ + +.ionic-logo { + display: block; + margin: 15px auto; + width: 96px; + height: 96px; +} diff --git a/templates/common/root/app/templates/about.html b/templates/common/root/app/templates/about.html new file mode 100644 index 0000000..91b13ae --- /dev/null +++ b/templates/common/root/app/templates/about.html @@ -0,0 +1,33 @@ + + + + +

+ This is a sample seed project for the Ionic Framework. Please cut it up and make it your own. + Check out the docs + for more info. +

+

+ Questions? Hit up the + forum. +

+

+ Find a bug? Create an + issue. +

+

+ What to help improve Ionic? + Contribute. +

+

+ Stay up-to-date with the Ionic + newsletter and + twitter account. +

+

+ MIT Licensed. Happy coding. +

+
+
diff --git a/templates/common/root/app/templates/adopt.html b/templates/common/root/app/templates/adopt.html new file mode 100644 index 0000000..ddd3eb8 --- /dev/null +++ b/templates/common/root/app/templates/adopt.html @@ -0,0 +1,19 @@ + + + +
+ + + Subscribe To Newsletter + +
+
+
diff --git a/templates/common/root/app/templates/pet-detail.html b/templates/common/root/app/templates/pet-detail.html new file mode 100644 index 0000000..061c756 --- /dev/null +++ b/templates/common/root/app/templates/pet-detail.html @@ -0,0 +1,12 @@ + + + +

{{ pet.description }}

+

All Pets

+
+
diff --git a/templates/common/root/app/templates/pet-index.html b/templates/common/root/app/templates/pet-index.html new file mode 100644 index 0000000..02b456e --- /dev/null +++ b/templates/common/root/app/templates/pet-index.html @@ -0,0 +1,19 @@ + + + + + + + +

{{pet.title}}

+

{{pet.description}}

+
+ +
+ +
+
diff --git a/templates/common/root/app/templates/tabs.html b/templates/common/root/app/templates/tabs.html new file mode 100644 index 0000000..a0fb93b --- /dev/null +++ b/templates/common/root/app/templates/tabs.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/javascript/app.js b/templates/javascript/app.js new file mode 100644 index 0000000..dc9d9c0 --- /dev/null +++ b/templates/javascript/app.js @@ -0,0 +1,64 @@ + + +angular.module('<%= appName %>', ['ionic', '<%= appName %>.services', '<%= appName %>.controllers']) + + +.config(function($stateProvider, $urlRouterProvider) { + + // Ionic uses AngularUI Router which uses the concept of states + // Learn more here: https://github.com/angular-ui/ui-router + // Set up the various states which the app can be in. + // Each state's controller can be found in controllers.js + $stateProvider + + // setup an abstract state for the tabs directive + .state('tab', { + url: "/tab", + abstract: true, + templateUrl: "templates/tabs.html" + }) + + // the pet tab has its own child nav-view and history + .state('tab.pet-index', { + url: '/pets', + views: { + 'pets-tab': { + templateUrl: 'templates/pet-index.html', + controller: 'PetIndexCtrl' + } + } + }) + + .state('tab.pet-detail', { + url: '/pet/:petId', + views: { + 'pets-tab': { + templateUrl: 'templates/pet-detail.html', + controller: 'PetDetailCtrl' + } + } + }) + + .state('tab.adopt', { + url: '/adopt', + views: { + 'adopt-tab': { + templateUrl: 'templates/adopt.html' + } + } + }) + + .state('tab.about', { + url: '/about', + views: { + 'about-tab': { + templateUrl: 'templates/about.html' + } + } + }); + + // if none of the above states are matched, use this as the fallback + $urlRouterProvider.otherwise('/tab/pets'); + +}); + diff --git a/templates/javascript/controllers.js b/templates/javascript/controllers.js new file mode 100644 index 0000000..f0f36b8 --- /dev/null +++ b/templates/javascript/controllers.js @@ -0,0 +1,15 @@ +angular.module('<%= appName %>.controllers', []) + + +// A simple controller that fetches a list of data from a service +.controller('PetIndexCtrl', function($scope, PetService) { + // "Pets" is a service returning mock data (services.js) + $scope.pets = PetService.all(); +}) + + +// A simple controller that shows a tapped item's data +.controller('PetDetailCtrl', function($scope, $stateParams, PetService) { + // "Pets" is a service returning mock data (services.js) + $scope.pet = PetService.get($stateParams.petId); +}); diff --git a/templates/javascript/services.js b/templates/javascript/services.js new file mode 100644 index 0000000..51bf64f --- /dev/null +++ b/templates/javascript/services.js @@ -0,0 +1,26 @@ +angular.module('<%= appName %>.services', []) + +/** + * A simple example service that returns some data. + */ +.factory('PetService', function() { + // Might use a resource here that returns a JSON array + + // Some fake testing data + var pets = [ + { id: 0, title: 'Cats', description: 'Furry little creatures. Obsessed with plotting assassination, but never following through on it.' }, + { id: 1, title: 'Dogs', description: 'Lovable. Loyal almost to a fault. Smarter than they let on.' }, + { id: 2, title: 'Turtles', description: 'Everyone likes turtles.' }, + { id: 3, title: 'Sharks', description: 'An advanced pet. Needs millions of gallons of salt water. Will happily eat you.' } + ]; + + return { + all: function() { + return pets; + }, + get: function(petId) { + // Simple index lookup + return pets[petId]; + } + } +}); diff --git a/templates/views/index.html b/templates/views/index.html new file mode 100644 index 0000000..1ad885e --- /dev/null +++ b/templates/views/index.html @@ -0,0 +1,59 @@ + + + + + + "<%= appName %>" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +