Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use wellknown if not needed #44

Merged
merged 1 commit into from Feb 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
});
}]);