Skip to content

Commit

Permalink
Merge pull request #2 from froothacks/revert-1-develop
Browse files Browse the repository at this point in the history
Revert "Browserified repository"
  • Loading branch information
Advait-M authored Aug 28, 2017
2 parents 6a023d9 + 2435486 commit 92b85fc
Show file tree
Hide file tree
Showing 18 changed files with 9,578 additions and 253 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ test/bower_components
package
app/scripts
.idea
build.crx
build.pem
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

Binary file removed build/icon128.png
Binary file not shown.
Binary file removed build/icon16.png
Binary file not shown.
Binary file removed build/icon48.png
Binary file not shown.
9 changes: 2 additions & 7 deletions build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Timelime",
"description": "",
"version": "0.1.0",
"version": "1.0",
"background": {
"scripts": ["background.js"],
"persistent": false
Expand All @@ -21,10 +21,5 @@
"tabs",
"<all_urls>",
"http://127.0.0.1/*"
],
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
}
]
}
38 changes: 37 additions & 1 deletion build/popup.js

Large diffs are not rendered by default.

9,189 changes: 9,189 additions & 0 deletions business-directory.csv

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions geo_finder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var csv = require('csv-parser')
var fs = require('fs')

var x = -79.7592242 //LONG
var y = 43.6850141 //LATT
var closest_location = [];
var shortest_distance = Infinity;
fs.createReadStream('business-directory.csv')
.pipe(csv())
.on('data', function(data) {
var a = x - parseFloat(data.X)
// console.log(x, data.X)
var b = y - parseFloat(data.Y)
var c = Math.sqrt(a * a + b * b);
// console.log(c);
// console.log(shortest_distance);
if (data.PRODUCT_DESC.toLowerCase().indexOf("coffee") !== -1 && c < shortest_distance) {
closest_location = [];
shortest_distance = c;
console.log(shortest_distance)
closest_location.push(data.COMPANY_NAME)
closest_location.push(data.PRODUCT_DESC)
closest_location.push((data.BUSINESS_FULL_ADDRESS +" "+ data.CITY +" "+data.PROVINCE+" "+ data.POSTAL_CODE))
console.log(closest_location)
}
})
54 changes: 23 additions & 31 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,25 @@ var pug = require("gulp-pug");
var sass = require("gulp-sass");
var autoprefixer = require("gulp-autoprefixer");
var sourcemaps = require("gulp-sourcemaps");
// var uglify = require('gulp-uglify');
var notify = require("gulp-notify");
var browserSync = require("browser-sync").create();
var browserify = require('gulp-browserify');


let uglify = require('gulp-uglify-es').default;
let rename = require("gulp-rename");

// var plumber = require('gulp-plumber');
// var gutil = require("gulp-util");

// config
var paths = {
src: {
pug: "src/**/*.pug",
babel: "src/**/*.js",
sass: "src/**/*.scss",
static: "static/**/*",
browserify: "src/popup.js"
static: "static/**/*"
},
dest: {
dest: { //
html: "build",
js: "build",
css: "build",
static: "build",
browserify: "build"
static: "build"
}
};
var browsers = "> 1%, last 2 versions, IE >= 9, Firefox ESR"
Expand All @@ -56,7 +51,7 @@ gulp.task("pug", function() {
});

gulp.task("babel", function() {
return gulp.src([paths.src.babel, "!src/**/popup.js"])
return gulp.src(paths.src.babel)
// .pipe(sourcemaps.init())
.pipe(babel({
presets: [
Expand Down Expand Up @@ -106,29 +101,26 @@ gulp.task("static", function() {
}));
});

gulp.task("scripts", function() {
// Single entry point to browserify
return gulp.src('src/popup.js')
.pipe(browserify({
insertGlobals : true,
debug : false
}))
.pipe(browserSync.stream())
.pipe(uglify())
.pipe(gulp.dest(paths.dest.browserify))
.pipe(notify({
title: "Success",
message: "Browserfied: <%= file.relative %>"
}));
});

// function makeWatcher(fileType) {
// console.log(fileType, paths.src[fileType]);
// gulp.watch(paths.src[fileType], [fileType])
// // Special handler for deleting files
// .on("change", (event) => {
// if (event.type === 'deleted') {
// var srcPath = path.relative(path.resolve(paths.src[fileType]), event.path);
// var destPath = path.resolve(paths.dest[fileType], srcPath);
// del.sync(destPath);
// browserSync.reload()
// }
// });
// }

gulp.task("clean", function(done) {
return del("build/**/*", done);
});

gulp.task("watch", function() {
gulp.watch(paths.src.browserify, gulp.task("scripts"));
gulp.task("watch", function() {
// ["pug", "babel", "sass", "static"].forEach(makeWatcher);
gulp.watch(paths.src.pug, gulp.task("pug"));
gulp.watch(paths.src.babel, gulp.task("babel"));
gulp.watch(paths.src.sass, gulp.task("sass"));
Expand All @@ -145,7 +137,7 @@ gulp.task("sync", function() {

gulp.task("build",
gulp.series("clean",
gulp.parallel("pug", "babel", "sass", "static", "scripts")));
gulp.parallel("pug", "babel", "sass", "static")));

gulp.task("default",
gulp.series("build", "watch"));
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@
"gulp": "github:gulpjs/gulp#4.0",
"gulp-autoprefixer": "^3.1.1",
"gulp-babel": "^6.1.2",
"gulp-browserify": "^0.5.1",
"gulp-notify": "^2.2.0",
"gulp-pug": "^3.2.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.4.0",
"gulp-uglify-es": "^0.1.3",
"uglify-es": "^3.0.28"
"gulp-sourcemaps": "^2.4.0"
},
"dependencies": {
"body-parser": "^1.17.2",
Expand Down
Loading

0 comments on commit 92b85fc

Please sign in to comment.