Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaimund Schlüßler <raimund.schluessler@googlemail.com>2016-02-28 19:15:20 +0300
committerRaimund Schlüßler <raimund.schluessler@googlemail.com>2016-02-28 19:15:20 +0300
commit07bd2b5178d9c5372838cab72a4b43428fd01c4b (patch)
tree9593967c9371ce71a790c068b04c075fcbc63ff1
parent04030b52330785d5e34409956d3f3157e60c19da (diff)
Use getter for calendar properties everywhere
-rw-r--r--js/app/controllers/listcontroller.coffee6
-rw-r--r--js/app/controllers/taskscontroller.coffee10
-rw-r--r--js/app/services/models/listsmodel.coffee14
-rw-r--r--js/public/app.js28
4 files changed, 29 insertions, 29 deletions
diff --git a/js/app/controllers/listcontroller.coffee b/js/app/controllers/listcontroller.coffee
index 90a00fef..94e2c25a 100644
--- a/js/app/controllers/listcontroller.coffee
+++ b/js/app/controllers/listcontroller.coffee
@@ -46,11 +46,11 @@ CalendarService) ->
@_$scope.deleteList = (calendar) ->
really = confirm(t('tasks',
'This will delete the Calendar "%s" and all of its entries.')
- .replace('%s',calendar._properties.displayname))
+ .replace('%s',calendar.displayname))
if really
_$listsbusinesslayer.delete(calendar).then(()->
$location.path('/calendars/'+
- _$listsmodel.getStandardList()._properties.uri)
+ _$listsmodel.getStandardList().uri)
$scope.$apply()
)
@@ -82,7 +82,7 @@ CalendarService) ->
}
_$listsbusinesslayer.add(_$scope.status.newListName)
.then((calendar) ->
- $location.path('/calendars/'+calendar._properties.uri)
+ $location.path('/calendars/'+calendar.uri)
$scope.$apply()
)
diff --git a/js/app/controllers/taskscontroller.coffee b/js/app/controllers/taskscontroller.coffee
index 61836550..dd07d735 100644
--- a/js/app/controllers/taskscontroller.coffee
+++ b/js/app/controllers/taskscontroller.coffee
@@ -55,23 +55,23 @@ SettingsBusinessLayer, SearchBusinessLayer) ->
switch _$scope.route.collectionID
when 'starred'
return t('tasks','Add an important item in "%s"...')
- .replace('%s',calendar._properties.displayname)
+ .replace('%s',calendar.displayname)
when 'today'
return t('tasks','Add an item due today in "%s"...')
- .replace('%s',calendar._properties.displayname)
+ .replace('%s',calendar.displayname)
when 'all'
return t('tasks','Add an item in "%s"...')
- .replace('%s',calendar._properties.displayname)
+ .replace('%s',calendar.displayname)
when 'current'
return t('tasks','Add a current item in "%s"...')
- .replace('%s',calendar._properties.displayname)
+ .replace('%s',calendar.displayname)
when 'completed', 'week'
return null
else
if angular.isDefined(_$listsmodel.getByUri(_$scope.route.calendarID))
return t('tasks','Add an item in "%s"...')
.replace('%s',
- _$listsmodel.getByUri(_$scope.route.calendarID)._properties.displayname)
+ _$listsmodel.getByUri(_$scope.route.calendarID).displayname)
@_$scope.getSubAddString = (taskname) ->
return t('tasks','Add a subtask to "%s"...')
diff --git a/js/app/services/models/listsmodel.coffee b/js/app/services/models/listsmodel.coffee
index 63f72d6c..f126b034 100644
--- a/js/app/services/models/listsmodel.coffee
+++ b/js/app/services/models/listsmodel.coffee
@@ -99,20 +99,20 @@ angular.module('Tasks').factory 'ListsModel',
return calendar
add: (calendar, clearCache=true) ->
- updateByUri = angular.isDefined(calendar._properties.uri) and
- angular.isDefined(@getByUri(calendar._properties.uri))
+ updateByUri = angular.isDefined(calendar.uri) and
+ angular.isDefined(@getByUri(calendar.uri))
if updateByUri
@update(calendar, clearCache)
else
- if angular.isDefined(calendar._properties.uri)
+ if angular.isDefined(calendar.uri)
if (clearCache)
@_invalidateCache()
- if (angular.isDefined(@_dataMap[calendar._properties.uri]))
+ if (angular.isDefined(@_dataMap[calendar.uri]))
# return @update(data, clearCache)
else
@_data.push(calendar)
- return @_dataMap[calendar._properties.uri] = calendar
+ return @_dataMap[calendar.uri] = calendar
getByUri: (uri) ->
return @_dataMap[uri]
@@ -133,8 +133,8 @@ angular.module('Tasks').factory 'ListsModel',
for entry, counter in @_data
if entry == calendar
@_data.splice(counter, 1)
- data = @_dataMap[calendar._properties.uri]
- delete @_dataMap[calendar._properties.uri]
+ data = @_dataMap[calendar.uri]
+ delete @_dataMap[calendar.uri]
if clearCache
@_invalidateCache()
return data
diff --git a/js/public/app.js b/js/public/app.js
index 17a5e960..7322945c 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -750,10 +750,10 @@
this._$scope.status.listNameBackup = '';
this._$scope.deleteList = function(calendar) {
var really;
- really = confirm(t('tasks', 'This will delete the Calendar "%s" and all of its entries.').replace('%s', calendar._properties.displayname));
+ really = confirm(t('tasks', 'This will delete the Calendar "%s" and all of its entries.').replace('%s', calendar.displayname));
if (really) {
return _$listsbusinesslayer["delete"](calendar).then(function() {
- $location.path('/calendars/' + _$listsmodel.getStandardList()._properties.uri);
+ $location.path('/calendars/' + _$listsmodel.getStandardList().uri);
return $scope.$apply();
});
}
@@ -786,7 +786,7 @@
notLoaded: 0
};
_$listsbusinesslayer.add(_$scope.status.newListName).then(function(calendar) {
- $location.path('/calendars/' + calendar._properties.uri);
+ $location.path('/calendars/' + calendar.uri);
return $scope.$apply();
});
return _$scope.status.newListName = '';
@@ -1015,20 +1015,20 @@
if (angular.isDefined(_$scope.route.collectionID)) {
switch (_$scope.route.collectionID) {
case 'starred':
- return t('tasks', 'Add an important item in "%s"...').replace('%s', calendar._properties.displayname);
+ return t('tasks', 'Add an important item in "%s"...').replace('%s', calendar.displayname);
case 'today':
- return t('tasks', 'Add an item due today in "%s"...').replace('%s', calendar._properties.displayname);
+ return t('tasks', 'Add an item due today in "%s"...').replace('%s', calendar.displayname);
case 'all':
- return t('tasks', 'Add an item in "%s"...').replace('%s', calendar._properties.displayname);
+ return t('tasks', 'Add an item in "%s"...').replace('%s', calendar.displayname);
case 'current':
- return t('tasks', 'Add a current item in "%s"...').replace('%s', calendar._properties.displayname);
+ return t('tasks', 'Add a current item in "%s"...').replace('%s', calendar.displayname);
case 'completed':
case 'week':
return null;
}
} else {
if (angular.isDefined(_$listsmodel.getByUri(_$scope.route.calendarID))) {
- return t('tasks', 'Add an item in "%s"...').replace('%s', _$listsmodel.getByUri(_$scope.route.calendarID)._properties.displayname);
+ return t('tasks', 'Add an item in "%s"...').replace('%s', _$listsmodel.getByUri(_$scope.route.calendarID).displayname);
}
}
}
@@ -3030,19 +3030,19 @@ angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', function($
if (clearCache == null) {
clearCache = true;
}
- updateByUri = angular.isDefined(calendar._properties.uri) && angular.isDefined(this.getByUri(calendar._properties.uri));
+ updateByUri = angular.isDefined(calendar.uri) && angular.isDefined(this.getByUri(calendar.uri));
if (updateByUri) {
return this.update(calendar, clearCache);
} else {
- if (angular.isDefined(calendar._properties.uri)) {
+ if (angular.isDefined(calendar.uri)) {
if (clearCache) {
this._invalidateCache();
}
- if (angular.isDefined(this._dataMap[calendar._properties.uri])) {
+ if (angular.isDefined(this._dataMap[calendar.uri])) {
} else {
this._data.push(calendar);
- return this._dataMap[calendar._properties.uri] = calendar;
+ return this._dataMap[calendar.uri] = calendar;
}
}
}
@@ -3076,8 +3076,8 @@ angular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', function($
entry = _ref[counter];
if (entry === calendar) {
this._data.splice(counter, 1);
- data = this._dataMap[calendar._properties.uri];
- delete this._dataMap[calendar._properties.uri];
+ data = this._dataMap[calendar.uri];
+ delete this._dataMap[calendar.uri];
if (clearCache) {
this._invalidateCache();
}