Skip to content

Commit 62da3bc

Browse files
committed
Merge pull request #10 from zendtech/revert-1-master
Revert "Update README.md - bower section"
2 parents bae21b3 + ca0667a commit 62da3bc

File tree

7 files changed

+20
-38
lines changed

7 files changed

+20
-38
lines changed

README.md

-10
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ Importing the project in Zend Studio
2424
9. Click Finish to clone the repository.
2525
10. Switch back to the PHP perspective, you will find the on-the-go-mobile project in the PHP Explorer view.
2626

27-
Installing the front-end dependencies with Zend Studio and Bower
28-
----------------------------------------------------------------
29-
(You must have configured Zend Studio to use Bower.)
30-
31-
1. Right-click on the mobile project in the PHP Explorer view.
32-
2. Select Bower > Install Dependencies from the context menu.
33-
3. Refresh the project.
34-
35-
Dependencies are installed into the www/lib directory.
36-
3727
Running the application
3828
-----------------------
3929
The easiest way to run the mobile application from Zend Studio is by using the CordovaSim emulator. It's a light-weight and fast web-based emulator that allows testing of Cordova-based mobile applications.

www/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
2121

22+
2223
<!-- your app's script -->
2324
<script src="lib/lodash/dist/lodash.js"></script>
2425
<script src="lib/highcharts/highcharts-all.js"></script>
@@ -27,7 +28,6 @@
2728
<script src="lib/Toast.js"></script>
2829
<script src="js/main.js"></script>
2930
<script src="js/app.js"></script>
30-
<script src="js/services/config.js"></script>
3131
<script src="js/controllers/app.js"></script>
3232
<script src="js/controllers/home.js"></script>
3333
<script src="js/controllers/monitor.js"></script>

www/js/controllers/login.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
angular.module('onthego.controllers')
22

3-
.controller('LoginController', function($rootScope, $scope, $http, $state, $ionicLoading, AuthenticationService, Config) {
3+
.controller('LoginController', function($rootScope, $scope, $http, $state, $ionicLoading, AuthenticationService) {
44
$rootScope.data = {};
55
$scope.data = {
6-
'server': Config.server,
6+
'server': 'http://onthego.zend.com/on-the-go-api',
77
//'server': 'http://54.209.165.66/on-the-go-api',
8-
'user': Config.user
8+
'user': {
9+
'username': 'demo',
10+
'password': 'zend'
11+
}
912
}
10-
13+
1114
$scope.login = function() {
12-
AuthenticationService.login(Config.user);
15+
window.localStorage.setItem('server', $scope.data.server);
16+
AuthenticationService.login($scope.data.user);
1317
};
1418

1519
$scope.logout = function() {

www/js/services/authentication.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
angular.module('onthego.services')
2-
.factory('AuthenticationService', function($rootScope, $http, authService, Config) {
2+
.factory('AuthenticationService', function($rootScope, $http, authService) {
33
var service = {
44
login: function(user) {
55
var payload = {};
66
payload.username = user.username;
77
payload.password = user.password;
88
payload.grant_type = 'password';
99
payload.client_id = 'on-the-go';
10-
var basePath = Config.server;
10+
var basePath = window.localStorage.getItem('server');
1111
var config = {
1212
url: basePath + '/oauth',
1313
method: 'POST',

www/js/services/config.js

-12
This file was deleted.

www/js/services/issue.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
angular.module('onthego.services')
22

3-
.factory('IssueResource', function ($rootScope, $http, $q, $window, Hal, Config) {
3+
.factory('IssueResource', function ($rootScope, $http, $q, Hal) {
44

55
return {
66
getList: function() {
7-
if (Config.server == null) {
7+
if (window.localStorage.getItem('server') == null) {
88
$rootScope.$broadcast('event:auth-loginRequired');
99
}
10-
var issuePath = Config.server + '/api/monitor-issues';
10+
var issuePath = window.localStorage.getItem('server') + '/api/monitor-issues';
1111
var issues;
1212
var config = {
1313
method: 'GET',
@@ -22,7 +22,7 @@ angular.module('onthego.services')
2222
);
2323
},
2424
get: function(issueId) {
25-
var issuePath = Config.server + '/api/monitor-issues';
25+
var issuePath = window.localStorage.getItem('server') + '/api/monitor-issues';
2626
var config = {
2727
method: 'GET',
2828
url: issuePath + '/' + issueId
@@ -34,7 +34,7 @@ angular.module('onthego.services')
3434
);
3535
},
3636
share: function(id) {
37-
var issuePath = Config.server + '/api/monitor-issues';
37+
var issuePath = window.localStorage.getItem('server') + '/api/monitor-issues';
3838
var config = {
3939
method: 'POST',
4040
url: issuePath + '/' + issueId,

www/js/services/stat.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
angular.module('onthego.services')
22

3-
.factory('StatResource', function ($rootScope, $http, $q, Hal, Config) {
3+
.factory('StatResource', function ($rootScope, $http, $q, Hal) {
44

55
return {
66
getList: function(type, from, to) {
7-
if (Config.server == null) {
7+
if (window.localStorage.getItem('server') == null) {
88
$rootScope.$broadcast('event:auth-loginRequired');
99
}
10-
var statPath = Config.server + '/api/statistics';
10+
var statPath = window.localStorage.getItem('server') + '/api/statistics';
1111
var stats;
1212
var url = statPath + "?type=" + type + "&from=" + from + '&to=' + to + '&' + makeid();
1313
/*if (! [500, 503, 504, 505].contains(type)) {

0 commit comments

Comments
 (0)