Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
saschaishikawa committed Jun 30, 2016
2 parents 1cadab6 + e6462d3 commit 429f78a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ templates.js
.tmp/
coverage/
node_modules/
app/panoptes-client.js
5 changes: 3 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ <h4 ng-bind="category.category"></h4>
<script src="bower_components/svg-pan-zoom/dist/svg-pan-zoom.js"></script>
<script src="bower_components/packery/dist/packery.pkgd.js"></script>

<!-- <script src="bower_components/panoptes-javascript-lib/dist/panoptes-javascript-lib.js"></script> -->
<script src ="bower_components/panoptes-client/index_built.js"></script>
<script src="panoptes-client.js"></script>

<script src="modules/app/scripts/init.js"></script>
<script src="modules/app/scripts/home-controller.js"></script>
Expand Down Expand Up @@ -228,6 +227,8 @@ <h4 ng-bind="category.category"></h4>

<script src="modules/zooniverse/scripts/init.js"></script>
<script src="modules/zooniverse/scripts/zooniverse-footer.factory.js"></script>
<script src="modules/zooniverse/scripts/zooniverse-footer.directive.js"></script>

<script src="modules/zooniverse/scripts/zooniverse-footer.directive.js"></script>
<!-- endbuild -->

Expand Down
23 changes: 13 additions & 10 deletions app/modules/zoo-api/scripts/project-service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
(function (angular, _) {
'use strict';

// use to determine if in production or staging
var isProd = window.location.hostname === 'www.oldweather.org' || window.location.hostname === 'oldweather.org';

var module = angular.module('zooAPI');

var upsert = function (arr, key, newVal) {
Expand All @@ -15,19 +18,19 @@

module.constant('zooAPIConfig', {
display_name: 'oldweather',
app_id: '0cee9a29027e78cc7f9df99a3d6b0d00aaf3bbfad014a4bb73bf29f30b46575f' // panoptes staging
// app_id: '2b10a14e8f11eefb130a275f01898c8406600834bff1063bb1b7938795acc8a3' // panoptes production
app_id: isProd ?
'2b10a14e8f11eefb130a275f01898c8406600834bff1063bb1b7938795acc8a3' : // production
'0cee9a29027e78cc7f9df99a3d6b0d00aaf3bbfad014a4bb73bf29f30b46575f', // staging
url: isProd ?
'https://panoptes.zooniverse.org/api' :
'https://panoptes-staging.zooniverse.org/api'
});

module.factory('zooAPI', function ($window, zooAPIConfig) {
// Set API root depending on environment
var isProd = window.location.hostname === 'www.oldweather.org' || window.location.hostname === 'oldweather.org';
$window.zooAPI.root = isProd ? 'https://panoptes.zooniverse.org/api' : 'https://panoptes-staging.zooniverse.org/api';
// Send Old Weather app id when in production
if (isProd) {
$window.zooAPI.appID = zooAPIConfig.app_id;
}
return $window.zooAPI;
console.log('zooAPIConfig = ', zooAPIConfig);
$window.zooAPI.root = zooAPIConfig.url;
$window.zooAPI.appID = zooAPIConfig.app_id;
return $window.zooAPI;
});

module.filter('removeCircularDeps', function () {
Expand Down
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"angular-spinner": "0.6.1",
"spin.js": "2.3.0",
"animate.css": "3.3.0",
"panoptes-javascript-lib": "0.0.3",
"angular-local-storage": "0.2.2",
"masonry": "3.3.1",
"packery": "1.4.1",
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"doc": "docs"
},
"scripts": {
"postinstall": "gulp hookmeup",
"postinstall": "bower install && browserify panoptes-client-wrapper/index.js > app/panoptes-client.js && gulp hookmeup",
"test": "gulp test-ci"
},
"repository": {
Expand All @@ -21,6 +21,8 @@
},
"homepage": "https://github.com/zooniverse/old-weather",
"devDependencies": {
"bower": "^1.7.9",
"browserify": "^13.0.1",
"gulp": "^3.8.11",
"gulp-angular-templatecache": "^1.6.0",
"gulp-chmod": "1.2.0",
Expand All @@ -45,7 +47,9 @@
"karma-firefox-launcher": "^0.1.6",
"karma-jasmine": "0.3.5",
"nib": "1.1.0",
"panoptes-client": "^2.5.1",
"run-sequence": "^1.1.0",
"stylus": "^0.51.1"
}
},
"dependencies": {}
}
2 changes: 2 additions & 0 deletions panoptes-client-wrapper/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
window.zooAPI = require('panoptes-client/lib/api-client');
window.zooAuth = require('panoptes-client/lib/auth');

0 comments on commit 429f78a

Please sign in to comment.