summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-02-23 16:01:17 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-02-23 16:01:17 -0500
commit16dbb6d67620fd86adc44dfd704a5f590eaf8348 (patch)
treeae1eda43bc8e0a69d1dde08bf6483ac5ee0a8643
parent18927496066167b73bf15e47882520da6624ee03 (diff)
f
-rw-r--r--.gitignore5
-rw-r--r--Makefile6
-rw-r--r--info.txt26
-rw-r--r--platforms/android/.gitignore14
-rw-r--r--platforms/android/.project71
-rw-r--r--platforms/android/AndroidManifest.xml15
-rw-r--r--platforms/android/build.gradle94
-rw-r--r--platforms/android/custom_rules.xml22
-rw-r--r--platforms/android/project.properties14
-rw-r--r--platforms/android/settings.gradle18
-rw-r--r--platforms/browser/config.xml15
-rw-r--r--plugins/android.json36
-rw-r--r--plugins/browser.json26
-rw-r--r--www/css/index.css115
-rw-r--r--www/css/index.scss40
-rw-r--r--www/index.html49
16 files changed, 407 insertions, 159 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3d364dc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/www/css/index.css
+*.css.map
+/plugins/*/
+/platforms/*/*/
+.sass-cache/
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1c1ed6c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+SCSS = scss
+
+all: www/css/index.css
+
+%.css: %.scss
+ $(SCSS) $< $@
diff --git a/info.txt b/info.txt
new file mode 100644
index 0000000..9cd961b
--- /dev/null
+++ b/info.txt
@@ -0,0 +1,26 @@
+Node version: v0.12.0
+
+Cordova version: 4.2.0
+
+Config.xml file:
+
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="org.usfirst.frc.team4272.safetyapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+ <name>SafetyApp</name>
+ <description>
+ A sample Apache Cordova application that responds to the deviceready event.
+ </description>
+ <author email="dev@cordova.apache.org" href="http://cordova.io">
+ Apache Cordova Team
+ </author>
+ <content src="index.html" />
+ <access origin="*" />
+</widget>
+
+
+Plugins:
+
+org.apache.cordova.camera
+
+Error retrieving Android platform information: Error: android: Command failed with exit code ENOENT
+
diff --git a/platforms/android/.gitignore b/platforms/android/.gitignore
new file mode 100644
index 0000000..a1c8ff7
--- /dev/null
+++ b/platforms/android/.gitignore
@@ -0,0 +1,14 @@
+# Non-project-specific build files:
+build.xml
+local.properties
+/gradlew
+/gradlew.bat
+/gradle
+# Ant builds
+ant-built
+ant-gen
+# Eclipse builds
+gen
+out
+# Gradle builds
+/build
diff --git a/platforms/android/.project b/platforms/android/.project
new file mode 100644
index 0000000..5e2a6bc
--- /dev/null
+++ b/platforms/android/.project
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SafetyApp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>config.xml</name>
+ <type>1</type>
+ <locationURI>$%7BPARENT-2-PROJECT_LOC%7D/config.xml</locationURI>
+ </link>
+ <link>
+ <name>www</name>
+ <type>2</type>
+ <locationURI>$%7BPARENT-2-PROJECT_LOC%7D/www</locationURI>
+ </link>
+ <link>
+ <name>merges</name>
+ <type>2</type>
+ <locationURI>$%7BPARENT-2-PROJECT_LOC%7D/merges</locationURI>
+ </link>
+ </linkedResources>
+ <filteredResources>
+ <filter>
+ <id>1390880034107</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-projectRelativePath-matches-false-true-^(build.xml|ant-gen|ant-build|custom_rules.xml|CordovaLib|platform_www|cordova)</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1390880034108</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-projectRelativePath-matches-false-true-^(assets/www|res/xml/config.xml)</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
+
diff --git a/platforms/android/AndroidManifest.xml b/platforms/android/AndroidManifest.xml
new file mode 100644
index 0000000..b7f945e
--- /dev/null
+++ b/platforms/android/AndroidManifest.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='utf-8'?>
+<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="org.usfirst.frc.team4272.safetyapp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="CordovaApp" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
+ <intent-filter android:label="@string/launcher_name">
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+ <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+</manifest>
diff --git a/platforms/android/build.gradle b/platforms/android/build.gradle
new file mode 100644
index 0000000..9d1d45a
--- /dev/null
+++ b/platforms/android/build.gradle
@@ -0,0 +1,94 @@
+import java.util.regex.Pattern
+
+apply plugin: 'android'
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.10.+'
+ }
+}
+
+ext.multiarch=false
+
+dependencies {
+ compile fileTree(dir: 'libs', include: '*.jar')
+ for (subproject in getProjectList()) {
+ compile project(subproject)
+ }
+}
+
+android {
+ sourceSets {
+ main {
+ manifest.srcFile 'AndroidManifest.xml'
+ java.srcDirs = ['src']
+ resources.srcDirs = ['src']
+ aidl.srcDirs = ['src']
+ renderscript.srcDirs = ['src']
+ res.srcDirs = ['res']
+ assets.srcDirs = ['assets']
+ }
+ }
+
+ defaultConfig {
+ versionCode Integer.parseInt("" + getVersionCodeFromManifest() + "0")
+ }
+
+ compileSdkVersion 19
+ buildToolsVersion "19.0.0"
+
+ if (multiarch || System.env.BUILD_MULTIPLE_APKS) {
+ productFlavors {
+ armv7 {
+ versionCode defaultConfig.versionCode + 2
+ ndk {
+ abiFilters "armeabi-v7a", ""
+ }
+ }
+ x86 {
+ versionCode defaultConfig.versionCode + 4
+ ndk {
+ abiFilters "x86", ""
+ }
+ }
+ all {
+ ndk {
+ abiFilters "all", ""
+ }
+ }
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
+ }
+
+}
+
+task wrapper(type: Wrapper) {
+ gradleVersion = '1.12'
+}
+
+def getVersionCodeFromManifest() {
+ def manifestFile = file(android.sourceSets.main.manifest.srcFile)
+ def pattern = Pattern.compile("versionCode=\"(\\d+)\"")
+ def matcher = pattern.matcher(manifestFile.getText())
+ matcher.find()
+ return Integer.parseInt(matcher.group(1))
+}
+
+def getProjectList() {
+ def manifestFile = file("project.properties")
+ def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
+ def matcher = pattern.matcher(manifestFile.getText())
+ def projects = []
+ while (matcher.find()) {
+ projects.add(":" + matcher.group(2).replace("/",":"))
+ }
+ return projects
+}
diff --git a/platforms/android/custom_rules.xml b/platforms/android/custom_rules.xml
new file mode 100644
index 0000000..66483d3
--- /dev/null
+++ b/platforms/android/custom_rules.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <target name="-pre-compile">
+ <!-- Fix library references due to bug in build.xml: See: https://groups.google.com/forum/#!topic/android-developers/0ivH-YqCjzg -->
+ <pathconvert property="fixedJarsPath" refid="project.all.jars.path">
+ <filtermapper>
+ <replacestring from="/bin/" to="/ant-build/"/>
+ <replacestring from="\bin\" to="\ant-build\"/>
+ </filtermapper>
+ </pathconvert>
+ <path id="project.all.jars.path">
+ <pathelement path="${fixedJarsPath}"/>
+ </path>
+ <echo message="Set jars path to: ${toString:project.all.jars.path}"/>
+ </target>
+ <!-- Rename AndroidManifest.xml so that Eclipse's import wizard doesn't detect ant-build as a project -->
+ <target name="-post-build">
+ <move file="ant-build/AndroidManifest.xml" tofile="ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
+ <move file="CordovaLib/ant-build/AndroidManifest.xml" tofile="CordovaLib/ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
+ </target>
+</project>
+
diff --git a/platforms/android/project.properties b/platforms/android/project.properties
new file mode 100644
index 0000000..ef68eb7
--- /dev/null
+++ b/platforms/android/project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+# Project target.
+target=android-19
+android.library.reference.1=CordovaLib
diff --git a/platforms/android/settings.gradle b/platforms/android/settings.gradle
new file mode 100644
index 0000000..baa1714
--- /dev/null
+++ b/platforms/android/settings.gradle
@@ -0,0 +1,18 @@
+import java.util.regex.Pattern
+
+def getProjectList() {
+ def manifestFile = file("project.properties")
+ def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
+ def matcher = pattern.matcher(manifestFile.getText())
+ def projects = []
+ while (matcher.find()) {
+ projects.add(":" + matcher.group(2).replace("/",":"))
+ }
+ return projects
+}
+
+for (subproject in getProjectList()) {
+ include subproject
+}
+
+include ':'
diff --git a/platforms/browser/config.xml b/platforms/browser/config.xml
new file mode 100644
index 0000000..f44d87a
--- /dev/null
+++ b/platforms/browser/config.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="org.usfirst.frc.team4272.safetyapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+ <feature name="Camera">
+ <param name="browser-package" value="Camera" />
+ </feature>
+ <name>SafetyApp</name>
+ <description>
+ A sample Apache Cordova application that responds to the deviceready event.
+ </description>
+ <author email="dev@cordova.apache.org" href="http://cordova.io">
+ Apache Cordova Team
+ </author>
+ <content src="index.html" />
+ <access origin="*" />
+</widget>
diff --git a/plugins/android.json b/plugins/android.json
new file mode 100644
index 0000000..d539e89
--- /dev/null
+++ b/plugins/android.json
@@ -0,0 +1,36 @@
+{
+ "prepare_queue": {
+ "installed": [],
+ "uninstalled": []
+ },
+ "config_munge": {
+ "files": {
+ "res/xml/config.xml": {
+ "parents": {
+ "/*": [
+ {
+ "xml": "<feature name=\"Camera\"><param name=\"android-package\" value=\"org.apache.cordova.camera.CameraLauncher\" /></feature>",
+ "count": 1
+ }
+ ]
+ }
+ },
+ "AndroidManifest.xml": {
+ "parents": {
+ "/*": [
+ {
+ "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
+ "count": 1
+ }
+ ]
+ }
+ }
+ }
+ },
+ "installed_plugins": {
+ "org.apache.cordova.camera": {
+ "PACKAGE_NAME": "org.usfirst.frc.team4272.safetyapp"
+ }
+ },
+ "dependent_plugins": {}
+} \ No newline at end of file
diff --git a/plugins/browser.json b/plugins/browser.json
new file mode 100644
index 0000000..3ed2a72
--- /dev/null
+++ b/plugins/browser.json
@@ -0,0 +1,26 @@
+{
+ "prepare_queue": {
+ "installed": [],
+ "uninstalled": []
+ },
+ "config_munge": {
+ "files": {
+ "config.xml": {
+ "parents": {
+ "/*": [
+ {
+ "xml": "<feature name=\"Camera\"><param name=\"browser-package\" value=\"Camera\" /></feature>",
+ "count": 1
+ }
+ ]
+ }
+ }
+ }
+ },
+ "installed_plugins": {
+ "org.apache.cordova.camera": {
+ "PACKAGE_NAME": "org.usfirst.frc.team4272.safetyapp"
+ }
+ },
+ "dependent_plugins": {}
+} \ No newline at end of file
diff --git a/www/css/index.css b/www/css/index.css
deleted file mode 100644
index 51daa79..0000000
--- a/www/css/index.css
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.
- */
-* {
- -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
-}
-
-body {
- -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
- -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
- -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
- background-color:#E4E4E4;
- background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
- background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
- background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
- background-image:-webkit-gradient(
- linear,
- left top,
- left bottom,
- color-stop(0, #A7A7A7),
- color-stop(0.51, #E4E4E4)
- );
- background-attachment:fixed;
- font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
- font-size:12px;
- height:100%;
- margin:0px;
- padding:0px;
- text-transform:uppercase;
- width:100%;
-}
-
-/* Portrait layout (default) */
-.app {
- background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
- position:absolute; /* position in the center of the screen */
- left:50%;
- top:50%;
- height:50px; /* text area height */
- width:225px; /* text area width */
- text-align:center;
- padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
- margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
- /* offset horizontal: half of text area width */
-}
-
-/* Landscape layout (with min-width) */
-@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
- .app {
- background-position:left center;
- padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
- margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
- /* offset horizontal: half of image width and text area width */
- }
-}
-
-h1 {
- font-size:24px;
- font-weight:normal;
- margin:0px;
- overflow:visible;
- padding:0px;
- text-align:center;
-}
-
-.event {
- border-radius:4px;
- -webkit-border-radius:4px;
- color:#FFFFFF;
- font-size:12px;
- margin:0px 30px;
- padding:2px 0px;
-}
-
-.event.listening {
- background-color:#333333;
- display:block;
-}
-
-.event.received {
- background-color:#4B946A;
- display:none;
-}
-
-@keyframes fade {
- from { opacity: 1.0; }
- 50% { opacity: 0.4; }
- to { opacity: 1.0; }
-}
-
-@-webkit-keyframes fade {
- from { opacity: 1.0; }
- 50% { opacity: 0.4; }
- to { opacity: 1.0; }
-}
-
-.blink {
- animation:fade 3000ms infinite;
- -webkit-animation:fade 3000ms infinite;
-}
diff --git a/www/css/index.scss b/www/css/index.scss
index 2f246a7..81d5a1a 100644
--- a/www/css/index.scss
+++ b/www/css/index.scss
@@ -5,14 +5,19 @@ html, body, table {
height: 100%;
padding: 0;
margin: 0;
+
background-color: $red;
+ color: $yellow;
+
+ font-family: sans-serif;
+ font-weight: bolder;
}
table {
width: 100%;
border-collapse: collapse;
td, th {
- border: solid 1px black;
+ border: solid 1px $yellow;
}
td {
text-align: center;
@@ -22,34 +27,35 @@ table {
thead {
height: 10%;
background-color: $yellow;
+ color: $red;
}
tbody {
td {
width: 33%;
height: 30%;
- a {
- /*display: inline-block;*/
- display: table-cell;
+ div {
+ /* A wrapper round cell contents allowing us to use fancy
+ table-positioning inside of the cell */
+ display: table;
width: 100%;
height: 100%;
- text-decoration: none;
- /* What this does is insert a 0-width, but tall, element to the left
- of the text, to stretch the line-height to the full
- height of the <a> element. *//*
- span:before {
- content: " ";
- display: inline-block;
+ a {
+ display: table-cell;
height: 100%;
+ width: 100%;
vertical-align: middle;
}
- span {
- display: inline-block;
- }*/
}
}
}
}
-a:hover, a:active, a:focus {
- text-decoration: underline;
- background-color: $yellow;
+
+a {
+ text-decoration: none;
+ color: $yellow;
+ &:hover, &:active, &:focus {
+ text-decoration: underline;
+ background-color: $yellow;
+ color: $red;
+ }
}
diff --git a/www/index.html b/www/index.html
index 1ec4720..fa3cb54 100644
--- a/www/index.html
+++ b/www/index.html
@@ -1,22 +1,4 @@
<!DOCTYPE html>
-<!--
- 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.
--->
<html>
<head>
<meta charset="utf-8" />
@@ -28,14 +10,27 @@
<title>Hello World</title>
</head>
<body>
- <div class="app">
- <h1>Apache Cordova</h1>
- <div id="deviceready" class="blink">
- <p class="event listening">Connecting to Device</p>
- <p class="event received">Device is Ready</p>
- </div>
- </div>
- <script type="text/javascript" src="cordova.js"></script>
- <script type="text/javascript" src="js/index.js"></script>
+ <table>
+ <thead>
+ <tr><th colspan=3>4272 Safety</th></tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><div><a href="./Emergency_Procedure.pdf">Emergency Procedures</a></div></td>
+ <td><div><a href="./PPE_Information.pdf">PPE Information</a></div></td>
+ <td><div><a href="./MSDS.pdf">MSDS</a></div></td>
+ </tr>
+ <tr>
+ <td><div><a href="./First_Aid_Instructions.pdf">First Aid Instructions</a></div></td>
+ <td><div><a href="./report.html">Report an Injury</a></div></td>
+ <td><div><a href="./alert.html">Alert Safety Person</a></div></td>
+ </tr>
+ <tr>
+ <td><div><a href="./Member_Health_Information.pdf">Member Health Information</a></div></td>
+ <td><div><a href="./find.html">Find Safety Mentor</a></div></td>
+ <td><div><a href="./FIRST_Safety_Manual.pdf">FIRST Safety Manual</a></div></td>
+ </tr>
+ </tbody>
+ </table>
</body>
</html>