Skip to content

Commit

Permalink
added papaparse,added tax mod
Browse files Browse the repository at this point in the history
  • Loading branch information
dvbondoy committed Dec 17, 2016
1 parent f41bffb commit e114b27
Show file tree
Hide file tree
Showing 44 changed files with 2,097 additions and 49 deletions.
2 changes: 2 additions & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@
<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>
<allow-navigation href="http://192.168.8.100:8100"/>
<allow-navigation href="http://192.168.8.101:8100"/>
</widget>
Empty file modified hooks/README.md
100644 → 100755
Empty file.
Empty file modified hooks/after_prepare/010_add_platform_class.js
100644 → 100755
Empty file.
143 changes: 143 additions & 0 deletions hooks/after_prepare/uglify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/usr/bin/env node

/*jshint latedef:nofunc, node:true*/

// Modules
var fs = require('fs');
var path = require('path');
var dependencyPath = path.join(process.cwd(), 'node_modules');
// cordova-uglify module dependencies
var UglifyJS = require(path.join(dependencyPath, 'uglify-js'));
var CleanCSS = require(path.join(dependencyPath, 'clean-css'));
var ngAnnotate = require(path.join(dependencyPath, 'ng-annotate'));

// Process
var rootDir = process.argv[2];
var platformPath = path.join(rootDir, 'platforms');
var platforms = process.env.CORDOVA_PLATFORMS.split(',');
var cliCommand = process.env.CORDOVA_CMDLINE;

// Hook configuration
var configFilePath = path.join(rootDir, 'hooks/uglify-config.json');
var hookConfig = JSON.parse(fs.readFileSync(configFilePath));
var isRelease = hookConfig.alwaysRun || (cliCommand.indexOf('--release') > -1);
var recursiveFolderSearch = hookConfig.recursiveFolderSearch; // set this to false to manually indicate the folders to process
var foldersToProcess = hookConfig.foldersToProcess; // add other www folders in here if needed (ex. js/controllers)
var cssMinifier = new CleanCSS(hookConfig.cleanCssOptions);

// Exit
if (!isRelease) {
return;
}

// Run uglifier
run();

/**
* Run compression for all specified platforms.
* @return {undefined}
*/
function run() {
platforms.forEach(function(platform) {
var wwwPath;

switch (platform) {
case 'android':
wwwPath = path.join(platformPath, platform, 'assets', 'www');
break;

case 'ios':
case 'browser':
case 'wp8':
case 'windows':
wwwPath = path.join(platformPath, platform, 'www');
break;

default:
console.log('this hook only supports android, ios, wp8, windows, and browser currently');
return;
}

processFolders(wwwPath);
});
}

/**
* Processes defined folders.
* @param {string} wwwPath - Path to www directory
* @return {undefined}
*/
function processFolders(wwwPath) {
foldersToProcess.forEach(function(folder) {
processFiles(path.join(wwwPath, folder));
});
}

/**
* Processes files in directories.
* @param {string} dir - Directory path
* @return {undefined}
*/
function processFiles(dir) {
fs.readdir(dir, function(err, list) {
if (err) {
console.log('processFiles err: ' + err);

return;
}

list.forEach(function(file) {
file = path.join(dir, file);

fs.stat(file, function(err, stat) {
if (stat.isFile()) {
compress(file);

return;
}

if (recursiveFolderSearch && stat.isDirectory()) {
processFiles(file);

return;
}
});
});
});
}

/**
* Compresses file.
* @param {string} file - File path
* @return {undefined}
*/
function compress(file) {
var ext = path.extname(file),
res,
source,
result;

switch (ext) {
case '.js':
console.log('uglifying js file ' + file);

res = ngAnnotate(String(fs.readFileSync(file)), {
add: true
});
result = UglifyJS.minify(res.src, hookConfig.uglifyJsOptions);
fs.writeFileSync(file, result.code, 'utf8'); // overwrite the original unminified file
break;

case '.css':
console.log('minifying css file ' + file);

source = fs.readFileSync(file, 'utf8');
result = cssMinifier.minify(source);
fs.writeFileSync(file, result.styles, 'utf8'); // overwrite the original unminified file
break;

default:
console.log('encountered a ' + ext + ' file, not compressing it');
break;
}
}
21 changes: 21 additions & 0 deletions hooks/uglify-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"alwaysRun": false,
"recursiveFolderSearch": true,
"foldersToProcess": [
"js",
"css",
"img",
"build"
],
"uglifyJsOptions": {
"compress": {
"drop_console": true
},
"fromString": true,
"mangle": false
},
"cleanCssOptions": {
"noAdvanced": true,
"keepSpecialComments": 0
}
}
12 changes: 12 additions & 0 deletions ionic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "ionPOS",
"app_id": "993e4936",
"gulpStartupTasks": [
"sass",
"watch"
],
"watchPatterns": [
"www/**/*",
"!www/lib/**/*"
]
}
Binary file added res/drawable-land-hdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-land-ldpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-land-mdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-land-xhdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-land-xxhdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-land-xxxhdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-port-hdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-port-ldpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-port-mdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-port-xhdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-port-xxhdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-port-xxxhdpi/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-hdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-ldpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-mdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-xhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-xxhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-xxxhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion www/core/core.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
});

