Permalink
Browse files

Merge branch 'master' of github.com:quartzjer/backpack

  • Loading branch information...
2 parents fff59d9 + ce7d0fa commit 6e0ed11cd8d8877c9471e0c85720e6fc857ef9cd @quartzjer committed Jun 27, 2012
Showing with 44 additions and 13 deletions.
  1. +1 −0 Procfile
  2. +4 −3 app.js
  3. +7 −4 idr.js
  4. +7 −3 package.json
  5. +25 −3 public/index.html
View
@@ -0,0 +1 @@
+web: node app.js
View
@@ -7,11 +7,12 @@ var sprintf = require('sprintf').sprintf;
var async = require('async');
// The port that this express app will listen on
-var port = 8442;
+var port = process.env.PORT || 8442;
+console.log("Using port: %d", port);
// Your client ID and secret from http://dev.singly.com/apps
-var clientId = process.argv[2] || '';
-var clientSecret = process.argv[3] || '';
+var clientId = process.env["OAUTH_CLIENT_ID"] || process.argv[2] || '';
+var clientSecret = process.env["OAUTH_CLIENT_SECRET"] || process.argv[3] || '';
var hostBaseUrl = process.argv[4] || 'http://localhost:' + port;
var apiBaseUrl = process.argv[5] || 'https://api.singly.com';
View
@@ -1,6 +1,6 @@
var url = require("url");
var crypto = require("crypto");
-var mmh = require("murmurhash3");
+//var mmh = require("murmurhash3");
// make sure it's parsed and clean up url-ish bits of the data we don't want
exports.parse = function(idrStr) {
@@ -69,15 +69,18 @@ exports.clone = function(idr) {
}
exports.hash = function(idr) {
- return mmh.murmur128HexSync(exports.toString(exports.parse(idr)));
+ return undefined;//mmh.murmur128HexSync(exports.toString(exports.parse(idr)));
}
exports.baseHash = function(idr) {
- return mmh.murmur128HexSync(exports.toString(exports.base(exports.parse(idr))));
+ return undefined;//mmh.murmur128HexSync(exports.toString(exports.base(exports.parse(idr))));
}
exports.id = function(idr) {
+ /*
var idh = exports.hash(idr);
var idb = mmh.murmur128HexSync(exports.pid(idr));
return idh + '_' + idb.substr(0,9);
-}
+ */
+ return undefined;
+}
View
@@ -2,11 +2,15 @@
"name": "backpack",
"version": "0.0.1",
"dependencies": {
- "express": "*",
+ "async": "*",
+ "express": "<3.0",
"querystring": "*",
"request": "*",
- "murmurhash3": "*",
"sprintf": "*",
"node-native-zip": "*"
- }
+ },
+ "engines": {
+ "node": "0.6.x",
+ "npm": "1.0.x"
+ }
}
View
@@ -50,11 +50,13 @@
<hr />
<p>Pick your output settings:</p>
- <div id='contacts_settings'>
+ <div id='export_settings'>
Output as:
<select id='export_data_type'>
<option>CSV</option>
- </select>
+ </select><br />
+ Zip file: <input type='checkbox' id='zip_file' /><br />
+ <span id='include_media'>Include photos in zip: <input type='checkbox' id='attach_photos' /></span>
</div>
<hr />
@@ -78,11 +80,31 @@
$(function() {
+ $("#include_media").hide();
+ $("#export_service_type").change(function() {
+ if ($("#export_service_type").val().toLowerCase() == "photos") {
+ $("#include_media").show();
+ } else {
+ $("#include_media").hide();
+ }
+ });
+
+ $("#attach_photos").attr("disabled", "disabled");
+ $("#zip_file").change(function() {
+ if ($("#zip_file").is(":checked")) {
+ $("#attach_photos").removeAttr("disabled");
+ } else {
+ $("#attach_photos").attr("disabled", "disabled");
+ }
+ });
+
$("#export_link").hide();
$("#do_export").click(function() {
var type = $("#export_service_type");
if (!type) return;
- $("#export_link").attr("href", "http://" + window.location.host + "/csv?type=" + type.val().toLowerCase() + "&token=" + $.cookie("token"));
+ var zip = $("#zip_file").is(":checked") ? true : false;
+ var attach = !$("#attach_photos").is(":disabled") && $("#attach_photos").is(":checked") ? true : false;
+ $("#export_link").attr("href", "http://" + window.location.host + "/csv?type=" + type.val().toLowerCase() + (zip ? "&zip=true":"") + (attach ? "&download=true" : "") + "&token=" + $.cookie("token"));
$("#export_link").show();
});

0 comments on commit 6e0ed11

Please sign in to comment.