diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-18 15:34:57 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-18 15:34:57 -0400 |
| commit | 1ecde45f88fa9a7a54a9a6fd8a398f3f4a8481de (patch) | |
| tree | ed0e14d0737a7361405584f93c757921513cac4d /www/lib | |
| parent | 845f1ed928838bc8c3694dc0235614f28facad89 (diff) | |
pullup view in events to show event summaries across monitors
Diffstat (limited to 'www/lib')
80 files changed, 1297 insertions, 0 deletions
diff --git a/www/lib/ionic-pullup/.bower.json b/www/lib/ionic-pullup/.bower.json new file mode 100644 index 00000000..3db1e838 --- /dev/null +++ b/www/lib/ionic-pullup/.bower.json @@ -0,0 +1,21 @@ +{ + "name": "ionic-pullup", + "description": "Ionic pull up footer", + "version": "1.0.2", + "homepage": "https://github.com/arielfaur", + "license": "MIT", + "private": false, + "devDependencies": { + "ionic": "~1.0.x" + }, + "_release": "1.0.2", + "_resolution": { + "type": "version", + "tag": "v1.0.2", + "commit": "a7b943729c363d736df346a92d26f5c4f20661ee" + }, + "_source": "git://github.com/arielfaur/ionic-pullup.git", + "_target": "~1.0.2", + "_originalSource": "ionic-pullup", + "_direct": true +}
\ No newline at end of file diff --git a/www/lib/ionic-pullup/.bowerrc b/www/lib/ionic-pullup/.bowerrc new file mode 100644 index 00000000..baa91a3e --- /dev/null +++ b/www/lib/ionic-pullup/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +}
\ No newline at end of file diff --git a/www/lib/ionic-pullup/.gitignore b/www/lib/ionic-pullup/.gitignore new file mode 100644 index 00000000..b702acc6 --- /dev/null +++ b/www/lib/ionic-pullup/.gitignore @@ -0,0 +1,7 @@ +logs/* +!.gitkeep +node_modules/ +bower_components/ +tmp +.DS_Store +.idea
\ No newline at end of file diff --git a/www/lib/ionic-pullup/.jshintrc b/www/lib/ionic-pullup/.jshintrc new file mode 100644 index 00000000..6f00218e --- /dev/null +++ b/www/lib/ionic-pullup/.jshintrc @@ -0,0 +1,13 @@ +{ + "globalstrict": true, + "globals": { + "angular": false, + "describe": false, + "it": false, + "expect": false, + "beforeEach": false, + "afterEach": false, + "module": false, + "inject": false + } +}
\ No newline at end of file diff --git a/www/lib/ionic-pullup/.travis.yml b/www/lib/ionic-pullup/.travis.yml new file mode 100644 index 00000000..cce5c682 --- /dev/null +++ b/www/lib/ionic-pullup/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +node_js: + - "0.10" + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - npm start > /dev/null & + - npm run update-webdriver + - sleep 1 # give server time to start + +script: + - node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox + - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox diff --git a/www/lib/ionic-pullup/CHANGELOG.md b/www/lib/ionic-pullup/CHANGELOG.md new file mode 100644 index 00000000..db8c9db9 --- /dev/null +++ b/www/lib/ionic-pullup/CHANGELOG.md @@ -0,0 +1,13 @@ +# v1.0.2 + +## Breaking change +Removed ```minimize``` attribute from ```ion-pull-up-footer``` directive and added two new attributes for better behavior + +- initial-state: "collapsed" || "minimized" +- default-behavior: "expand" || "hide" + +# v1.0.1 +fixed DI issue in ```ion-pull-up-footer``` controller + +# v1.0.0 +Initial release
\ No newline at end of file diff --git a/www/lib/ionic-pullup/LICENSE b/www/lib/ionic-pullup/LICENSE new file mode 100644 index 00000000..9ced3319 --- /dev/null +++ b/www/lib/ionic-pullup/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2010-2014 Google, Inc. http://angularjs.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/www/lib/ionic-pullup/README.md b/www/lib/ionic-pullup/README.md new file mode 100644 index 00000000..5181a87d --- /dev/null +++ b/www/lib/ionic-pullup/README.md @@ -0,0 +1 @@ +See project [website](http://arielfaur.github.io/ionic-pullup) for documentation and demo
\ No newline at end of file diff --git a/www/lib/ionic-pullup/bower.json b/www/lib/ionic-pullup/bower.json new file mode 100644 index 00000000..f98158c4 --- /dev/null +++ b/www/lib/ionic-pullup/bower.json @@ -0,0 +1,11 @@ +{ + "name": "ionic-pullup", + "description": "Ionic pull up footer", + "version": "1.0.2", + "homepage": "https://github.com/arielfaur", + "license": "MIT", + "private": false, + "devDependencies": { + "ionic": "~1.0.x" + } +} diff --git a/www/lib/ionic-pullup/dist/ion-pullup.js b/www/lib/ionic-pullup/dist/ion-pullup.js new file mode 100644 index 00000000..c558cb93 --- /dev/null +++ b/www/lib/ionic-pullup/dist/ion-pullup.js @@ -0,0 +1,226 @@ +angular.module('ionic-pullup', []) + .constant('ionPullUpFooterState', { + COLLAPSED: 'COLLAPSED', + MINIMIZED: 'MINIMIZED', + EXPANDED: 'EXPANDED' + }) + .constant('ionPullUpFooterBehavior', { + HIDE: 'HIDE', + EXPAND: 'EXPAND' + }) + .directive('ionPullUpFooter', ['$timeout', '$rootScope', '$window', function($timeout, $rootScope, $window) { + return { + restrict: 'AE', + scope: { + onExpand: '&', + onCollapse: '&', + onMinimize: '&' + }, + controller: ['$scope', '$element', '$attrs', 'ionPullUpFooterState', 'ionPullUpFooterBehavior', function($scope, $element, $attrs, FooterState, FooterBehavior) { + var + tabs = document.querySelector('.tabs'), + hasBottomTabs = document.querySelector('.tabs-bottom'), + header = document.querySelector('.bar-header'), + tabsHeight = tabs ? tabs.offsetHeight : 0, + headerHeight = header ? header.offsetHeight : 0, + handleHeight = 0, + footer = { + height: 0, + posY: 0, + lastPosY: 0, + state: FooterState.COLLAPSED, + defaultHeight : $element[0].offsetHeight, + maxHeight: parseInt($attrs.maxHeight, 10) || 0, + initialState: $attrs.initialState ? $attrs.initialState.toUpperCase() : FooterState.COLLAPSED, + defaultBehavior: $attrs.defaultBehavior ? $attrs.defaultBehavior.toUpperCase() : FooterBehavior.EXPAND + }; + + function init() { + $element.css({'-webkit-backface-visibility': 'hidden', 'backface-visibility': 'hidden', 'transition': '300ms ease-in-out', 'padding': 0}); + if (tabs && hasBottomTabs) { + $element.css('bottom', tabs.offsetHeight + 'px'); + } + } + + function computeHeights() { + footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight; + $element.css({'height': footer.height + 'px'}); + + if (footer.initialState == FooterState.MINIMIZED) { + minimize(); + } else { + collapse(); + } + } + + function expand() { + footer.lastPosY = 0; + $element.css({'-webkit-transform': 'translate3d(0, 0, 0)', 'transform': 'translate3d(0, 0, 0)'}); + $scope.onExpand(); + footer.state = FooterState.EXPANDED; + } + + function collapse() { + footer.lastPosY = (tabs && hasBottomTabs) ? footer.height - tabsHeight : footer.height - footer.defaultHeight; + $element.css({'-webkit-transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)', 'transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)'}); + $scope.onCollapse(); + footer.state = FooterState.COLLAPSED + } + + function minimize() { + footer.lastPosY = footer.height; + $element.css({'-webkit-transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)', 'transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)'}); + $scope.onMinimize(); + footer.state = FooterState.MINIMIZED; + } + + + this.setHandleHeight = function(height) { + handleHeight = height; + computeHeights(); + }; + + this.getHeight = function() { + return $element[0].offsetHeight; + }; + + this.getBackground = function() { + return $window.getComputedStyle($element[0]).background; + }; + + this.onTap = function(e) { + e.gesture.srcEvent.preventDefault(); + e.gesture.preventDefault(); + + if (footer.state == FooterState.COLLAPSED) { + if (footer.defaultBehavior == FooterBehavior.HIDE) { + minimize(); + } else { + expand(); + } + } else { + if (footer.state == FooterState.MINIMIZED) { + if (footer.defaultBehavior == FooterBehavior.HIDE) + collapse(); + else + expand(); + } else { + // footer is expanded + footer.initialState == FooterState.MINIMIZED ? minimize() : collapse(); + } + } + + $rootScope.$broadcast('ionPullUp:tap', footer.state); + }; + + this.onDrag = function(e) { + e.gesture.srcEvent.preventDefault(); + e.gesture.preventDefault(); + + switch (e.type) { + case 'dragstart': + $element.css('transition', 'none'); + break; + case 'drag': + footer.posY = Math.round(e.gesture.deltaY) + footer.lastPosY; + if (footer.posY < 0 || footer.posY > footer.height) return; + $element.css({'-webkit-transform': 'translate3d(0, ' + footer.posY + 'px, 0)', 'transform': 'translate3d(0, ' + footer.posY + 'px, 0)'}); + break; + case 'dragend': + $element.css({'transition': '300ms ease-in-out'}); + footer.lastPosY = footer.posY; + break; + } + }; + + $window.addEventListener('orientationchange', function() { + $timeout(function() { + computeHeights(); + }, 500); + }); + + init(); + }], + compile: function(element, attrs) { + attrs.defaultHeight && element.css('height', parseInt(attrs.defaultHeight, 10) + 'px'); + element.addClass('bar bar-footer'); + } + } + }]) + .directive('ionPullUpContent', [function() { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + var + footerHeight = controller.getHeight(); + element.css({'display': 'block', 'margin-top': footerHeight + 'px', width: '100%'}); + // add scrolling if needed + if (attrs.scroll && attrs.scroll.toUpperCase() == 'TRUE') { + element.css({'overflow-y': 'scroll', 'overflow-x': 'hidden'}); + } + } + } + }]) + .directive('ionPullUpBar', [function() { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + var + footerHeight = controller.getHeight(); + element.css({'display': 'flex', 'height': footerHeight + 'px', position: 'absolute', right: '0', left: '0'}); + + } + } + }]) + .directive('ionPullUpTrigger', ['$ionicGesture', function($ionicGesture) { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + // add gesture + $ionicGesture.on('tap', controller.onTap, element); + $ionicGesture.on('drag dragstart dragend', controller.onDrag, element); + } + } + }]) + .directive('ionPullUpHandle', ['$ionicGesture', '$timeout', '$window', function($ionicGesture, $timeout, $window) { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + var height = parseInt(attrs.height,10) || 25, width = parseInt(attrs.width, 10) || 100, + background = controller.getBackground(), + toggleClasses = attrs.toggle; + + controller.setHandleHeight(height); + + element.css({ + display: 'block', + background: background, + position: 'absolute', + top: 1-height + 'px', + left: (($window.innerWidth - width) / 2) + 'px', + height: height + 'px', + width: width + 'px', + //margin: '0 auto', + 'text-align': 'center' + }); + + // add gesture + $ionicGesture.on('tap', controller.onTap, element); + $ionicGesture.on('drag dragstart dragend', controller.onDrag, element); + + scope.$on('ionPullUp:tap', function() { + element.find('i').toggleClass(toggleClasses); + }); + + $window.addEventListener('orientationchange', function() { + $timeout(function() { + element.css('left', (($window.innerWidth - width) / 2) + 'px'); + }, 500); + }); + } + } + }]);
\ No newline at end of file diff --git a/www/lib/ionic-pullup/example/.bowerrc b/www/lib/ionic-pullup/example/.bowerrc new file mode 100644 index 00000000..e28246d4 --- /dev/null +++ b/www/lib/ionic-pullup/example/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "www/lib" +} diff --git a/www/lib/ionic-pullup/example/.gitignore b/www/lib/ionic-pullup/example/.gitignore new file mode 100644 index 00000000..88d92183 --- /dev/null +++ b/www/lib/ionic-pullup/example/.gitignore @@ -0,0 +1,7 @@ +# Specifies intentionally untracked files to ignore when using Git +# http://git-scm.com/docs/gitignore + +node_modules/ +platforms/ +plugins/ +www/lib/
\ No newline at end of file diff --git a/www/lib/ionic-pullup/example/bower.json b/www/lib/ionic-pullup/example/bower.json new file mode 100644 index 00000000..2995b60f --- /dev/null +++ b/www/lib/ionic-pullup/example/bower.json @@ -0,0 +1,7 @@ +{ + "name": "HelloIonic", + "private": "true", + "devDependencies": { + "ionic": "driftyco/ionic-bower#1.0.1" + } +} diff --git a/www/lib/ionic-pullup/example/config.xml b/www/lib/ionic-pullup/example/config.xml new file mode 100644 index 00000000..b897c8b6 --- /dev/null +++ b/www/lib/ionic-pullup/example/config.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<widget id="com.ionicframework.example928161" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + <name>example</name> + <description> + An Ionic Framework and Cordova project. + </description> + <author email="hi@ionicframework" href="http://ionicframework.com/"> + Ionic Framework Team + </author> + <content src="index.html"/> + <access origin="*"/> + <preference name="webviewbounce" value="false"/> + <preference name="UIWebViewBounce" value="false"/> + <preference name="DisallowOverscroll" value="true"/> + <preference name="android-minSdkVersion" value="16"/> + <preference name="BackupWebStorage" value="none"/> + <preference name="SplashScreen" value="screen"/> + <preference name="SplashScreenDelay" value="3000"/> + <feature name="StatusBar"> + <param name="ios-package" value="CDVStatusBar" onload="true"/> + </feature> + <platform name="android"> + <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/> + <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/> + <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/> + <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/> + <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/> + <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/> + <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/> + <splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/> + <splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/> + <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/> + <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/> + <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/> + <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/> + <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/> + <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/> + <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/> + <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/> + <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/> + </platform> +</widget>
\ No newline at end of file diff --git a/www/lib/ionic-pullup/example/gulpfile.js b/www/lib/ionic-pullup/example/gulpfile.js new file mode 100644 index 00000000..3efdfc0a --- /dev/null +++ b/www/lib/ionic-pullup/example/gulpfile.js @@ -0,0 +1,52 @@ +var gulp = require('gulp'); +var gutil = require('gulp-util'); +var bower = require('bower'); +var concat = require('gulp-concat'); +var sass = require('gulp-sass'); +var minifyCss = require('gulp-minify-css'); +var rename = require('gulp-rename'); +var sh = require('shelljs'); + +var paths = { + sass: ['./scss/**/*.scss'] +}; + +gulp.task('default', ['sass']); + +gulp.task('sass', function(done) { + gulp.src('./scss/ionic.app.scss') + .pipe(sass({ + errLogToConsole: true + })) + .pipe(gulp.dest('./www/css/')) + .pipe(minifyCss({ + keepSpecialComments: 0 + })) + .pipe(rename({ extname: '.min.css' })) + .pipe(gulp.dest('./www/css/')) + .on('end', done); +}); + +gulp.task('watch', function() { + gulp.watch(paths.sass, ['sass']); +}); + +gulp.task('install', ['git-check'], function() { + return bower.commands.install() + .on('log', function(data) { + gutil.log('bower', gutil.colors.cyan(data.id), data.message); + }); +}); + +gulp.task('git-check', function(done) { + if (!sh.which('git')) { + console.log( + ' ' + gutil.colors.red('Git is not installed.'), + '\n Git, the version control system, is required to download Ionic.', + '\n Download git here:', gutil.colors.cyan('http://git-scm.com/downloads') + '.', + '\n Once git is installed, run \'' + gutil.colors.cyan('gulp install') + '\' again.' + ); + process.exit(1); + } + done(); +}); diff --git a/www/lib/ionic-pullup/example/hooks/README.md b/www/lib/ionic-pullup/example/hooks/README.md new file mode 100644 index 00000000..d2563eab --- /dev/null +++ b/www/lib/ionic-pullup/example/hooks/README.md @@ -0,0 +1,83 @@ +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--> +# Cordova Hooks + +This directory may contain scripts used to customize cordova commands. This +directory used to exist at `.cordova/hooks`, but has now been moved to the +project root. Any scripts you add to these directories will be executed before +and after the commands corresponding to the directory name. Useful for +integrating your own build systems or integrating with version control systems. + +__Remember__: Make your scripts executable. + +## Hook Directories +The following subdirectories will be used for hooks: + + after_build/ + after_compile/ + after_docs/ + after_emulate/ + after_platform_add/ + after_platform_rm/ + after_platform_ls/ + after_plugin_add/ + after_plugin_ls/ + after_plugin_rm/ + after_plugin_search/ + after_prepare/ + after_run/ + after_serve/ + before_build/ + before_compile/ + before_docs/ + before_emulate/ + before_platform_add/ + before_platform_rm/ + before_platform_ls/ + before_plugin_add/ + before_plugin_ls/ + before_plugin_rm/ + before_plugin_search/ + before_prepare/ + before_run/ + before_serve/ + pre_package/ <-- Windows 8 and Windows Phone only. + +## Script Interface + +All scripts are run from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables: + +* CORDOVA_VERSION - The version of the Cordova-CLI. +* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios). +* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer) +* CORDOVA_HOOK - Path to the hook that is being executed. +* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate) + +If a script returns a non-zero exit code, then the parent cordova command will be aborted. + + +## Writing hooks + +We highly recommend writting your hooks using Node.js so that they are +cross-platform. Some good examples are shown here: + +[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) + diff --git a/www/lib/ionic-pullup/example/hooks/after_prepare/010_add_platform_class.js b/www/lib/ionic-pullup/example/hooks/after_prepare/010_add_platform_class.js new file mode 100644 index 00000000..bda3e415 --- /dev/null +++ b/www/lib/ionic-pullup/example/hooks/after_prepare/010_add_platform_class.js @@ -0,0 +1,94 @@ +#!/usr/bin/env node + +// Add Platform Class +// v1.0 +// Automatically adds the platform class to the body tag +// after the `prepare` command. By placing the platform CSS classes +// directly in the HTML built for the platform, it speeds up +// rendering the correct layout/style for the specific platform +// instead of waiting for the JS to figure out the correct classes. + +var fs = require('fs'); +var path = require('path'); + +var rootdir = process.argv[2]; + +function addPlatformBodyTag(indexPath, platform) { + // add the platform class to the body tag + try { + var platformClass = 'platform-' + platform; + var cordovaClass = 'platform-cordova platform-webview'; + + var html = fs.readFileSync(indexPath, 'utf8'); + + var bodyTag = findBodyTag(html); + if(!bodyTag) return; // no opening body tag, something's wrong + + if(bodyTag.indexOf(platformClass) > -1) return; // already added + + var newBodyTag = bodyTag; + + var classAttr = findClassAttr(bodyTag); + if(classAttr) { + // body tag has existing class attribute, add the classname + var endingQuote = classAttr.substring(classAttr.length-1); + var newClassAttr = classAttr.substring(0, classAttr.length-1); + newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote; + newBodyTag = bodyTag.replace(classAttr, newClassAttr); + + } else { + // add class attribute to the body tag + newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">'); + } + + html = html.replace(bodyTag, newBodyTag); + + fs.writeFileSync(indexPath, html, 'utf8'); + + process.stdout.write('add to body class: ' + platformClass + '\n'); + } catch(e) { + process.stdout.write(e); + } +} + +function findBodyTag(html) { + // get the body tag + try{ + return html.match(/<body(?=[\s>])(.*?)>/gi)[0]; + }catch(e){} +} + +function findClassAttr(bodyTag) { + // get the body tag's class attribute + try{ + return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0]; + }catch(e){} +} + +if (rootdir) { + + // go through each of the platform directories that have been prepared + var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []); + + for(var x=0; x<platforms.length; x++) { + // open up the index.html file at the www root + try { + var platform = platforms[x].trim().toLowerCase(); + var indexPath; + + if(platform == 'android') { + indexPath = path.join('platforms', platform, 'assets', 'www', 'index.html'); + } else { + indexPath = path.join('platforms', platform, 'www', 'index.html'); + } + + if(fs.existsSync(indexPath)) { + addPlatformBodyTag(indexPath, platform); + } + + } catch(e) { + process.stdout.write(e); + } + } + +} diff --git a/www/lib/ionic-pullup/example/ionic.project b/www/lib/ionic-pullup/example/ionic.project new file mode 100644 index 00000000..96bfb8e0 --- /dev/null +++ b/www/lib/ionic-pullup/example/ionic.project @@ -0,0 +1,11 @@ +{ + "name": "example", + "app_id": "", + "browsers": [ + { + "platform": "android", + "browser": "crosswalk-lite", + "version": "12.41.296.5" + } + ] +}
\ No newline at end of file diff --git a/www/lib/ionic-pullup/example/package.json b/www/lib/ionic-pullup/example/package.json new file mode 100644 index 00000000..1bd7d46c --- /dev/null +++ b/www/lib/ionic-pullup/example/package.json @@ -0,0 +1,27 @@ +{ + "name": "example", + "version": "1.0.0", + "description": "example: An Ionic project", + "dependencies": { + "gulp": "^3.5.6", + "gulp-sass": "^1.3.3", + "gulp-concat": "^2.2.0", + "gulp-minify-css": "^0.3.0", + "gulp-rename": "^1.2.0" + }, + "devDependencies": { + "bower": "^1.3.3", + "gulp-util": "^2.2.14", + "shelljs": "^0.3.0" + }, + "cordovaPlugins": [ + "cordova-plugin-device", + "cordova-plugin-console", + "cordova-plugin-whitelist", + "cordova-plugin-splashscreen", + "com.ionic.keyboard" + ], + "cordovaPlatforms": [ + "android" + ] +}
\ No newline at end of file diff --git a/www/lib/ionic-pullup/example/resources/android/icon/drawable-hdpi-icon.png b/www/lib/ionic-pullup/example/resources/android/icon/drawable-hdpi-icon.png Binary files differnew file mode 100644 index 00000000..b9100934 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/icon/drawable-hdpi-icon.png diff --git a/www/lib/ionic-pullup/example/resources/android/icon/drawable-ldpi-icon.png b/www/lib/ionic-pullup/example/resources/android/icon/drawable-ldpi-icon.png Binary files differnew file mode 100644 index 00000000..16cd5dba --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/icon/drawable-ldpi-icon.png diff --git a/www/lib/ionic-pullup/example/resources/android/icon/drawable-mdpi-icon.png b/www/lib/ionic-pullup/example/resources/android/icon/drawable-mdpi-icon.png Binary files differnew file mode 100644 index 00000000..64a6cbc5 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/icon/drawable-mdpi-icon.png diff --git a/www/lib/ionic-pullup/example/resources/android/icon/drawable-xhdpi-icon.png b/www/lib/ionic-pullup/example/resources/android/icon/drawable-xhdpi-icon.png Binary files differnew file mode 100644 index 00000000..1605f695 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/icon/drawable-xhdpi-icon.png diff --git a/www/lib/ionic-pullup/example/resources/android/icon/drawable-xxhdpi-icon.png b/www/lib/ionic-pullup/example/resources/android/icon/drawable-xxhdpi-icon.png Binary files differnew file mode 100644 index 00000000..56fb29e6 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/icon/drawable-xxhdpi-icon.png diff --git a/www/lib/ionic-pullup/example/resources/android/icon/drawable-xxxhdpi-icon.png b/www/lib/ionic-pullup/example/resources/android/icon/drawable-xxxhdpi-icon.png Binary files differnew file mode 100644 index 00000000..e4a91525 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/icon/drawable-xxxhdpi-icon.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-hdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-hdpi-screen.png Binary files differnew file mode 100644 index 00000000..66b12fea --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-hdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-ldpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-ldpi-screen.png Binary files differnew file mode 100644 index 00000000..7dceec7b --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-ldpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-mdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-mdpi-screen.png Binary files differnew file mode 100644 index 00000000..0dc2ba75 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-mdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xhdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xhdpi-screen.png Binary files differnew file mode 100644 index 00000000..39ae00c3 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xhdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xxhdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xxhdpi-screen.png Binary files differnew file mode 100644 index 00000000..3f591b1e --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xxhdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xxxhdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xxxhdpi-screen.png Binary files differnew file mode 100644 index 00000000..253e6f18 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-land-xxxhdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-hdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-hdpi-screen.png Binary files differnew file mode 100644 index 00000000..e0dbb62f --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-hdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-ldpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-ldpi-screen.png Binary files differnew file mode 100644 index 00000000..8e93c2d6 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-ldpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-mdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-mdpi-screen.png Binary files differnew file mode 100644 index 00000000..0aaad62b --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-mdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xhdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xhdpi-screen.png Binary files differnew file mode 100644 index 00000000..64c27f8a --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xhdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xxhdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xxhdpi-screen.png Binary files differnew file mode 100644 index 00000000..f605e6a3 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xxhdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xxxhdpi-screen.png b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xxxhdpi-screen.png Binary files differnew file mode 100644 index 00000000..2b993cff --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/android/splash/drawable-port-xxxhdpi-screen.png diff --git a/www/lib/ionic-pullup/example/resources/icon.png b/www/lib/ionic-pullup/example/resources/icon.png Binary files differnew file mode 100644 index 00000000..bee77667 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/icon.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-40.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-40.png Binary files differnew file mode 100644 index 00000000..76cc53c3 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-40.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-40@2x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-40@2x.png Binary files differnew file mode 100644 index 00000000..64b49069 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-40@2x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-50.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-50.png Binary files differnew file mode 100644 index 00000000..8bd51dfd --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-50.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-50@2x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-50@2x.png Binary files differnew file mode 100644 index 00000000..2676f8f6 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-50@2x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-60.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-60.png Binary files differnew file mode 100644 index 00000000..11f39124 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-60.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-60@2x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-60@2x.png Binary files differnew file mode 100644 index 00000000..b5210482 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-60@2x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-60@3x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-60@3x.png Binary files differnew file mode 100644 index 00000000..dbc83030 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-60@3x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-72.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-72.png Binary files differnew file mode 100644 index 00000000..4e5a8276 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-72.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-72@2x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-72@2x.png Binary files differnew file mode 100644 index 00000000..56fb29e6 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-72@2x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-76.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-76.png Binary files differnew file mode 100644 index 00000000..e66a90ed --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-76.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-76@2x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-76@2x.png Binary files differnew file mode 100644 index 00000000..3f5c942f --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-76@2x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-small.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-small.png Binary files differnew file mode 100644 index 00000000..de3146dc --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-small.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-small@2x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-small@2x.png Binary files differnew file mode 100644 index 00000000..916a02ec --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-small@2x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon-small@3x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon-small@3x.png Binary files differnew file mode 100644 index 00000000..0efa99d8 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon-small@3x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon.png Binary files differnew file mode 100644 index 00000000..89f8c00f --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon.png diff --git a/www/lib/ionic-pullup/example/resources/ios/icon/icon@2x.png b/www/lib/ionic-pullup/example/resources/ios/icon/icon@2x.png Binary files differnew file mode 100644 index 00000000..a6687a10 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/icon/icon@2x.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-568h@2x~iphone.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-568h@2x~iphone.png Binary files differnew file mode 100644 index 00000000..d2128a63 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-568h@2x~iphone.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-667h.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-667h.png Binary files differnew file mode 100644 index 00000000..fc23e64c --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-667h.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-736h.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-736h.png Binary files differnew file mode 100644 index 00000000..71b16ca4 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-736h.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape-736h.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape-736h.png Binary files differnew file mode 100644 index 00000000..aaff74ad --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape-736h.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape@2x~ipad.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape@2x~ipad.png Binary files differnew file mode 100644 index 00000000..19770a2c --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape@2x~ipad.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape~ipad.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape~ipad.png Binary files differnew file mode 100644 index 00000000..6fe89255 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Landscape~ipad.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-Portrait@2x~ipad.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Portrait@2x~ipad.png Binary files differnew file mode 100644 index 00000000..3d06d86d --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Portrait@2x~ipad.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default-Portrait~ipad.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Portrait~ipad.png Binary files differnew file mode 100644 index 00000000..53ad4c4c --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default-Portrait~ipad.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default@2x~iphone.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default@2x~iphone.png Binary files differnew file mode 100644 index 00000000..6a133168 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default@2x~iphone.png diff --git a/www/lib/ionic-pullup/example/resources/ios/splash/Default~iphone.png b/www/lib/ionic-pullup/example/resources/ios/splash/Default~iphone.png Binary files differnew file mode 100644 index 00000000..0aaad62b --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/ios/splash/Default~iphone.png diff --git a/www/lib/ionic-pullup/example/resources/splash.png b/www/lib/ionic-pullup/example/resources/splash.png Binary files differnew file mode 100644 index 00000000..cbddba06 --- /dev/null +++ b/www/lib/ionic-pullup/example/resources/splash.png diff --git a/www/lib/ionic-pullup/example/scss/ionic.app.scss b/www/lib/ionic-pullup/example/scss/ionic.app.scss new file mode 100644 index 00000000..9eb2f782 --- /dev/null +++ b/www/lib/ionic-pullup/example/scss/ionic.app.scss @@ -0,0 +1,23 @@ +/* +To customize the look and feel of Ionic, you can override the variables +in ionic's _variables.scss file. + +For example, you might change some of the default colors: + +$light: #fff !default; +$stable: #f8f8f8 !default; +$positive: #387ef5 !default; +$calm: #11c1f3 !default; +$balanced: #33cd5f !default; +$energized: #ffc900 !default; +$assertive: #ef473a !default; +$royal: #886aea !default; +$dark: #444 !default; +*/ + +// The path for our ionicons font files, relative to the built CSS in www/css +$ionicons-font-path: "../lib/ionic/fonts" !default; + +// Include all of Ionic +@import "www/lib/ionic/scss/ionic"; + diff --git a/www/lib/ionic-pullup/example/www/css/style.css b/www/lib/ionic-pullup/example/www/css/style.css new file mode 100644 index 00000000..fa229279 --- /dev/null +++ b/www/lib/ionic-pullup/example/www/css/style.css @@ -0,0 +1 @@ +/* Empty. Add your own CSS if you like */ diff --git a/www/lib/ionic-pullup/example/www/img/ionic.png b/www/lib/ionic-pullup/example/www/img/ionic.png Binary files differnew file mode 100644 index 00000000..21c7f375 --- /dev/null +++ b/www/lib/ionic-pullup/example/www/img/ionic.png diff --git a/www/lib/ionic-pullup/example/www/index.html b/www/lib/ionic-pullup/example/www/index.html new file mode 100644 index 00000000..a7e8650b --- /dev/null +++ b/www/lib/ionic-pullup/example/www/index.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> + <title></title> + + <link href="lib/ionic/css/ionic.css" rel="stylesheet"> + <link href="css/style.css" rel="stylesheet"> + + <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above + <link href="css/ionic.app.css" rel="stylesheet"> + --> + + <!-- ionic/angularjs js --> + <script src="lib/ionic/js/ionic.bundle.js"></script> + + <!-- cordova script (this will be a 404 during development) --> + <script src="cordova.js"></script> + + <!-- your app's js --> + <script src="js/ion-pullup.js"></script> + <script src="js/app.js"></script> + <script src="js/controllers.js"></script> + <script src="js/services.js"></script> + </head> + <body ng-app="starter"> + <!-- + The nav bar that will be updated as we navigate between views. + --> + <ion-nav-bar class="bar-stable"> + <ion-nav-back-button> + </ion-nav-back-button> + </ion-nav-bar> + <!-- + The views will be rendered in the <ion-nav-view> directive below + Templates are in the /templates folder (but you could also + have templates inline in this html file if you'd like). + --> + <ion-nav-view></ion-nav-view> + </body> +</html> diff --git a/www/lib/ionic-pullup/example/www/js/app.js b/www/lib/ionic-pullup/example/www/js/app.js new file mode 100644 index 00000000..c7c7c5f2 --- /dev/null +++ b/www/lib/ionic-pullup/example/www/js/app.js @@ -0,0 +1,85 @@ +// Ionic Starter App + +// angular.module is a global place for creating, registering and retrieving Angular modules +// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html) +// the 2nd parameter is an array of 'requires' +// 'starter.services' is found in services.js +// 'starter.controllers' is found in controllers.js +angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ionic-pullup']) + +.run(function($ionicPlatform) { + $ionicPlatform.ready(function() { + // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard + // for form inputs) + if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { + cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); + cordova.plugins.Keyboard.disableScroll(true); + + } + if (window.StatusBar) { + // org.apache.cordova.statusbar required + StatusBar.styleLightContent(); + } + }); +}) + +.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' + }) + + // Each tab has its own nav history stack: + + .state('tab.dash', { + url: '/dash', + views: { + 'tab-dash': { + templateUrl: 'templates/tab-dash.html', + controller: 'DashCtrl' + } + } + }) + + .state('tab.chats', { + url: '/chats', + views: { + 'tab-chats': { + templateUrl: 'templates/tab-chats.html', + controller: 'ChatsCtrl' + } + } + }) + .state('tab.chat-detail', { + url: '/chats/:chatId', + views: { + 'tab-chats': { + templateUrl: 'templates/chat-detail.html', + controller: 'ChatDetailCtrl' + } + } + }) + + .state('tab.account', { + url: '/account', + views: { + 'tab-account': { + templateUrl: 'templates/tab-account.html', + controller: 'AccountCtrl' + } + } + }); + + // if none of the above states are matched, use this as the fallback + $urlRouterProvider.otherwise('/tab/dash'); + +}); diff --git a/www/lib/ionic-pullup/example/www/js/controllers.js b/www/lib/ionic-pullup/example/www/js/controllers.js new file mode 100644 index 00000000..9a418765 --- /dev/null +++ b/www/lib/ionic-pullup/example/www/js/controllers.js @@ -0,0 +1,35 @@ +angular.module('starter.controllers', []) + +.controller('DashCtrl', function($scope) { + $scope.footerExpand = function() { + console.log('Footer expanded'); + }; + $scope.footerCollapse = function() { + console.log('Footer collapsed'); + }; + }) + +.controller('ChatsCtrl', function($scope, Chats) { + // With the new view caching in Ionic, Controllers are only called + // when they are recreated or on app start, instead of every page change. + // To listen for when this page is active (for example, to refresh data), + // listen for the $ionicView.enter event: + // + //$scope.$on('$ionicView.enter', function(e) { + //}); + + $scope.chats = Chats.all(); + $scope.remove = function(chat) { + Chats.remove(chat); + }; +}) + +.controller('ChatDetailCtrl', function($scope, $stateParams, Chats) { + $scope.chat = Chats.get($stateParams.chatId); +}) + +.controller('AccountCtrl', function($scope) { + $scope.settings = { + enableFriends: true + }; +}); diff --git a/www/lib/ionic-pullup/example/www/js/ion-pullup.js b/www/lib/ionic-pullup/example/www/js/ion-pullup.js new file mode 100644 index 00000000..c558cb93 --- /dev/null +++ b/www/lib/ionic-pullup/example/www/js/ion-pullup.js @@ -0,0 +1,226 @@ +angular.module('ionic-pullup', []) + .constant('ionPullUpFooterState', { + COLLAPSED: 'COLLAPSED', + MINIMIZED: 'MINIMIZED', + EXPANDED: 'EXPANDED' + }) + .constant('ionPullUpFooterBehavior', { + HIDE: 'HIDE', + EXPAND: 'EXPAND' + }) + .directive('ionPullUpFooter', ['$timeout', '$rootScope', '$window', function($timeout, $rootScope, $window) { + return { + restrict: 'AE', + scope: { + onExpand: '&', + onCollapse: '&', + onMinimize: '&' + }, + controller: ['$scope', '$element', '$attrs', 'ionPullUpFooterState', 'ionPullUpFooterBehavior', function($scope, $element, $attrs, FooterState, FooterBehavior) { + var + tabs = document.querySelector('.tabs'), + hasBottomTabs = document.querySelector('.tabs-bottom'), + header = document.querySelector('.bar-header'), + tabsHeight = tabs ? tabs.offsetHeight : 0, + headerHeight = header ? header.offsetHeight : 0, + handleHeight = 0, + footer = { + height: 0, + posY: 0, + lastPosY: 0, + state: FooterState.COLLAPSED, + defaultHeight : $element[0].offsetHeight, + maxHeight: parseInt($attrs.maxHeight, 10) || 0, + initialState: $attrs.initialState ? $attrs.initialState.toUpperCase() : FooterState.COLLAPSED, + defaultBehavior: $attrs.defaultBehavior ? $attrs.defaultBehavior.toUpperCase() : FooterBehavior.EXPAND + }; + + function init() { + $element.css({'-webkit-backface-visibility': 'hidden', 'backface-visibility': 'hidden', 'transition': '300ms ease-in-out', 'padding': 0}); + if (tabs && hasBottomTabs) { + $element.css('bottom', tabs.offsetHeight + 'px'); + } + } + + function computeHeights() { + footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight; + $element.css({'height': footer.height + 'px'}); + + if (footer.initialState == FooterState.MINIMIZED) { + minimize(); + } else { + collapse(); + } + } + + function expand() { + footer.lastPosY = 0; + $element.css({'-webkit-transform': 'translate3d(0, 0, 0)', 'transform': 'translate3d(0, 0, 0)'}); + $scope.onExpand(); + footer.state = FooterState.EXPANDED; + } + + function collapse() { + footer.lastPosY = (tabs && hasBottomTabs) ? footer.height - tabsHeight : footer.height - footer.defaultHeight; + $element.css({'-webkit-transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)', 'transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)'}); + $scope.onCollapse(); + footer.state = FooterState.COLLAPSED + } + + function minimize() { + footer.lastPosY = footer.height; + $element.css({'-webkit-transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)', 'transform': 'translate3d(0, ' + footer.lastPosY + 'px, 0)'}); + $scope.onMinimize(); + footer.state = FooterState.MINIMIZED; + } + + + this.setHandleHeight = function(height) { + handleHeight = height; + computeHeights(); + }; + + this.getHeight = function() { + return $element[0].offsetHeight; + }; + + this.getBackground = function() { + return $window.getComputedStyle($element[0]).background; + }; + + this.onTap = function(e) { + e.gesture.srcEvent.preventDefault(); + e.gesture.preventDefault(); + + if (footer.state == FooterState.COLLAPSED) { + if (footer.defaultBehavior == FooterBehavior.HIDE) { + minimize(); + } else { + expand(); + } + } else { + if (footer.state == FooterState.MINIMIZED) { + if (footer.defaultBehavior == FooterBehavior.HIDE) + collapse(); + else + expand(); + } else { + // footer is expanded + footer.initialState == FooterState.MINIMIZED ? minimize() : collapse(); + } + } + + $rootScope.$broadcast('ionPullUp:tap', footer.state); + }; + + this.onDrag = function(e) { + e.gesture.srcEvent.preventDefault(); + e.gesture.preventDefault(); + + switch (e.type) { + case 'dragstart': + $element.css('transition', 'none'); + break; + case 'drag': + footer.posY = Math.round(e.gesture.deltaY) + footer.lastPosY; + if (footer.posY < 0 || footer.posY > footer.height) return; + $element.css({'-webkit-transform': 'translate3d(0, ' + footer.posY + 'px, 0)', 'transform': 'translate3d(0, ' + footer.posY + 'px, 0)'}); + break; + case 'dragend': + $element.css({'transition': '300ms ease-in-out'}); + footer.lastPosY = footer.posY; + break; + } + }; + + $window.addEventListener('orientationchange', function() { + $timeout(function() { + computeHeights(); + }, 500); + }); + + init(); + }], + compile: function(element, attrs) { + attrs.defaultHeight && element.css('height', parseInt(attrs.defaultHeight, 10) + 'px'); + element.addClass('bar bar-footer'); + } + } + }]) + .directive('ionPullUpContent', [function() { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + var + footerHeight = controller.getHeight(); + element.css({'display': 'block', 'margin-top': footerHeight + 'px', width: '100%'}); + // add scrolling if needed + if (attrs.scroll && attrs.scroll.toUpperCase() == 'TRUE') { + element.css({'overflow-y': 'scroll', 'overflow-x': 'hidden'}); + } + } + } + }]) + .directive('ionPullUpBar', [function() { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + var + footerHeight = controller.getHeight(); + element.css({'display': 'flex', 'height': footerHeight + 'px', position: 'absolute', right: '0', left: '0'}); + + } + } + }]) + .directive('ionPullUpTrigger', ['$ionicGesture', function($ionicGesture) { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + // add gesture + $ionicGesture.on('tap', controller.onTap, element); + $ionicGesture.on('drag dragstart dragend', controller.onDrag, element); + } + } + }]) + .directive('ionPullUpHandle', ['$ionicGesture', '$timeout', '$window', function($ionicGesture, $timeout, $window) { + return { + restrict: 'AE', + require: '^ionPullUpFooter', + link: function (scope, element, attrs, controller) { + var height = parseInt(attrs.height,10) || 25, width = parseInt(attrs.width, 10) || 100, + background = controller.getBackground(), + toggleClasses = attrs.toggle; + + controller.setHandleHeight(height); + + element.css({ + display: 'block', + background: background, + position: 'absolute', + top: 1-height + 'px', + left: (($window.innerWidth - width) / 2) + 'px', + height: height + 'px', + width: width + 'px', + //margin: '0 auto', + 'text-align': 'center' + }); + + // add gesture + $ionicGesture.on('tap', controller.onTap, element); + $ionicGesture.on('drag dragstart dragend', controller.onDrag, element); + + scope.$on('ionPullUp:tap', function() { + element.find('i').toggleClass(toggleClasses); + }); + + $window.addEventListener('orientationchange', function() { + $timeout(function() { + element.css('left', (($window.innerWidth - width) / 2) + 'px'); + }, 500); + }); + } + } + }]);
\ No newline at end of file diff --git a/www/lib/ionic-pullup/example/www/js/services.js b/www/lib/ionic-pullup/example/www/js/services.js new file mode 100644 index 00000000..db975f21 --- /dev/null +++ b/www/lib/ionic-pullup/example/www/js/services.js @@ -0,0 +1,50 @@ +angular.module('starter.services', []) + +.factory('Chats', function() { + // Might use a resource here that returns a JSON array + + // Some fake testing data + var chats = [{ + id: 0, + name: 'Ben Sparrow', + lastText: 'You on your way?', + face: 'https://pbs.twimg.com/profile_images/514549811765211136/9SgAuHeY.png' + }, { + id: 1, + name: 'Max Lynx', + lastText: 'Hey, it\'s me', + face: 'https://avatars3.githubusercontent.com/u/11214?v=3&s=460' + }, { + id: 2, + name: 'Adam Bradleyson', + lastText: 'I should buy a boat', + face: 'https://pbs.twimg.com/profile_images/479090794058379264/84TKj_qa.jpeg' + }, { + id: 3, + name: 'Perry Governor', + lastText: 'Look at my mukluks!', + face: 'https://pbs.twimg.com/profile_images/598205061232103424/3j5HUXMY.png' + }, { + id: 4, + name: 'Mike Harrington', + lastText: 'This is wicked good ice cream.', + face: 'https://pbs.twimg.com/profile_images/578237281384841216/R3ae1n61.png' + }]; + + return { + all: function() { + return chats; + }, + remove: function(chat) { + chats.splice(chats.indexOf(chat), 1); + }, + get: function(chatId) { + for (var i = 0; i < chats.length; i++) { + if (chats[i].id === parseInt(chatId)) { + return chats[i]; + } + } + return null; + } + }; +}); diff --git a/www/lib/ionic-pullup/example/www/templates/chat-detail.html b/www/lib/ionic-pullup/example/www/templates/chat-detail.html new file mode 100644 index 00000000..e776d022 --- /dev/null +++ b/www/lib/ionic-pullup/example/www/templates/chat-detail.html @@ -0,0 +1,14 @@ +<!-- + This template loads for the 'tab.friend-detail' state (app.js) + 'friend' is a $scope variable created in the FriendsCtrl controller (controllers.js) + The FriendsCtrl pulls data from the Friends service (service.js) + The Friends service returns an array of friend data +--> +<ion-view view-title="{{chat.name}}"> + <ion-content class="padding"> + <img ng-src="{{chat.face}}" style="width: 64px; height: 64px"> + <p> + {{chat.lastText}} + </p> + </ion-content> +</ion-view> diff --git a/www/lib/ionic-pullup/example/www/templates/tab-account.html b/www/lib/ionic-pullup/example/www/templates/tab-account.html new file mode 100644 index 00000000..2e72f67a --- /dev/null +++ b/www/lib/ionic-pullup/example/www/templates/tab-account.html @@ -0,0 +1,9 @@ +<ion-view view-title="Account"> + <ion-content> + <ion-list> + <ion-toggle ng-model="settings.enableFriends"> + Enable Friends + </ion-toggle> + </ion-list> + </ion-content> +</ion-view> diff --git a/www/lib/ionic-pullup/example/www/templates/tab-chats.html b/www/lib/ionic-pullup/example/www/templates/tab-chats.html new file mode 100644 index 00000000..0c6a88ad --- /dev/null +++ b/www/lib/ionic-pullup/example/www/templates/tab-chats.html @@ -0,0 +1,33 @@ +<ion-view view-title="Chats"> + <ion-content> + <ion-list> + <ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="chat in chats" type="item-text-wrap" href="#/tab/chats/{{chat.id}}"> + <img ng-src="{{chat.face}}"> + <h2>{{chat.name}}</h2> + <p>{{chat.lastText}}</p> + <i class="icon ion-chevron-right icon-accessory"></i> + + <ion-option-button class="button-assertive" ng-click="remove(chat)"> + Delete + </ion-option-button> + </ion-item> + </ion-list> + </ion-content> + <ion-pull-up-footer class="bar-calm" initial-state="minimized" default-behavior="hide"> + <div class="title" ion-pull-up-trigger>More details</div> + <ion-pull-up-handle width="100" height="25" toggle="ion-chevron-down ion-chevron-up" style="border-radius: 25px 25px 0 0"> + <i class="icon ion-chevron-up"></i> + </ion-pull-up-handle> + + <ion-pull-up-content scroll="false"> + <div class="list card"> + <div class="item item-divider">Recent Updates</div> + <div class="item item-body"> + <div> + There is a fire in <b>sector 3</b> + </div> + </div> + </div> + </ion-pull-up-content> + </ion-pull-up-footer> +</ion-view> diff --git a/www/lib/ionic-pullup/example/www/templates/tab-dash.html b/www/lib/ionic-pullup/example/www/templates/tab-dash.html new file mode 100644 index 00000000..37b688fd --- /dev/null +++ b/www/lib/ionic-pullup/example/www/templates/tab-dash.html @@ -0,0 +1,46 @@ +<ion-view view-title="Dashboard"> + <ion-content class="padding"> + <div class="list card"> + <div class="item item-divider">Recent Updates</div> + <div class="item item-body"> + <div> + There is a fire in <b>sector 3</b> + </div> + </div> + </div> + <div class="list card"> + <div class="item item-divider">Upcoming</div> + <label class="item item-input"> + <i class="icon ion-search placeholder-icon"></i> + <input type="text" placeholder="Search"> + </label> + </div> + <div class="list card"> + <div class="item item-divider">Upcoming</div> + <div class="item item-body"> + <div> + You have <b>29</b> meetings on your calendar tomorrow. + </div> + </div> + </div> + </ion-content> + <ion-pull-up-footer class="bar-energized" on-expand="footerExpand()" on-collapse="footerCollapse()"> + <ion-pull-up-handle toggle="ion-chevron-up ion-chevron-down" style="border-radius: 25px 25px 0 0"> + <i class="icon ion-chevron-up"></i> + </ion-pull-up-handle> + <ion-pull-up-bar> + <h1 class="title" ion-pull-up-trigger>Tap here</h1> + <button class="button icon ion-gear-a"></button> + </ion-pull-up-bar> + <ion-pull-up-content scroll="false"> + <div class="list card"> + <div class="item item-divider">Recent Updates</div> + <div class="item item-body"> + <div> + There is a fire in <b>sector 3</b> + </div> + </div> + </div> + </ion-pull-up-content> + </ion-pull-up-footer> +</ion-view> diff --git a/www/lib/ionic-pullup/example/www/templates/tabs.html b/www/lib/ionic-pullup/example/www/templates/tabs.html new file mode 100644 index 00000000..ed615d2c --- /dev/null +++ b/www/lib/ionic-pullup/example/www/templates/tabs.html @@ -0,0 +1,24 @@ +<!-- +Create tabs with an icon and label, using the tabs-positive style. +Each tab's child <ion-nav-view> directive will have its own +navigation history that also transitions its views in and out. +--> +<ion-tabs class="tabs-icon-top tabs-color-active-positive"> + + <!-- Dashboard Tab --> + <ion-tab title="Status" icon-off="ion-ios-pulse" icon-on="ion-ios-pulse-strong" href="#/tab/dash"> + <ion-nav-view name="tab-dash"></ion-nav-view> + </ion-tab> + + <!-- Chats Tab --> + <ion-tab title="Chats" icon-off="ion-ios-chatboxes-outline" icon-on="ion-ios-chatboxes" href="#/tab/chats"> + <ion-nav-view name="tab-chats"></ion-nav-view> + </ion-tab> + + <!-- Account Tab --> + <ion-tab title="Account" icon-off="ion-ios-gear-outline" icon-on="ion-ios-gear" href="#/tab/account"> + <ion-nav-view name="tab-account"></ion-nav-view> + </ion-tab> + + +</ion-tabs> diff --git a/www/lib/ionic-pullup/karma.conf.js b/www/lib/ionic-pullup/karma.conf.js new file mode 100644 index 00000000..44bb29f1 --- /dev/null +++ b/www/lib/ionic-pullup/karma.conf.js @@ -0,0 +1,33 @@ +module.exports = function(config){ + config.set({ + + basePath : './', + + files : [ + 'app/bower_components/angular/angular.js', + 'app/bower_components/angular-route/angular-route.js', + 'app/bower_components/angular-mocks/angular-mocks.js', + 'app/components/**/*.js', + 'app/view*/**/*.js' + ], + + autoWatch : true, + + frameworks: ['jasmine'], + + browsers : ['Chrome'], + + plugins : [ + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-jasmine', + 'karma-junit-reporter' + ], + + junitReporter : { + outputFile: 'test_out/unit.xml', + suite: 'unit' + } + + }); +}; diff --git a/www/lib/ionic-pullup/package.json b/www/lib/ionic-pullup/package.json new file mode 100644 index 00000000..0bbe67fa --- /dev/null +++ b/www/lib/ionic-pullup/package.json @@ -0,0 +1,19 @@ +{ + "name": "ionic-pullup", + "private": false, + "version": "1.0.2", + "description": "Ionic pull up footer", + "repository": "https://github.com/arielfaur", + "license": "MIT", + "devDependencies": { + "bower": "^1.3.1", + "jasmine-core": "^2.3.4", + "karma": "~0.12", + "karma-chrome-launcher": "^0.1.12", + "karma-firefox-launcher": "^0.1.6", + "karma-jasmine": "^0.3.5", + "karma-junit-reporter": "^0.2.2", + "protractor": "^2.1.0", + "shelljs": "^0.2.6" + } +} |
