Skip to content

Commit

Permalink
Merge pull request #44 from owncloud/fix-welknown-issue-41
Browse files Browse the repository at this point in the history
Don't use wellknown if not needed
  • Loading branch information
DeepDiver1975 committed Feb 19, 2016
2 parents 216ab7a + aeed15e commit c206420
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion js/dav/dav.js
Expand Up @@ -683,7 +683,7 @@ var serviceDiscovery = _co2['default'].wrap(regeneratorRuntime.mark(function cal
uri = _url2['default'].format({
protocol: endpoint.protocol,
host: endpoint.host,
pathname: '/.well-known/' + options.accountType
pathname: !options.useProvidedPath ? '/.well-known/' + options.accountType : endpoint.pathname
});
req = request.basic({ method: 'GET' });
context$1$0.prev = 5;
Expand Down
2 changes: 1 addition & 1 deletion js/dav/lib/accounts.js
Expand Up @@ -30,7 +30,7 @@ let serviceDiscovery = co.wrap(function *(account, options) {
let uri = url.format({
protocol: endpoint.protocol,
host: endpoint.host,
pathname: `/.well-known/${options.accountType}`
pathname: (!options.useProvidedPath ? '/.well-known/' + options.accountType : endpoint.pathname)
});

let req = request.basic({ method: 'GET' });
Expand Down
51 changes: 26 additions & 25 deletions js/public/script.js
Expand Up @@ -67,30 +67,6 @@ app.directive('addressbooklist', function() {
};
});

app.controller('contactCtrl', ['$route', '$routeParams', function($route, $routeParams) {
var ctrl = this;

ctrl.openContact = function() {
$route.updateParams({
gid: $routeParams.gid,
uid: ctrl.contact.uid()});
};

console.log("Contact: ",ctrl.contact);

}]);

app.directive('contact', function() {
return {
scope: {},
controller: 'contactCtrl',
controllerAs: 'ctrl',
bindToController: {
contact: '=data'
},
templateUrl: OC.linkTo('contactsrework', 'templates/contact.html')
};
});
app.controller('contactdetailsCtrl', ['ContactService', '$routeParams', '$scope', function(ContactService, $routeParams, $scope) {
var ctrl = this;

Expand Down Expand Up @@ -131,6 +107,30 @@ app.directive('contactdetails', function() {
};
});

app.controller('contactCtrl', ['$route', '$routeParams', function($route, $routeParams) {
var ctrl = this;

ctrl.openContact = function() {
$route.updateParams({
gid: $routeParams.gid,
uid: ctrl.contact.uid()});
};

console.log("Contact: ",ctrl.contact);

}]);

app.directive('contact', function() {
return {
scope: {},
controller: 'contactCtrl',
controllerAs: 'ctrl',
bindToController: {
contact: '=data'
},
templateUrl: OC.linkTo('contactsrework', 'templates/contact.html')
};
});
app.controller('contactlistCtrl', ['$scope', 'ContactService', '$routeParams', function($scope, ContactService, $routeParams) {
var ctrl = this;

Expand Down Expand Up @@ -579,7 +579,8 @@ app.service('DavClient', function() {
app.service('DavService', ['DavClient', function(client) {
return client.createAccount({
server: OC.linkToRemoteBase('dav/addressbooks'),
accountType: 'carddav'
accountType: 'carddav',
useProvidedPath: true
});
}]);

Expand Down
3 changes: 2 additions & 1 deletion js/services/dav_service.js
@@ -1,6 +1,7 @@
app.service('DavService', ['DavClient', function(client) {
return client.createAccount({
server: OC.linkToRemoteBase('dav/addressbooks'),
accountType: 'carddav'
accountType: 'carddav',
useProvidedPath: true
});
}]);

0 comments on commit c206420

Please sign in to comment.