_db = new PouchDB('peddler', {adapter:'websql'});
_db.info().then(console.log.bind(console));
// _db.info().then(console.log.bind(console));
}
})();
51 changes: 51 additions & 0 deletions www/lib/papaparse/.bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "papaparse",
"main": "papaparse.js",
"homepage": "http://papaparse.com",
"authors": [
"Matthew Holt"
],
"description": "Fast and powerful CSV parser for the browser. Converts CSV->JSON and JSON->CSV. Supports web workers and streaming large files.",
"keywords": [
"csv",
"parse",
"parsing",
"parser",
"delimited",
"text",
"data",
"auto-detect",
"comma",
"tab",
"pipe",
"file",
"filereader",
"stream",
"worker",
"workers",
"ajax",
"thread",
"threading",
"multi-threaded"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"player"
],
"version": "4.1.2",
"_release": "4.1.2",
"_resolution": {
"type": "version",
"tag": "4.1.2",
"commit": "f26c8e5c58ea669e5bdee8b8363f740550552ea6"
},
"_source": "https://github.com/mholt/PapaParse.git",
"_target": "^4.1.2",
"_originalSource": "papaparse",
"_direct": true
}
18 changes: 18 additions & 0 deletions www/lib/papaparse/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
options: {
preserveComments: 'some',
},
min: {
files: {
'papaparse.min.js': ['papaparse.js']
},
},
},
});

grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.registerTask('build', ['uglify']);
}
20 changes: 20 additions & 0 deletions www/lib/papaparse/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2015 Matthew Holt

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.
76 changes: 76 additions & 0 deletions www/lib/papaparse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Parse CSV with JavaScript
========================================

[![mholt on Gratipay](http://img.shields.io/badge/tips-accepted-brightgreen.svg?style=flat)](https://www.gratipay.com/mholt/)

Papa Parse is the [fastest](http://jsperf.com/javascript-csv-parsers/4) in-browser CSV (or delimited text) parser for JavaScript. It is reliable and correct according to [RFC 4180](https://tools.ietf.org/html/rfc4180), and it comes with these features:

- Easy to use
- Parse CSV files directly (local or over the network)
- Fast mode ([is really fast](http://jsperf.com/javascript-csv-parsers/3))
- Stream large files (even via HTTP)
- Reverse parsing (converts JSON to CSV)
- Auto-detect delimiter
- Worker threads to keep your web page reactive
- Header row support
- Pause, resume, abort
- Can convert numbers and booleans to their types
- Optional jQuery integration to get files from `<input type="file">` elements

Papa Parse has **no dependencies** - not even jQuery.


Homepage & Demo
----------------

- [Homepage](http://papaparse.com)
- [Demo](http://papaparse.com/demo)

To learn how to use Papa Parse:

- [Documentation](http://papaparse.com/docs)


Papa Parse for Node
--------------------

[Rich Harris](https://github.com/Rich-Harris) forked this project to make **[Baby Parse](https://github.com/Rich-Harris/BabyParse)** which runs in Node.js environments.

```bash
$ npm install babyparse
```

[Baby Parse on npm registry](https://www.npmjs.org/package/babyparse)

Use it just like Papa Parse. However:

- Files are not supported; strings only (you can use Node's file facilities to load file contents yourself)
- Some config options are unavailable:
- worker
- download (you can use Node's network facilities to download files yourself)
- encoding
- chunk

Otherwise, Baby Parse has nearly all the same functionality as Papa Parse 4.0, including the `unparse()` utility.


Get Started
-----------

Use [papaparse.min.js](https://github.com/mholt/PapaParse/blob/master/papaparse.min.js) for production.

For usage instructions, see the [homepage](http://papaparse.com) and, for more detail, the [documentation](http://papaparse.com/docs).



Tests
-----

Papa Parse is under test. Download this repository, run `npm install`, then `npm test` to run the tests in your browser.



Contributing
------------

To discuss a new feature or ask a question, open an issue. To fix a bug, submit a pull request to be credited with the [contributors](https://github.com/mholt/PapaParse/graphs/contributors)! Remember, a pull request, *with test*, is best. You may also discuss on Twitter with [#PapaParse](https://twitter.com/search?q=%23PapaParse&src=typd&f=realtime) or directly to me, [@mholt6](https://twitter.com/mholt6).
Loading

0 comments on commit e114b27

Please sign in to comment.