diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2017-09-17 18:48:20 +0300 |
---|---|---|
committer | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2017-09-17 18:48:20 +0300 |
commit | 8464ca12e3e5bc593340b011244a794db006da6b (patch) | |
tree | 16a0f4b1ca3881d2fee1e29f22c5d143e118a5b4 | |
parent | d8b9feedaef28f32dcb00f36f7eb7d9b5a674e6d (diff) |
Fix sort order priority icon
-rw-r--r-- | js/app/controllers/taskscontroller.js | 2 | ||||
-rw-r--r-- | js/public/app.min.js | 2 | ||||
-rw-r--r-- | js/public/app.min.js.map | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/js/app/controllers/taskscontroller.js b/js/app/controllers/taskscontroller.js index 049a9cb2..33ac362b 100644 --- a/js/app/controllers/taskscontroller.js +++ b/js/app/controllers/taskscontroller.js @@ -370,7 +370,7 @@ case 'start': return 'icon-calendar'; case 'priority': - return 'icon-star'; + return 'icon-task-star'; case 'alphabetically': return 'icon-alphabetically'; case 'manual': diff --git a/js/public/app.min.js b/js/public/app.min.js index 00008dd5..29f089aa 100644 --- a/js/public/app.min.js +++ b/js/public/app.min.js @@ -1,4 +1,4 @@ -!function(e,r,s){"use strict";angular.module("Tasks",["ngRoute","ngAnimate","ui.select","ngSanitize","dndLists"]).config(["$provide","$routeProvider","$interpolateProvider","$httpProvider",function(t,e,n,s){t.value("Config",{markReadTimeout:500,taskUpdateInterval:6e5}),s.defaults.headers.common.requesttoken=r,e.when("/calendars/:calendarID",{}).when("/calendars/:calendarID/edit/:listparameter",{}).when("/calendars/:calendarID/tasks/:taskID",{}).when("/calendars/:calendarID/tasks/:taskID/settings",{}).when("/calendars/:calendarID/tasks/:taskID/edit/:parameter",{}).when("/collections/:collectionID/tasks/:taskID",{}).when("/collections/:collectionID/tasks/:taskID/settings",{}).when("/collections/:collectionID/tasks/:taskID/edit/:parameter",{}).when("/collections/:collectionID",{}).when("/search/:searchString",{}).when("/search/:searchString/tasks/:taskID",{}).when("/search/:searchString/tasks/:taskID/edit/:parameter",{}).otherwise({redirectTo:"/collections/all"})}]),angular.module("Tasks").run(["$document","$rootScope","Config","$timeout","ListsBusinessLayer","TasksBusinessLayer","SearchBusinessLayer",function(e,n,r,s,a,o,i){var u,c=!1;return(u=function(){var t;return t=function(){return s(u,r.taskUpdateInterval)},c=!0,t()}).call(),OCA.Search.tasks=i,e.click(function(t){n.$broadcast("documentClicked",t)}),moment.locale("details",{calendar:{lastDay:"["+t("tasks","Due yesterday")+"], HH:mm",sameDay:"["+t("tasks","Due today")+"], HH:mm",nextDay:"["+t("tasks","Due tomorrow")+"], HH:mm",lastWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm",nextWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm",sameElse:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm"}}),moment.locale("details_allday",{calendar:{lastDay:"["+t("tasks","Due yesterday")+"]",sameDay:"["+t("tasks","Due today")+"]",nextDay:"["+t("tasks","Due tomorrow")+"]",lastWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY",nextWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY",sameElse:"["+t("tasks","Due on")+"] MMM DD, YYYY"}}),moment.locale("start",{calendar:{lastDay:"["+t("tasks","Started yesterday")+"], HH:mm",sameDay:"["+t("tasks","Starts today")+"], HH:mm",nextDay:"["+t("tasks","Starts tomorrow")+"], HH:mm",lastWeek:"["+t("tasks","Started on")+"] MMM DD, YYYY, HH:mm",nextWeek:"["+t("tasks","Starts on")+"] MMM DD, YYYY, HH:mm",sameElse:function(){return this.diff(moment())>0?"["+t("tasks","Starts on")+"] MMM DD, YYYY, HH:mm":"["+t("tasks","Started on")+"] MMM DD, YYYY, HH:mm"}}}),moment.locale("start_allday",{calendar:{lastDay:"["+t("tasks","Started yesterday")+"]",sameDay:"["+t("tasks","Starts today")+"]",nextDay:"["+t("tasks","Starts tomorrow")+"]",lastWeek:"["+t("tasks","Started on")+"] MMM DD, YYYY",nextWeek:"["+t("tasks","Starts on")+"] MMM DD, YYYY",sameElse:function(){return this.diff(moment())>0?"["+t("tasks","Starts on")+"] MMM DD, YYYY":"["+t("tasks","Started on")+"] MMM DD, YYYY"}}}),moment.locale("reminder",{calendar:{lastDay:t("tasks","[Remind me yesterday at ]HH:mm"),sameDay:t("tasks","[Remind me today at ]HH:mm"),nextDay:t("tasks","[Remind me tomorrow at ]HH:mm"),lastWeek:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm"),nextWeek:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm"),sameElse:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm")}}),moment.locale("tasks",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"]",nextDay:"["+t("tasks","Tomorrow")+"]",lastWeek:"DD.MM.YYYY",nextWeek:"DD.MM.YYYY",sameElse:"DD.MM.YYYY"}}),moment.locale("details_short",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"]",nextDay:"["+t("tasks","Tomorrow")+"]",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY",sameElse:"MMM DD, YYYY"}}),moment.locale("list_week",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"], MMM. DD",nextDay:"["+t("tasks","Tomorrow")+"], MMM. DD",lastWeek:"ddd, MMM. DD",nextWeek:"ddd, MMM. DD",sameElse:"ddd, MMM. DD"}}),moment.locale("en",{relativeTime:{future:t("tasks","in %s"),past:t("tasks","%s ago"),s:t("tasks","seconds"),m:t("tasks","a minute"),mm:t("tasks","%d minutes"),h:t("tasks","an hour"),hh:t("tasks","%d hours"),d:t("tasks","a day"),dd:t("tasks","%d days"),M:t("tasks","a month"),MM:t("tasks","%d months"),y:t("tasks","a year"),yy:t("tasks","%d years")}})}]),angular.module("Tasks").controller("AppController",["$scope","$rootScope","ListsBusinessLayer","$route","Status","$timeout","$location","$routeParams","Loading","SettingsModel","Persistence",function(t,n,r,s,a,o,i,u,c,l,d){return new(function(){function n(n,r,s,a,o,i,u,c,l,d,p){this._$scope=n,this._$listsbusinesslayer=s,this._$route=a,this._$status=o,this._$timeout=i,this._$location=u,this._$routeparams=c,this._Loading=l,this._$settingsmodel=d,this._persistence=p,this._$scope.status=this._$status.getStatus(),this._$scope.route=this._$routeparams,this._$scope.status.newListName="",this._$scope.settingsmodel=this._$settingsmodel,this._$listsbusinesslayer.init().then(function(e){Promise.all(e).then(function(){t.$apply()})}),this._persistence.init(),this._$scope.closeAll=function(t){(e(t.target).closest(".close-all").length||e(t.currentTarget).is(e(t.target).closest(".handler")))&&(angular.isUndefined(n.route.calendarID)?angular.isUndefined(n.route.collectionID)?u.path("/collections/all"):u.path("/collections/"+n.route.collectionID):("name"===n.route.listparameter&&r.$broadcast("cancelEditCalendar",n.route.calendarID),u.path("/calendars/"+n.route.calendarID)),n.status.addingList=!1,n.status.focusTaskInput=!1,n.status.newListName=""),e(t.target).closest(".newList").length||(n.status.addingList=!1,n.status.newListName=""),e(t.target).closest(".add-subtask").length||(n.status.addSubtaskTo=null,n.status.focusSubtaskInput=!1)},this._$scope.isLoading=function(){return l.isLoading()}}return n}())(t,n,r,s,a,o,i,u,c,l,d)}]),angular.module("Tasks").controller("DetailsController",["$scope","$window","TasksModel","TasksBusinessLayer","$route","$location","$timeout","$routeParams","SettingsModel","Loading","ListsModel",function(n,r,s,a,o,i,u,c,l,d,p){return new(function(){function r(r,s,a,o,u,c,l,d,p,m,h){this._$scope=r,this._$window=s,this._$tasksmodel=a,this._$listsmodel=h,this._tasksbusinesslayer=o,this._$route=u,this._$location=c,this._$timeout=l,this._$routeparams=d,this._$settingsmodel=p,this._Loading=m,this._$scope.task=a.getById(r.route.taskID),this._$scope.found=!0,this._$scope.$on("$routeChangeSuccess",function(){var t=a.getByUri(r.route.taskID);angular.isUndefined(t)||null===t?void 0!==r.route.taskID&&(r.found=!1):(r.task=t,r.task.cats=t.categories,r.found=!0)}),this._$scope.settingsmodel=this._$settingsmodel,this._$scope.settingsmodel.add({id:"various",categories:[]}),this._$scope.isAddingComment=!1,this._$scope.timers=[],this._$scope.durations=[{name:t("tasks","week"),names:t("tasks","weeks"),id:"week"},{name:t("tasks","day"),names:t("tasks","days"),id:"day"},{name:t("tasks","hour"),names:t("tasks","hours"),id:"hour"},{name:t("tasks","minute"),names:t("tasks","minutes"),id:"minute"},{name:t("tasks","second"),names:t("tasks","seconds"),id:"second"}],this._$scope.loadTask=function(t){var e=a.getByUri(r.route.taskID);angular.isUndefined(e)||null===e||(r.task=e,r.found=!0)},this._$scope.TaskState=function(){return r.found?"found":m.isLoading()?"loading":null},this._$scope.params=[{name:t("tasks","before beginning"),invert:!0,related:"START",id:"10"},{name:t("tasks","after beginning"),invert:!1,related:"START",id:"00"},{name:t("tasks","before end"),invert:!0,related:"END",id:"11"},{name:t("tasks","after end"),invert:!1,related:"END",id:"01"}],this._$scope.filterParams=function(t){var e;if(e=a.getById(r.route.taskID),!angular.isUndefined(e)&&null!==e)return e.due&&e.start?t:e.start?t.slice(0,2):t.slice(2)},this._$scope.deleteTask=function(t){return l(function(){return o.deleteTask(t).then(function(){return n.$apply()})},500)},this._$scope.triggerUpdate=function(t){o.triggerUpdate(t)},this._$scope.editName=function(t,n){n.calendar.writable&&(e(t.target).is("a")||r.setEditRoute("name"))},this._$scope.editDueDate=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&(r.setEditRoute("duedate"),o.initDueDate(n))},this._$scope.editStart=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&(r.setEditRoute("startdate"),o.initStartDate(n))},this._$scope.editReminder=function(t,n){if(n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler")))return r.setEditRoute("reminer"),o.initReminder(r.route.taskID)},this._$scope.editNote=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&(e(t.target).is("a")||r.setEditRoute("note"))},this._$scope.editPriority=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&r.setEditRoute("priority")},this._$scope.editPercent=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&r.setEditRoute("percent")},this._$scope.endEdit=function(t){(e(t.target).closest(".end-edit").length||e(t.currentTarget).is(e(t.target).closest(".handler")))&&r.resetRoute()},this._$scope.endName=function(t){if(13===t.keyCode&&(t.preventDefault(),r.resetRoute()),27===t.keyCode)return r.resetRoute()},this._$scope.setEditRoute=function(t){var e=r.route.calendarID,n=r.route.collectionID;e?i.path("/calendars/"+e+"/tasks/"+r.route.taskID+"/edit/"+t):n&&i.path("/collections/"+n+"/tasks/"+r.route.taskID+"/edit/"+t)},this._$scope.resetRoute=function(){var t=r.route.calendarID,e=r.route.collectionID;t?i.path("/calendars/"+t+"/tasks/"+r.route.taskID):e&&i.path("/collections/"+e+"/tasks/"+r.route.taskID)},this._$scope.deletePercent=function(t){return o.setPercentComplete(t,0)},this._$scope.deleteReminder=function(){return o.deleteReminderDate(r.route.taskID)},this._$scope.toggleCompleted=function(t){t.completed?o.setPercentComplete(t,0):o.setPercentComplete(t,100)},this._$scope.setPercentComplete=function(t,e){o.setPercentComplete(t,e)},this._$scope.toggleStarred=function(t){t.priority>5?o.setPriority(t,0):o.setPriority(t,9)},this._$scope.deletePriority=function(t){return o.setPriority(t,0)},this._$scope.isDue=function(t){return a.due(t)},this._$scope.isOverDue=function(t){return a.overdue(t)},this._$scope.setstartday=function(t){return o.setStart(r.task,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setstarttime=function(t){return o.setStart(r.task,moment(t,"HH:mm"),"time")},this._$scope.deleteStartDate=function(t){o.deleteStartDate(t)},this._$scope.setdueday=function(t){return o.setDue(r.task,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setduetime=function(t){return o.setDue(r.task,moment(t,"HH:mm"),"time")},this._$scope.deleteDueDate=function(t){o.deleteDueDate(t)},this._$scope.isAllDayPossible=function(t){return!angular.isUndefined(t)&&t.calendar.writable&&(t.due||t.start)},this._$scope.toggleAllDay=function(t){o.setAllDay(t,!t.allDay)},this._$scope.setreminderday=function(t){return o.setReminderDate(r.route.taskID,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setremindertime=function(t){return o.setReminderDate(r.route.taskID,moment(t,"HH:mm"),"time")},this._$scope.reminderType=function(t){if(!angular.isUndefined(t))return null===t.reminder?moment(t.start,"YYYYMMDDTHHmmss").isValid()||moment(t.due,"YYYYMMDDTHHmmss").isValid()?"DURATION":"DATE-TIME":t.reminder.type},this._$scope.changeReminderType=function(t){return o.checkReminderDate(t.id),"DURATION"===this.reminderType(t)?t.reminder?t.reminder.type="DATE-TIME":t.reminder={type:"DATE-TIME"}:t.reminder?t.reminder.type="DURATION":t.reminder={type:"DURATION"},o.setReminder(t.id)},this._$scope.setReminderDuration=function(t){return o.setReminder(r.route.taskID)},this._$scope.addComment=function(){var t;r.CommentContent&&(r.isAddingComment=!0,t={tmpID:"newComment"+Date.now(),comment:r.CommentContent,taskID:r.route.taskID,time:moment().format("YYYYMMDDTHHmmss"),name:e("#expandDisplayName").text()},o.addComment(t,function(t){a.updateComment(t),r.isAddingComment=!1},function(){r.isAddingComment=!1}),r.CommentContent="")},this._$scope.sendComment=function(t){if(13===t.keyCode)return r.addComment()},this._$scope.deleteComment=function(t){return o.deleteComment(r.route.taskID,t)},this._$scope.commentStrings=function(){return{button:t("tasks","Comment"),input:t("tasks","Add a comment")}},this._$scope.addCategory=function(t,e){r.task.categories=r.task.cats;var n=r.settingsmodel.getById("various").categories;n.indexOf(t)<0&&n.push(t),o.doUpdate(r.task)},this._$scope.removeCategory=function(t,e){r.task.categories=r.task.cats,o.doUpdate(r.task)}}return r}())(n,r,s,a,o,i,u,c,l,d,p)}]),angular.module("Tasks").controller("ListController",["$scope","$rootScope","$window","$routeParams","ListsModel","TasksBusinessLayer","CollectionsModel","ListsBusinessLayer","$location","SearchBusinessLayer","CalendarService","TasksModel","$timeout",function(n,r,s,a,o,i,u,c,l,d,p,m,h){return new(function(){function r(r,a,o,i,u,c,l,d,p,m,h,f,g){this._$scope=r,this._$window=o,this._$routeParams=i,this._$listsmodel=u,this._$tasksmodel=f,this._$tasksbusinesslayer=c,this._$collectionsmodel=l,this._$listsbusinesslayer=d,this.$location=p,this._$timeout=g,this._$searchbusinesslayer=m,this._$calendarservice=h,this._$scope.collections=this._$collectionsmodel.getAll(),this._$scope.calendars=this._$listsmodel.getAll(),this._$scope.draggedTasks=[],this._$scope.TasksBusinessLayer=this._$tasksbusinesslayer,this._$scope.nameError=!1,this._$scope.color="#31CC7C",this._$scope.deleteMessage=function(e){return t("tasks",'This will delete the Calendar "%s" and all of its entries.').replace("%s",e.displayname)},this._$scope.delete=function(t){return d.delete(t).then(function(){return p.path("/calendars/"+u.getStandardList().uri),n.$apply()})},this._$scope.startCreate=function(){r.status.addingList=!0,r.nameError=!1,e(".hasTooltip").tooltip("hide"),g(function(){e("#newList").focus()},50)},this._$scope.create=function(){r.isNameAllowed(r.status.newListName).allowed&&(r.status.addingList=!1,r.isAddingList=!0,d.add(r.status.newListName,r.color).then(function(t){return p.path("/calendars/"+t.uri),n.$apply()}),r.status.newListName="")},this._$scope.cancelCreate=function(){e(".hasTooltip").tooltip("hide"),r.nameError=!1,r.status.addingList=!1,r.status.newListName=""},this._$scope.startEdit=function(t){r.status.addingList=!1,r.nameError=!1,e(".hasTooltip").tooltip("hide"),t.prepareUpdate(),p.path("/calendars/"+r.route.calendarID+"/edit/name"),g(function(){e("#list_"+t.uri+" input.edit").focus()},50)},this._$scope.showCalDAVUrl=function(t){r.status.addingList=!1,r.nameError=!1,p.path("/calendars/"+r.route.calendarID+"/edit/caldav"),g(function(){e("#list_"+t.uri+" input.caldav").focus()},50)},this._$scope.hideCalDAVUrl=function(){p.path("/calendars/"+r.route.calendarID)},this._$scope.download=function(t){var e=t.url;"/"===e.slice(e.length-1)&&(e=e.slice(0,e.length-1)),e+="?export",s.open(e)},this._$scope.checkNew=function(t,e){r.checkName(t,e)},this._$scope.checkEdit=function(t,e){r.checkName(t,e.displayname,e.uri),27===t.keyCode&&r.cancelEdit(e)},this._$scope.checkName=function(t,n,s){var a=r.isNameAllowed(n,s),o=e(t.currentTarget);a.allowed?(o.tooltip("hide"),r.nameError=!1):(o.attr("title",a.msg).tooltip({placement:"bottom",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),r.nameError=!0),27===t.keyCode&&(t.preventDefault(),o.tooltip("hide"),r.status.addingList=!1,r.status.newListName="",r.nameError=!1)},a.$on("cancelEditCalendar",function(t,e){var n=u.getByUri(e);r.cancelEdit(n)}),this._$scope.cancelEdit=function(t){t.resetToPreviousState(),e(".hasTooltip").tooltip("hide"),r.nameError=!1,p.path("/calendars/"+r.route.calendarID)},this._$scope.saveEdit=function(t){r.isNameAllowed(t.displayname,t.uri).allowed&&(d.rename(t),p.path("/calendars/"+r.route.calendarID))},this._$scope.isNameAllowed=function(e,n){var r={allowed:!1,msg:""};return u.isNameAlreadyTaken(e,n)?r.msg=t("tasks",'The name "%s" is already used.').replace("%s",e):e?r.allowed=!0:r.msg=t("tasks","An empty name is not allowed."),r},this._$scope.getCollectionCount=function(t){var e;return e=m.getFilter(),l.getCount(t,e)},this._$scope.hideCollection=function(t){var e;switch(e=l.getById(t),e.show){case 0:return!0;case 1:return!1;case 2:return this.getCollectionCount(t)<1}},this._$scope.getCollectionString=function(t){var e;return"completed"!==t?(e=m.getFilter(),l.getCount(t,e)):""},this._$scope.getListCount=function(t,e){var n;return n=m.getFilter(),u.getCount(t,e,n)},this._$scope.dragoverList=function(t,n){var r=e(t.target).closest("li.list").attr("calendarID");return u.getByUri(r).writable},this._$scope.dropList=function(t,n,s){if("move"===t.dataTransfer.dropEffect){var a=f.getByUri(s.uri),o=e(t.target).closest("li.list").attr("calendarID"),i=u.getByUri(o);c.changeCalendar(a,i).then(function(){r.$apply()})}return!0},this._$scope.dragoverCollection=function(t,n){if("copy"===t.dataTransfer.effectAllowed||"copyMove"===t.dataTransfer.effectAllowed&&t.ctrlKey)return!1;var r;return"starred"===(r=e(t.target).closest("li.collection").attr("collectionID"))||"completed"===r||"today"===r},this._$scope.dropCollection=function(t,n,r){if("move"===t.dataTransfer.dropEffect){var s=e(t.target).closest("li.collection").attr("collectionID");c.changeCollection(r.uri,s)}return!0}}return r}())(n,r,s,a,o,i,u,c,l,d,p,m,h)}]),angular.module("Tasks").controller("SettingsController",["$scope","$window","Status","$location","CollectionsModel","SettingsBusinessLayer","SettingsModel",function(e,n,r,s,a,o,i){return new(function(){function e(e,n,r,s,a,o,i){this._$scope=e,this._$window=n,this._$status=r,this._$location=s,this._$collectionsmodel=a,this._$settingsbusinesslayer=o,this._$settingsmodel=i,this._$scope.status=this._$status.getStatus(),this._$scope.collections=this._$collectionsmodel.getAll(),this._$scope.settingsmodel=this._$settingsmodel,this._$scope.collectionOptions=[{id:0,name:t("tasks","Hidden")},{id:1,name:t("tasks","Visible")},{id:2,name:t("tasks","Automatic")}],this._$scope.startOfWeekOptions=[{id:0,name:t("tasks","Sunday")},{id:1,name:t("tasks","Monday")},{id:2,name:t("tasks","Tuesday")},{id:3,name:t("tasks","Wednesday")},{id:4,name:t("tasks","Thursday")},{id:5,name:t("tasks","Friday")},{id:6,name:t("tasks","Saturday")}],this._$scope.setVisibility=function(t){var e;return e=a.getById(t),o.setVisibility(t,e.show)},this._$scope.setStartOfWeek=function(){return o.set("various","startOfWeek",i.getById("various").startOfWeek)}}return e}())(e,n,r,s,a,o,i)}]),function(){var r=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};angular.module("Tasks").controller("TasksController",["$scope","$window","$routeParams","TasksModel","ListsModel","CollectionsModel","TasksBusinessLayer","$location","SettingsBusinessLayer","SearchBusinessLayer","VTodo","SettingsModel",function(s,a,o,i,u,c,l,d,p,m,h,f){return new(function(){function a(a,o,i,u,c,l,d,p,m,f,g,y){this._$scope=a,this._$window=o,this._$routeParams=i,this._$tasksmodel=u,this._$listsmodel=c,this._$collectionsmodel=l,this._tasksbusinesslayer=d,this.$location=p,this._settingsbusinesslayer=m,this._searchbusinesslayer=f,this._vtodo=g,this._$scope.tasks=this._$tasksmodel.getAll(),this._$scope.draggedTasks=[],this._$scope.calendars=this._$listsmodel.getAll(),this._$scope.days=[0,1,2,3,4,5,6],this._$scope.isAddingTask=!1,this._$scope.focusInputField=!1,this._$scope.TasksModel=this._$tasksmodel,this._$scope.TasksBusinessLayer=this._tasksbusinesslayer,this._$settingsmodel=y,this._$scope.addTask=function(t,e,n,r){var o;null===n&&(n=""),a.isAddingTask=!0;var i={calendar:null,related:e,summary:t,priority:"0",due:!1,start:!1,reminder:null,completed:!1,complete:"0",note:""};"starred"===(o=a.route.collectionID)||"today"===o||"week"===o||"all"===o||"completed"===o||"current"===o?(i.calendar=e?n:c.getStandardList(),"starred"===a.route.collectionID&&(i.priority="1"),"today"===a.route.collectionID&&(i.due=moment().startOf("day").format("YYYY-MM-DDTHH:mm:ss")),"current"===a.route.collectionID&&(i.start=moment().format("YYYY-MM-DDTHH:mm:ss"))):i.calendar=c.getByUri(a.route.calendarID),i=h.create(i),d.add(i).then(function(t){return a.isAddingTask=!1,a.openDetails(t.uri,null),s.$apply()}),r&&d.setHideSubtasks(r,0),a.status.focusTaskInput=!1,a.status.focusSubtaskInput=!1,a.status.addSubtaskTo=null,a.status.taskName="",a.status.subtaskName=""},this._$scope.getAddString=function(){var e=c.getStandardList();if(angular.isDefined(e))if(angular.isDefined(a.route.collectionID))switch(a.route.collectionID){case"starred":return t("tasks",'Add an important item in "%s"...').replace("%s",e.displayname);case"today":return t("tasks",'Add an item due today in "%s"...').replace("%s",e.displayname);case"all":return t("tasks",'Add an item in "%s"...').replace("%s",e.displayname);case"current":return t("tasks",'Add a current item in "%s"...').replace("%s",e.displayname);case"completed":case"week":return null}else if(angular.isDefined(c.getByUri(a.route.calendarID)))return t("tasks",'Add an item in "%s"...').replace("%s",c.getByUri(a.route.calendarID).displayname)},this._$scope.getSubAddString=function(e){return t("tasks",'Add a subtask to "%s"...').replace("%s",e)},this._$scope.showSubtaskInput=function(t){a.status.addSubtaskTo=t},this._$scope.hideSubtasks=function(t){var e=a.route.taskID,n=u.getDescendantIDs(t);return t.uri!==e&&(!(r.call(n,e)>=0)&&t.hideSubtasks)},this._$scope.showInput=function(){var t=a.route.collectionID,e=c.getByUri(a.route.calendarID);return"completed"!==t&&"week"!==t&&(!angular.isDefined(e)||e.writable)},this._$scope.focusTaskInput=function(){a.status.focusTaskInput=!0},this._$scope.focusSubtaskInput=function(){a.status.focusSubtaskInput=!0},this._$scope.openDetails=function(t,n){var r=a.route.calendarID,o=a.route.collectionID;if(null===n||e(n.currentTarget).is(e(n.target).closest(".handler"))){var i=u.getByUri(t);i.loadedCompleted||d.getAll(i.calendar,!0,i).then(function(){i.loadedCompleted=!0,s.$apply()}),r?p.path("/calendars/"+r+"/tasks/"+t):o&&p.path("/collections/"+o+"/tasks/"+t)}},this._$scope.toggleCompleted=function(t){t.completed?d.setPercentComplete(t,0):d.setPercentComplete(t,100)},this._$scope.toggleStarred=function(t){t.priority>5?d.setPriority(t,0):d.setPriority(t,9)},this._$scope.toggleHidden=function(){return m.toggle("various","showHidden")},this._$scope.filterTasks=function(t,e){return function(t){return u.filterTasks(t,e)}},this._$scope.getSubTasks=function(t,e){var n,r,s,a;for(n=[],s=0,a=t.length;s<a;s++)r=t[s],r.related!==e.uid||r===e||e.hideCompletedSubtasks&&r.completed||n.push(r);return n},this._$scope.hasNoParent=function(t){return function(t){return u.hasNoParent(t)}},this._$scope.hasSubtasks=function(t){return u.hasSubtasks(t.uid)},this._$scope.hasCompletedSubtasks=function(t){return u.hasCompletedSubtasks(t.uid)},this._$scope.toggleSubtasks=function(t){d.setHideSubtasks(t,!t.hideSubtasks)},this._$scope.toggleCompletedSubtasks=function(t){d.setHideCompletedSubtasks(t,!t.hideCompletedSubtasks)},this._$scope.filterTasksByString=function(t){return function(t){var e=f.getFilter();return u.filterTasksByString(t,e)}},this._$scope.filteredTasks=function(){var t;return t=f.getFilter(),u.filteredTasks(t)},this._$scope.dayHasEntry=function(){return function(t){var e,n,r,s,a;for(e=f.getFilter(),r=u.filteredTasks(e),s=0,a=r.length;s<a;s++)if(n=r[s],!n.completed&&u.hasNoParent(n)&&u.taskAtDay(n,t))return!0;return!1}},this._$scope.taskAtDay=function(t,e){return function(t){return u.taskAtDay(t,e)}},this._$scope.filterLists=function(){return function(t){return a.getCount(t.uri,a.route.collectionID)}},this._$scope.getCount=function(t,e){var n=f.getFilter();return c.getCount(t,e,n)},this._$scope.getCountString=function(t,e){var r=f.getFilter();return n("tasks","%n Completed Task","%n Completed Tasks",c.getCount(t,e,r))},this._$scope.checkTaskInput=function(t){27===t.keyCode&&(e(t.currentTarget).blur(),a.status.taskName="",a.status.subtaskName="",a.status.addSubtaskTo=null,a.status.focusTaskInput=!1,a.status.focusSubtaskInput=!1)},this._$scope.getCompletedTasks=function(t){var e=c.getById(t);d.getAll(e,!0).then(function(){c.setLoadedCompleted(t),s.$apply()})},this._$scope.loadedCompleted=function(t){return c.loadedCompleted(t)},this._$scope.sortDue=function(t){return null===t.due?"last":t.due},this._$scope.sortStart=function(t){return null===t.start?"last":t.start},this._$scope.getSortOrder=function(){switch(a.settingsmodel.getById("various").sortOrder){case"due":return a.sortDue;case"start":return a.sortStart;case"priority":return"-priority";case"alphabetically":return"summary";case"manual":return"manual";default:return["completed",a.sortDue,"-priority",a.sortStart,"summary"]}},this._$scope.getSortOrderIcon=function(){switch(a.settingsmodel.getById("various").sortOrder){case"due":case"start":return"icon-calendar";case"priority":return"icon-star";case"alphabetically":return"icon-alphabetically";case"manual":return"icon-manual";default:return"icon-menu"}},this._$scope.setSortOrder=function(t,e){a.settingsmodel.getById("various").sortDirection=a.settingsmodel.getById("various").sortOrder===e?+!a.settingsmodel.getById("various").sortDirection:0,a.settingsmodel.getById("various").sortOrder=e,m.set("various","sortOrder",e),m.set("various","sortDirection",a.settingsmodel.getById("various").sortDirection)},this._$scope.dropAsSubtask=function(t,n,r){if("move"===t.dataTransfer.dropEffect){var s=e(t.target).closest(".task-item").attr("taskID"),a=u.getByUri(n.uri),o=u.getByUri(s);d.changeParent(a,o)}return e(".subtasks-container").removeClass("dropzone-visible"),!0},this._$scope.dropAsRootTask=function(t,n,r){if("move"===t.dataTransfer.dropEffect){var a=u.getByUri(n.uri),o=e(t.target).closest("ol[dnd-list]").attr("collectionID"),i=e(t.target).closest("ol[dnd-list]").attr("calendarID"),l=c.getByUri(i),p=d.makeRootTask(a,l,o);Promise.all(p).then(function(){s.$apply()})}return e(".subtasks-container").removeClass("dropzone-visible"),!0},this._$scope.dragover=function(t,n,r){e(".subtasks-container").removeClass("dropzone-visible");var s=e(t.target).closest("ol[dnd-list]").attr("calendarID");return!!c.getByUri(s).writable&&(e(t.target).closest(".task-item").children(".subtasks-container").addClass("dropzone-visible"),!0)},this._$scope.allow=function(t){return t.calendar.writable?"copyMove":"copy"},this._$scope.dragStart=function(t){("copy"===t.dataTransfer.effectAllowed||"copyMove"===t.dataTransfer.effectAllowed&&t.ctrlKey)&&e(t.target).addClass("copy")},this._$scope.dragEnd=function(t){e(t.target).removeClass("copy")}}return a}())(s,a,o,i,u,c,l,d,p,m,h,f)}])}.call(void 0),angular.module("Tasks").directive("appNavigationEntryUtils",function(){return{restrict:"C",link:function(t,n){var r,s;s=n.siblings(".app-navigation-entry-menu"),r=e(n).find(".app-navigation-entry-utils-menu-button button"),r.click(function(){s.toggleClass("open")}),t.$on("documentClicked",function(t,e){e.target!==r[0]&&s.removeClass("open")})}}}),angular.module("Tasks").directive("autofocusOnInsert",function(){return function(t,e){return e.focus()}}),angular.module("Tasks").directive("avatar",function(){return{restrict:"A",scope:!1,link:function(t,e,n){return n.$observe("userid",function(){if(n.userid)return e.avatar(n.userid,n.size)})}}});var a=function(t,e,n){if(Array.isArray(t)&&(e=t[1],n=t[2],t=t[0]),void 0===t)return[0,0,0];e/=100,n/=100;var r=(1-Math.abs(2*n-1))*e,s=t/60,a=r*(1-Math.abs(s%2-1));s=Math.floor(s);var o,i,u;0===s?(o=r,i=a,u=0):1===s?(o=a,i=r,u=0):2===s?(o=0,i=r,u=a):3===s?(o=0,i=a,u=r):4===s?(o=a,i=0,u=r):5===s&&(o=r,i=0,u=a);var c=n-r/2;return o+=c,i+=c,u+=c,[Math.round(255*o),Math.round(255*i),Math.round(255*u)]},o=function(t,e,n){return Array.isArray(t)&&(e=t[1],n=t[2],t=t[0]),"#"+parseInt(t,10).toString(16)+parseInt(e,10).toString(16)+parseInt(n,10).toString(16)},i=["#31CC7C","#317CCC","#FF7A66","#F1DB50","#7C31CC","#CC317C","#3A3B3D","#CACBCD"],u=function(){return"function"==typeof String.prototype.toHsl?o(a(Math.random().toString().toHsl())):i[Math.floor(Math.random()*i.length)]};angular.module("Tasks").directive("colorpicker",function(){if("function"==typeof String.prototype.toHsl){var t="",e="";i=["15","9","4","b","6","11","74","f","57"],i.forEach(function(n,r){t=n.toHsl(),e=a(t),i[r]=o(e)})}return{scope:{selected:"=",customizedColors:"=colors"},restrict:"AE",templateUrl:OC.filePath("tasks","templates","colorpicker.html"),link:function(t,e,n){t.colors=t.customizedColors||i,t.selected=t.selected||t.colors[0],t.random="#000000",t.randomizeColour=function(){t.random=u(),t.pick(t.random)},t.pick=function(e){t.selected=e}}}}),angular.module("Tasks").directive("confirmation",function(){return{priority:-1,restrict:"A",templateUrl:OC.generateUrl("/apps/tasks/templates/confirmation",{}),scope:{confirmationFunction:"&confirmation",confirmationMessage:"&confirmationMessage"},controller:"ConfirmationController"}}),angular.module("Tasks").controller("ConfirmationController",["$scope","$rootScope","$element","$attrs","$compile","$document","$window","$timeout",function(t,e,n,r,s,a,o,i){return new(function(){function e(e,n,r,s,a,o,i,u){this._$scope=e,this._$scope.countdown=3,r.bind("click",function(t){e.countdown=3,r.removeClass("active");var n=e.confirmationMessage()?e.confirmationMessage():"Are you sure?";r.hasClass("confirmed")||(t.stopPropagation(),e.activate(),r.children(".confirmation-confirm").tooltip({title:n,container:"body",placement:"right"}),r.addClass("confirmed"))}),r.children(".confirmation-confirm").bind("click",function(t){if(r.hasClass("confirmed active"))return void e.confirmationFunction();t.stopPropagation()}),this._$scope.documentClick=function(){r.removeClass("confirmed")},this._$scope.activate=function(){e.countdown?(r.find(".countdown").html(e.countdown+" s"),u(function(){e.activate()},1e3),e.countdown--):r.addClass("active")},o.bind("click",e.documentClick),o.bind("touchend",e.documentClick),t.$on("$destroy",function(){o.unbind("click",e.documentClick),o.unbind("touchend",e.documentClick)})}return e}())(t,e,n,r,s,a,o,i)}]),angular.module("Tasks").directive("datepicker",function(){return{restrict:"A",scope:!1,link:function(t,n,r){return n.datepicker({onSelect:function(e,n){return t["set"+r.datepicker+"day"](e),t.$apply()},beforeShow:function(n,r){var s,a;return s=e(r).datepicker("widget"),a=-Math.abs(e(n).outerWidth()-s.outerWidth())/2+"px",s.css({"margin-left":a}),e("div.ui-datepicker:before").css({left:"100px"}),e(".hasDatepicker").datepicker("option","firstDay",t.settingsmodel.getById("various").startOfWeek)},beforeShowDay:function(e){return 0===moment(e).startOf("day").diff(moment(t.task[r.datepicker],"YYYYMMDDTHHmmss").startOf("day"),"days")?[1,"selected"]:[1,""]},minDate:null})}}}),angular.module("Tasks").directive("ocClickFocus",["$timeout",function(t){return function(n,r,s){var a;if(a=n.$eval(s.ocClickFocus),angular.isDefined(a)&&angular.isDefined(a.selector))return r.click(function(){return angular.isDefined(a.timeout)?t(function(){return e(a.selector).focus()},a.timeout):e(a.selector).focus()})}}]),angular.module("Tasks").directive("timepicker",function(){return{restrict:"A",link:function(e,n,r){return n.timepicker({onSelect:function(t,n){return e["set"+r.timepicker+"time"](t),e.$apply()},myPosition:"center top",atPosition:"center bottom",hourText:t("tasks","Hours"),minuteText:t("tasks","Minutes")})}}}),angular.module("Tasks").directive("watchTop",function(){return{restrict:"A",link:function(t,e,n){return t.$watch(function(){t.divTop=e.prev().outerHeight(!0)})}}}),angular.module("Tasks").filter("counterFormatter",function(){return function(t){switch(!1){case 0!==t:return"";case t<999:return"999+";default:return t}}}),angular.module("Tasks").filter("dateDetails",function(){return function(e){return moment(e,"YYYYMMDDTHHmmss").isValid()?moment(e,"YYYYMMDDTHHmmss").locale(e.isDate?"details_allday":"details").calendar():t("tasks","Set due date")}}), +!function(e,r,s){"use strict";angular.module("Tasks",["ngRoute","ngAnimate","ui.select","ngSanitize","dndLists"]).config(["$provide","$routeProvider","$interpolateProvider","$httpProvider",function(t,e,n,s){t.value("Config",{markReadTimeout:500,taskUpdateInterval:6e5}),s.defaults.headers.common.requesttoken=r,e.when("/calendars/:calendarID",{}).when("/calendars/:calendarID/edit/:listparameter",{}).when("/calendars/:calendarID/tasks/:taskID",{}).when("/calendars/:calendarID/tasks/:taskID/settings",{}).when("/calendars/:calendarID/tasks/:taskID/edit/:parameter",{}).when("/collections/:collectionID/tasks/:taskID",{}).when("/collections/:collectionID/tasks/:taskID/settings",{}).when("/collections/:collectionID/tasks/:taskID/edit/:parameter",{}).when("/collections/:collectionID",{}).when("/search/:searchString",{}).when("/search/:searchString/tasks/:taskID",{}).when("/search/:searchString/tasks/:taskID/edit/:parameter",{}).otherwise({redirectTo:"/collections/all"})}]),angular.module("Tasks").run(["$document","$rootScope","Config","$timeout","ListsBusinessLayer","TasksBusinessLayer","SearchBusinessLayer",function(e,n,r,s,a,o,i){var u,c=!1;return(u=function(){var t;return t=function(){return s(u,r.taskUpdateInterval)},c=!0,t()}).call(),OCA.Search.tasks=i,e.click(function(t){n.$broadcast("documentClicked",t)}),moment.locale("details",{calendar:{lastDay:"["+t("tasks","Due yesterday")+"], HH:mm",sameDay:"["+t("tasks","Due today")+"], HH:mm",nextDay:"["+t("tasks","Due tomorrow")+"], HH:mm",lastWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm",nextWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm",sameElse:"["+t("tasks","Due on")+"] MMM DD, YYYY, HH:mm"}}),moment.locale("details_allday",{calendar:{lastDay:"["+t("tasks","Due yesterday")+"]",sameDay:"["+t("tasks","Due today")+"]",nextDay:"["+t("tasks","Due tomorrow")+"]",lastWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY",nextWeek:"["+t("tasks","Due on")+"] MMM DD, YYYY",sameElse:"["+t("tasks","Due on")+"] MMM DD, YYYY"}}),moment.locale("start",{calendar:{lastDay:"["+t("tasks","Started yesterday")+"], HH:mm",sameDay:"["+t("tasks","Starts today")+"], HH:mm",nextDay:"["+t("tasks","Starts tomorrow")+"], HH:mm",lastWeek:"["+t("tasks","Started on")+"] MMM DD, YYYY, HH:mm",nextWeek:"["+t("tasks","Starts on")+"] MMM DD, YYYY, HH:mm",sameElse:function(){return this.diff(moment())>0?"["+t("tasks","Starts on")+"] MMM DD, YYYY, HH:mm":"["+t("tasks","Started on")+"] MMM DD, YYYY, HH:mm"}}}),moment.locale("start_allday",{calendar:{lastDay:"["+t("tasks","Started yesterday")+"]",sameDay:"["+t("tasks","Starts today")+"]",nextDay:"["+t("tasks","Starts tomorrow")+"]",lastWeek:"["+t("tasks","Started on")+"] MMM DD, YYYY",nextWeek:"["+t("tasks","Starts on")+"] MMM DD, YYYY",sameElse:function(){return this.diff(moment())>0?"["+t("tasks","Starts on")+"] MMM DD, YYYY":"["+t("tasks","Started on")+"] MMM DD, YYYY"}}}),moment.locale("reminder",{calendar:{lastDay:t("tasks","[Remind me yesterday at ]HH:mm"),sameDay:t("tasks","[Remind me today at ]HH:mm"),nextDay:t("tasks","[Remind me tomorrow at ]HH:mm"),lastWeek:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm"),nextWeek:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm"),sameElse:t("tasks","[Remind me on ]MMM DD, YYYY,[ at ]HH:mm")}}),moment.locale("tasks",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"]",nextDay:"["+t("tasks","Tomorrow")+"]",lastWeek:"DD.MM.YYYY",nextWeek:"DD.MM.YYYY",sameElse:"DD.MM.YYYY"}}),moment.locale("details_short",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"]",nextDay:"["+t("tasks","Tomorrow")+"]",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY",sameElse:"MMM DD, YYYY"}}),moment.locale("list_week",{calendar:{lastDay:"["+t("tasks","Yesterday")+"]",sameDay:"["+t("tasks","Today")+"], MMM. DD",nextDay:"["+t("tasks","Tomorrow")+"], MMM. DD",lastWeek:"ddd, MMM. DD",nextWeek:"ddd, MMM. DD",sameElse:"ddd, MMM. DD"}}),moment.locale("en",{relativeTime:{future:t("tasks","in %s"),past:t("tasks","%s ago"),s:t("tasks","seconds"),m:t("tasks","a minute"),mm:t("tasks","%d minutes"),h:t("tasks","an hour"),hh:t("tasks","%d hours"),d:t("tasks","a day"),dd:t("tasks","%d days"),M:t("tasks","a month"),MM:t("tasks","%d months"),y:t("tasks","a year"),yy:t("tasks","%d years")}})}]),angular.module("Tasks").controller("AppController",["$scope","$rootScope","ListsBusinessLayer","$route","Status","$timeout","$location","$routeParams","Loading","SettingsModel","Persistence",function(t,n,r,s,a,o,i,u,c,l,d){return new(function(){function n(n,r,s,a,o,i,u,c,l,d,p){this._$scope=n,this._$listsbusinesslayer=s,this._$route=a,this._$status=o,this._$timeout=i,this._$location=u,this._$routeparams=c,this._Loading=l,this._$settingsmodel=d,this._persistence=p,this._$scope.status=this._$status.getStatus(),this._$scope.route=this._$routeparams,this._$scope.status.newListName="",this._$scope.settingsmodel=this._$settingsmodel,this._$listsbusinesslayer.init().then(function(e){Promise.all(e).then(function(){t.$apply()})}),this._persistence.init(),this._$scope.closeAll=function(t){(e(t.target).closest(".close-all").length||e(t.currentTarget).is(e(t.target).closest(".handler")))&&(angular.isUndefined(n.route.calendarID)?angular.isUndefined(n.route.collectionID)?u.path("/collections/all"):u.path("/collections/"+n.route.collectionID):("name"===n.route.listparameter&&r.$broadcast("cancelEditCalendar",n.route.calendarID),u.path("/calendars/"+n.route.calendarID)),n.status.addingList=!1,n.status.focusTaskInput=!1,n.status.newListName=""),e(t.target).closest(".newList").length||(n.status.addingList=!1,n.status.newListName=""),e(t.target).closest(".add-subtask").length||(n.status.addSubtaskTo=null,n.status.focusSubtaskInput=!1)},this._$scope.isLoading=function(){return l.isLoading()}}return n}())(t,n,r,s,a,o,i,u,c,l,d)}]),angular.module("Tasks").controller("DetailsController",["$scope","$window","TasksModel","TasksBusinessLayer","$route","$location","$timeout","$routeParams","SettingsModel","Loading","ListsModel",function(n,r,s,a,o,i,u,c,l,d,p){return new(function(){function r(r,s,a,o,u,c,l,d,p,m,h){this._$scope=r,this._$window=s,this._$tasksmodel=a,this._$listsmodel=h,this._tasksbusinesslayer=o,this._$route=u,this._$location=c,this._$timeout=l,this._$routeparams=d,this._$settingsmodel=p,this._Loading=m,this._$scope.task=a.getById(r.route.taskID),this._$scope.found=!0,this._$scope.$on("$routeChangeSuccess",function(){var t=a.getByUri(r.route.taskID);angular.isUndefined(t)||null===t?void 0!==r.route.taskID&&(r.found=!1):(r.task=t,r.task.cats=t.categories,r.found=!0)}),this._$scope.settingsmodel=this._$settingsmodel,this._$scope.settingsmodel.add({id:"various",categories:[]}),this._$scope.isAddingComment=!1,this._$scope.timers=[],this._$scope.durations=[{name:t("tasks","week"),names:t("tasks","weeks"),id:"week"},{name:t("tasks","day"),names:t("tasks","days"),id:"day"},{name:t("tasks","hour"),names:t("tasks","hours"),id:"hour"},{name:t("tasks","minute"),names:t("tasks","minutes"),id:"minute"},{name:t("tasks","second"),names:t("tasks","seconds"),id:"second"}],this._$scope.loadTask=function(t){var e=a.getByUri(r.route.taskID);angular.isUndefined(e)||null===e||(r.task=e,r.found=!0)},this._$scope.TaskState=function(){return r.found?"found":m.isLoading()?"loading":null},this._$scope.params=[{name:t("tasks","before beginning"),invert:!0,related:"START",id:"10"},{name:t("tasks","after beginning"),invert:!1,related:"START",id:"00"},{name:t("tasks","before end"),invert:!0,related:"END",id:"11"},{name:t("tasks","after end"),invert:!1,related:"END",id:"01"}],this._$scope.filterParams=function(t){var e;if(e=a.getById(r.route.taskID),!angular.isUndefined(e)&&null!==e)return e.due&&e.start?t:e.start?t.slice(0,2):t.slice(2)},this._$scope.deleteTask=function(t){return l(function(){return o.deleteTask(t).then(function(){return n.$apply()})},500)},this._$scope.triggerUpdate=function(t){o.triggerUpdate(t)},this._$scope.editName=function(t,n){n.calendar.writable&&(e(t.target).is("a")||r.setEditRoute("name"))},this._$scope.editDueDate=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&(r.setEditRoute("duedate"),o.initDueDate(n))},this._$scope.editStart=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&(r.setEditRoute("startdate"),o.initStartDate(n))},this._$scope.editReminder=function(t,n){if(n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler")))return r.setEditRoute("reminer"),o.initReminder(r.route.taskID)},this._$scope.editNote=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&(e(t.target).is("a")||r.setEditRoute("note"))},this._$scope.editPriority=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&r.setEditRoute("priority")},this._$scope.editPercent=function(t,n){n.calendar.writable&&e(t.currentTarget).is(e(t.target).closest(".handler"))&&r.setEditRoute("percent")},this._$scope.endEdit=function(t){(e(t.target).closest(".end-edit").length||e(t.currentTarget).is(e(t.target).closest(".handler")))&&r.resetRoute()},this._$scope.endName=function(t){if(13===t.keyCode&&(t.preventDefault(),r.resetRoute()),27===t.keyCode)return r.resetRoute()},this._$scope.setEditRoute=function(t){var e=r.route.calendarID,n=r.route.collectionID;e?i.path("/calendars/"+e+"/tasks/"+r.route.taskID+"/edit/"+t):n&&i.path("/collections/"+n+"/tasks/"+r.route.taskID+"/edit/"+t)},this._$scope.resetRoute=function(){var t=r.route.calendarID,e=r.route.collectionID;t?i.path("/calendars/"+t+"/tasks/"+r.route.taskID):e&&i.path("/collections/"+e+"/tasks/"+r.route.taskID)},this._$scope.deletePercent=function(t){return o.setPercentComplete(t,0)},this._$scope.deleteReminder=function(){return o.deleteReminderDate(r.route.taskID)},this._$scope.toggleCompleted=function(t){t.completed?o.setPercentComplete(t,0):o.setPercentComplete(t,100)},this._$scope.setPercentComplete=function(t,e){o.setPercentComplete(t,e)},this._$scope.toggleStarred=function(t){t.priority>5?o.setPriority(t,0):o.setPriority(t,9)},this._$scope.deletePriority=function(t){return o.setPriority(t,0)},this._$scope.isDue=function(t){return a.due(t)},this._$scope.isOverDue=function(t){return a.overdue(t)},this._$scope.setstartday=function(t){return o.setStart(r.task,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setstarttime=function(t){return o.setStart(r.task,moment(t,"HH:mm"),"time")},this._$scope.deleteStartDate=function(t){o.deleteStartDate(t)},this._$scope.setdueday=function(t){return o.setDue(r.task,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setduetime=function(t){return o.setDue(r.task,moment(t,"HH:mm"),"time")},this._$scope.deleteDueDate=function(t){o.deleteDueDate(t)},this._$scope.isAllDayPossible=function(t){return!angular.isUndefined(t)&&t.calendar.writable&&(t.due||t.start)},this._$scope.toggleAllDay=function(t){o.setAllDay(t,!t.allDay)},this._$scope.setreminderday=function(t){return o.setReminderDate(r.route.taskID,moment(t,"MM/DD/YYYY"),"day")},this._$scope.setremindertime=function(t){return o.setReminderDate(r.route.taskID,moment(t,"HH:mm"),"time")},this._$scope.reminderType=function(t){if(!angular.isUndefined(t))return null===t.reminder?moment(t.start,"YYYYMMDDTHHmmss").isValid()||moment(t.due,"YYYYMMDDTHHmmss").isValid()?"DURATION":"DATE-TIME":t.reminder.type},this._$scope.changeReminderType=function(t){return o.checkReminderDate(t.id),"DURATION"===this.reminderType(t)?t.reminder?t.reminder.type="DATE-TIME":t.reminder={type:"DATE-TIME"}:t.reminder?t.reminder.type="DURATION":t.reminder={type:"DURATION"},o.setReminder(t.id)},this._$scope.setReminderDuration=function(t){return o.setReminder(r.route.taskID)},this._$scope.addComment=function(){var t;r.CommentContent&&(r.isAddingComment=!0,t={tmpID:"newComment"+Date.now(),comment:r.CommentContent,taskID:r.route.taskID,time:moment().format("YYYYMMDDTHHmmss"),name:e("#expandDisplayName").text()},o.addComment(t,function(t){a.updateComment(t),r.isAddingComment=!1},function(){r.isAddingComment=!1}),r.CommentContent="")},this._$scope.sendComment=function(t){if(13===t.keyCode)return r.addComment()},this._$scope.deleteComment=function(t){return o.deleteComment(r.route.taskID,t)},this._$scope.commentStrings=function(){return{button:t("tasks","Comment"),input:t("tasks","Add a comment")}},this._$scope.addCategory=function(t,e){r.task.categories=r.task.cats;var n=r.settingsmodel.getById("various").categories;n.indexOf(t)<0&&n.push(t),o.doUpdate(r.task)},this._$scope.removeCategory=function(t,e){r.task.categories=r.task.cats,o.doUpdate(r.task)}}return r}())(n,r,s,a,o,i,u,c,l,d,p)}]),angular.module("Tasks").controller("ListController",["$scope","$rootScope","$window","$routeParams","ListsModel","TasksBusinessLayer","CollectionsModel","ListsBusinessLayer","$location","SearchBusinessLayer","CalendarService","TasksModel","$timeout",function(n,r,s,a,o,i,u,c,l,d,p,m,h){return new(function(){function r(r,a,o,i,u,c,l,d,p,m,h,f,g){this._$scope=r,this._$window=o,this._$routeParams=i,this._$listsmodel=u,this._$tasksmodel=f,this._$tasksbusinesslayer=c,this._$collectionsmodel=l,this._$listsbusinesslayer=d,this.$location=p,this._$timeout=g,this._$searchbusinesslayer=m,this._$calendarservice=h,this._$scope.collections=this._$collectionsmodel.getAll(),this._$scope.calendars=this._$listsmodel.getAll(),this._$scope.draggedTasks=[],this._$scope.TasksBusinessLayer=this._$tasksbusinesslayer,this._$scope.nameError=!1,this._$scope.color="#31CC7C",this._$scope.deleteMessage=function(e){return t("tasks",'This will delete the Calendar "%s" and all of its entries.').replace("%s",e.displayname)},this._$scope.delete=function(t){return d.delete(t).then(function(){return p.path("/calendars/"+u.getStandardList().uri),n.$apply()})},this._$scope.startCreate=function(){r.status.addingList=!0,r.nameError=!1,e(".hasTooltip").tooltip("hide"),g(function(){e("#newList").focus()},50)},this._$scope.create=function(){r.isNameAllowed(r.status.newListName).allowed&&(r.status.addingList=!1,r.isAddingList=!0,d.add(r.status.newListName,r.color).then(function(t){return p.path("/calendars/"+t.uri),n.$apply()}),r.status.newListName="")},this._$scope.cancelCreate=function(){e(".hasTooltip").tooltip("hide"),r.nameError=!1,r.status.addingList=!1,r.status.newListName=""},this._$scope.startEdit=function(t){r.status.addingList=!1,r.nameError=!1,e(".hasTooltip").tooltip("hide"),t.prepareUpdate(),p.path("/calendars/"+r.route.calendarID+"/edit/name"),g(function(){e("#list_"+t.uri+" input.edit").focus()},50)},this._$scope.showCalDAVUrl=function(t){r.status.addingList=!1,r.nameError=!1,p.path("/calendars/"+r.route.calendarID+"/edit/caldav"),g(function(){e("#list_"+t.uri+" input.caldav").focus()},50)},this._$scope.hideCalDAVUrl=function(){p.path("/calendars/"+r.route.calendarID)},this._$scope.download=function(t){var e=t.url;"/"===e.slice(e.length-1)&&(e=e.slice(0,e.length-1)),e+="?export",s.open(e)},this._$scope.checkNew=function(t,e){r.checkName(t,e)},this._$scope.checkEdit=function(t,e){r.checkName(t,e.displayname,e.uri),27===t.keyCode&&r.cancelEdit(e)},this._$scope.checkName=function(t,n,s){var a=r.isNameAllowed(n,s),o=e(t.currentTarget);a.allowed?(o.tooltip("hide"),r.nameError=!1):(o.attr("title",a.msg).tooltip({placement:"bottom",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),r.nameError=!0),27===t.keyCode&&(t.preventDefault(),o.tooltip("hide"),r.status.addingList=!1,r.status.newListName="",r.nameError=!1)},a.$on("cancelEditCalendar",function(t,e){var n=u.getByUri(e);r.cancelEdit(n)}),this._$scope.cancelEdit=function(t){t.resetToPreviousState(),e(".hasTooltip").tooltip("hide"),r.nameError=!1,p.path("/calendars/"+r.route.calendarID)},this._$scope.saveEdit=function(t){r.isNameAllowed(t.displayname,t.uri).allowed&&(d.rename(t),p.path("/calendars/"+r.route.calendarID))},this._$scope.isNameAllowed=function(e,n){var r={allowed:!1,msg:""};return u.isNameAlreadyTaken(e,n)?r.msg=t("tasks",'The name "%s" is already used.').replace("%s",e):e?r.allowed=!0:r.msg=t("tasks","An empty name is not allowed."),r},this._$scope.getCollectionCount=function(t){var e;return e=m.getFilter(),l.getCount(t,e)},this._$scope.hideCollection=function(t){var e;switch(e=l.getById(t),e.show){case 0:return!0;case 1:return!1;case 2:return this.getCollectionCount(t)<1}},this._$scope.getCollectionString=function(t){var e;return"completed"!==t?(e=m.getFilter(),l.getCount(t,e)):""},this._$scope.getListCount=function(t,e){var n;return n=m.getFilter(),u.getCount(t,e,n)},this._$scope.dragoverList=function(t,n){var r=e(t.target).closest("li.list").attr("calendarID");return u.getByUri(r).writable},this._$scope.dropList=function(t,n,s){if("move"===t.dataTransfer.dropEffect){var a=f.getByUri(s.uri),o=e(t.target).closest("li.list").attr("calendarID"),i=u.getByUri(o);c.changeCalendar(a,i).then(function(){r.$apply()})}return!0},this._$scope.dragoverCollection=function(t,n){if("copy"===t.dataTransfer.effectAllowed||"copyMove"===t.dataTransfer.effectAllowed&&t.ctrlKey)return!1;var r;return"starred"===(r=e(t.target).closest("li.collection").attr("collectionID"))||"completed"===r||"today"===r},this._$scope.dropCollection=function(t,n,r){if("move"===t.dataTransfer.dropEffect){var s=e(t.target).closest("li.collection").attr("collectionID");c.changeCollection(r.uri,s)}return!0}}return r}())(n,r,s,a,o,i,u,c,l,d,p,m,h)}]),angular.module("Tasks").controller("SettingsController",["$scope","$window","Status","$location","CollectionsModel","SettingsBusinessLayer","SettingsModel",function(e,n,r,s,a,o,i){return new(function(){function e(e,n,r,s,a,o,i){this._$scope=e,this._$window=n,this._$status=r,this._$location=s,this._$collectionsmodel=a,this._$settingsbusinesslayer=o,this._$settingsmodel=i,this._$scope.status=this._$status.getStatus(),this._$scope.collections=this._$collectionsmodel.getAll(),this._$scope.settingsmodel=this._$settingsmodel,this._$scope.collectionOptions=[{id:0,name:t("tasks","Hidden")},{id:1,name:t("tasks","Visible")},{id:2,name:t("tasks","Automatic")}],this._$scope.startOfWeekOptions=[{id:0,name:t("tasks","Sunday")},{id:1,name:t("tasks","Monday")},{id:2,name:t("tasks","Tuesday")},{id:3,name:t("tasks","Wednesday")},{id:4,name:t("tasks","Thursday")},{id:5,name:t("tasks","Friday")},{id:6,name:t("tasks","Saturday")}],this._$scope.setVisibility=function(t){var e;return e=a.getById(t),o.setVisibility(t,e.show)},this._$scope.setStartOfWeek=function(){return o.set("various","startOfWeek",i.getById("various").startOfWeek)}}return e}())(e,n,r,s,a,o,i)}]),function(){var r=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};angular.module("Tasks").controller("TasksController",["$scope","$window","$routeParams","TasksModel","ListsModel","CollectionsModel","TasksBusinessLayer","$location","SettingsBusinessLayer","SearchBusinessLayer","VTodo","SettingsModel",function(s,a,o,i,u,c,l,d,p,m,h,f){return new(function(){function a(a,o,i,u,c,l,d,p,m,f,g,y){this._$scope=a,this._$window=o,this._$routeParams=i,this._$tasksmodel=u,this._$listsmodel=c,this._$collectionsmodel=l,this._tasksbusinesslayer=d,this.$location=p,this._settingsbusinesslayer=m,this._searchbusinesslayer=f,this._vtodo=g,this._$scope.tasks=this._$tasksmodel.getAll(),this._$scope.draggedTasks=[],this._$scope.calendars=this._$listsmodel.getAll(),this._$scope.days=[0,1,2,3,4,5,6],this._$scope.isAddingTask=!1,this._$scope.focusInputField=!1,this._$scope.TasksModel=this._$tasksmodel,this._$scope.TasksBusinessLayer=this._tasksbusinesslayer,this._$settingsmodel=y,this._$scope.addTask=function(t,e,n,r){var o;null===n&&(n=""),a.isAddingTask=!0;var i={calendar:null,related:e,summary:t,priority:"0",due:!1,start:!1,reminder:null,completed:!1,complete:"0",note:""};"starred"===(o=a.route.collectionID)||"today"===o||"week"===o||"all"===o||"completed"===o||"current"===o?(i.calendar=e?n:c.getStandardList(),"starred"===a.route.collectionID&&(i.priority="1"),"today"===a.route.collectionID&&(i.due=moment().startOf("day").format("YYYY-MM-DDTHH:mm:ss")),"current"===a.route.collectionID&&(i.start=moment().format("YYYY-MM-DDTHH:mm:ss"))):i.calendar=c.getByUri(a.route.calendarID),i=h.create(i),d.add(i).then(function(t){return a.isAddingTask=!1,a.openDetails(t.uri,null),s.$apply()}),r&&d.setHideSubtasks(r,0),a.status.focusTaskInput=!1,a.status.focusSubtaskInput=!1,a.status.addSubtaskTo=null,a.status.taskName="",a.status.subtaskName=""},this._$scope.getAddString=function(){var e=c.getStandardList();if(angular.isDefined(e))if(angular.isDefined(a.route.collectionID))switch(a.route.collectionID){case"starred":return t("tasks",'Add an important item in "%s"...').replace("%s",e.displayname);case"today":return t("tasks",'Add an item due today in "%s"...').replace("%s",e.displayname);case"all":return t("tasks",'Add an item in "%s"...').replace("%s",e.displayname);case"current":return t("tasks",'Add a current item in "%s"...').replace("%s",e.displayname);case"completed":case"week":return null}else if(angular.isDefined(c.getByUri(a.route.calendarID)))return t("tasks",'Add an item in "%s"...').replace("%s",c.getByUri(a.route.calendarID).displayname)},this._$scope.getSubAddString=function(e){return t("tasks",'Add a subtask to "%s"...').replace("%s",e)},this._$scope.showSubtaskInput=function(t){a.status.addSubtaskTo=t},this._$scope.hideSubtasks=function(t){var e=a.route.taskID,n=u.getDescendantIDs(t);return t.uri!==e&&(!(r.call(n,e)>=0)&&t.hideSubtasks)},this._$scope.showInput=function(){var t=a.route.collectionID,e=c.getByUri(a.route.calendarID);return"completed"!==t&&"week"!==t&&(!angular.isDefined(e)||e.writable)},this._$scope.focusTaskInput=function(){a.status.focusTaskInput=!0},this._$scope.focusSubtaskInput=function(){a.status.focusSubtaskInput=!0},this._$scope.openDetails=function(t,n){var r=a.route.calendarID,o=a.route.collectionID;if(null===n||e(n.currentTarget).is(e(n.target).closest(".handler"))){var i=u.getByUri(t);i.loadedCompleted||d.getAll(i.calendar,!0,i).then(function(){i.loadedCompleted=!0,s.$apply()}),r?p.path("/calendars/"+r+"/tasks/"+t):o&&p.path("/collections/"+o+"/tasks/"+t)}},this._$scope.toggleCompleted=function(t){t.completed?d.setPercentComplete(t,0):d.setPercentComplete(t,100)},this._$scope.toggleStarred=function(t){t.priority>5?d.setPriority(t,0):d.setPriority(t,9)},this._$scope.toggleHidden=function(){return m.toggle("various","showHidden")},this._$scope.filterTasks=function(t,e){return function(t){return u.filterTasks(t,e)}},this._$scope.getSubTasks=function(t,e){var n,r,s,a;for(n=[],s=0,a=t.length;s<a;s++)r=t[s],r.related!==e.uid||r===e||e.hideCompletedSubtasks&&r.completed||n.push(r);return n},this._$scope.hasNoParent=function(t){return function(t){return u.hasNoParent(t)}},this._$scope.hasSubtasks=function(t){return u.hasSubtasks(t.uid)},this._$scope.hasCompletedSubtasks=function(t){return u.hasCompletedSubtasks(t.uid)},this._$scope.toggleSubtasks=function(t){d.setHideSubtasks(t,!t.hideSubtasks)},this._$scope.toggleCompletedSubtasks=function(t){d.setHideCompletedSubtasks(t,!t.hideCompletedSubtasks)},this._$scope.filterTasksByString=function(t){return function(t){var e=f.getFilter();return u.filterTasksByString(t,e)}},this._$scope.filteredTasks=function(){var t;return t=f.getFilter(),u.filteredTasks(t)},this._$scope.dayHasEntry=function(){return function(t){var e,n,r,s,a;for(e=f.getFilter(),r=u.filteredTasks(e),s=0,a=r.length;s<a;s++)if(n=r[s],!n.completed&&u.hasNoParent(n)&&u.taskAtDay(n,t))return!0;return!1}},this._$scope.taskAtDay=function(t,e){return function(t){return u.taskAtDay(t,e)}},this._$scope.filterLists=function(){return function(t){return a.getCount(t.uri,a.route.collectionID)}},this._$scope.getCount=function(t,e){var n=f.getFilter();return c.getCount(t,e,n)},this._$scope.getCountString=function(t,e){var r=f.getFilter();return n("tasks","%n Completed Task","%n Completed Tasks",c.getCount(t,e,r))},this._$scope.checkTaskInput=function(t){27===t.keyCode&&(e(t.currentTarget).blur(),a.status.taskName="",a.status.subtaskName="",a.status.addSubtaskTo=null,a.status.focusTaskInput=!1,a.status.focusSubtaskInput=!1)},this._$scope.getCompletedTasks=function(t){var e=c.getById(t);d.getAll(e,!0).then(function(){c.setLoadedCompleted(t),s.$apply()})},this._$scope.loadedCompleted=function(t){return c.loadedCompleted(t)},this._$scope.sortDue=function(t){return null===t.due?"last":t.due},this._$scope.sortStart=function(t){return null===t.start?"last":t.start},this._$scope.getSortOrder=function(){switch(a.settingsmodel.getById("various").sortOrder){case"due":return a.sortDue;case"start":return a.sortStart;case"priority":return"-priority";case"alphabetically":return"summary";case"manual":return"manual";default:return["completed",a.sortDue,"-priority",a.sortStart,"summary"]}},this._$scope.getSortOrderIcon=function(){switch(a.settingsmodel.getById("various").sortOrder){case"due":case"start":return"icon-calendar";case"priority":return"icon-task-star";case"alphabetically":return"icon-alphabetically";case"manual":return"icon-manual";default:return"icon-menu"}},this._$scope.setSortOrder=function(t,e){a.settingsmodel.getById("various").sortDirection=a.settingsmodel.getById("various").sortOrder===e?+!a.settingsmodel.getById("various").sortDirection:0,a.settingsmodel.getById("various").sortOrder=e,m.set("various","sortOrder",e),m.set("various","sortDirection",a.settingsmodel.getById("various").sortDirection)},this._$scope.dropAsSubtask=function(t,n,r){if("move"===t.dataTransfer.dropEffect){var s=e(t.target).closest(".task-item").attr("taskID"),a=u.getByUri(n.uri),o=u.getByUri(s);d.changeParent(a,o)}return e(".subtasks-container").removeClass("dropzone-visible"),!0},this._$scope.dropAsRootTask=function(t,n,r){if("move"===t.dataTransfer.dropEffect){var a=u.getByUri(n.uri),o=e(t.target).closest("ol[dnd-list]").attr("collectionID"),i=e(t.target).closest("ol[dnd-list]").attr("calendarID"),l=c.getByUri(i),p=d.makeRootTask(a,l,o);Promise.all(p).then(function(){s.$apply()})}return e(".subtasks-container").removeClass("dropzone-visible"),!0},this._$scope.dragover=function(t,n,r){e(".subtasks-container").removeClass("dropzone-visible");var s=e(t.target).closest("ol[dnd-list]").attr("calendarID");return!!c.getByUri(s).writable&&(e(t.target).closest(".task-item").children(".subtasks-container").addClass("dropzone-visible"),!0)},this._$scope.allow=function(t){return t.calendar.writable?"copyMove":"copy"},this._$scope.dragStart=function(t){("copy"===t.dataTransfer.effectAllowed||"copyMove"===t.dataTransfer.effectAllowed&&t.ctrlKey)&&e(t.target).addClass("copy")},this._$scope.dragEnd=function(t){e(t.target).removeClass("copy")}}return a}())(s,a,o,i,u,c,l,d,p,m,h,f)}])}.call(void 0),angular.module("Tasks").directive("appNavigationEntryUtils",function(){return{restrict:"C",link:function(t,n){var r,s;s=n.siblings(".app-navigation-entry-menu"),r=e(n).find(".app-navigation-entry-utils-menu-button button"),r.click(function(){s.toggleClass("open")}),t.$on("documentClicked",function(t,e){e.target!==r[0]&&s.removeClass("open")})}}}),angular.module("Tasks").directive("autofocusOnInsert",function(){return function(t,e){return e.focus()}}),angular.module("Tasks").directive("avatar",function(){return{restrict:"A",scope:!1,link:function(t,e,n){return n.$observe("userid",function(){if(n.userid)return e.avatar(n.userid,n.size)})}}});var a=function(t,e,n){if(Array.isArray(t)&&(e=t[1],n=t[2],t=t[0]),void 0===t)return[0,0,0];e/=100,n/=100;var r=(1-Math.abs(2*n-1))*e,s=t/60,a=r*(1-Math.abs(s%2-1));s=Math.floor(s);var o,i,u;0===s?(o=r,i=a,u=0):1===s?(o=a,i=r,u=0):2===s?(o=0,i=r,u=a):3===s?(o=0,i=a,u=r):4===s?(o=a,i=0,u=r):5===s&&(o=r,i=0,u=a);var c=n-r/2;return o+=c,i+=c,u+=c,[Math.round(255*o),Math.round(255*i),Math.round(255*u)]},o=function(t,e,n){return Array.isArray(t)&&(e=t[1],n=t[2],t=t[0]),"#"+parseInt(t,10).toString(16)+parseInt(e,10).toString(16)+parseInt(n,10).toString(16)},i=["#31CC7C","#317CCC","#FF7A66","#F1DB50","#7C31CC","#CC317C","#3A3B3D","#CACBCD"],u=function(){return"function"==typeof String.prototype.toHsl?o(a(Math.random().toString().toHsl())):i[Math.floor(Math.random()*i.length)]};angular.module("Tasks").directive("colorpicker",function(){if("function"==typeof String.prototype.toHsl){var t="",e="";i=["15","9","4","b","6","11","74","f","57"],i.forEach(function(n,r){t=n.toHsl(),e=a(t),i[r]=o(e)})}return{scope:{selected:"=",customizedColors:"=colors"},restrict:"AE",templateUrl:OC.filePath("tasks","templates","colorpicker.html"),link:function(t,e,n){t.colors=t.customizedColors||i,t.selected=t.selected||t.colors[0],t.random="#000000",t.randomizeColour=function(){t.random=u(),t.pick(t.random)},t.pick=function(e){t.selected=e}}}}),angular.module("Tasks").directive("confirmation",function(){return{priority:-1,restrict:"A",templateUrl:OC.generateUrl("/apps/tasks/templates/confirmation",{}),scope:{confirmationFunction:"&confirmation",confirmationMessage:"&confirmationMessage"},controller:"ConfirmationController"}}),angular.module("Tasks").controller("ConfirmationController",["$scope","$rootScope","$element","$attrs","$compile","$document","$window","$timeout",function(t,e,n,r,s,a,o,i){return new(function(){function e(e,n,r,s,a,o,i,u){this._$scope=e,this._$scope.countdown=3,r.bind("click",function(t){e.countdown=3,r.removeClass("active");var n=e.confirmationMessage()?e.confirmationMessage():"Are you sure?";r.hasClass("confirmed")||(t.stopPropagation(),e.activate(),r.children(".confirmation-confirm").tooltip({title:n,container:"body",placement:"right"}),r.addClass("confirmed"))}),r.children(".confirmation-confirm").bind("click",function(t){if(r.hasClass("confirmed active"))return void e.confirmationFunction();t.stopPropagation()}),this._$scope.documentClick=function(){r.removeClass("confirmed")},this._$scope.activate=function(){e.countdown?(r.find(".countdown").html(e.countdown+" s"),u(function(){e.activate()},1e3),e.countdown--):r.addClass("active")},o.bind("click",e.documentClick),o.bind("touchend",e.documentClick),t.$on("$destroy",function(){o.unbind("click",e.documentClick),o.unbind("touchend",e.documentClick)})}return e}())(t,e,n,r,s,a,o,i)}]),angular.module("Tasks").directive("datepicker",function(){return{restrict:"A",scope:!1,link:function(t,n,r){return n.datepicker({onSelect:function(e,n){return t["set"+r.datepicker+"day"](e),t.$apply()},beforeShow:function(n,r){var s,a;return s=e(r).datepicker("widget"),a=-Math.abs(e(n).outerWidth()-s.outerWidth())/2+"px",s.css({"margin-left":a}),e("div.ui-datepicker:before").css({left:"100px"}),e(".hasDatepicker").datepicker("option","firstDay",t.settingsmodel.getById("various").startOfWeek)},beforeShowDay:function(e){return 0===moment(e).startOf("day").diff(moment(t.task[r.datepicker],"YYYYMMDDTHHmmss").startOf("day"),"days")?[1,"selected"]:[1,""]},minDate:null})}}}),angular.module("Tasks").directive("ocClickFocus",["$timeout",function(t){return function(n,r,s){var a;if(a=n.$eval(s.ocClickFocus),angular.isDefined(a)&&angular.isDefined(a.selector))return r.click(function(){return angular.isDefined(a.timeout)?t(function(){return e(a.selector).focus()},a.timeout):e(a.selector).focus()})}}]),angular.module("Tasks").directive("timepicker",function(){return{restrict:"A",link:function(e,n,r){return n.timepicker({onSelect:function(t,n){return e["set"+r.timepicker+"time"](t),e.$apply()},myPosition:"center top",atPosition:"center bottom",hourText:t("tasks","Hours"),minuteText:t("tasks","Minutes")})}}}),angular.module("Tasks").directive("watchTop",function(){return{restrict:"A",link:function(t,e,n){return t.$watch(function(){t.divTop=e.prev().outerHeight(!0)})}}}),angular.module("Tasks").filter("counterFormatter",function(){return function(t){switch(!1){case 0!==t:return"";case t<999:return"999+";default:return t}}}),angular.module("Tasks").filter("dateDetails",function(){return function(e){return moment(e,"YYYYMMDDTHHmmss").isValid()?moment(e,"YYYYMMDDTHHmmss").locale(e.isDate?"details_allday":"details").calendar():t("tasks","Set due date")}}), angular.module("Tasks").filter("dateDetailsShort",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").locale("details_short").calendar():""}}),angular.module("Tasks").filter("dateFromNow",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").fromNow():""}}),angular.module("Tasks").filter("dateTaskList",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").locale("tasks").calendar():""}}),angular.module("Tasks").filter("day",function(){return function(t){return moment().add("days",t).locale("list_week").calendar()}}),angular.module("Tasks").filter("dayTaskList",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").locale("tasks").calendar():""}}),angular.module("Tasks").filter("percentDetails",function(){return function(e){return t("tasks","%s %% completed").replace("%s",e).replace("%%","%")}}),angular.module("Tasks").filter("priorityDetails",function(){return function(e){var n;return n=t("tasks","priority %s: ").replace("%s",e),6==+e||7==+e||8==+e||9==+e?n+" "+t("tasks","high"):5==+e?n+" "+t("tasks","medium"):1==+e||2==+e||3==+e||4==+e?n+" "+t("tasks","low"):t("tasks","no priority assigned")}}),angular.module("Tasks").filter("reminderDetails",function(){return function(e,n){var r,s,a,o;if(angular.isUndefined(e)||null===e)return t("tasks","Remind me");if("DATE-TIME"===e.type&&moment(e.date,"YYYYMMDDTHHmmss").isValid())return moment(e.date,"YYYYMMDDTHHmmss").locale("reminder").calendar();if("DURATION"===e.type&&e.duration){r=t("tasks","Remind me"),o=n.durations;for(var i=0,u=o.length;i<u;i++)a=o[i],+e.duration[a.id]&&(s=1,r+=" "+e.duration[a.id]+" ",r+=function(t,e){return 1==+t.duration[e.id]?e.name:e.names}(e,a));return s?e.duration.params.invert?r+=function(e){return"END"===e?" "+t("tasks","before end"):" "+t("tasks","before beginning")}(e.duration.params.related):r+=function(e){return"END"===e?" "+t("tasks","after end"):" "+t("tasks","after beginning")}(e.duration.params.related):"END"===e.duration.params.related?r+=" "+t("tasks","at the end"):r+=" "+t("tasks","at the beginning"),r}return t("tasks","Remind me")}}),angular.module("Tasks").filter("startDetails",function(){return function(e){return moment(e,"YYYYMMDDTHHmmss").isValid()?moment(e,"YYYYMMDDTHHmmss").locale(e.isDate?"start_allday":"start").calendar():t("tasks","Set start date")}}),angular.module("Tasks").filter("timeTaskList",function(){return function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()?moment(t,"YYYYMMDDTHHmmss").format("HH:mm"):""}}),angular.module("Tasks").service("CalendarService",["DavClient","Calendar",function(e,n){function s(t){return e.propFind(e.buildUrl(OC.linkToRemoteBase("dav")),["{"+e.NS_DAV+"}current-user-principal"],0,{requesttoken:OC.requestToken}).then(function(n){if(!e.wasRequestSuccessful(n.status))throw"CalDAV client could not be initialized - Querying current-user-principal failed";if(!(n.body.propStat.length<1)){var r=n.body.propStat[0].properties;return o._currentUserPrincipal=r["{"+e.NS_DAV+"}current-user-principal"][0].textContent,e.propFind(e.buildUrl(o._currentUserPrincipal),["{"+e.NS_IETF+"}calendar-home-set"],0,{requesttoken:OC.requestToken}).then(function(n){if(!e.wasRequestSuccessful(n.status))throw"CalDAV client could not be initialized - Querying calendar-home-set failed";if(!(n.body.propStat.length<1)){var r=n.body.propStat[0].properties;return o._CALENDAR_HOME=r["{"+e.NS_IETF+"}calendar-home-set"][0].textContent,t()}})}})}function a(t){return parseInt(t.split(" ")[1])}var o=this;this._CALENDAR_HOME=null,this._currentUserPrincipal=null,this._takenUrls=[],this._PROPERTIES=["{"+e.NS_DAV+"}displayname","{"+e.NS_IETF+"}calendar-description","{"+e.NS_IETF+"}calendar-timezone","{"+e.NS_APPLE+"}calendar-order","{"+e.NS_APPLE+"}calendar-color","{"+e.NS_IETF+"}supported-calendar-component-set","{"+e.NS_OWNCLOUD+"}calendar-enabled","{"+e.NS_DAV+"}acl","{"+e.NS_DAV+"}owner","{"+e.NS_OWNCLOUD+"}invite"],this.getAll=function(){return null===this._CALENDAR_HOME?s(function(){return o.getAll()}):e.propFind(e.buildUrl(this._CALENDAR_HOME),this._PROPERTIES,1,{requesttoken:OC.requestToken}).then(function(t){var r=[];if(!e.wasRequestSuccessful(t.status))throw"CalDAV client could not be initialized - Querying calendars failed";for(var s=0;s<t.body.length;s++){var i=t.body[s];if(!(i.propStat.length<1)){o._takenUrls.push(i.href);var u=a(i.propStat[0].status);if(e.wasRequestSuccessful(u)){var c=!1,l=i.propStat[0].properties["{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set"];if(l)for(var d=0;d<l.length;d++){var p=l[d].attributes.getNamedItem("name").textContent.toLowerCase();"vtodo"===p&&(c=!0)}if(c){o._getACLFromResponse(i);var m=i.href.substr(o._CALENDAR_HOME.length).replace(/[^\w\-]+/g,""),h=new n(i.href,i.propStat[0].properties,m);r.push(h)}}}}return r})},this.get=function(t){return null===this._CALENDAR_HOME?s(function(){return o.get(t)}):e.propFind(e.buildUrl(t),this._PROPERTIES,0,{requesttoken:OC.requestToken}).then(function(t){var r=t.body;if(!(r.propStat.length<1)){var s=a(r.propStat[0].status);if(e.wasRequestSuccessful(s)){o._getACLFromResponse(r);var i=r.href.substr(o._CALENDAR_HOME.length).replace(/[^\w\-]+/g,"");return new n(r.href,r.propStat[0].properties,i)}}})},this.create=function(t,n,r){if(null===this._CALENDAR_HOME)return s(function(){return o.create(t,n)});void 0===r&&(r=["vtodo"]);var a=document.implementation.createDocument("","",null),i=a.createElement("c:mkcalendar");i.setAttribute("xmlns:c","urn:ietf:params:xml:ns:caldav"),i.setAttribute("xmlns:d","DAV:"),i.setAttribute("xmlns:a","http://apple.com/ns/ical/"),i.setAttribute("xmlns:o","http://owncloud.org/ns"),a.appendChild(i);var u=a.createElement("d:set");i.appendChild(u);var c=a.createElement("d:prop");u.appendChild(c),c.appendChild(this._createXMLForProperty(a,"displayname",t)),c.appendChild(this._createXMLForProperty(a,"enabled",!0)),c.appendChild(this._createXMLForProperty(a,"color",n)),c.appendChild(this._createXMLForProperty(a,"components",r));var l=i.outerHTML,d=this._suggestUri(t),p=this._CALENDAR_HOME+d+"/",m={"Content-Type":"application/xml; charset=utf-8",requesttoken:OC.requestToken};return e.request("MKCALENDAR",p,m,l).then(function(t){if(201===t.status)return o._takenUrls.push(p),o.get(p).then(function(t){return t.enabled=!0,o.update(t)})})},this.update=function(t){var n=document.implementation.createDocument("","",null),r=n.createElement("d:propertyupdate");r.setAttribute("xmlns:c","urn:ietf:params:xml:ns:caldav"),r.setAttribute("xmlns:d","DAV:"),r.setAttribute("xmlns:a","http://apple.com/ns/ical/"),r.setAttribute("xmlns:o","http://owncloud.org/ns"),n.appendChild(r);var s=n.createElement("d:set");r.appendChild(s);var a=n.createElement("d:prop");s.appendChild(a);var o=t.updatedProperties;t.resetUpdatedProperties();for(var i=0;i<o.length;i++)a.appendChild(this._createXMLForProperty(n,o[i],t[o[i]]));var u=t.url,c=r.outerHTML,l={"Content-Type":"application/xml; charset=utf-8",requesttoken:OC.requestToken};return e.request("PROPPATCH",u,l,c).then(function(e){return t})},this.delete=function(t){return e.request("DELETE",t.url,{requesttoken:OC.requestToken},"").then(function(t){return 204===t.status})},this.share=function(n,s,a,o,i){var u=document.implementation.createDocument("","",null),c=u.createElement("o:share");c.setAttribute("xmlns:d","DAV:"),c.setAttribute("xmlns:o","http://owncloud.org/ns"),u.appendChild(c);var l=u.createElement("o:set");c.appendChild(l);var d=u.createElement("d:href");s===OC.Share.SHARE_TYPE_USER?d.textContent="principal:principals/users/":s===OC.Share.SHARE_TYPE_GROUP&&(d.textContent="principal:principals/groups/"),d.textContent+=a,l.appendChild(d);var p=u.createElement("o:summary");if(p.textContent=t("calendar","{calendar} shared by {owner}",{calendar:n.displayname,owner:n.owner}),l.appendChild(p),o){var m=u.createElement("o:read-write");l.appendChild(m)}var h={"Content-Type":"application/xml; charset=utf-8",requesttoken:r},f=c.outerHTML;return e.request("POST",n.url,h,f).then(function(t){200===t.status&&(i||(s===OC.Share.SHARE_TYPE_USER?n.sharedWith.users.push({id:a,displayname:a,writable:o}):s===OC.Share.SHARE_TYPE_GROUP&&n.sharedWith.groups.push({id:a,displayname:a,writable:o})))})},this.unshare=function(t,n,s){var a=document.implementation.createDocument("","",null),o=a.createElement("o:share");o.setAttribute("xmlns:d","DAV:"),o.setAttribute("xmlns:o","http://owncloud.org/ns"),a.appendChild(o);var i=a.createElement("o:remove");o.appendChild(i);var u=a.createElement("d:href");n===OC.Share.SHARE_TYPE_USER?u.textContent="principal:principals/users/":n===OC.Share.SHARE_TYPE_GROUP&&(u.textContent="principal:principals/groups/"),u.textContent+=s,i.appendChild(u);var c={"Content-Type":"application/xml; charset=utf-8",requesttoken:r},l=o.outerHTML;return e.request("POST",t.url,c,l).then(function(e){return 200===e.status&&(n===OC.Share.SHARE_TYPE_USER?t.sharedWith.users=t.sharedWith.users.filter(function(t){return t.id!==s}):n===OC.Share.SHARE_TYPE_GROUP&&(t.sharedWith.groups=t.sharedWith.groups.filter(function(t){return t.id!==s})),!0)})},this._createXMLForProperty=function(t,e,n){switch(e){case"enabled":var r=t.createElement("o:calendar-enabled");return r.textContent=n?"1":"0",r;case"displayname":var s=t.createElement("d:displayname");return s.textContent=n,s;case"order":var a=t.createElement("a:calendar-color");return a.textContent=n,a;case"color":var o=t.createElement("a:calendar-color");return o.textContent=n,o;case"components":for(var i=t.createElement("c:supported-calendar-component-set"),u=0;u<n.length;u++){var c=t.createElement("c:comp");c.setAttribute("name",n[u].toUpperCase()),i.appendChild(c)}return i}},this._getACLFromResponse=function(t){var n=!1,r=t.propStat[0].properties["{"+e.NS_DAV+"}acl"];if(r)for(var s=0;s<r.length;s++){var a=r[s].getElementsByTagNameNS("DAV:","href");if(0!==a.length&&(a=a[0].textContent)===o._currentUserPrincipal){var i=r[s].getElementsByTagNameNS("DAV:","write");i.length>0&&(n=!0)}}t.propStat[0].properties.canWrite=n},this._isUriAlreadyTaken=function(t){return-1!==this._takenUrls.indexOf(this._CALENDAR_HOME+t+"/")},this._suggestUri=function(t){var e=t.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"");if(!this._isUriAlreadyTaken(e))return e;if(-1===e.indexOf("-")&&(e+="-1",!this._isUriAlreadyTaken(e)))return e;for(;this._isUriAlreadyTaken(e);){var n=e.lastIndexOf("-"),r=e.substr(0,n),s=e.substr(n+1);s.match(/^\d+$/)?(s=parseInt(s),s++,e=r+"-"+s):""===s?e+="1":e=e="-1"}return e}}]),angular.module("Tasks").service("DavClient",[function(){var t;return t=new dav.Client({baseUrl:OC.linkToRemote("dav/calendars"),xmlNamespaces:{"DAV:":"d","urn:ietf:params:xml:ns:caldav":"c","http://apple.com/ns/ical/":"aapl","http://owncloud.org/ns":"oc","http://nextcloud.com/ns":"nc","http://calendarserver.org/ns/":"cs"}}),angular.extend(t,{NS_DAV:"DAV:",NS_IETF:"urn:ietf:params:xml:ns:caldav",NS_APPLE:"http://apple.com/ns/ical/",NS_OWNCLOUD:"http://owncloud.org/ns",NS_NEXTCLOUD:"http://nextcloud.com/ns",NS_CALENDARSERVER:"http://calendarserver.org/ns/",buildUrl:function(t){return window.location.protocol+"//"+window.location.host+t},wasRequestSuccessful:function(t){return t>=200&&t<=299}}),t}]),angular.module("Tasks").service("ICalFactory",[function(){return{new:function(){var t=new ICAL.Component(["vcalendar",[],[]]),e=angular.element("#app").attr("data-appVersion");return t.updatePropertyWithValue("prodid","-//Nextcloud Tasks v"+e),t}}}]),angular.module("Tasks").factory("Loading",[function(){return new(function(){function t(){this.count=0}return t.prototype.increase=function(){return this.count+=1},t.prototype.decrease=function(){return this.count-=1},t.prototype.getCount=function(){return this.count},t.prototype.isLoading=function(){return this.count>0},t}())}]),function(){angular.module("Tasks").factory("_Model",[function(){return function(){function t(){this._data=[],this._dataMap={},this._filterCache={}}return t.prototype.handle=function(t){var e,n,r,s;for(s=[],n=0,r=t.length;n<r;n++)e=t[n],s.push(this.add(e));return s},t.prototype.add=function(t,e){if(null===e&&(e=!0),e&&this._invalidateCache(),angular.isDefined(this._dataMap[t.id]))return this.update(t,e);this._data.push(t),this._dataMap[t.id]=t},t.prototype.update=function(t,e){var n,r,s,a;null===e&&(e=!0),e&&this._invalidateCache(),n=this.getById(t.id),a=[];for(r in t)s=t[r],"id"!==r&&a.push(n[r]=s);return a},t.prototype.getById=function(t){return this._dataMap[t]},t.prototype.getAll=function(){return this._data},t.prototype.removeById=function(t,e){var n,r,s,a,o,i;for(null===e&&(e=!0),i=this._data,n=a=0,o=i.length;a<o;n=++a)if(s=i[n],s.id===t)return this._data.splice(n,1),r=this._dataMap[t],delete this._dataMap[t],e&&this._invalidateCache(),r},t.prototype.clear=function(){return this._data.length=0,this._dataMap={},this._invalidateCache()},t.prototype._invalidateCache=function(){this._filterCache={}},t.prototype.get=function(t){var e;return e=t.hashCode(),angular.isDefined(this._filterCache[e])||(this._filterCache[e]=t.exec(this._data)),this._filterCache[e]},t.prototype.size=function(){return this._data.length},t}()}])}.call(void 0),angular.module("Tasks").factory("Persistence",["Request","Loading","$rootScope","$q","CalendarService",function(t,e,n,r,s){return new(function(){function t(t,e,n,r){this._request=t,this._Loading=e,this._$rootScope=n,this._CalendarService=r}return t.prototype.init=function(){var t=this;return this.deferred=r.defer(),function(){return t.deferred.resolve()},this.getCollections(),this.getSettings(),this.deferred.promise},t.prototype.getCollections=function(t,e){var n,r,s,a=this;return null===e&&(e=!0),t||(t=function(){}),e?(this._Loading.increase(),s=function(e){return t(),a._Loading.decrease()},n=function(t){return a._Loading.decrease()}):(s=function(e){return t()},n=function(t){}),r={onSuccess:s,onFailure:n},this._request.get("/apps/tasks/collections",r)},t.prototype.getSettings=function(t,e){var n,r,s,a=this;return null===e&&(e=!0),t||(t=function(){}),e?(this._Loading.increase(),s=function(e){return t(),a._Loading.decrease()},n=function(t){return a._Loading.decrease()}):(s=function(e){return t()},n=function(t){}),r={onSuccess:s,onFailure:n},this._request.get("/apps/tasks/settings",r)},t.prototype.setVisibility=function(t,e){var n={routeParams:{collectionID:t,visibility:e}};return this._request.post("/apps/tasks/collection/{collectionID}/visibility/{visibility}",n)},t.prototype.setting=function(t,e,n){var r={routeParams:{type:t,setting:e,value:n}};return this._request.post("/apps/tasks/settings/{type}/{setting}/{value}",r)},t}())(t,e,n,s)}]),angular.module("Tasks").factory("Publisher",["CollectionsModel","SettingsModel",function(t,e){return new(function(){function t(t,e){this._$collectionsmodel=t,this._$settingsmodel=e,this._subscriptions={},this.subscribeObjectTo(this._$collectionsmodel,"collections"),this.subscribeObjectTo(this._$settingsmodel,"settings")}return t.prototype.subscribeObjectTo=function(t,e){var n=this._subscriptions;return n[e]||(n[e]=[]),this._subscriptions[e].push(t)},t.prototype.publishDataTo=function(t,e){var n,r,s,a,o;for(n=this._subscriptions[e]||[],r=[],a=0,o=n.length;a<o;a++)s=n[a],r.push(s.handle(t));return r},t}())(t,e)}]),angular.module("Tasks").factory("RandomStringService",function(){return{generate:function(){return Math.random().toString(36).substr(2)}}}),angular.module("Tasks").factory("Request",["$http","Publisher",function(t,e){return new(function(){function t(t,e){this.$http=t,this.publisher=e,this.count=0,this.initialized=!1,this.shelvedRequests=[],this.initialized=!0,this._executeShelvedRequests()}return t.prototype.request=function(t,e){var n,r,s;return null===e&&(e={}),r={routeParams:{},data:{},onSuccess:function(){return{}},onFailure:function(){return{}},config:{}},angular.extend(r,e),this.initialized?(s=OC.generateUrl(t,r.routeParams),n={url:s,data:r.data},angular.extend(n,r.config),"GET"===n.method&&(n.params=n.data),this.$http(n).then(function(t){return function(e){var n,s,a;s=e.data.data;for(n in s)a=s[n],t.publisher.publishDataTo(a,n);return r.onSuccess(e.data,e.status,e.headers,e.config)}}(this)).catch(function(t){return r.onFailure(t.data,t.status,t.headers,t.config)})):void this._shelveRequest(t,r)},t.prototype.post=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="POST",this.request(t,e)},t.prototype.get=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="GET",this.request(t,e)},t.prototype.put=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="PUT",this.request(t,e)},t.prototype.delete=function(t,e){return null===e&&(e={}),e.config||(e.config={}),e.config.method="DELETE",this.request(t,e)},t.prototype._shelveRequest=function(t,e){var n={route:t,data:e};return this.shelvedRequests.push(n)},t.prototype._executeShelvedRequests=function(){var t,e,n,r,s;for(e=this.shelvedRequests,n=[],r=0,s=e.length;r<s;r++)t=e[r],n.push(this.request(t.route,t.data));return n},t}())(t,e)}]),angular.module("Tasks").factory("Status",[function(){return new(function(){function t(){this._$status={addingList:!1,focusTaskInput:!1}}return t.prototype.getStatus=function(){return this._$status},t}())}]),angular.module("Tasks").service("VTodoService",["DavClient","RandomStringService","$timeout",function(t,e,n){var r=this;this.getAll=function(e,n,r){null===n&&(n=!1),null===r&&(r=!1);var s=document.implementation.createDocument("","",null),a=s.createElement("c:calendar-query");a.setAttribute("xmlns:c","urn:ietf:params:xml:ns:caldav"),a.setAttribute("xmlns:d","DAV:"),a.setAttribute("xmlns:a","http://apple.com/ns/ical/"),a.setAttribute("xmlns:o","http://owncloud.org/ns"),s.appendChild(a);var o=s.createElement("d:prop");a.appendChild(o);var i=s.createElement("d:getetag");o.appendChild(i);var u=s.createElement("c:calendar-data");o.appendChild(u);var c=s.createElement("c:filter");a.appendChild(c);var l=s.createElement("c:comp-filter");l.setAttribute("name","VCALENDAR"),c.appendChild(l);var d=s.createElement("c:comp-filter");d.setAttribute("name","VTODO"),l.appendChild(d);var p=s.createElement("c:prop-filter");if(p.setAttribute("name","COMPLETED"),d.appendChild(p),!n){var m=s.createElement("c:is-not-defined");p.appendChild(m)}if(r){var h=s.createElement("c:prop-filter");h.setAttribute("name","RELATED-TO"),d.appendChild(h);var f=s.createElement("c:text-match"),g=s.createTextNode(r.uid);f.appendChild(g),h.appendChild(f)}var y=e.url,k={"Content-Type":"application/xml; charset=utf-8",Depth:1,requesttoken:OC.requestToken},_=a.outerHTML;return t.request("REPORT",y,k,_).then(function(n){if(t.wasRequestSuccessful(n.status)){var r=[];for(var s in n.body){var a=n.body[s],o=a.propStat[0].properties,i=a.href.substr(a.href.lastIndexOf("/")+1),u={calendar:e,properties:o,uri:i};r.push(u)}return r}})},this.get=function(e,n){var r=e.url+n;return t.request("GET",r,{requesttoken:OC.requestToken},"").then(function(t){return{calendar:e,properties:{"{urn:ietf:params:xml:ns:caldav}calendar-data":t.body,"{DAV:}getetag":t.xhr.getResponseHeader("ETag")},uri:n}})},this.create=function(e,n,s){void 0===s&&(s=!0);var a={"Content-Type":"text/calendar; charset=utf-8",requesttoken:OC.requestToken},o=this._generateRandomUri(),i=e.url+o;return t.request("PUT",i,a,n).then(function(n){return t.wasRequestSuccessful(n.status)?!s||r.get(e,o):(console.log(n),!1)})},this.update=function(e){var r=e.calendar.url+e.uri,s={"Content-Type":"text/calendar; charset=utf-8","If-Match":e.etag,requesttoken:OC.requestToken};return n.cancel(e.timers.update),t.request("PUT",r,s,e.data).then(function(n){return e.etag=n.xhr.getResponseHeader("ETag"),t.wasRequestSuccessful(n.status)})},this.delete=function(e){var n=e.calendar.url+e.uri,r={"If-Match":e.etag,requesttoken:OC.requestToken};return t.request("DELETE",n,r,"").then(function(e){return t.wasRequestSuccessful(e.status)})},this._generateRandomUri=function(){var t="Nextcloud-";return t+=e.generate(),t+=e.generate(),t+=".ics"}}]),angular.module("Tasks").factory("ListsBusinessLayer",["ListsModel","Persistence","TasksBusinessLayer","CalendarService",function(t,e,n,r){return new(function(){function e(t,e,n,r){this._$listsmodel=t,this._persistence=e,this._$tasksbusinesslayer=n,this._$calendarservice=r}return e.prototype.init=function(){return this._$calendarservice.getAll().then(function(e){var r,s,a,o;for(o=[],s=0,a=e.length;s<a;s++)r=e[s],t.add(r),o.push(n.getAll(r));return o})},e.prototype.add=function(e,n){return this._$calendarservice.create(e,n,["vtodo"]).then(function(e){return t.add(e),e})},e.prototype.delete=function(e){return this._$calendarservice.delete(e).then(function(){return t.delete(e)})},e.prototype.rename=function(t){this._$calendarservice.update(t).then(function(t){t.dropPreviousState()})},e}())(t,e,n,r)}]),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};angular.module("Tasks").factory("SearchBusinessLayer",["ListsModel","Persistence","TasksModel","$rootScope","$routeParams","$location",function(n,r,s,a,o,i){return new(function(){function n(e,n,r,s,a,o){this._$listsmodel=e,this._persistence=n,this._$tasksmodel=r,this._$rootScope=s,this._$routeparams=a,this._$location=o,this.getFilter=t(this.getFilter,this),this.setFilter=t(this.setFilter,this),this.attach=t(this.attach,this),this.initialize(),this._$searchString=""}return n.prototype.attach=function(t){var e=this;return t.setFilter("tasks",function(t){return e._$rootScope.$apply(function(){return e.setFilter(t)})}),t.setRenderer("task",this.renderTaskResult.bind(this)),t.setHandler("task",this.handleTaskClick.bind(this))},n.prototype.setFilter=function(t){this._$searchString=t},n.prototype.getFilter=function(){return this._$searchString},n.prototype.initialize=function(){var t=this;return this.handleTaskClick=function(e,n,r){return t._$location.path("/lists/"+n.calendarid+"/tasks/"+n.id)},this.renderTaskResult=function(n,r){var s;return t._$tasksmodel.filterTasks(r,t._$routeparams.listID)&&t._$tasksmodel.isLoaded(r)?null:(s=e("div.task-item.template"),s=s.clone(),n=e('<tr class="result"></tr>').append(s.removeClass("template")),n.data("result",r),n.find("span.title").text(r.name),r.starred&&n.find("span.task-star").addClass("task-starred"),r.completed&&(n.find("div.task-item").addClass("done"),n.find("span.task-checkbox").addClass("svg-checkmark")),r.complete&&n.find("div.percentdone").css({width:r.complete+"%","background-color":""+t._$listsmodel.getColor(r.calendarid)}),r.note&&n.find("div.title-wrapper").addClass("attachment"),n)},OC.Plugins.register("OCA.Search",this)},n}())(n,r,s,a,o,i)}])}.call(void 0),angular.module("Tasks").factory("SettingsBusinessLayer",["Persistence","SettingsModel",function(t,e){return new(function(){function t(t,e){this._persistence=t,this._$settingsmodel=e}return t.prototype.updateModel=function(){var t;return t=function(){},this._persistence.getCollections(t,!0)},t.prototype.setVisibility=function(t,e){return this._persistence.setVisibility(t,e)},t.prototype.toggle=function(t,e){this._$settingsmodel.toggle(t,e);var n=this._$settingsmodel.getById(t)[e];return this._persistence.setting(t,e,+n)},t.prototype.set=function(t,e,n){return this._persistence.setting(t,e,n)},t}())(t,e)}]),angular.module("Tasks").factory("TasksBusinessLayer",["TasksModel","Persistence","VTodoService","VTodo","$timeout",function(t,e,n,r,s){return new(function(){function e(t,e,n,r,s){this._$tasksmodel=t,this._persistence=e,this._$vtodoservice=n}return e.prototype.getAll=function(e,n,s){return this._$vtodoservice.getAll(e,n,s).then(function(e){var n,s,a,o;for(o=[],s=0,a=e.length;s<a;s++){n=e[s];var i=new r(n.calendar,n.properties,n.uri);o.push(t.ad(i))}return o})},e.prototype.add=function(e){return this._$vtodoservice.create(e.calendar,e.data).then(function(e){var n=new r(e.calendar,e.properties,e.uri);return t.ad(n),n})},e.prototype.getTask=function(e,n){return this._$vtodoservice.get(e,n).then(function(e){return t.ad(e),e})},e.prototype.setPriority=function(t,e){t.calendar.writable&&(t.priority=e,this.doUpdate(t))},e.prototype.setPercentComplete=function(t,e){t.calendar.writable&&(e<100?this.uncompleteParents(t.related):this.completeChildren(t),t.complete=e,this.triggerUpdate(t))},e.prototype.triggerUpdate=function(t,e){e||(e=1e3),t.timers.update&&s.cancel(t.timers.update),t.timers.update=s(function(t){n.update(t)},e,!0,t)},e.prototype.doUpdate=function(t){return this._$vtodoservice.update(t)},e.prototype.completeChildren=function(t){var e,n,r,s=this._$tasksmodel.getChildren(t),a=[];for(n=0,r=s.length;n<r;n++)e=s[n],a.push(this.setPercentComplete(e,100));return a},e.prototype.uncompleteParents=function(t){if(t){var e=this._$tasksmodel.getByUid(t);if(e.completed)return this.setPercentComplete(e,0)}},e.prototype.setHideSubtasks=function(t,e){t.hideSubtasks=e,t.calendar.writable&&this.doUpdate(t)},e.prototype.setHideCompletedSubtasks=function(t,e){t.hideCompletedSubtasks=e,t.calendar.writable&&this.doUpdate(t)},e.prototype.deleteTask=function(e){var n,r,s,a;for(r=this._$tasksmodel.getChildren(e),s=0,a=r.length;s<a;s++)n=r[s],this.deleteTask(n);return this._$vtodoservice.delete(e).then(function(){return t.delete(e)})},e.prototype.momentToICALTime=function(t,e){return e?ICAL.Time.fromDateString(t.format("YYYY-MM-DD")):ICAL.Time.fromDateTimeString(t.format("YYYY-MM-DDTHH:mm:ss"))},e.prototype.initDueDate=function(t){var e=moment(t.start,"YYYY-MM-DDTHH:mm:ss");if(!moment(t.due,"YYYY-MM-DDTHH:mm:ss").isValid()){var n=e.isAfter()?e:moment();return t.allDay?n.startOf("day").add(1,"d"):n.startOf("hour").add(1,"h"),this.setDue(t,n,"all")}},e.prototype.setDue=function(t,e,n){null===n&&(n="day");var r=t.allDay,s=moment(t.start,"YYYY-MM-DDTHH:mm:ss"),a=moment(t.due,"YYYY-MM-DDTHH:mm:ss"),o=a.clone();if("day"===n)moment(o).isValid()?o.year(e.year()).month(e.month()).date(e.date()):o=e.add(12,"h");else if("time"===n)moment(o).isValid()?o.hour(e.hour()).minute(e.minute()):o=e;else{if("all"!==n)return;o=e}(o.isBefore(s)||o.isSame(s))&&(s.subtract(a.diff(o),"ms"),t.start=this.momentToICALTime(s,r)),t.due=this.momentToICALTime(o,r),this.doUpdate(t)},e.prototype.deleteDueDate=function(t){t.due=null,this.doUpdate(t)},e.prototype.initStartDate=function(t){var e=moment(t.start,"YYYY-MM-DDTHH:mm:ss"),n=moment(t.due,"YYYY-MM-DDTHH:mm:ss");if(!e.isValid()){var r=moment().add(1,"h");return n.isBefore(r)&&(r=n.subtract(1,"m")),r.startOf(t.allDay?"day":"hour"),this.setStart(t,r,"all")}},e.prototype.setStart=function(t,e,n){null===n&&(n="day");var r=t.allDay,s=moment(t.due,"YYYY-MM-DDTHH:mm:ss"),a=moment(t.start,"YYYY-MM-DDTHH:mm:ss"),o=a.clone();if("day"===n)moment(o).isValid()?o.year(e.year()).month(e.month()).date(e.date()):o=e.add(12,"h");else if("time"===n)moment(o).isValid()?o.hour(e.hour()).minute(e.minute()):o=e;else{if("all"!==n)return;o=e}(o.isAfter(s)||o.isSame(s))&&(s.add(o.diff(a),"ms"),t.due=this.momentToICALTime(s,r)),t.start=this.momentToICALTime(o,r),this.doUpdate(t)},e.prototype.deleteStartDate=function(t){t.start=null,this.doUpdate(t)},e.prototype.setAllDay=function(t,e){if(t.allDay=e,e){var n=moment(t.due,"YYYY-MM-DDTHH:mm:ss"),r=moment(t.start,"YYYY-MM-DDTHH:mm:ss");(r.isAfter(n)||r.isSame(n))&&(r=moment(n).subtract(1,"day"),t.start=this.momentToICALTime(r,e))}this.doUpdate(t)},e.prototype.initReminder=function(t){var e,n;if(!this.checkReminderDate(t))return n=this._$tasksmodel.getById(t),n.reminder={type:"DURATION",action:"DISPLAY",duration:{token:"week",week:0,day:0,hour:0,minute:0,second:0,params:{invert:!0}}},moment(n.start,"YYYYMMDDTHHmmss").isValid()?(e=n.reminder.duration.params,e.related="START",e.id="10"):moment(n.due,"YYYYMMDDTHHmmss").isValid()?(e=n.reminder.duration.params,e.related="END",e.id="11"):(n.reminder.type="DATE-TIME",n.reminder.date=moment().startOf("hour").add(1,"h").format("YYYYMMDDTHHmmss")),this.setReminder(t)},e.prototype.setReminderDate=function(t,e,n){var r,s,a;if(null===n&&(n="day"),s=this._$tasksmodel.getById(t).reminder,r={type:"DATE-TIME",action:"DISPLAY",duration:null},"day"===n)this.checkReminderDate(t)||null===s?(a=moment(s.date,"YYYYMMDDTHHmmss"),r.action=s.action,a.isValid()&&"DATE-TIME"===s.type?a.year(e.year()).month(e.month()).date(e.date()):a=e.add(12,"h")):a=e.add(12,"h");else{if("time"!==n)return;this.checkReminderDate(t)||null===s?(a=moment(s.date,"YYYYMMDDTHHmmss"),r.action=s.action,a.isValid()&&"DATE-TIME"===s.type?a.hour(e.hour()).minute(e.minute()):a=e):a=e}return r.date=a.format("YYYYMMDDTHHmmss"),this._$tasksmodel.setReminder(t,r),this._persistence.setReminder(t,r)},e.prototype.setReminder=function(t){var e;if(this.checkReminderDate(t))return e=this._$tasksmodel.getById(t).reminder,this._persistence.setReminder(t,e)},e.prototype.checkReminderDate=function(t){var e,n,r,s,a,o,i,u,c;if(u=this._$tasksmodel.getById(t),null!==(o=u.reminder)&&"DURATION"===o.type){if(!o.duration)return!1;if("START"===o.duration.params.related)c="start";else{if("END"!==o.duration.params.related)return!1;c="due"}n=moment(u[c],"YYYYMMDDTHHmmss"),r=o.duration,e={w:r.week,d:r.day,h:r.hour,m:r.minute,s:r.second},n=r.params.invert?n.subtract(e):n.add(e),u.reminder.date=n.format("YYYYMMDDTHHmmss")}else{if(null===o||"DATE-TIME"!==o.type)return!1;if(r=o.duration,n=moment(o.date,"YYYYMMDDTHHmmss"),!n.isValid())return!1;if(r)a="START"===r.params.related?moment(u.start,"YYYYMMDDTHHmmss"):moment(u.due,"YYYYMMDDTHHmmss"),i=this.secondsToSegments(n.diff(a,"seconds")),r.params.invert=i.invert,r.token="week",r.week=i.week,r.day=i.day,r.hour=i.hour,r.minute=i.minute,r.second=i.second;else{if(u.start)a=moment(u.start,"YYYYMMDDTHHmmss"),s="START",e=0;else{if(!u.due)return!0;a=moment(u.due,"YYYYMMDDTHHmmss"),s="END",e=1}i=this.secondsToSegments(n.diff(a,"seconds")),o.duration={token:"week",params:{related:s,invert:i.invert,id:+i.invert+""+e},week:i.week,day:i.day,hour:i.hour,minute:i.minute,second:i.second}}}return!0},e.prototype.secondsToSegments=function(t){var e,n,r,s,a;return t<0?(t*=-1,r=!0):r=!1,a=Math.floor(t/604800),t-=604800*a,e=Math.floor(t/86400),t-=86400*e,n=Math.floor(t/3600),t-=3600*n,s=Math.floor(t/60),t-=60*s,{week:a,day:e,hour:n,minute:s,second:t,invert:r}},e.prototype.deleteReminderDate=function(t){return this._$tasksmodel.setReminder(t,null),this._persistence.setReminder(t,!1)},e.prototype.changeCalendar=function(s,a){if(s.calendar!==a&&a.writable){var o=angular.copy(s);if(o.calendar=a,!t.hasNoParent(o)){t.getByUid(o.related).calendar.uri!==o.calendar.uri&&(o.related=null,e.prototype.setPercentComplete(o,0))}return n.create(a,o.data).then(function(a){var i=new r(a.calendar,a.properties,a.uri);return t.ad(i),n.delete(s).then(function(){t.delete(s);var n,r,a,i=[],u=t.getChildren(o);for(n=0,r=u.length;n<r;n++)a=u[n],a.calendar.uri!==o.calendar.uri&&i.push(e.prototype.changeCalendar(a,o.calendar));return Promise.all(i)})})}return Promise.resolve(!0)},e.prototype.changeCollection=function(t,e){var n=this._$tasksmodel.getById(t);switch(e){case"starred":return n.priority=9,this.doUpdate(n);case"completed":return this.setPercentComplete(n,100);case"uncompleted":return!!n.completed&&this.setPercentComplete(n,0);case"today":return this.setDue(n,moment().startOf("day").add(12,"h"),"all");case"week":case"all":default:return!1}},e.prototype.changeParent=function(t,e){e.calendar.writable&&(t.related=e.uid,e.hideSubtasks=0,e.completed&&!t.completed?this.setPercentComplete(e,0):this.doUpdate(e),e.calendar.uri!==t.calendar.uri?this.changeCalendar(t,e.calendar):this.doUpdate(t))},e.prototype.makeRootTask=function(t,e,n){if(e.writable){var r=[];return t.related=null,"completed"!==n&&t.completed&&(t.complete=0),r.push(this.changeCollection(t.uri,n)),t.calendar!==e?r.push(this.changeCalendar(t,e)):r.push(this.doUpdate(t)),r}},e.prototype.addComment=function(t,e,n){var r;return e||(e=function(){}),n||(n=function(){}), this._$tasksmodel.addComment(t),r=function(t){return"error"===t.status?n():e(t.data)},this._persistence.addComment(t,r)},e.prototype.deleteComment=function(t,e){return this._$tasksmodel.deleteComment(t,e),this._persistence.deleteComment(t,e)},e}())(t,e,n,r,s)}]),angular.module("Tasks").factory("Calendar",["$rootScope","$filter","$window",function(e,n,r){function s(e,n,r){n.color=n["{http://apple.com/ns/ical/}calendar-color"],void 0!==n.color?9===n.color.length&&(n.color=n.color.substr(0,7)):n.color="#1d2d44",angular.extend(this,{_propertiesBackup:{},_properties:{url:e,uri:r,enabled:"1"===n["{http://owncloud.org/ns}calendar-enabled"],displayname:n["{DAV:}displayname"]||t("tasks","Unnamed"),color:n.color,order:parseInt(n["{http://apple.com/ns/ical/}calendar-order"])||0,components:{vevent:!1,vjournal:!1,vtodo:!1},writable:n.canWrite,shareable:n.canWrite,sharedWith:{users:[],groups:[]},owner:"",loadedCompleted:!1},_updatedProperties:[]}),this._propertiesBackup=angular.copy(this._properties);for(var s=n["{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set"],a=0;a<s.length;a++){var o=s[a].attributes.getNamedItem("name").textContent.toLowerCase();this._properties.components.hasOwnProperty(o)&&(this._properties.components[o]=!0)}var i=n["{http://owncloud.org/ns}invite"];if(void 0!==i)for(var u=0;u<i.length;u++){var c=i[u].getElementsByTagNameNS("DAV:","href");if(0!==c.length){c=c[0].textContent;var l=i[u].getElementsByTagNameNS("http://owncloud.org/ns","access");if(0!==l.length){l=l[0];var d=l.getElementsByTagNameNS("http://owncloud.org/ns","read-write");d=0!==d.length,c.startsWith("principal:principals/users/")?this._properties.sharedWith.users.push({id:c.substr(27),displayname:c.substr(27),writable:d}):c.startsWith("principal:principals/groups/")&&this._properties.sharedWith.groups.push({id:c.substr(28),displayname:c.substr(28),writable:d})}}}var p=n["{DAV:}owner"];void 0!==p&&0!==p.length&&(p=p[0].textContent.slice(0,-1),p.startsWith("/remote.php/dav/principals/users/")&&(this._properties.owner=p.substr(33)))}return s.prototype={get url(){return this._properties.url},get caldav(){return r.location.origin+this.url},get exportUrl(){var t=this.url;return"/"===t.slice(t.length-1)&&(t=t.slice(0,t.length-1)),t+="?export"},get enabled(){return this._properties.enabled},get uri(){return this._properties.uri},get components(){return this._properties.components},set enabled(t){this._properties.enabled=t,this._setUpdated("enabled")},get displayname(){return this._properties.displayname},set displayname(t){this._properties.displayname=t,this._setUpdated("displayname")},get color(){return this._properties.color},set color(t){this._properties.color=t,this._setUpdated("color")},get sharedWith(){return this._properties.sharedWith},set sharedWith(t){this._properties.sharedWith=t},get textColor(){var t,e=this.color;switch(e.length){case 4:return t=e.match(/^#([0-9a-f]{3})$/i)[1],t?this._generateTextColor(17*parseInt(t.charAt(0),16),17*parseInt(t.charAt(1),16),17*parseInt(t.charAt(2),16)):"#fff";case 7:case 9:var n=new RegExp("^#([0-9a-f]{"+(e.length-1)+"})$","i");return t=e.match(n)[1],t?this._generateTextColor(parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)):"#fff";default:return"#fff"}},get order(){return this._properties.order},set order(t){this._properties.order=t,this._setUpdated("order")},get writable(){return this._properties.writable},get shareable(){return this._properties.shareable},get owner(){return this._properties.owner},get loadedCompleted(){return this._properties.loadedCompleted},set loadedCompleted(t){this._properties.loadedCompleted=t},_setUpdated:function(t){-1===this._updatedProperties.indexOf(t)&&this._updatedProperties.push(t)},get updatedProperties(){return this._updatedProperties},resetUpdatedProperties:function(){this._updatedProperties=[]},prepareUpdate:function(){this._propertiesBackup=angular.copy(this._properties)},resetToPreviousState:function(){this._properties=angular.copy(this._propertiesBackup),this._propertiesBackup={}},dropPreviousState:function(){this._propertiesBackup={}},toggleSharesEditor:function(){this.list.editingShares=!this.list.editingShares},_generateTextColor:function(t,e,n){return(299*t+587*e+114*n)/1e3>130?"#000000":"#FAFAFA"}},s}]),function(){var t={}.hasOwnProperty,e=function(e,n){function r(){this.constructor=e}for(var s in n)t.call(n,s)&&(e[s]=n[s]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e};angular.module("Tasks").factory("CollectionsModel",["TasksModel","_Model",function(t,n){return new(function(t){function n(t){this._$tasksmodel=t,this._nameCache={},n.__super__.constructor.call(this)}return e(n,t),n.prototype.add=function(t,e){if(null===e&&(e=!0),this._nameCache[t.displayname]=t,angular.isDefined(t.id))return n.__super__.add.call(this,t,e)},n.prototype.getCount=function(t,e){var n,r,s,a,o;for(null===e&&(e=""),n=0,s=this._$tasksmodel.filteredTasks(e),a=0,o=s.length;a<o;a++)r=s[a],n+=this._$tasksmodel.filterTasks(r,t)&&!r.related;return n},n}(n))(t)}])}.call(void 0),function(){var t={}.hasOwnProperty,e=function(e,n){function r(){this.constructor=e}for(var s in n)t.call(n,s)&&(e[s]=n[s]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e};angular.module("Tasks").factory("ListsModel",["TasksModel","_Model",function(t,n){return new(function(t){function n(t){this._$tasksmodel=t,this._tmpUriCache={},this._data=[],this._dataMap={},this._filterCache={}}return e(n,t),n.prototype.add=function(t,e){if(null===e&&(e=!0),angular.isDefined(t.uri)&&angular.isDefined(this.getByUri(t.uri)))return this.update(t,e);angular.isDefined(t.uri)&&(e&&this._invalidateCache(),angular.isDefined(this._dataMap[t.uri])||(this._data.push(t),this._dataMap[t.uri]=t))},n.prototype.getByUri=function(t){return this._dataMap[t]},n.prototype.update=function(t,e){var r;return null===e&&(e=!0),r=this._tmpIdCache[t.tmpID],angular.isDefined(t.id)&&angular.isDefined(r)&&angular.isUndefined(r.id)&&(r.id=t.id,this._dataMap[t.id]=r),t.void=!1,n.__super__.update.call(this,t,e)},n.prototype.delete=function(t,e){var n,r,s,a,o;for(null===e&&(e=!0),o=this._data,n=s=0,a=o.length;s<a;n=++s)if(o[n]===t)return this._data.splice(n,1),r=this._dataMap[t.uri],delete this._dataMap[t.uri],e&&this._invalidateCache(),r},n.prototype.getStandardList=function(){var t;if(this.size())return t=this.getAll(),t[0]},n.prototype.isNameAlreadyTaken=function(t,e){var n,r,s,a,o;for(r=this.getAll(),s=!1,a=0,o=r.length;a<o;a++)n=r[a],n.displayname===t&&n.uri!==e&&(s=!0);return s},n.prototype.getCount=function(t,e,n){var r,s,a,o,i;for(null===n&&(n=""),r=0,a=this._$tasksmodel.filteredTasks(n),o=0,i=a.length;o<i;o++)s=a[o],r+=this._$tasksmodel.filterTasks(s,e)&&s.calendar.uri===t&&!s.related;return r},n.prototype.loadedCompleted=function(t){return!angular.isUndefined(this.getById(t))&&this.getById(t).loadedCompleted},n.prototype.setLoadedCompleted=function(t){this.getById(t).loadedCompleted=!0},n.prototype.getColor=function(t){return angular.isUndefined(this.getById(t))?"#CCCCCC":this.getById(t).calendarcolor},n.prototype.getName=function(t){return angular.isUndefined(this.getById(t))?"":this.getById(t).displayname},n}(n))(t)}])}.call(void 0),function(){var t={}.hasOwnProperty,e=function(e,n){function r(){this.constructor=e}for(var s in n)t.call(n,s)&&(e[s]=n[s]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e};angular.module("Tasks").factory("SettingsModel",["_Model",function(t){return new(function(t){function n(){this._nameCache={},n.__super__.constructor.call(this)}return e(n,t),n.prototype.add=function(t,e){return null===e&&(e=!0),this._nameCache[t.displayname]=t,angular.isDefined(t.id)?n.__super__.add.call(this,t,e):this._data.push(t)},n.prototype.toggle=function(t,e){var n;n=this.getById(t),this.getById(t)[e]=!n[e]},n}(t))}])}.call(void 0),function(){var t={}.hasOwnProperty,e=function(e,n){function r(){this.constructor=e}for(var s in n)t.call(n,s)&&(e[s]=n[s]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e},n=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};angular.module("Tasks").factory("TasksModel",["_Model",function(t){return new(function(t){function r(){this._tmpIdCache={},r.__super__.constructor.call(this)}return e(r,t),r.prototype.ad=function(t,e){if(null===e&&(e=!0),angular.isDefined(t.uri)&&angular.isDefined(this.getByUri(t.uri)))return this.update(t,e);angular.isDefined(t.uri)&&(e&&this._invalidateCache(),angular.isDefined(this._dataMap[t.uri])||(this._data.push(t),this._dataMap[t.uri]=t))},r.prototype.getByUri=function(t){return this._dataMap[t]},r.prototype.update=function(t,e){var n;return null===e&&(e=!0),e&&this._invalidateCache(),n=this.getByUri(t.uri),n.components=t.components,n.components.toString(),n},r.prototype.removeById=function(t){return r.__super__.removeById.call(this,t)},r.prototype.delete=function(t,e){var n,r,s,a,o;for(null===e&&(e=!0),o=this._data,n=s=0,a=o.length;s<a;n=++s)if(o[n]===t)return this._data.splice(n,1),r=this._dataMap[t.uri],delete this._dataMap[t.uri],e&&this._invalidateCache(),r},r.prototype.removeByList=function(t){var e,n,r,s,a;s=this.getAll(),r=[];for(var o=0,i=s.length;o<i;o++)n=s[o],n.calendarid===t&&r.push(n.id);a=[];for(var u=0,c=r.length;u<c;u++)e=r[u],a.push(this.removeById(e));return a},r.prototype.taskAtDay=function(t,e){var n,r,s,a,o;if(a=moment(t.start,"YYYYMMDDTHHmmss"),r=moment(t.due,"YYYYMMDDTHHmmss"),a.isValid()&&!r.isValid()){if(n=a.diff(moment().startOf("day"),"days",!0),!e&&n<e+1)return!0;if(n<e+1&&n>=e)return!0}if(r.isValid()&&!a.isValid()){if(n=r.diff(moment().startOf("day"),"days",!0),!e&&n<e+1)return!0;if(n<e+1&&n>=e)return!0}if(a.isValid()&&r.isValid()){if(o=a.diff(moment().startOf("day"),"days",!0),s=r.diff(moment().startOf("day"),"days",!0),!e&&(o<e+1||s<e+1))return!0;if(o<e+1&&o>=e&&s>=e)return!0;if(s<e+1&&s>=e&&o>=e)return!0}return!1},r.prototype.isLoaded=function(t){return!!this.getById(t.id)},r.prototype.hasSubtasks=function(t){for(var e=this.getAll(),n=0,r=e.length;n<r;n++){if(e[n].related===t)return!0}return!1},r.prototype.hasCompletedSubtasks=function(t){for(var e=this.getAll(),n=0,r=e.length;n<r;n++){var s=e[n];if(s.related===t&&s.completed)return!0}return!1},r.prototype.hasNoParent=function(t){if(t.related){for(var e=this.getAll(),n=0,r=e.length;n<r;n++){var s=e[n];if(t.related===s.uid&&t!==s)return!1}return!0}return!0},r.prototype.getIdByUid=function(t){for(var e=this.getAll(),n=0,r=e.length;n<r;n++){var s=e[n];if(s.uid===t)return s.id}return!1},r.prototype.getByUid=function(t){for(var e=this.getAll(),n=0,r=e.length;n<r;n++){var s=e[n];if(s.uid===t)return s}return null},r.prototype.getChildren=function(t){var e,n,r;r=this.getAll(),e=[];for(var s=0,a=r.length;s<a;s++)n=r[s],n.related===t.uid&&n!==t&&e.push(n);return e},r.prototype.getDescendantIDs=function(t){var e,n,r;n=this.getChildren(t),r=[];for(var s=0,a=n.length;s<a;s++)e=n[s],r=r.concat(e.uri),r=r.concat(this.getDescendantIDs(e));return r},r.prototype.filterTasks=function(t,e){switch(e){case"completed":return!0===t.completed;case"all":return!1===t.completed;case"current":return!1===t.completed&&this.current(t.start,t.due);case"starred":return!1===t.completed&&t.priority>5;case"today":return!1===t.completed&&(this.today(t.start)||this.today(t.due));case"week":return!1===t.completed&&(this.week(t.start)||this.week(t.due));default:return""+t.calendar.uri==""+e}},r.prototype.filteredTasks=function(t){var e,n,r,s,a;if(r=[],a=this.getAll(),t){for(var o=0,i=a.length;o<i;o++)if(s=a[o],this.filterTasksByString(s,t)){if(this.objectExists(s,r))continue;r.push(s),n=this.getIdByUid(s.related),e=this.getAncestor(n,r),e&&(r=r.concat(e))}}else r=a;return r},r.prototype.objectExists=function(t,e){for(var n=0,r=e.length;n<r;n++){if(e[n].id===t.id)return!0}return!1},r.prototype.filterTasksByString=function(t,e){var r,s,a;s=["name","note","location","categories","comments"],e=e.toLowerCase();for(r in t)if(a=t[r],n.call(s,r)>=0)if("comments"===r){if(this.searchComments(t.comments,e))return!0}else if("categories"===r){if(this.searchCategories(t.categories,e))return!0}else if(-1!==a.toLowerCase().indexOf(e))return!0;return!1},r.prototype.searchComments=function(t,e){for(var n=0,r=t.length;n<r;n++){if(-1!==t[n].comment.toLowerCase().indexOf(e))return!0}return!1},r.prototype.searchCategories=function(t,e){for(var n=0,r=t.length;n<r;n++){if(-1!==t[n].toLowerCase().indexOf(e))return!0}return!1},r.prototype.setReminder=function(t,e){return this.update({id:t,reminder:e})},r.prototype.overdue=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()&&moment(t,"YYYYMMDDTHHmmss").diff(moment())<0},r.prototype.due=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()},r.prototype.today=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()&&moment(t,"YYYYMMDDTHHmmss").diff(moment().startOf("day"),"days",!0)<1},r.prototype.week=function(t){return moment(t,"YYYYMMDDTHHmmss").isValid()&&moment(t,"YYYYMMDDTHHmmss").diff(moment().startOf("day"),"days",!0)<7},r.prototype.current=function(t,e){return!moment(t,"YYYYMMDDTHHmmss").isValid()||moment(t,"YYYYMMDDTHHmmss").diff(moment(),"days",!0)<0||moment(e,"YYYYMMDDTHHmmss").diff(moment(),"days",!0)<0},r.prototype.addComment=function(t){var e;e=this.getById(t.taskID),e.comments?e.comments.push(t):e.comments=[t]},r.prototype.updateComment=function(t){var e,n,r,s,a,o,i;for(r=this.getById(t.taskID),n=0,o=r.comments,i=[],s=0,a=o.length;s<a;s++){if(e=o[s],e.tmpID===t.tmpID){r.comments[n]=t;break}i.push(n++)}return i},r.prototype.deleteComment=function(t,e){var n,r,s,a,o,i,u;for(s=this.getById(t),r=0,i=s.comments,u=[],a=0,o=i.length;a<o;a++){if(n=i[a],n.id===e){s.comments.splice(r,1);break}u.push(r++)}return u},r}(t))}])}.call(void 0),angular.module("Tasks").factory("VTodo",["$filter","ICalFactory","RandomStringService",function(t,e,n){function r(t,e,n){if(angular.extend(this,{calendar:t,data:e["{urn:ietf:params:xml:ns:caldav}calendar-data"],uri:n,etag:e["{DAV:}getetag"]||null,timers:[],loaded:!1}),this.jCal=ICAL.parse(this.data),this.components=new ICAL.Component(this.jCal),0===this.components.jCal.length)throw"invalid calendar"}return r.prototype={get summary(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("summary")},set summary(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("summary",t),this.updateLastModified(),this.data=this.components.toString()},get priority(){return(10-this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("priority"))%10},set priority(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("priority",(10-t)%10),this.updateLastModified(),this.data=this.components.toString()},get complete(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("percent-complete")||0},set complete(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("percent-complete",t),this.updateLastModified(),this.data=this.components.toString(),t<100?(this.completed=null,this.status=0===t?"NEEDS-ACTION":"IN-PROCESS"):(this.completed=ICAL.Time.now(),this.status="COMPLETED")},get completed(){return!!this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("completed")},set completed(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("completed",t):e[0].removeProperty("completed"),this.updateLastModified(),this.data=this.components.toString()},get completed_date(){var t=this.components.getAllSubcomponents("vtodo"),e=t[0].getFirstPropertyValue("completed");return e?e.toJSDate():null},get status(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("status")},set status(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("status",t),this.updateLastModified(),this.data=this.components.toString()},get note(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("description")||""},set note(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("description",t),this.updateLastModified(),this.data=this.components.toString()},get uid(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("uid")||""},get related(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("related-to")||null},set related(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("related-to",t):e[0].removeProperty("related-to"),this.updateLastModified(),this.data=this.components.toString()},get hideSubtasks(){return+this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("x-oc-hidesubtasks")||0},set hideSubtasks(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("x-oc-hidesubtasks",+t),this.updateLastModified(),this.data=this.components.toString()},get hideCompletedSubtasks(){return+this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("x-oc-hidecompletedsubtasks")||0},set hideCompletedSubtasks(t){this.components.getAllSubcomponents("vtodo")[0].updatePropertyWithValue("x-oc-hidecompletedsubtasks",+t),this.updateLastModified(),this.data=this.components.toString()},get reminder(){return null},get categories(){var t=this.components.getAllSubcomponents("vtodo"),e=t[0].getFirstProperty("categories");return e?e.getValues():[]},set categories(t){var e=this.components.getAllSubcomponents("vtodo"),n=e[0].getFirstProperty("categories");if(t.length>0)if(n)n.setValues(t);else{var r=new ICAL.Property("categories");r.setValues(t),n=e[0].addProperty(r)}else e[0].removeProperty("categories");this.updateLastModified(),this.data=this.components.toString()},get start(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("dtstart")},set start(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("dtstart",t):e[0].removeProperty("dtstart"),this.updateLastModified(),this.data=this.components.toString()},get due(){return this.components.getAllSubcomponents("vtodo")[0].getFirstPropertyValue("due")},set due(t){var e=this.components.getAllSubcomponents("vtodo");t?e[0].updatePropertyWithValue("due",t):e[0].removeProperty("due"),this.updateLastModified(),this.data=this.components.toString()},get allDay(){var t=this.components.getAllSubcomponents("vtodo"),e=t[0].getFirstPropertyValue("dtstart"),n=t[0].getFirstPropertyValue("due"),r=n||e;return null!==r&&r.isDate},set allDay(t){var e=this.components.getAllSubcomponents("vtodo"),n=e[0].getFirstPropertyValue("dtstart");n&&(n.isDate=t,e[0].updatePropertyWithValue("dtstart",n));var r=e[0].getFirstPropertyValue("due");r&&(r.isDate=t,e[0].updatePropertyWithValue("due",r)),this.updateLastModified(),this.data=this.components.toString()},get comments(){return null},get loadedCompleted(){return this.loaded},set loadedCompleted(t){this.loaded=t},updateLastModified:function(){var t=this.components.getAllSubcomponents("vtodo");t[0].updatePropertyWithValue("last-modified",ICAL.Time.now()),t[0].updatePropertyWithValue("dtstamp",ICAL.Time.now())}},r.create=function(t){var s=e.new(),a=new ICAL.Component("vtodo");return s.addSubcomponent(a),a.updatePropertyWithValue("created",ICAL.Time.now()),a.updatePropertyWithValue("dtstamp",ICAL.Time.now()),a.updatePropertyWithValue("last-modified",ICAL.Time.now()),a.updatePropertyWithValue("uid",n.generate()),a.updatePropertyWithValue("summary",t.summary),a.updatePropertyWithValue("priority",t.priority),a.updatePropertyWithValue("percent-complete",t.complete),a.updatePropertyWithValue("x-oc-hidesubtasks",0),t.related&&a.updatePropertyWithValue("related-to",t.related),t.note&&a.updatePropertyWithValue("description",t.note),t.due&&a.updatePropertyWithValue("due",t.due),t.start&&a.updatePropertyWithValue("dtstart",t.start),new r(t.calendar,{"{urn:ietf:params:xml:ns:caldav}calendar-data":s.toString(),"{DAV:}getetag":null},null)},r}])}(jQuery,oc_requesttoken); //# sourceMappingURL=app.min.js.map diff --git a/js/public/app.min.js.map b/js/public/app.min.js.map index 5c55b300..6a110b89 100644 --- a/js/public/app.min.js.map +++ b/js/public/app.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["app.js","controllers/appcontroller.js","controllers/detailscontroller.js","controllers/listcontroller.js","controllers/settingscontroller.js","controllers/taskscontroller.js","directives/appnavigationentryutils.js","directives/autofocusoninsert.js","directives/avatar.js","directives/colorpickerDirective.js","directives/confirmation.js","directives/datepicker.js","directives/occlickfocus.js","directives/timepicker.js","directives/watchtop.js","filters/counterFormatter.js","filters/dateDetails.js","filters/dateDetailsShort.js","filters/dateFromNow.js","filters/dateTaskList.js","filters/day.js","filters/dayTaskList.js","filters/percentDetails.js","filters/priorityDetails.js","filters/reminderDetails.js","filters/startDetails.js","filters/timeTaskList.js","services/calendarservice.js","services/davclient.js","services/icalfactory.js","services/loading.js","services/model.js","services/persistence.js","services/publisher.js","services/randomstringservice.js","services/request.js","services/status.js","services/vtodoservice.js","services/businesslayer/listsbusinesslayer.js","services/businesslayer/searchbusinesslayer.js","services/businesslayer/settingsbusinesslayer.js","services/businesslayer/tasksbusinesslayer.js","services/models/calendar.js","services/models/collectionsmodel.js","services/models/listsmodel.js","services/models/settingsmodel.js","services/models/tasksmodel.js","services/models/vtodo.js"],"names":["$","oc_requesttoken","undefined","config","$provide","$routeProvider","$interpolateProvider","$httpProvider","value","defaults","headers","common","requesttoken","when","otherwise","_update","run","$document","$rootScope","Config","$timeout","TasksBusinessLayer","ListsBusinessLayer","SearchBusinessLayer","timeOutUpdate","init","taskUpdateInterval","OCA","Search","tasks","moment","locale","event","calendar","$broadcast","sameDay","lastWeek","t","nextWeek","sameElse","diff","this","m","mm","h","hh","d","dd","M","MM","y","yy","AppController","controller","$scope","$route","status","$location","$routeParams","Loading","SettingsModel","Persistence","_$listsbusinesslayer","_$route","_$scope","_$status","_$timeout","_$location","_$routeparams","_Loading","_$settingsmodel","_persistence","newListName","settingsmodel","then","Promise","results","all","target","listparameter","length","route","calendarID","is","$event","closest","angular","isUndefined","path","collectionID","focusTaskInput","addingList","addSubtaskTo","isLoading","DetailsController","$window","TasksModel","ListsModel","_$window","_$tasksmodel","_tasksbusinesslayer","_$listsmodel","task","getById","taskID","getByUri","cats","categories","found","add","id","isAddingComment","names","timers","durations","name","loadTask","TaskState","related","params","invert","slice","start","deleteTask","$apply","editName","writable","setEditRoute","currentTarget","initDueDate","initStartDate","initReminder","endEdit","resetRoute","keyCode","type","deletePercent","deleteReminder","deleteReminderDate","toggleCompleted","setPercentComplete","toggleStarred","complete","setPriority","isDue","date","isOverDue","overdue","setstartday","setstarttime","setStart","deleteStartDate","setdueday","setduetime","setDue","deleteDueDate","isAllDayPossible","toggleAllDay","setAllDay","allDay","due","setreminderday","setremindertime","setReminderDate","reminderType","reminder","isValid","setReminder","addComment","comment","CommentContent","tmpID","time","Date","now","data","sendComment","deleteComment","commentStrings","commentID","input","button","addCategory","default_categories","indexOf","category","model","doUpdate","push","removeCategory","ListController","CollectionsModel","CalendarService","_$routeParams","_$tasksbusinesslayer","_$collectionsmodel","_$searchbusinesslayer","_$calendarservice","collections","draggedTasks","nameError","getAll","color","deleteMessage","replace","displayname","getStandardList","uri","startCreate","tooltip","isAddingList","startEdit","prepareUpdate","download","url","open","checkNew","checkEdit","cancelEdit","checkName","allowed","$input","isNameAllowed","check","preventDefault","msg","placement","trigger","$on","s","calendarUri","resetToPreviousState","saveEdit","rename","isNameAlreadyTaken","getCount","filter","hideCollection","collection","show","getFilter","dragoverList","listID","index","attr","dropList","item","changeCalendar","dragoverCollection","effectAllowed","dataTransfer","ctrlKey","dropCollection","changeCollection","dropEffect","SettingsController","Status","SettingsBusinessLayer","_$settingsbusinesslayer","collectionOptions","getStatus","startOfWeekOptions","setVisibility","setStartOfWeek","set","__indexOf","i","l","module","TasksController","_settingsbusinesslayer","_searchbusinesslayer","VTodo","vtodo","_vtodo","calendars","days","isAddingTask","focusInputField","addTask","taskName","_ref","parent","summary","priority","completed","note","startOf","format","openDetails","focusSubtaskInput","subtaskName","getAddString","isDefined","showSubtaskInput","taskname","hideSubtasks","uid","descendantIDs","loadedCompleted","toggle","filterTasks","getSubTasks","_i","_len","hideCompletedSubtasks","ret","hasNoParent","hasCompletedSubtasks","toggleSubtasks","toggleCompletedSubtasks","filterTasksByString","filteredTasks","dayHasEntry","taskAtDay","day","filterLists","getCountString","checkTaskInput","setLoadedCompleted","sortDue","sortStart","sortOrder","getSortOrderIcon","order","sortDirection","dropAsSubtask","parentID","changeParent","removeClass","newCalendar","queries","makeRootTask","children","addClass","allow","dragStart","dragEnd","directive","elm","find","menu","toggleClass","scope","focus","avatar","userid","$observe","size","saturation","hue","isArray","lightness","huePrime","red","chroma","Math","abs","floor","blue","secondComponent","green","lightnessAdjustment","rgbToHex","round","r","g","b","Array","listofcolours","toString","parseInt","randColour","String","random","hslToRgb","toHsl","prototype","forEach","hsl","hash","hslcolour","restrict","templateUrl","filePath","colors","selected","element","randomizeColour","pick","confirmationFunction","confirmationMessage","ConfirmationController","$element","$attrs","$compile","countdown","message","hasClass","stopPropagation","activate","bind","e","html","documentClick","unbind","onSelect","datepicker","inst","beforeShow","marginLeft","outerWidth","dp","css","margin-left","left","startOfWeek","minDate","options","selector","click","timeout","timepicker","atPosition","myPosition","minuteText","hourText","divTop","$watch","prev","outerHeight","count","isDate","fromNow","percent","string","ds","duration","token","tokenName","after","_this","service","DavClient","Calendar","discoverHome","callback","propFind","buildUrl","OC","linkToRemoteBase","NS_DAV","requestToken","response","props","propStat","wasRequestSuccessful","textContent","_currentUserPrincipal","NS_IETF","body","properties","_CALENDAR_HOME","split","_PROPERTIES","NS_APPLE","NS_OWNCLOUD","responseCode","getResponseCodeFromHTTPResponse","doesSupportVTodo","components","attributes","getNamedItem","j","toLowerCase","get","href","substr","create","document","cMkcalendar","setAttribute","createDocument","createElement","xmlDoc","appendChild","dProp","dSet","_createXMLForProperty","outerHTML","_suggestUri","request","enabled","_takenUrls","update","dPropUpdate","updatedProperties","resetUpdatedProperties","delete","oShare","shareType","shareWith","existingShare","implementation","oSet","dHref","Share","SHARE_TYPE_USER","SHARE_TYPE_GROUP","oSummary","owner","oRW","Content-Type","users","sharedWith","oRemove","user","groups","propName","oEnabled","dDisplayname","aOrder","aColor","cComponents","cComp","toUpperCase","acl","canWrite","getElementsByTagNameNS","k","writeNode","_isUriAlreadyTaken","lastPart","positionLastDash","match","firstPart","client","xmlNamespaces","dav","Client","linkToRemote","DAV:","urn:ietf:params:xml:ns:caldav","http://apple.com/ns/ical/","http://owncloud.org/ns","http://nextcloud.com/ns","NS_NEXTCLOUD","NS_CALENDARSERVER","location","protocol","window","host","root","updatePropertyWithValue","version","factory","decrease","Model","_dataMap","_filterCache","_data","_results","clearCache","_invalidateCache","entry","key","removeById","counter","splice","query","hashCode","exec","Request","$q","_$rootScope","_CalendarService","deferred","defer","successCallback","getCollections","getSettings","resolve","successCallbackWrapper","onSuccess","showLoading","failureCallbackWrapper","_request","onFailure","visibility","routeParams","setting","post","Publisher","_subscriptions","subscribeObjectTo","object","base","publishDataTo","ref","subscriber","handle","generate","$http","publisher","initialized","shelvedRequests","_executeShelvedRequests","defaultConfig","defaultData","extend","method","catch","put","_shelveRequest","RandomStringService","cCalQuery","dGetEtag","cCalendarData","cFilter","cCompFilterVCal","cCompFilterVTodo","cPropFilterCompleted","cIsNotDefined","cTextMatch","cPropFilterRelated","cTextMatchValue","createTextNode","Depth","vTodos","lastIndexOf","vTodo","{urn:ietf:params:xml:ns:caldav}calendar-data","{DAV:}getetag","xhr","getResponseHeader","returnTodo","_generateRandomUri","console","log","cancel","etag","__bind","fn","me","setFilter","attach","initialize","_$searchString","search","setRenderer","result","renderTaskResult","$row","$template","calendarid","isLoaded","clone","append","text","width","background-color","getColor","success","updateModel","VTodoService","_$vtodoservice","_$vtodo","ad","getTask","uncompleteParents","percentComplete","triggerUpdate","completeChildren","child","getChildren","getByUid","setHideSubtasks","hide","setHideCompletedSubtasks","momentToICALTime","asDate","ICAL","Time","fromDateString","reference","isAfter","olddue","year","month","hour","minute","isBefore","isSame","subtract","oldstart","checkReminderDate","second","p","newreminder","reminderdate","action","rel","seg","week","secondsToSegments","w","newTask","newVTodo","requests","$filter","vjournal","vevent","shareable","_updatedProperties","_properties","hasOwnProperty","shares","access","readWrite","startsWith","origin","_setUpdated","c","regex","_generateTextColor","_propertiesBackup","copy","dropPreviousState","toggleSharesEditor","list","brightness","editingShares","__hasProp","call","Ctor","_Model","__super__","__extends","_super","_nameCache","updateByUri","tmplist","_tmpIdCache","calendarcolor","getName","removeByList","taskIDs","_j","_len1","startdiff","duediff","hasSubtasks","getIdByUid","getDescendantIDs","concat","current","today","needle","ancestors","objectExists","getAncestor","keys","searchComments","comments","searchCategories","updateComment","com","icalfactory","loaded","jCal","Component","getAllSubcomponents","getFirstPropertyValue","updateLastModified","vtodos","removeProperty","completed_date","toJSDate","comp","getFirstProperty","getValues","setValues","prop","Property","addProperty","addSubcomponent"],"mappings":"CAAA,SAAAA,EAAYC,EAAAC,wBAKPC,OAAM,SAAA,UAAA,YAAA,YAAA,aAAA,aAAAA,QAAA,WAAA,iBAAA,uBAAA,gBAAA,SAAAC,EAAAC,EAAAC,EAAAC,GAIVH,EAAEI,MAAA,UACFD,gBAAcE,IACdJ,mBAAoB,MAEpBE,EAAEE,SAAAC,QAAAC,OAAAC,aAAAX,EACFI,EAAEQ,KAAA,6BAAAA,KAAA,iDAAAA,KAAA,2CAAAA,KAAA,oDAAAA,KAAA,2DAAAA,KAAA,+CAAAA,KAAA,wDAAAA,KAAA,+DAAAA,KAAA,iCAAAA,KAAA,4BAAAA,KAAA,0CAAAA,KAAA,0DAAAC,sDAKEC,OAAO,SAAAC,KAAA,YAAA,aAAA,SAAA,WAAA,qBAAA,qBAAA,sBAAA,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,MAGVR,GACAS,GAAAA,WACQJ,WACR,GAACI,EAKFP,OAJCQ,GAAW,WACX,MAAOD,GAAAA,EA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,OACrCrV,EAAMwR,wBAAwB,UAAWnc,KAAKqL,KAAAA,OAC9CV,EAAMwR,wBAAwB,gBAAiB7Q,KAAAA,KAAS9G,OACxDmG,EAAMwR,wBAAwB,MAAA6D,EAAyBxd,YACvDmI,EAAMwR,wBAAwB,UAAAnc,EAAAqL,SAC9BV,EAAI3K,wBAAc,WAAAA,EAAAsL,YACZ6Q,wBAAwB,mBAAoBnb,EAAAA,UAClD2J,EAAAwR,wBAAA,oBAAA,GACInc,EAAKwL,SACRb,EAAMwR,wBAAwB,aAAanc,EAAMgB,SAE9ChB,EAAK0D,MACRiH,EAAMwR,wBAAwB,cAAenc,EAACwL,MAE3CxL,EAAKoB,KACRuJ,EAAMwR,wBAAwB,MAAAnc,EAAWA,cAG1C2K,EAAOwR,wBAAuB,UAAEnc,EAAAoB,OAGzB,GAACsJ,GAAA1K,EAAArE,UACRslB,+CAAAmJ,EAAAxZ,iCAED","file":"app.min.js","sourcesContent":["'use strict';\n\nangular.module('Tasks', ['ngRoute', 'ngAnimate', 'ui.select', 'ngSanitize', 'dndLists']).config(['$provide', '$routeProvider', '$interpolateProvider', '$httpProvider', function ($provide, $routeProvider, $interpolateProvider, $httpProvider) {\n\t'use strict';\n\n\tvar config;\n\t$provide.value('Config', config = {\n\t\tmarkReadTimeout: 500,\n\t\ttaskUpdateInterval: 1000 * 600\n\t});\n\t$httpProvider.defaults.headers.common.requesttoken = oc_requesttoken;\n\t$routeProvider.when('/calendars/:calendarID', {}).when('/calendars/:calendarID/edit/:listparameter', {}).when('/calendars/:calendarID/tasks/:taskID', {}).when('/calendars/:calendarID/tasks/:taskID/settings', {}).when('/calendars/:calendarID/tasks/:taskID/edit/:parameter', {}).when('/collections/:collectionID/tasks/:taskID', {}).when('/collections/:collectionID/tasks/:taskID/settings', {}).when('/collections/:collectionID/tasks/:taskID/edit/:parameter', {}).when('/collections/:collectionID', {}).when('/search/:searchString', {}).when('/search/:searchString/tasks/:taskID', {}).when('/search/:searchString/tasks/:taskID/edit/:parameter', {}).otherwise({\n\t\tredirectTo: '/collections/all'\n\t});\n}]);\n\nangular.module('Tasks').run(['$document', '$rootScope', 'Config', '$timeout', 'ListsBusinessLayer', 'TasksBusinessLayer', 'SearchBusinessLayer', function ($document, $rootScope, Config, $timeout, TasksBusinessLayer, ListsBusinessLayer, SearchBusinessLayer) {\n\t'use strict';\n\n\tvar _update;\n\tvar init = false;\n\t(_update = function update() {\n\t\tvar timeOutUpdate;\n\t\ttimeOutUpdate = function timeOutUpdate() {\n\t\t\treturn $timeout(_update, Config.taskUpdateInterval);\n\t\t};\n\t\tinit = true;\n\t\treturn timeOutUpdate();\n\t}).call();\n\tOCA.Search.tasks = SearchBusinessLayer;\n\t$document.click(function (event) {\n\t\t$rootScope.$broadcast('documentClicked', event);\n\t});\n\tmoment.locale('details', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Due yesterday') + '], HH:mm',\n\t\t\tsameDay: '[' + t('tasks', 'Due today') + '], HH:mm',\n\t\t\tnextDay: '[' + t('tasks', 'Due tomorrow') + '], HH:mm',\n\t\t\tlastWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tnextWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tsameElse: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY, HH:mm'\n\t\t}\n\t});\n\tmoment.locale('details_allday', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Due yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Due today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Due tomorrow') + ']',\n\t\t\tlastWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY',\n\t\t\tnextWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY',\n\t\t\tsameElse: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY'\n\t\t}\n\t});\n\tmoment.locale('start', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Started yesterday') + '], HH:mm',\n\t\t\tsameDay: '[' + t('tasks', 'Starts today') + '], HH:mm',\n\t\t\tnextDay: '[' + t('tasks', 'Starts tomorrow') + '], HH:mm',\n\t\t\tlastWeek: '[' + t('tasks', 'Started on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tnextWeek: '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tsameElse: function sameElse() {\n\t\t\t\tif (this.diff(moment()) > 0) {\n\t\t\t\t\treturn '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY, HH:mm';\n\t\t\t\t} else {\n\t\t\t\t\treturn '[' + t('tasks', 'Started on') + '] MMM DD, YYYY, HH:mm';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tmoment.locale('start_allday', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Started yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Starts today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Starts tomorrow') + ']',\n\t\t\tlastWeek: '[' + t('tasks', 'Started on') + '] MMM DD, YYYY',\n\t\t\tnextWeek: '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY',\n\t\t\tsameElse: function sameElse() {\n\t\t\t\tif (this.diff(moment()) > 0) {\n\t\t\t\t\treturn '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY';\n\t\t\t\t} else {\n\t\t\t\t\treturn '[' + t('tasks', 'Started on') + '] MMM DD, YYYY';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tmoment.locale('reminder', {\n\t\tcalendar: {\n\t\t\tlastDay: t('tasks', '[Remind me yesterday at ]HH:mm'),\n\t\t\tsameDay: t('tasks', '[Remind me today at ]HH:mm'),\n\t\t\tnextDay: t('tasks', '[Remind me tomorrow at ]HH:mm'),\n\t\t\tlastWeek: t('tasks', '[Remind me on ]MMM DD, YYYY,[ at ]HH:mm'),\n\t\t\tnextWeek: t('tasks', '[Remind me on ]MMM DD, YYYY,[ at ]HH:mm'),\n\t\t\tsameElse: t('tasks', '[Remind me on ]MMM DD, YYYY,[ at ]HH:mm')\n\t\t}\n\t});\n\tmoment.locale('tasks', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Tomorrow') + ']',\n\t\t\tlastWeek: 'DD.MM.YYYY',\n\t\t\tnextWeek: 'DD.MM.YYYY',\n\t\t\tsameElse: 'DD.MM.YYYY'\n\t\t}\n\t});\n\tmoment.locale('details_short', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Tomorrow') + ']',\n\t\t\tlastWeek: 'MMM DD, YYYY',\n\t\t\tnextWeek: 'MMM DD, YYYY',\n\t\t\tsameElse: 'MMM DD, YYYY'\n\t\t}\n\t});\n\tmoment.locale('list_week', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Today') + '], MMM. DD',\n\t\t\tnextDay: '[' + t('tasks', 'Tomorrow') + '], MMM. DD',\n\t\t\tlastWeek: 'ddd, MMM. DD',\n\t\t\tnextWeek: 'ddd, MMM. DD',\n\t\t\tsameElse: 'ddd, MMM. DD'\n\t\t}\n\t});\n\treturn moment.locale('en', {\n\t\trelativeTime: {\n\t\t\tfuture: t('tasks', \"in %s\"),\n\t\t\tpast: t('tasks', \"%s ago\"),\n\t\t\ts: t('tasks', \"seconds\"),\n\t\t\tm: t('tasks', \"a minute\"),\n\t\t\tmm: t('tasks', \"%d minutes\"),\n\t\t\th: t('tasks', \"an hour\"),\n\t\t\thh: t('tasks', \"%d hours\"),\n\t\t\td: t('tasks', \"a day\"),\n\t\t\tdd: t('tasks', \"%d days\"),\n\t\t\tM: t('tasks', \"a month\"),\n\t\t\tMM: t('tasks', \"%d months\"),\n\t\t\ty: t('tasks', \"a year\"),\n\t\t\tyy: t('tasks', \"%d years\")\n\t\t}\n\t});\n}]);","'use strict';\n\nangular.module('Tasks').controller('AppController', ['$scope', '$rootScope', 'ListsBusinessLayer', '$route', 'Status', '$timeout', '$location', '$routeParams', 'Loading', 'SettingsModel', 'Persistence', function ($scope, $rootScope, ListsBusinessLayer, $route, status, $timeout, $location, $routeParams, Loading, SettingsModel, Persistence) {\n\t'use strict';\n\n\tvar AppController = function () {\n\t\tfunction AppController(_$scope, $rootScope, _$listsbusinesslayer, _$route, _$status, _$timeout, _$location, _$routeparams, _Loading, _$settingsmodel, _persistence) {\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$listsbusinesslayer = _$listsbusinesslayer;\n\t\t\tthis._$route = _$route;\n\t\t\tthis._$status = _$status;\n\t\t\tthis._$timeout = _$timeout;\n\t\t\tthis._$location = _$location;\n\t\t\tthis._$routeparams = _$routeparams;\n\t\t\tthis._Loading = _Loading;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$scope.status = this._$status.getStatus();\n\t\t\tthis._$scope.route = this._$routeparams;\n\t\t\tthis._$scope.status.newListName = \"\";\n\t\t\tthis._$scope.settingsmodel = this._$settingsmodel;\n\n\t\t\tthis._$listsbusinesslayer.init().then(function (results) {\n\t\t\t\tPromise.all(results).then(function () {\n\t\t\t\t\t$scope.$apply();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis._persistence.init();\n\n\t\t\tthis._$scope.closeAll = function ($event) {\n\t\t\t\tif ($($event.target).closest('.close-all').length || $($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\tif (!angular.isUndefined(_$scope.route.calendarID)) {\n\t\t\t\t\t\tif (_$scope.route.listparameter === 'name') {\n\t\t\t\t\t\t\t$rootScope.$broadcast('cancelEditCalendar', _$scope.route.calendarID);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t\t\t} else if (!angular.isUndefined(_$scope.route.collectionID)) {\n\t\t\t\t\t\t_$location.path('/collections/' + _$scope.route.collectionID);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_$location.path('/collections/all');\n\t\t\t\t\t}\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.status.focusTaskInput = false;\n\t\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t\t}\n\t\t\t\tif (!$($event.target).closest('.newList').length) {\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t\t}\n\t\t\t\tif (!$($event.target).closest('.add-subtask').length) {\n\t\t\t\t\t_$scope.status.addSubtaskTo = null;\n\t\t\t\t\t_$scope.status.focusSubtaskInput = false;\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.isLoading = function () {\n\t\t\t\treturn _Loading.isLoading();\n\t\t\t};\n\t\t}\n\t\treturn AppController;\n\t}();\n\treturn new AppController($scope, $rootScope, ListsBusinessLayer, $route, status, $timeout, $location, $routeParams, Loading, SettingsModel, Persistence);\n}]);","'use strict';\n\nangular.module('Tasks').controller('DetailsController', ['$scope', '$window', 'TasksModel', 'TasksBusinessLayer', '$route', '$location', '$timeout', '$routeParams', 'SettingsModel', 'Loading', 'ListsModel', function ($scope, $window, TasksModel, TasksBusinessLayer, $route, $location, $timeout, $routeParams, SettingsModel, Loading, ListsModel) {\n\t'use strict';\n\n\tvar DetailsController = function () {\n\t\tfunction DetailsController(_$scope, _$window, _$tasksmodel, _tasksbusinesslayer, _$route, _$location, _$timeout, _$routeparams, _$settingsmodel, _Loading, _$listsmodel) {\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$window = _$window;\n\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\tthis._tasksbusinesslayer = _tasksbusinesslayer;\n\t\t\tthis._$route = _$route;\n\t\t\tthis._$location = _$location;\n\t\t\tthis._$timeout = _$timeout;\n\t\t\tthis._$routeparams = _$routeparams;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._Loading = _Loading;\n\t\t\tthis._$scope.task = _$tasksmodel.getById(_$scope.route.taskID);\n\t\t\tthis._$scope.found = true;\n\t\t\tthis._$scope.$on('$routeChangeSuccess', function () {\n\t\t\t\tvar task = _$tasksmodel.getByUri(_$scope.route.taskID);\n\n\t\t\t\tif (!(angular.isUndefined(task) || task === null)) {\n\t\t\t\t\t_$scope.task = task;\n\t\t\t\t\t// Bind categories to task.cats as angular.ui/ui-select seems to have problems with Getter/Setter\n\t\t\t\t\t_$scope.task.cats = task.categories;\n\t\t\t\t\t_$scope.found = true;\n\t\t\t\t} else if (_$scope.route.taskID !== void 0) {\n\t\t\t\t\t_$scope.found = false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._$scope.settingsmodel = this._$settingsmodel;\n\t\t\tthis._$scope.settingsmodel.add({\n\t\t\t\t'id': 'various',\n\t\t\t\t'categories': []\n\t\t\t});\n\t\t\tthis._$scope.isAddingComment = false;\n\t\t\tthis._$scope.timers = [];\n\t\t\tthis._$scope.durations = [{\n\t\t\t\tname: t('tasks', 'week'),\n\t\t\t\tnames: t('tasks', 'weeks'),\n\t\t\t\tid: 'week'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'day'),\n\t\t\t\tnames: t('tasks', 'days'),\n\t\t\t\tid: 'day'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'hour'),\n\t\t\t\tnames: t('tasks', 'hours'),\n\t\t\t\tid: 'hour'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'minute'),\n\t\t\t\tnames: t('tasks', 'minutes'),\n\t\t\t\tid: 'minute'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'second'),\n\t\t\t\tnames: t('tasks', 'seconds'),\n\t\t\t\tid: 'second'\n\t\t\t}];\n\t\t\tthis._$scope.loadTask = function (taskID) {\n\t\t\t\tvar task = _$tasksmodel.getByUri(_$scope.route.taskID);\n\t\t\t\tif (!(angular.isUndefined(task) || task === null)) {\n\t\t\t\t\t_$scope.task = task;\n\t\t\t\t\t_$scope.found = true;\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.TaskState = function () {\n\t\t\t\tif (_$scope.found) {\n\t\t\t\t\treturn 'found';\n\t\t\t\t} else {\n\t\t\t\t\tif (_Loading.isLoading()) {\n\t\t\t\t\t\treturn 'loading';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.params = [{\n\t\t\t\tname: t('tasks', 'before beginning'),\n\t\t\t\tinvert: true,\n\t\t\t\trelated: 'START',\n\t\t\t\tid: \"10\"\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'after beginning'),\n\t\t\t\tinvert: false,\n\t\t\t\trelated: 'START',\n\t\t\t\tid: \"00\"\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'before end'),\n\t\t\t\tinvert: true,\n\t\t\t\trelated: 'END',\n\t\t\t\tid: \"11\"\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'after end'),\n\t\t\t\tinvert: false,\n\t\t\t\trelated: 'END',\n\t\t\t\tid: \"01\"\n\t\t\t}];\n\t\t\tthis._$scope.filterParams = function (params) {\n\t\t\t\tvar task;\n\t\t\t\ttask = _$tasksmodel.getById(_$scope.route.taskID);\n\t\t\t\tif (!(angular.isUndefined(task) || task === null)) {\n\t\t\t\t\tif (task.due && task.start) {\n\t\t\t\t\t\treturn params;\n\t\t\t\t\t} else if (task.start) {\n\t\t\t\t\t\treturn params.slice(0, 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn params.slice(2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.deleteTask = function (task) {\n\t\t\t\treturn _$timeout(function () {\n\t\t\t\t\treturn _tasksbusinesslayer.deleteTask(task).then(function () {\n\t\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t}, 500);\n\t\t\t};\n\t\t\tthis._$scope.triggerUpdate = function (task) {\n\t\t\t\t_tasksbusinesslayer.triggerUpdate(task);\n\t\t\t};\n\t\t\tthis._$scope.editName = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif (!$($event.target).is('a')) {\n\t\t\t\t\t\t_$scope.setEditRoute('name');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editDueDate = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('duedate');\n\t\t\t\t\t\t_tasksbusinesslayer.initDueDate(task);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editStart = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('startdate');\n\t\t\t\t\t\t_tasksbusinesslayer.initStartDate(task);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editReminder = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('reminer');\n\t\t\t\t\t\treturn _tasksbusinesslayer.initReminder(_$scope.route.taskID);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editNote = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\tif (!$($event.target).is('a')) {\n\t\t\t\t\t\t\t_$scope.setEditRoute('note');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editPriority = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('priority');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editPercent = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('percent');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.endEdit = function ($event) {\n\t\t\t\tif ($($event.target).closest('.end-edit').length || $($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t_$scope.resetRoute();\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.endName = function ($event) {\n\t\t\t\tif ($event.keyCode === 13) {\n\t\t\t\t\t$event.preventDefault();\n\t\t\t\t\t_$scope.resetRoute();\n\t\t\t\t}\n\t\t\t\tif ($event.keyCode === 27) {\n\t\t\t\t\treturn _$scope.resetRoute();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.setEditRoute = function (type) {\n\t\t\t\tvar calendarID = _$scope.route.calendarID;\n\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\tif (calendarID) {\n\t\t\t\t\t$location.path('/calendars/' + calendarID + '/tasks/' + _$scope.route.taskID + '/edit/' + type);\n\t\t\t\t} else if (collectionID) {\n\t\t\t\t\t$location.path('/collections/' + collectionID + '/tasks/' + _$scope.route.taskID + '/edit/' + type);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.resetRoute = function () {\n\t\t\t\tvar calendarID = _$scope.route.calendarID;\n\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\tif (calendarID) {\n\t\t\t\t\t$location.path('/calendars/' + calendarID + '/tasks/' + _$scope.route.taskID);\n\t\t\t\t} else if (collectionID) {\n\t\t\t\t\t$location.path('/collections/' + collectionID + '/tasks/' + _$scope.route.taskID);\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.deletePercent = function (task) {\n\t\t\t\treturn _tasksbusinesslayer.setPercentComplete(task, 0);\n\t\t\t};\n\t\t\tthis._$scope.deleteReminder = function () {\n\t\t\t\treturn _tasksbusinesslayer.deleteReminderDate(_$scope.route.taskID);\n\t\t\t};\n\n\t\t\tthis._$scope.toggleCompleted = function (task) {\n\t\t\t\tif (task.completed) {\n\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 0);\n\t\t\t\t} else {\n\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 100);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.setPercentComplete = function (task, complete) {\n\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, complete);\n\t\t\t};\n\n\t\t\tthis._$scope.toggleStarred = function (task) {\n\t\t\t\tif (task.priority > 5) {\n\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 0);\n\t\t\t\t} else {\n\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 9);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.deletePriority = function (task) {\n\t\t\t\treturn _tasksbusinesslayer.setPriority(task, 0);\n\t\t\t};\n\t\t\tthis._$scope.isDue = function (date) {\n\t\t\t\treturn _$tasksmodel.due(date);\n\t\t\t};\n\t\t\tthis._$scope.isOverDue = function (date) {\n\t\t\t\treturn _$tasksmodel.overdue(date);\n\t\t\t};\n\n\t\t\tthis._$scope.setstartday = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setStart(_$scope.task, moment(date, 'MM/DD/YYYY'), 'day');\n\t\t\t};\n\t\t\tthis._$scope.setstarttime = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setStart(_$scope.task, moment(date, 'HH:mm'), 'time');\n\t\t\t};\n\t\t\tthis._$scope.deleteStartDate = function (task) {\n\t\t\t\t_tasksbusinesslayer.deleteStartDate(task);\n\t\t\t};\n\n\t\t\tthis._$scope.setdueday = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setDue(_$scope.task, moment(date, 'MM/DD/YYYY'), 'day');\n\t\t\t};\n\t\t\tthis._$scope.setduetime = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setDue(_$scope.task, moment(date, 'HH:mm'), 'time');\n\t\t\t};\n\t\t\tthis._$scope.deleteDueDate = function (task) {\n\t\t\t\t_tasksbusinesslayer.deleteDueDate(task);\n\t\t\t};\n\n\t\t\tthis._$scope.isAllDayPossible = function (task) {\n\t\t\t\treturn !angular.isUndefined(task) && task.calendar.writable && (task.due || task.start);\n\t\t\t};\n\t\t\tthis._$scope.toggleAllDay = function (task) {\n\t\t\t\t_tasksbusinesslayer.setAllDay(task, !task.allDay);\n\t\t\t};\n\n\t\t\tthis._$scope.setreminderday = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setReminderDate(_$scope.route.taskID, moment(date, 'MM/DD/YYYY'), 'day');\n\t\t\t};\n\t\t\tthis._$scope.setremindertime = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setReminderDate(_$scope.route.taskID, moment(date, 'HH:mm'), 'time');\n\t\t\t};\n\t\t\tthis._$scope.reminderType = function (task) {\n\t\t\t\tif (!angular.isUndefined(task)) {\n\t\t\t\t\tif (task.reminder === null) {\n\t\t\t\t\t\tif (moment(task.start, \"YYYYMMDDTHHmmss\").isValid() || moment(task.due, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\t\t\t\treturn 'DURATION';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn 'DATE-TIME';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.reminder.type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.changeReminderType = function (task) {\n\t\t\t\t_tasksbusinesslayer.checkReminderDate(task.id);\n\t\t\t\tif (this.reminderType(task) === 'DURATION') {\n\t\t\t\t\tif (task.reminder) {\n\t\t\t\t\t\ttask.reminder.type = 'DATE-TIME';\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttask.reminder = {\n\t\t\t\t\t\t\ttype: 'DATE-TIME'\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (task.reminder) {\n\t\t\t\t\t\ttask.reminder.type = 'DURATION';\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttask.reminder = {\n\t\t\t\t\t\t\ttype: 'DURATION'\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _tasksbusinesslayer.setReminder(task.id);\n\t\t\t};\n\t\t\tthis._$scope.setReminderDuration = function (taskID) {\n\t\t\t\treturn _tasksbusinesslayer.setReminder(_$scope.route.taskID);\n\t\t\t};\n\t\t\tthis._$scope.addComment = function () {\n\t\t\t\tvar comment,\n\t\t\t\t _this = this;\n\t\t\t\tif (_$scope.CommentContent) {\n\t\t\t\t\t_$scope.isAddingComment = true;\n\t\t\t\t\tcomment = {\n\t\t\t\t\t\ttmpID: 'newComment' + Date.now(),\n\t\t\t\t\t\tcomment: _$scope.CommentContent,\n\t\t\t\t\t\ttaskID: _$scope.route.taskID,\n\t\t\t\t\t\ttime: moment().format('YYYYMMDDTHHmmss'),\n\t\t\t\t\t\tname: $('#expandDisplayName').text()\n\t\t\t\t\t};\n\t\t\t\t\t_tasksbusinesslayer.addComment(comment, function (data) {\n\t\t\t\t\t\t_$tasksmodel.updateComment(data);\n\t\t\t\t\t\t_$scope.isAddingComment = false;\n\t\t\t\t\t}, function () {\n\t\t\t\t\t\t_$scope.isAddingComment = false;\n\t\t\t\t\t});\n\t\t\t\t\t_$scope.CommentContent = '';\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.sendComment = function (event) {\n\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\treturn _$scope.addComment();\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.deleteComment = function (commentID) {\n\t\t\t\treturn _tasksbusinesslayer.deleteComment(_$scope.route.taskID, commentID);\n\t\t\t};\n\t\t\tthis._$scope.commentStrings = function () {\n\t\t\t\treturn {\n\t\t\t\t\tbutton: t('tasks', 'Comment'),\n\t\t\t\t\tinput: t('tasks', 'Add a comment')\n\t\t\t\t};\n\t\t\t};\n\t\t\tthis._$scope.addCategory = function (category, model) {\n\t\t\t\t_$scope.task.categories = _$scope.task.cats;\n\t\t\t\tvar default_categories = _$scope.settingsmodel.getById('various').categories;\n\t\t\t\tif (default_categories.indexOf(category) < 0) {\n\t\t\t\t\tdefault_categories.push(category);\n\t\t\t\t}\n\t\t\t\t_tasksbusinesslayer.doUpdate(_$scope.task);\n\t\t\t};\n\t\t\tthis._$scope.removeCategory = function (category, model) {\n\t\t\t\t_$scope.task.categories = _$scope.task.cats;\n\t\t\t\t_tasksbusinesslayer.doUpdate(_$scope.task);\n\t\t\t};\n\t\t}\n\n\t\treturn DetailsController;\n\t}();\n\treturn new DetailsController($scope, $window, TasksModel, TasksBusinessLayer, $route, $location, $timeout, $routeParams, SettingsModel, Loading, ListsModel);\n}]);","'use strict';\n\nangular.module('Tasks').controller('ListController', ['$scope', '$rootScope', '$window', '$routeParams', 'ListsModel', 'TasksBusinessLayer', 'CollectionsModel', 'ListsBusinessLayer', '$location', 'SearchBusinessLayer', 'CalendarService', 'TasksModel', '$timeout', function ($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location, SearchBusinessLayer, CalendarService, TasksModel, $timeout) {\n\t'use strict';\n\n\tvar ListController;\n\tListController = function () {\n\t\tfunction ListController(_$scope, $rootScope, _$window, _$routeParams, _$listsmodel, _$tasksbusinesslayer, _$collectionsmodel, _$listsbusinesslayer, $location, _$searchbusinesslayer, _$calendarservice, _$tasksmodel, _$timeout) {\n\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$window = _$window;\n\t\t\tthis._$routeParams = _$routeParams;\n\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\tthis._$tasksbusinesslayer = _$tasksbusinesslayer;\n\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\tthis._$listsbusinesslayer = _$listsbusinesslayer;\n\t\t\tthis.$location = $location;\n\t\t\tthis._$timeout = _$timeout;\n\t\t\tthis._$searchbusinesslayer = _$searchbusinesslayer;\n\t\t\tthis._$calendarservice = _$calendarservice;\n\t\t\tthis._$scope.collections = this._$collectionsmodel.getAll();\n\t\t\tthis._$scope.calendars = this._$listsmodel.getAll();\n\t\t\tthis._$scope.draggedTasks = [];\n\t\t\tthis._$scope.TasksBusinessLayer = this._$tasksbusinesslayer;\n\t\t\tthis._$scope.nameError = false;\n\t\t\tthis._$scope.color = '#31CC7C';\n\n\t\t\tthis._$scope.deleteMessage = function (calendar) {\n\t\t\t\treturn t('tasks', 'This will delete the Calendar \"%s\" and all of its entries.').replace('%s', calendar.displayname);\n\t\t\t};\n\n\t\t\tthis._$scope[\"delete\"] = function (calendar) {\n\t\t\t\treturn _$listsbusinesslayer[\"delete\"](calendar).then(function () {\n\t\t\t\t\t$location.path('/calendars/' + _$listsmodel.getStandardList().uri);\n\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis._$scope.startCreate = function () {\n\t\t\t\t_$scope.status.addingList = true;\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\t_$timeout(function () {\n\t\t\t\t\t$('#newList').focus();\n\t\t\t\t}, 50);\n\t\t\t};\n\n\t\t\tthis._$scope.create = function () {\n\t\t\t\tvar check = _$scope.isNameAllowed(_$scope.status.newListName);\n\t\t\t\tif (check.allowed) {\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.isAddingList = true;\n\t\t\t\t\t_$listsbusinesslayer.add(_$scope.status.newListName, _$scope.color).then(function (calendar) {\n\t\t\t\t\t\t$location.path('/calendars/' + calendar.uri);\n\t\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t\t_$scope.status.newListName = '';\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.cancelCreate = function () {\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t};\n\n\t\t\tthis._$scope.startEdit = function (calendar) {\n\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\tcalendar.prepareUpdate();\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID + '/edit/name');\n\t\t\t\t_$timeout(function () {\n\t\t\t\t\t$('#list_' + calendar.uri + ' input.edit').focus();\n\t\t\t\t}, 50);\n\t\t\t};\n\n\t\t\tthis._$scope.showCalDAVUrl = function (calendar) {\n\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID + '/edit/caldav');\n\t\t\t\t_$timeout(function () {\n\t\t\t\t\t$('#list_' + calendar.uri + ' input.caldav').focus();\n\t\t\t\t}, 50);\n\t\t\t};\n\n\t\t\tthis._$scope.hideCalDAVUrl = function () {\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t};\n\n\t\t\tthis._$scope.download = function (calendar) {\n\t\t\t\tvar url = calendar.url;\n\t\t\t\t// cut off last slash to have a fancy name for the ics\n\t\t\t\tif (url.slice(url.length - 1) === '/') {\n\t\t\t\t\turl = url.slice(0, url.length - 1);\n\t\t\t\t}\n\t\t\t\turl += '?export';\n\t\t\t\t$window.open(url);\n\t\t\t};\n\n\t\t\tthis._$scope.checkNew = function (event, name) {\n\t\t\t\t_$scope.checkName(event, name);\n\t\t\t};\n\n\t\t\tthis._$scope.checkEdit = function (event, calendar) {\n\t\t\t\t_$scope.checkName(event, calendar.displayname, calendar.uri);\n\t\t\t\tif (event.keyCode === 27) {\n\t\t\t\t\t_$scope.cancelEdit(calendar);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.checkName = function (event, name, uri) {\n\t\t\t\tvar check = _$scope.isNameAllowed(name, uri);\n\t\t\t\tvar $input = $(event.currentTarget);\n\t\t\t\tif (!check.allowed) {\n\t\t\t\t\t$input.attr('title', check.msg).tooltip({ placement: 'bottom', trigger: 'manual' }).tooltip('fixTitle').tooltip('show');\n\t\t\t\t\t_$scope.nameError = true;\n\t\t\t\t} else {\n\t\t\t\t\t$input.tooltip('hide');\n\t\t\t\t\t_$scope.nameError = false;\n\t\t\t\t}\n\t\t\t\tif (event.keyCode === 27) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t$input.tooltip('hide');\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t\t\t_$scope.nameError = false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t$rootScope.$on('cancelEditCalendar', function (s, calendarUri) {\n\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarUri);\n\t\t\t\t_$scope.cancelEdit(calendar);\n\t\t\t});\n\n\t\t\tthis._$scope.cancelEdit = function (calendar) {\n\t\t\t\tcalendar.resetToPreviousState();\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t};\n\n\t\t\tthis._$scope.saveEdit = function (calendar) {\n\t\t\t\tvar check = _$scope.isNameAllowed(calendar.displayname, calendar.uri);\n\t\t\t\tif (check.allowed) {\n\t\t\t\t\t_$listsbusinesslayer.rename(calendar);\n\t\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.isNameAllowed = function (name, uri) {\n\t\t\t\tvar check = {\n\t\t\t\t\tallowed: false,\n\t\t\t\t\tmsg: ''\n\t\t\t\t};\n\t\t\t\tif (_$listsmodel.isNameAlreadyTaken(name, uri)) {\n\t\t\t\t\tcheck.msg = t('tasks', 'The name \"%s\" is already used.').replace('%s', name);\n\t\t\t\t} else if (!name) {\n\t\t\t\t\tcheck.msg = t('tasks', 'An empty name is not allowed.');\n\t\t\t\t} else {\n\t\t\t\t\tcheck.allowed = true;\n\t\t\t\t}\n\t\t\t\treturn check;\n\t\t\t};\n\n\t\t\tthis._$scope.getCollectionCount = function (collectionID) {\n\t\t\t\tvar filter;\n\t\t\t\tfilter = _$searchbusinesslayer.getFilter();\n\t\t\t\treturn _$collectionsmodel.getCount(collectionID, filter);\n\t\t\t};\n\n\t\t\tthis._$scope.hideCollection = function (collectionID) {\n\t\t\t\tvar collection;\n\t\t\t\tcollection = _$collectionsmodel.getById(collectionID);\n\t\t\t\tswitch (collection.show) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\treturn this.getCollectionCount(collectionID) < 1;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.getCollectionString = function (collectionID) {\n\t\t\t\tvar filter;\n\t\t\t\tif (collectionID !== 'completed') {\n\t\t\t\t\tfilter = _$searchbusinesslayer.getFilter();\n\t\t\t\t\treturn _$collectionsmodel.getCount(collectionID, filter);\n\t\t\t\t} else {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.getListCount = function (listID, type) {\n\t\t\t\tvar filter;\n\t\t\t\tfilter = _$searchbusinesslayer.getFilter();\n\t\t\t\treturn _$listsmodel.getCount(listID, type, filter);\n\t\t\t};\n\n\t\t\tthis._$scope.dragoverList = function ($event, index) {\n\t\t\t\tvar calendarID = $($event.target).closest('li.list').attr('calendarID');\n\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\treturn calendar.writable;\n\t\t\t};\n\n\t\t\tthis._$scope.dropList = function ($event, index, item) {\n\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\t// we can't simply use item as task, since the directive seems to not copy all properties --> task.calendar.uri == undefined\n\t\t\t\t\tvar task = _$tasksmodel.getByUri(item.uri);\n\t\t\t\t\tvar calendarID = $($event.target).closest('li.list').attr('calendarID');\n\t\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\t\t_$tasksbusinesslayer.changeCalendar(task, calendar).then(function () {\n\t\t\t\t\t\t_$scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tthis._$scope.dragoverCollection = function ($event, index) {\n\t\t\t\tif ($event.dataTransfer.effectAllowed === 'copy' || $event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tvar collectionID;\n\t\t\t\tcollectionID = $($event.target).closest('li.collection').attr('collectionID');\n\t\t\t\treturn collectionID === 'starred' || collectionID === 'completed' || collectionID === 'today';\n\t\t\t};\n\n\t\t\tthis._$scope.dropCollection = function ($event, index, item) {\n\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\tvar collectionID = $($event.target).closest('li.collection').attr('collectionID');\n\t\t\t\t\t_$tasksbusinesslayer.changeCollection(item.uri, collectionID);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\t\t}\n\t\treturn ListController;\n\t}();\n\treturn new ListController($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location, SearchBusinessLayer, CalendarService, TasksModel, $timeout);\n}]);","'use strict';\n\nangular.module('Tasks').controller('SettingsController', ['$scope', '$window', 'Status', '$location', 'CollectionsModel', 'SettingsBusinessLayer', 'SettingsModel', function ($scope, $window, Status, $location, CollectionsModel, SettingsBusinessLayer, SettingsModel) {\n\t'use strict';\n\n\tvar SettingsController;\n\tSettingsController = function () {\n\t\tfunction SettingsController(_$scope, _$window, _$status, _$location, _$collectionsmodel, _$settingsbusinesslayer, _$settingsmodel) {\n\t\t\tvar _this = this;\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$window = _$window;\n\t\t\tthis._$status = _$status;\n\t\t\tthis._$location = _$location;\n\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\tthis._$settingsbusinesslayer = _$settingsbusinesslayer;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._$scope.status = this._$status.getStatus();\n\t\t\tthis._$scope.collections = this._$collectionsmodel.getAll();\n\t\t\tthis._$scope.settingsmodel = this._$settingsmodel;\n\t\t\tthis._$scope.collectionOptions = [{\n\t\t\t\tid: 0,\n\t\t\t\tname: t('tasks', 'Hidden')\n\t\t\t}, {\n\t\t\t\tid: 1,\n\t\t\t\tname: t('tasks', 'Visible')\n\t\t\t}, {\n\t\t\t\tid: 2,\n\t\t\t\tname: t('tasks', 'Automatic')\n\t\t\t}];\n\t\t\tthis._$scope.startOfWeekOptions = [{\n\t\t\t\tid: 0,\n\t\t\t\tname: t('tasks', 'Sunday')\n\t\t\t}, {\n\t\t\t\tid: 1,\n\t\t\t\tname: t('tasks', 'Monday')\n\t\t\t}, {\n\t\t\t\tid: 2,\n\t\t\t\tname: t('tasks', 'Tuesday')\n\t\t\t}, {\n\t\t\t\tid: 3,\n\t\t\t\tname: t('tasks', 'Wednesday')\n\t\t\t}, {\n\t\t\t\tid: 4,\n\t\t\t\tname: t('tasks', 'Thursday')\n\t\t\t}, {\n\t\t\t\tid: 5,\n\t\t\t\tname: t('tasks', 'Friday')\n\t\t\t}, {\n\t\t\t\tid: 6,\n\t\t\t\tname: t('tasks', 'Saturday')\n\t\t\t}];\n\t\t\tthis._$scope.setVisibility = function (collectionID) {\n\t\t\t\tvar collection;\n\t\t\t\tcollection = _$collectionsmodel.getById(collectionID);\n\t\t\t\treturn _$settingsbusinesslayer.setVisibility(collectionID, collection.show);\n\t\t\t};\n\t\t\tthis._$scope.setStartOfWeek = function () {\n\t\t\t\treturn _$settingsbusinesslayer.set('various', 'startOfWeek', _$settingsmodel.getById('various').startOfWeek);\n\t\t\t};\n\t\t}\n\n\t\treturn SettingsController;\n\t}();\n\treturn new SettingsController($scope, $window, Status, $location, CollectionsModel, SettingsBusinessLayer, SettingsModel);\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').controller('TasksController', ['$scope', '$window', '$routeParams', 'TasksModel', 'ListsModel', 'CollectionsModel', 'TasksBusinessLayer', '$location', 'SettingsBusinessLayer', 'SearchBusinessLayer', 'VTodo', 'SettingsModel', function ($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer, SearchBusinessLayer, VTodo, SettingsModel) {\n\t\tvar TasksController;\n\t\tTasksController = function () {\n\t\t\tfunction TasksController(_$scope, _$window, _$routeParams, _$tasksmodel, _$listsmodel, _$collectionsmodel, _tasksbusinesslayer, $location, _settingsbusinesslayer, _searchbusinesslayer, vtodo, _$settingsmodel) {\n\t\t\t\tvar _this = this;\n\t\t\t\tthis._$scope = _$scope;\n\t\t\t\tthis._$window = _$window;\n\t\t\t\tthis._$routeParams = _$routeParams;\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\t\tthis._tasksbusinesslayer = _tasksbusinesslayer;\n\t\t\t\tthis.$location = $location;\n\t\t\t\tthis._settingsbusinesslayer = _settingsbusinesslayer;\n\t\t\t\tthis._searchbusinesslayer = _searchbusinesslayer;\n\t\t\t\tthis._vtodo = vtodo;\n\t\t\t\tthis._$scope.tasks = this._$tasksmodel.getAll();\n\t\t\t\tthis._$scope.draggedTasks = [];\n\t\t\t\tthis._$scope.calendars = this._$listsmodel.getAll();\n\t\t\t\tthis._$scope.days = [0, 1, 2, 3, 4, 5, 6];\n\t\t\t\tthis._$scope.isAddingTask = false;\n\t\t\t\tthis._$scope.focusInputField = false;\n\t\t\t\tthis._$scope.TasksModel = this._$tasksmodel;\n\t\t\t\tthis._$scope.TasksBusinessLayer = this._tasksbusinesslayer;\n\t\t\t\tthis._$settingsmodel = _$settingsmodel;\n\n\t\t\t\tthis._$scope.addTask = function (taskName, related, calendar, parent) {\n\t\t\t\t\tvar _ref,\n\t\t\t\t\t _this = this;\n\t\t\t\t\tif (calendar === null) {\n\t\t\t\t\t\tcalendar = '';\n\t\t\t\t\t}\n\t\t\t\t\t_$scope.isAddingTask = true;\n\t\t\t\t\tvar task = {\n\t\t\t\t\t\tcalendar: null,\n\t\t\t\t\t\trelated: related,\n\t\t\t\t\t\tsummary: taskName,\n\t\t\t\t\t\tpriority: '0',\n\t\t\t\t\t\tdue: false,\n\t\t\t\t\t\tstart: false,\n\t\t\t\t\t\treminder: null,\n\t\t\t\t\t\tcompleted: false,\n\t\t\t\t\t\tcomplete: '0',\n\t\t\t\t\t\tnote: ''\n\t\t\t\t\t};\n\t\t\t\t\tif ((_ref = _$scope.route.collectionID) === 'starred' || _ref === 'today' || _ref === 'week' || _ref === 'all' || _ref === 'completed' || _ref === 'current') {\n\t\t\t\t\t\tif (related) {\n\t\t\t\t\t\t\ttask.calendar = calendar;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttask.calendar = _$listsmodel.getStandardList();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_$scope.route.collectionID === 'starred') {\n\t\t\t\t\t\t\ttask.priority = '1';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_$scope.route.collectionID === 'today') {\n\t\t\t\t\t\t\ttask.due = moment().startOf('day').format(\"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_$scope.route.collectionID === 'current') {\n\t\t\t\t\t\t\ttask.start = moment().format(\"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttask.calendar = _$listsmodel.getByUri(_$scope.route.calendarID);\n\t\t\t\t\t}\n\t\t\t\t\ttask = VTodo.create(task);\n\t\t\t\t\t_tasksbusinesslayer.add(task).then(function (task) {\n\t\t\t\t\t\t_$scope.isAddingTask = false;\n\t\t\t\t\t\t_$scope.openDetails(task.uri, null);\n\t\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t_tasksbusinesslayer.setHideSubtasks(parent, 0);\n\t\t\t\t\t}\n\t\t\t\t\t_$scope.status.focusTaskInput = false;\n\t\t\t\t\t_$scope.status.focusSubtaskInput = false;\n\t\t\t\t\t_$scope.status.addSubtaskTo = null;\n\t\t\t\t\t_$scope.status.taskName = '';\n\t\t\t\t\t_$scope.status.subtaskName = '';\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getAddString = function () {\n\t\t\t\t\tvar calendar = _$listsmodel.getStandardList();\n\t\t\t\t\tif (angular.isDefined(calendar)) {\n\t\t\t\t\t\tif (angular.isDefined(_$scope.route.collectionID)) {\n\t\t\t\t\t\t\tswitch (_$scope.route.collectionID) {\n\t\t\t\t\t\t\t\tcase 'starred':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add an important item in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'today':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add an item due today in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'all':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add an item in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'current':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add a current item in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'completed':\n\t\t\t\t\t\t\t\tcase 'week':\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (angular.isDefined(_$listsmodel.getByUri(_$scope.route.calendarID))) {\n\t\t\t\t\t\t\t\treturn t('tasks', 'Add an item in \"%s\"...').replace('%s', _$listsmodel.getByUri(_$scope.route.calendarID).displayname);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSubAddString = function (taskname) {\n\t\t\t\t\treturn t('tasks', 'Add a subtask to \"%s\"...').replace('%s', taskname);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.showSubtaskInput = function (uid) {\n\t\t\t\t\t_$scope.status.addSubtaskTo = uid;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hideSubtasks = function (task) {\n\t\t\t\t\tvar taskID = _$scope.route.taskID;\n\t\t\t\t\tvar descendantIDs = _$tasksmodel.getDescendantIDs(task);\n\t\t\t\t\tif (task.uri === taskID) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if (__indexOf.call(descendantIDs, taskID) >= 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.hideSubtasks;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.showInput = function () {\n\t\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\t\tvar calendar = _$listsmodel.getByUri(_$scope.route.calendarID);\n\t\t\t\t\tif (collectionID === 'completed' || collectionID === 'week') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (angular.isDefined(calendar)) {\n\t\t\t\t\t\treturn calendar.writable;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.focusTaskInput = function () {\n\t\t\t\t\t_$scope.status.focusTaskInput = true;\n\t\t\t\t};\n\t\t\t\tthis._$scope.focusSubtaskInput = function () {\n\t\t\t\t\t_$scope.status.focusSubtaskInput = true;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.openDetails = function (id, $event) {\n\t\t\t\t\tvar calendarID = _$scope.route.calendarID;\n\t\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\t\tif ($event === null || $($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\tvar parent = _$tasksmodel.getByUri(id);\n\t\t\t\t\t\tif (!parent.loadedCompleted) {\n\t\t\t\t\t\t\t_tasksbusinesslayer.getAll(parent.calendar, true, parent).then(function () {\n\t\t\t\t\t\t\t\tparent.loadedCompleted = true;\n\t\t\t\t\t\t\t\t$scope.$apply();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (calendarID) {\n\t\t\t\t\t\t\t$location.path('/calendars/' + calendarID + '/tasks/' + id);\n\t\t\t\t\t\t} else if (collectionID) {\n\t\t\t\t\t\t\t$location.path('/collections/' + collectionID + '/tasks/' + id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleCompleted = function (task) {\n\t\t\t\t\tif (task.completed) {\n\t\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 100);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleStarred = function (task) {\n\t\t\t\t\tif (task.priority > 5) {\n\t\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 9);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleHidden = function () {\n\t\t\t\t\treturn _settingsbusinesslayer.toggle('various', 'showHidden');\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.filterTasks = function (task, filter) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\treturn _$tasksmodel.filterTasks(task, filter);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSubTasks = function (tasks, parent) {\n\t\t\t\t\tvar ret, task, _i, _len;\n\t\t\t\t\tret = [];\n\t\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\t\tif (task.related === parent.uid && task !== parent && !(parent.hideCompletedSubtasks && task.completed)) {\n\t\t\t\t\t\t\tret.push(task);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn ret;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hasNoParent = function (task) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\treturn _$tasksmodel.hasNoParent(task);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hasSubtasks = function (task) {\n\t\t\t\t\treturn _$tasksmodel.hasSubtasks(task.uid);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hasCompletedSubtasks = function (task) {\n\t\t\t\t\treturn _$tasksmodel.hasCompletedSubtasks(task.uid);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleSubtasks = function (task) {\n\t\t\t\t\t_tasksbusinesslayer.setHideSubtasks(task, !task.hideSubtasks);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleCompletedSubtasks = function (task) {\n\t\t\t\t\t_tasksbusinesslayer.setHideCompletedSubtasks(task, !task.hideCompletedSubtasks);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.filterTasksByString = function (task) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\tvar filter = _searchbusinesslayer.getFilter();\n\t\t\t\t\t\treturn _$tasksmodel.filterTasksByString(task, filter);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.filteredTasks = function () {\n\t\t\t\t\tvar filter;\n\t\t\t\t\tfilter = _searchbusinesslayer.getFilter();\n\t\t\t\t\treturn _$tasksmodel.filteredTasks(filter);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dayHasEntry = function () {\n\t\t\t\t\treturn function (date) {\n\t\t\t\t\t\tvar filter, task, tasks, _i, _len;\n\t\t\t\t\t\tfilter = _searchbusinesslayer.getFilter();\n\t\t\t\t\t\ttasks = _$tasksmodel.filteredTasks(filter);\n\t\t\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\t\t\tif (task.completed || !_$tasksmodel.hasNoParent(task)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (_$tasksmodel.taskAtDay(task, date)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tthis._$scope.taskAtDay = function (task, day) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\treturn _$tasksmodel.taskAtDay(task, day);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tthis._$scope.filterLists = function () {\n\t\t\t\t\treturn function (calendar) {\n\t\t\t\t\t\treturn _$scope.getCount(calendar.uri, _$scope.route.collectionID);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getCount = function (calendarID, type) {\n\t\t\t\t\tvar filter = _searchbusinesslayer.getFilter();\n\t\t\t\t\treturn _$listsmodel.getCount(calendarID, type, filter);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getCountString = function (calendarID, type) {\n\t\t\t\t\tvar filter = _searchbusinesslayer.getFilter();\n\t\t\t\t\treturn n('tasks', '%n Completed Task', '%n Completed Tasks', _$listsmodel.getCount(calendarID, type, filter));\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.checkTaskInput = function ($event) {\n\t\t\t\t\tif ($event.keyCode === 27) {\n\t\t\t\t\t\t$($event.currentTarget).blur();\n\t\t\t\t\t\t_$scope.status.taskName = '';\n\t\t\t\t\t\t_$scope.status.subtaskName = '';\n\t\t\t\t\t\t_$scope.status.addSubtaskTo = null;\n\t\t\t\t\t\t_$scope.status.focusTaskInput = false;\n\t\t\t\t\t\t_$scope.status.focusSubtaskInput = false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getCompletedTasks = function (calendarID) {\n\t\t\t\t\tvar calendar = _$listsmodel.getById(calendarID);\n\t\t\t\t\t_tasksbusinesslayer.getAll(calendar, true).then(function () {\n\t\t\t\t\t\t_$listsmodel.setLoadedCompleted(calendarID);\n\t\t\t\t\t\t$scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.loadedCompleted = function (calendarID) {\n\t\t\t\t\treturn _$listsmodel.loadedCompleted(calendarID);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.sortDue = function (task) {\n\t\t\t\t\tif (task.due === null) {\n\t\t\t\t\t\treturn 'last';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.due;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.sortStart = function (task) {\n\t\t\t\t\tif (task.start === null) {\n\t\t\t\t\t\treturn 'last';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.start;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSortOrder = function () {\n\t\t\t\t\tswitch (_$scope.settingsmodel.getById('various').sortOrder) {\n\t\t\t\t\t\tcase 'due':\n\t\t\t\t\t\t\treturn _$scope.sortDue;\n\t\t\t\t\t\tcase 'start':\n\t\t\t\t\t\t\treturn _$scope.sortStart;\n\t\t\t\t\t\tcase 'priority':\n\t\t\t\t\t\t\treturn '-priority';\n\t\t\t\t\t\tcase 'alphabetically':\n\t\t\t\t\t\t\treturn 'summary';\n\t\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t\treturn 'manual';\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn ['completed', _$scope.sortDue, '-priority', _$scope.sortStart, 'summary'];\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSortOrderIcon = function () {\n\t\t\t\t\tswitch (_$scope.settingsmodel.getById('various').sortOrder) {\n\t\t\t\t\t\tcase 'due':\n\t\t\t\t\t\tcase 'start':\n\t\t\t\t\t\t\treturn 'icon-calendar';\n\t\t\t\t\t\tcase 'priority':\n\t\t\t\t\t\t\treturn 'icon-star';\n\t\t\t\t\t\tcase 'alphabetically':\n\t\t\t\t\t\t\treturn 'icon-alphabetically';\n\t\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t\treturn 'icon-manual';\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn 'icon-menu';\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.setSortOrder = function ($event, order) {\n\t\t\t\t\t_$scope.settingsmodel.getById('various').sortDirection = _$scope.settingsmodel.getById('various').sortOrder === order ? +!_$scope.settingsmodel.getById('various').sortDirection : 0;\n\t\t\t\t\t_$scope.settingsmodel.getById('various').sortOrder = order;\n\t\t\t\t\t_settingsbusinesslayer.set('various', 'sortOrder', order);\n\t\t\t\t\t_settingsbusinesslayer.set('various', 'sortDirection', _$scope.settingsmodel.getById('various').sortDirection);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dropAsSubtask = function ($event, item, index) {\n\t\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\t\tvar parentID = $($event.target).closest('.task-item').attr('taskID');\n\t\t\t\t\t\tvar task = _$tasksmodel.getByUri(item.uri);\n\t\t\t\t\t\tvar parent = _$tasksmodel.getByUri(parentID);\n\t\t\t\t\t\t_tasksbusinesslayer.changeParent(task, parent);\n\t\t\t\t\t}\n\t\t\t\t\t$('.subtasks-container').removeClass('dropzone-visible');\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dropAsRootTask = function ($event, item, index) {\n\t\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\t\tvar task = _$tasksmodel.getByUri(item.uri);\n\t\t\t\t\t\tvar collectionID = $($event.target).closest('ol[dnd-list]').attr('collectionID');\n\t\t\t\t\t\tvar calendarID = $($event.target).closest('ol[dnd-list]').attr('calendarID');\n\t\t\t\t\t\tvar newCalendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\t\t\tvar queries = _tasksbusinesslayer.makeRootTask(task, newCalendar, collectionID);\n\t\t\t\t\t\tPromise.all(queries).then(function () {\n\t\t\t\t\t\t\t$scope.$apply();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t$('.subtasks-container').removeClass('dropzone-visible');\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dragover = function ($event, item, index) {\n\t\t\t\t\t$('.subtasks-container').removeClass('dropzone-visible');\n\t\t\t\t\tvar calendarID = $($event.target).closest('ol[dnd-list]').attr('calendarID');\n\t\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\t\tif (calendar.writable) {\n\t\t\t\t\t\t$($event.target).closest('.task-item').children('.subtasks-container').addClass('dropzone-visible');\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.allow = function (task) {\n\t\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\t\treturn \"copyMove\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn \"copy\";\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dragStart = function ($event) {\n\t\t\t\t\tif ($event.dataTransfer.effectAllowed === 'copy' || $event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey) {\n\t\t\t\t\t\t$($event.target).addClass('copy');\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dragEnd = function ($event) {\n\t\t\t\t\t$($event.target).removeClass('copy');\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn TasksController;\n\t\t}();\n\t\treturn new TasksController($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer, SearchBusinessLayer, VTodo, SettingsModel);\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').directive('appNavigationEntryUtils', function () {\n 'use strict';\n\n return {\n restrict: 'C',\n link: function link(scope, elm) {\n var button, menu;\n menu = elm.siblings('.app-navigation-entry-menu');\n button = $(elm).find('.app-navigation-entry-utils-menu-button button');\n button.click(function () {\n menu.toggleClass('open');\n });\n scope.$on('documentClicked', function (scope, event) {\n if (event.target !== button[0]) {\n menu.removeClass('open');\n }\n });\n }\n };\n});","'use strict';\n\nangular.module('Tasks').directive('autofocusOnInsert', function () {\n 'use strict';\n\n return function (scope, elm) {\n return elm.focus();\n };\n});","'use strict';\n\nangular.module('Tasks').directive('avatar', function () {\n 'use strict';\n\n return {\n restrict: 'A',\n scope: false,\n link: function link(scope, elm, attr) {\n return attr.$observe('userid', function () {\n if (attr.userid) {\n return elm.avatar(attr.userid, attr.size);\n }\n });\n }\n };\n});","'use strict';\n\nvar hslToRgb = function hslToRgb(hue, saturation, lightness) {\n\t'use strict';\n\t// based on algorithm from http://en.wikipedia.org/wiki/HSL_and_HSV#Converting_to_RGB\n\n\tif (Array.isArray(hue)) {\n\t\tsaturation = hue[1];\n\t\tlightness = hue[2];\n\t\thue = hue[0];\n\t}\n\tif (hue === undefined) {\n\t\treturn [0, 0, 0];\n\t}\n\tsaturation /= 100;\n\tlightness /= 100;\n\n\tvar chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;\n\tvar huePrime = hue / 60;\n\tvar secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n\n\thuePrime = Math.floor(huePrime);\n\tvar red;\n\tvar green;\n\tvar blue;\n\n\tif (huePrime === 0) {\n\t\tred = chroma;\n\t\tgreen = secondComponent;\n\t\tblue = 0;\n\t} else if (huePrime === 1) {\n\t\tred = secondComponent;\n\t\tgreen = chroma;\n\t\tblue = 0;\n\t} else if (huePrime === 2) {\n\t\tred = 0;\n\t\tgreen = chroma;\n\t\tblue = secondComponent;\n\t} else if (huePrime === 3) {\n\t\tred = 0;\n\t\tgreen = secondComponent;\n\t\tblue = chroma;\n\t} else if (huePrime === 4) {\n\t\tred = secondComponent;\n\t\tgreen = 0;\n\t\tblue = chroma;\n\t} else if (huePrime === 5) {\n\t\tred = chroma;\n\t\tgreen = 0;\n\t\tblue = secondComponent;\n\t}\n\n\tvar lightnessAdjustment = lightness - chroma / 2;\n\tred += lightnessAdjustment;\n\tgreen += lightnessAdjustment;\n\tblue += lightnessAdjustment;\n\n\treturn [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];\n};\n\nvar rgbToHex = function rgbToHex(r, g, b) {\n\t'use strict';\n\n\tif (Array.isArray(r)) {\n\t\tg = r[1];\n\t\tb = r[2];\n\t\tr = r[0];\n\t}\n\treturn '#' + parseInt(r, 10).toString(16) + parseInt(g, 10).toString(16) + parseInt(b, 10).toString(16);\n};\n\nvar listofcolours = ['#31CC7C', '#317CCC', '#FF7A66', '#F1DB50', '#7C31CC', '#CC317C', '#3A3B3D', '#CACBCD'];\n\nvar randColour = function randColour() {\n\t'use strict';\n\n\tif (typeof String.prototype.toHsl === 'function') {\n\t\treturn rgbToHex(hslToRgb(Math.random().toString().toHsl()));\n\t} else {\n\t\treturn listofcolours[Math.floor(Math.random() * listofcolours.length)];\n\t}\n};\n\nangular.module('Tasks').directive('colorpicker', function () {\n\t'use strict';\n\n\tif (typeof String.prototype.toHsl === 'function') {\n\t\tvar hsl = \"\";\n\t\tvar hslcolour = \"\";\n\t\t//\t\t 0 40 80 120 160 200 240 280 320\n\t\tlistofcolours = [\"15\", \"9\", \"4\", \"b\", \"6\", \"11\", \"74\", \"f\", \"57\"];\n\t\tlistofcolours.forEach(function (hash, index) {\n\t\t\thsl = hash.toHsl();\n\t\t\thslcolour = hslToRgb(hsl);\n\t\t\tlistofcolours[index] = rgbToHex(hslcolour);\n\t\t});\n\t}\n\treturn {\n\t\tscope: {\n\t\t\tselected: '=',\n\t\t\tcustomizedColors: '=colors'\n\t\t},\n\t\trestrict: 'AE',\n\t\ttemplateUrl: OC.filePath('tasks', 'templates', 'colorpicker.html'),\n\t\tlink: function link(scope, element, attr) {\n\t\t\tscope.colors = scope.customizedColors || listofcolours;\n\t\t\tscope.selected = scope.selected || scope.colors[0];\n\t\t\tscope.random = \"#000000\";\n\n\t\t\tscope.randomizeColour = function () {\n\t\t\t\tscope.random = randColour();\n\t\t\t\tscope.pick(scope.random);\n\t\t\t};\n\n\t\t\tscope.pick = function (color) {\n\t\t\t\tscope.selected = color;\n\t\t\t};\n\t\t}\n\t};\n});","'use strict';\n\nangular.module('Tasks').directive('confirmation', function () {\n\t'use strict';\n\n\treturn {\n\t\tpriority: -1,\n\t\trestrict: 'A',\n\t\ttemplateUrl: OC.generateUrl('/apps/tasks/templates/confirmation', {}),\n\t\tscope: {\n\t\t\tconfirmationFunction: \"&confirmation\",\n\t\t\tconfirmationMessage: \"&confirmationMessage\"\n\n\t\t},\n\t\tcontroller: 'ConfirmationController'\n\t};\n});\n\nangular.module('Tasks').controller('ConfirmationController', ['$scope', '$rootScope', '$element', '$attrs', '$compile', '$document', '$window', '$timeout', function ($scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout) {\n\t'use strict';\n\n\tvar ConfirmationController = function () {\n\t\tfunction ConfirmationController(_$scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout) {\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$scope.countdown = 3;\n\n\t\t\t$element.bind('click', function (e) {\n\t\t\t\t_$scope.countdown = 3;\n\t\t\t\t$element.removeClass('active');\n\t\t\t\tvar message = _$scope.confirmationMessage() ? _$scope.confirmationMessage() : \"Are you sure?\";\n\t\t\t\tif ($element.hasClass('confirmed')) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\te.stopPropagation();\n\t\t\t\t_$scope.activate();\n\t\t\t\t$element.children('.confirmation-confirm').tooltip({ title: message, container: 'body', placement: 'right' });\n\t\t\t\t$element.addClass(\"confirmed\");\n\t\t\t});\n\n\t\t\t$element.children('.confirmation-confirm').bind('click', function (e) {\n\t\t\t\tif ($element.hasClass('confirmed active')) {\n\t\t\t\t\t_$scope.confirmationFunction();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._$scope.documentClick = function () {\n\t\t\t\t$element.removeClass(\"confirmed\");\n\t\t\t};\n\n\t\t\tthis._$scope.activate = function () {\n\t\t\t\tif (_$scope.countdown) {\n\t\t\t\t\t$element.find('.countdown').html(_$scope.countdown + ' s');\n\t\t\t\t\t$timeout(function () {\n\t\t\t\t\t\t_$scope.activate();\n\t\t\t\t\t}, 1000);\n\t\t\t\t\t_$scope.countdown--;\n\t\t\t\t} else {\n\t\t\t\t\t$element.addClass('active');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t$document.bind('click', _$scope.documentClick);\n\t\t\t$document.bind('touchend', _$scope.documentClick);\n\n\t\t\t$scope.$on('$destroy', function () {\n\t\t\t\t$document.unbind('click', _$scope.documentClick);\n\t\t\t\t$document.unbind('touchend', _$scope.documentClick);\n\t\t\t});\n\t\t}\n\t\treturn ConfirmationController;\n\t}();\n\treturn new ConfirmationController($scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout);\n}]);","'use strict';\n\nangular.module('Tasks').directive('datepicker', function () {\n\t'use strict';\n\n\treturn {\n\t\trestrict: 'A',\n\t\tscope: false,\n\t\tlink: function link(scope, elm, attr) {\n\t\t\treturn elm.datepicker({\n\t\t\t\tonSelect: function onSelect(date, inst) {\n\t\t\t\t\tscope['set' + attr.datepicker + 'day'](date);\n\t\t\t\t\treturn scope.$apply();\n\t\t\t\t},\n\t\t\t\tbeforeShow: function beforeShow(input, inst) {\n\t\t\t\t\tvar dp, marginLeft;\n\t\t\t\t\tdp = $(inst).datepicker('widget');\n\t\t\t\t\tmarginLeft = -Math.abs($(input).outerWidth() - dp.outerWidth()) / 2 + 'px';\n\t\t\t\t\tdp.css({\n\t\t\t\t\t\t'margin-left': marginLeft\n\t\t\t\t\t});\n\t\t\t\t\t$(\"div.ui-datepicker:before\").css({\n\t\t\t\t\t\t'left': 100 + 'px'\n\t\t\t\t\t});\n\t\t\t\t\treturn $('.hasDatepicker').datepicker(\"option\", \"firstDay\", scope.settingsmodel.getById('various').startOfWeek);\n\t\t\t\t},\n\t\t\t\tbeforeShowDay: function beforeShowDay(date) {\n\t\t\t\t\tif (moment(date).startOf('day').diff(moment(scope.task[attr.datepicker], \"YYYYMMDDTHHmmss\").startOf('day'), 'days') === 0) {\n\t\t\t\t\t\treturn [1, \"selected\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn [1, \"\"];\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tminDate: null\n\t\t\t});\n\t\t}\n\t};\n});","'use strict';\n\nangular.module('Tasks').directive('ocClickFocus', ['$timeout', function ($timeout) {\n 'use strict';\n\n return function (scope, elm, attr) {\n var options;\n options = scope.$eval(attr.ocClickFocus);\n if (angular.isDefined(options) && angular.isDefined(options.selector)) {\n return elm.click(function () {\n if (angular.isDefined(options.timeout)) {\n return $timeout(function () {\n return $(options.selector).focus();\n }, options.timeout);\n } else {\n return $(options.selector).focus();\n }\n });\n }\n };\n}]);","'use strict';\n\nangular.module('Tasks').directive('timepicker', function () {\n 'use strict';\n\n return {\n restrict: 'A',\n link: function link(scope, elm, attr) {\n return elm.timepicker({\n onSelect: function onSelect(date, inst) {\n scope['set' + attr.timepicker + 'time'](date);\n return scope.$apply();\n },\n myPosition: 'center top',\n atPosition: 'center bottom',\n hourText: t('tasks', 'Hours'),\n minuteText: t('tasks', 'Minutes')\n });\n }\n };\n});","'use strict';\n\nangular.module('Tasks').directive('watchTop', function () {\n 'use strict';\n\n return {\n restrict: 'A',\n link: function link(scope, element, attr) {\n return scope.$watch(function () {\n scope.divTop = element.prev().outerHeight(true);\n });\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('counterFormatter', function () {\n 'use strict';\n\n return function (count) {\n switch (false) {\n case count !== 0:\n return '';\n case count < 999:\n return '999+';\n default:\n return count;\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateDetails', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale(due.isDate ? 'details_allday' : 'details').calendar();\n } else {\n return t('tasks', 'Set due date');\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateDetailsShort', function () {\n 'use strict';\n\n return function (reminder) {\n if (moment(reminder, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(reminder, \"YYYYMMDDTHHmmss\").locale('details_short').calendar();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateFromNow', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").fromNow();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateTaskList', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale('tasks').calendar();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('day', function () {\n 'use strict';\n\n return function (i) {\n return moment().add('days', i).locale('list_week').calendar();\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dayTaskList', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale('tasks').calendar();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('percentDetails', function () {\n 'use strict';\n\n return function (percent) {\n return t('tasks', '%s %% completed').replace('%s', percent).replace('%%', '%');\n };\n});","'use strict';\n\nangular.module('Tasks').filter('priorityDetails', function () {\n 'use strict';\n\n return function (priority) {\n var string;\n string = t('tasks', 'priority %s: ').replace('%s', priority);\n if (+priority === 6 || +priority === 7 || +priority === 8 || +priority === 9) {\n return string + ' ' + t('tasks', 'high');\n } else if (+priority === 5) {\n return string + ' ' + t('tasks', 'medium');\n } else if (+priority === 1 || +priority === 2 || +priority === 3 || +priority === 4) {\n return string + ' ' + t('tasks', 'low');\n } else {\n return t('tasks', 'no priority assigned');\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('reminderDetails', function () {\n\t'use strict';\n\n\treturn function (reminder, scope) {\n\t\tfunction before(related) {\n\t\t\tif (related === 'END') {\n\t\t\t\treturn ' ' + t('tasks', 'before end');\n\t\t\t} else {\n\t\t\t\treturn ' ' + t('tasks', 'before beginning');\n\t\t\t}\n\t\t}\n\t\tfunction after(related) {\n\t\t\tif (related === 'END') {\n\t\t\t\treturn ' ' + t('tasks', 'after end');\n\t\t\t} else {\n\t\t\t\treturn ' ' + t('tasks', 'after beginning');\n\t\t\t}\n\t\t}\n\t\tfunction tokenName(reminder, token) {\n\t\t\tif (+reminder.duration[token.id] === 1) {\n\t\t\t\treturn token.name;\n\t\t\t} else {\n\t\t\t\treturn token.names;\n\t\t\t}\n\t\t}\n\t\tvar ds, time, token, _ref;\n\t\tif (!(angular.isUndefined(reminder) || reminder === null)) {\n\t\t\tif (reminder.type === 'DATE-TIME' && moment(reminder.date, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\treturn moment(reminder.date, \"YYYYMMDDTHHmmss\").locale('reminder').calendar();\n\t\t\t} else if (reminder.type === 'DURATION' && reminder.duration) {\n\t\t\t\tds = t('tasks', 'Remind me');\n\t\t\t\t_ref = scope.durations;\n\t\t\t\tfor (var _i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t\t\t\ttoken = _ref[_i];\n\t\t\t\t\tif (+reminder.duration[token.id]) {\n\t\t\t\t\t\ttime = 1;\n\t\t\t\t\t\tds += ' ' + reminder.duration[token.id] + ' ';\n\t\t\t\t\t\tds += tokenName(reminder, token);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!time) {\n\t\t\t\t\tif (reminder.duration.params.related === 'END') {\n\t\t\t\t\t\tds += ' ' + t('tasks', 'at the end');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tds += ' ' + t('tasks', 'at the beginning');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (reminder.duration.params.invert) {\n\t\t\t\t\t\tds += before(reminder.duration.params.related);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tds += after(reminder.duration.params.related);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ds;\n\t\t\t} else {\n\t\t\t\treturn t('tasks', 'Remind me');\n\t\t\t}\n\t\t} else {\n\t\t\treturn t('tasks', 'Remind me');\n\t\t}\n\t};\n});","'use strict';\n\nangular.module('Tasks').filter('startDetails', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale(due.isDate ? 'start_allday' : 'start').calendar();\n } else {\n return t('tasks', 'Set start date');\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('timeTaskList', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").format('HH:mm');\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').service('CalendarService', ['DavClient', 'Calendar', function (DavClient, Calendar) {\n\t'use strict';\n\n\tvar _this = this;\n\n\tthis._CALENDAR_HOME = null;\n\n\tthis._currentUserPrincipal = null;\n\n\tthis._takenUrls = [];\n\n\tthis._PROPERTIES = ['{' + DavClient.NS_DAV + '}displayname', '{' + DavClient.NS_IETF + '}calendar-description', '{' + DavClient.NS_IETF + '}calendar-timezone', '{' + DavClient.NS_APPLE + '}calendar-order', '{' + DavClient.NS_APPLE + '}calendar-color', '{' + DavClient.NS_IETF + '}supported-calendar-component-set', '{' + DavClient.NS_OWNCLOUD + '}calendar-enabled', '{' + DavClient.NS_DAV + '}acl', '{' + DavClient.NS_DAV + '}owner', '{' + DavClient.NS_OWNCLOUD + '}invite'];\n\n\tfunction discoverHome(callback) {\n\t\treturn DavClient.propFind(DavClient.buildUrl(OC.linkToRemoteBase('dav')), ['{' + DavClient.NS_DAV + '}current-user-principal'], 0, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\tthrow \"CalDAV client could not be initialized - Querying current-user-principal failed\";\n\t\t\t}\n\n\t\t\tif (response.body.propStat.length < 1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar props = response.body.propStat[0].properties;\n\t\t\t_this._currentUserPrincipal = props['{' + DavClient.NS_DAV + '}current-user-principal'][0].textContent;\n\n\t\t\treturn DavClient.propFind(DavClient.buildUrl(_this._currentUserPrincipal), ['{' + DavClient.NS_IETF + '}calendar-home-set'], 0, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\t\tthrow \"CalDAV client could not be initialized - Querying calendar-home-set failed\";\n\t\t\t\t}\n\n\t\t\t\tif (response.body.propStat.length < 1) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar props = response.body.propStat[0].properties;\n\t\t\t\t_this._CALENDAR_HOME = props['{' + DavClient.NS_IETF + '}calendar-home-set'][0].textContent;\n\n\t\t\t\treturn callback();\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction getResponseCodeFromHTTPResponse(t) {\n\t\treturn parseInt(t.split(' ')[1]);\n\t}\n\n\tthis.getAll = function () {\n\t\tif (this._CALENDAR_HOME === null) {\n\t\t\treturn discoverHome(function () {\n\t\t\t\treturn _this.getAll();\n\t\t\t});\n\t\t}\n\n\t\tvar prom = DavClient.propFind(DavClient.buildUrl(this._CALENDAR_HOME), this._PROPERTIES, 1, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\tvar calendars = [];\n\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\tthrow \"CalDAV client could not be initialized - Querying calendars failed\";\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < response.body.length; i++) {\n\t\t\t\tvar body = response.body[i];\n\t\t\t\tif (body.propStat.length < 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t_this._takenUrls.push(body.href);\n\n\t\t\t\tvar responseCode = getResponseCodeFromHTTPResponse(body.propStat[0].status);\n\t\t\t\tif (!DavClient.wasRequestSuccessful(responseCode)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar doesSupportVTodo = false;\n\t\t\t\tvar components = body.propStat[0].properties['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set'];\n\t\t\t\tif (components) {\n\t\t\t\t\tfor (var j = 0; j < components.length; j++) {\n\t\t\t\t\t\tvar name = components[j].attributes.getNamedItem('name').textContent.toLowerCase();\n\t\t\t\t\t\tif (name === 'vtodo') {\n\t\t\t\t\t\t\tdoesSupportVTodo = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!doesSupportVTodo) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t_this._getACLFromResponse(body);\n\n\t\t\t\tvar uri = body.href.substr(_this._CALENDAR_HOME.length).replace(/[^\\w\\-]+/g, '');\n\n\t\t\t\tvar calendar = new Calendar(body.href, body.propStat[0].properties, uri);\n\t\t\t\tcalendars.push(calendar);\n\t\t\t}\n\n\t\t\treturn calendars;\n\t\t});\n\t\treturn prom;\n\t};\n\n\tthis.get = function (url) {\n\t\tif (this._CALENDAR_HOME === null) {\n\t\t\treturn discoverHome(function () {\n\t\t\t\treturn _this.get(url);\n\t\t\t});\n\t\t}\n\n\t\treturn DavClient.propFind(DavClient.buildUrl(url), this._PROPERTIES, 0, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\tvar body = response.body;\n\t\t\tif (body.propStat.length < 1) {\n\t\t\t\t//TODO - something went wrong\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar responseCode = getResponseCodeFromHTTPResponse(body.propStat[0].status);\n\t\t\tif (!DavClient.wasRequestSuccessful(responseCode)) {\n\t\t\t\t//TODO - something went wrong\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_this._getACLFromResponse(body);\n\n\t\t\tvar uri = body.href.substr(_this._CALENDAR_HOME.length).replace(/[^\\w\\-]+/g, '');\n\n\t\t\treturn new Calendar(body.href, body.propStat[0].properties, uri);\n\t\t});\n\t};\n\n\tthis.create = function (name, color, components) {\n\t\tif (this._CALENDAR_HOME === null) {\n\t\t\treturn discoverHome(function () {\n\t\t\t\treturn _this.create(name, color);\n\t\t\t});\n\t\t}\n\n\t\tif (typeof components === 'undefined') {\n\t\t\tcomponents = ['vtodo'];\n\t\t}\n\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar cMkcalendar = xmlDoc.createElement('c:mkcalendar');\n\t\tcMkcalendar.setAttribute('xmlns:c', 'urn:ietf:params:xml:ns:caldav');\n\t\tcMkcalendar.setAttribute('xmlns:d', 'DAV:');\n\t\tcMkcalendar.setAttribute('xmlns:a', 'http://apple.com/ns/ical/');\n\t\tcMkcalendar.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(cMkcalendar);\n\n\t\tvar dSet = xmlDoc.createElement('d:set');\n\t\tcMkcalendar.appendChild(dSet);\n\n\t\tvar dProp = xmlDoc.createElement('d:prop');\n\t\tdSet.appendChild(dProp);\n\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'displayname', name));\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'enabled', true));\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'color', color));\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'components', components));\n\n\t\tvar body = cMkcalendar.outerHTML;\n\n\t\tvar uri = this._suggestUri(name);\n\t\tvar url = this._CALENDAR_HOME + uri + '/';\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\n\t\treturn DavClient.request('MKCALENDAR', url, headers, body).then(function (response) {\n\t\t\tif (response.status === 201) {\n\t\t\t\t_this._takenUrls.push(url);\n\t\t\t\treturn _this.get(url).then(function (calendar) {\n\t\t\t\t\tcalendar.enabled = true;\n\t\t\t\t\treturn _this.update(calendar);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n\n\tthis.update = function (calendar) {\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar dPropUpdate = xmlDoc.createElement('d:propertyupdate');\n\t\tdPropUpdate.setAttribute('xmlns:c', 'urn:ietf:params:xml:ns:caldav');\n\t\tdPropUpdate.setAttribute('xmlns:d', 'DAV:');\n\t\tdPropUpdate.setAttribute('xmlns:a', 'http://apple.com/ns/ical/');\n\t\tdPropUpdate.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(dPropUpdate);\n\n\t\tvar dSet = xmlDoc.createElement('d:set');\n\t\tdPropUpdate.appendChild(dSet);\n\n\t\tvar dProp = xmlDoc.createElement('d:prop');\n\t\tdSet.appendChild(dProp);\n\n\t\tvar updatedProperties = calendar.updatedProperties;\n\t\tcalendar.resetUpdatedProperties();\n\t\tfor (var i = 0; i < updatedProperties.length; i++) {\n\t\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, updatedProperties[i], calendar[updatedProperties[i]]));\n\t\t}\n\n\t\tvar url = calendar.url;\n\t\tvar body = dPropUpdate.outerHTML;\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\n\t\treturn DavClient.request('PROPPATCH', url, headers, body).then(function (response) {\n\t\t\treturn calendar;\n\t\t});\n\t};\n\n\tthis.delete = function (calendar) {\n\t\treturn DavClient.request('DELETE', calendar.url, { 'requesttoken': OC.requestToken }, '').then(function (response) {\n\t\t\tif (response.status === 204) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// TODO - handle error case\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t};\n\n\tthis.share = function (calendar, shareType, shareWith, writable, existingShare) {\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar oShare = xmlDoc.createElement('o:share');\n\t\toShare.setAttribute('xmlns:d', 'DAV:');\n\t\toShare.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(oShare);\n\n\t\tvar oSet = xmlDoc.createElement('o:set');\n\t\toShare.appendChild(oSet);\n\n\t\tvar dHref = xmlDoc.createElement('d:href');\n\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\tdHref.textContent = 'principal:principals/users/';\n\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\tdHref.textContent = 'principal:principals/groups/';\n\t\t}\n\t\tdHref.textContent += shareWith;\n\t\toSet.appendChild(dHref);\n\n\t\tvar oSummary = xmlDoc.createElement('o:summary');\n\t\toSummary.textContent = t('calendar', '{calendar} shared by {owner}', {\n\t\t\tcalendar: calendar.displayname,\n\t\t\towner: calendar.owner\n\t\t});\n\t\toSet.appendChild(oSummary);\n\n\t\tif (writable) {\n\t\t\tvar oRW = xmlDoc.createElement('o:read-write');\n\t\t\toSet.appendChild(oRW);\n\t\t}\n\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\trequesttoken: oc_requesttoken\n\t\t};\n\t\tvar body = oShare.outerHTML;\n\t\treturn DavClient.request('POST', calendar.url, headers, body).then(function (response) {\n\t\t\tif (response.status === 200) {\n\t\t\t\tif (!existingShare) {\n\t\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\t\tcalendar.sharedWith.users.push({\n\t\t\t\t\t\t\tid: shareWith,\n\t\t\t\t\t\t\tdisplayname: shareWith,\n\t\t\t\t\t\t\twritable: writable\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\t\tcalendar.sharedWith.groups.push({\n\t\t\t\t\t\t\tid: shareWith,\n\t\t\t\t\t\t\tdisplayname: shareWith,\n\t\t\t\t\t\t\twritable: writable\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tthis.unshare = function (calendar, shareType, shareWith) {\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar oShare = xmlDoc.createElement('o:share');\n\t\toShare.setAttribute('xmlns:d', 'DAV:');\n\t\toShare.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(oShare);\n\n\t\tvar oRemove = xmlDoc.createElement('o:remove');\n\t\toShare.appendChild(oRemove);\n\n\t\tvar dHref = xmlDoc.createElement('d:href');\n\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\tdHref.textContent = 'principal:principals/users/';\n\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\tdHref.textContent = 'principal:principals/groups/';\n\t\t}\n\t\tdHref.textContent += shareWith;\n\t\toRemove.appendChild(dHref);\n\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\trequesttoken: oc_requesttoken\n\t\t};\n\t\tvar body = oShare.outerHTML;\n\t\treturn DavClient.request('POST', calendar.url, headers, body).then(function (response) {\n\t\t\tif (response.status === 200) {\n\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\tcalendar.sharedWith.users = calendar.sharedWith.users.filter(function (user) {\n\t\t\t\t\t\treturn user.id !== shareWith;\n\t\t\t\t\t});\n\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\tcalendar.sharedWith.groups = calendar.sharedWith.groups.filter(function (groups) {\n\t\t\t\t\t\treturn groups.id !== shareWith;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t//todo - remove entry from calendar object\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t};\n\n\tthis._createXMLForProperty = function (xmlDoc, propName, value) {\n\t\tswitch (propName) {\n\t\t\tcase 'enabled':\n\t\t\t\tvar oEnabled = xmlDoc.createElement('o:calendar-enabled');\n\t\t\t\toEnabled.textContent = value ? '1' : '0';\n\t\t\t\treturn oEnabled;\n\n\t\t\tcase 'displayname':\n\t\t\t\tvar dDisplayname = xmlDoc.createElement('d:displayname');\n\t\t\t\tdDisplayname.textContent = value;\n\t\t\t\treturn dDisplayname;\n\n\t\t\tcase 'order':\n\t\t\t\tvar aOrder = xmlDoc.createElement('a:calendar-color');\n\t\t\t\taOrder.textContent = value;\n\t\t\t\treturn aOrder;\n\n\t\t\tcase 'color':\n\t\t\t\tvar aColor = xmlDoc.createElement('a:calendar-color');\n\t\t\t\taColor.textContent = value;\n\t\t\t\treturn aColor;\n\n\t\t\tcase 'components':\n\t\t\t\tvar cComponents = xmlDoc.createElement('c:supported-calendar-component-set');\n\t\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\t\tvar cComp = xmlDoc.createElement('c:comp');\n\t\t\t\t\tcComp.setAttribute('name', value[i].toUpperCase());\n\t\t\t\t\tcComponents.appendChild(cComp);\n\t\t\t\t}\n\t\t\t\treturn cComponents;\n\t\t}\n\t};\n\n\tthis._getACLFromResponse = function (body) {\n\t\tvar canWrite = false;\n\t\tvar acl = body.propStat[0].properties['{' + DavClient.NS_DAV + '}acl'];\n\t\tif (acl) {\n\t\t\tfor (var k = 0; k < acl.length; k++) {\n\t\t\t\tvar href = acl[k].getElementsByTagNameNS('DAV:', 'href');\n\t\t\t\tif (href.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thref = href[0].textContent;\n\t\t\t\tif (href !== _this._currentUserPrincipal) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar writeNode = acl[k].getElementsByTagNameNS('DAV:', 'write');\n\t\t\t\tif (writeNode.length > 0) {\n\t\t\t\t\tcanWrite = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbody.propStat[0].properties.canWrite = canWrite;\n\t};\n\n\tthis._isUriAlreadyTaken = function (uri) {\n\t\treturn this._takenUrls.indexOf(this._CALENDAR_HOME + uri + '/') !== -1;\n\t};\n\n\tthis._suggestUri = function (displayname) {\n\t\tvar uri = displayname.toString().toLowerCase().replace(/\\s+/g, '-') // Replace spaces with -\n\t\t.replace(/[^\\w\\-]+/g, '') // Remove all non-word chars\n\t\t.replace(/\\-\\-+/g, '-') // Replace multiple - with single -\n\t\t.replace(/^-+/, '') // Trim - from start of text\n\t\t.replace(/-+$/, ''); // Trim - from end of text\n\n\t\tif (!this._isUriAlreadyTaken(uri)) {\n\t\t\treturn uri;\n\t\t}\n\n\t\tif (uri.indexOf('-') === -1) {\n\t\t\turi = uri + '-1';\n\t\t\tif (!this._isUriAlreadyTaken(uri)) {\n\t\t\t\treturn uri;\n\t\t\t}\n\t\t}\n\n\t\twhile (this._isUriAlreadyTaken(uri)) {\n\t\t\tvar positionLastDash = uri.lastIndexOf('-');\n\t\t\tvar firstPart = uri.substr(0, positionLastDash);\n\t\t\tvar lastPart = uri.substr(positionLastDash + 1);\n\n\t\t\tif (lastPart.match(/^\\d+$/)) {\n\t\t\t\tlastPart = parseInt(lastPart);\n\t\t\t\tlastPart++;\n\n\t\t\t\turi = firstPart + '-' + lastPart;\n\t\t\t} else if (lastPart === '') {\n\t\t\t\turi = uri + '1';\n\t\t\t} else {\n\t\t\t\turi = uri = '-1';\n\t\t\t}\n\t\t}\n\n\t\treturn uri;\n\t};\n}]);","'use strict';\n\nangular.module('Tasks').service('DavClient', [function () {\n\t'use strict';\n\n\tvar client;\n\tclient = new dav.Client({\n\t\tbaseUrl: OC.linkToRemote('dav/calendars'),\n\t\txmlNamespaces: {\n\t\t\t'DAV:': 'd',\n\t\t\t'urn:ietf:params:xml:ns:caldav': 'c',\n\t\t\t'http://apple.com/ns/ical/': 'aapl',\n\t\t\t'http://owncloud.org/ns': 'oc',\n\t\t\t'http://nextcloud.com/ns': 'nc',\n\t\t\t'http://calendarserver.org/ns/': 'cs'\n\t\t}\n\t});\n\tangular.extend(client, {\n\t\tNS_DAV: 'DAV:',\n\t\tNS_IETF: 'urn:ietf:params:xml:ns:caldav',\n\t\tNS_APPLE: 'http://apple.com/ns/ical/',\n\t\tNS_OWNCLOUD: 'http://owncloud.org/ns',\n\t\tNS_NEXTCLOUD: 'http://nextcloud.com/ns',\n\t\tNS_CALENDARSERVER: 'http://calendarserver.org/ns/',\n\t\tbuildUrl: function buildUrl(path) {\n\t\t\treturn window.location.protocol + '//' + window.location.host + path;\n\t\t},\n\t\twasRequestSuccessful: function wasRequestSuccessful(status) {\n\t\t\treturn status >= 200 && status <= 299;\n\t\t}\n\t});\n\treturn client;\n}]);","'use strict';\n\nangular.module('Tasks').service('ICalFactory', [function () {\n 'use strict';\n\n // creates a new ICAL root element with a product id property\n\n return {\n new: function _new() {\n var root = new ICAL.Component(['vcalendar', [], []]);\n\n var version = angular.element('#app').attr('data-appVersion');\n root.updatePropertyWithValue('prodid', '-//Nextcloud Tasks v' + version);\n\n return root;\n }\n };\n}]);","'use strict';\n\nangular.module('Tasks').factory('Loading', [function () {\n\t'use strict';\n\n\tvar Loading = function () {\n\t\tfunction Loading() {\n\t\t\tthis.count = 0;\n\t\t}\n\n\t\tLoading.prototype.increase = function () {\n\t\t\treturn this.count += 1;\n\t\t};\n\n\t\tLoading.prototype.decrease = function () {\n\t\t\treturn this.count -= 1;\n\t\t};\n\n\t\tLoading.prototype.getCount = function () {\n\t\t\treturn this.count;\n\t\t};\n\n\t\tLoading.prototype.isLoading = function () {\n\t\t\treturn this.count > 0;\n\t\t};\n\n\t\treturn Loading;\n\t}();\n\treturn new Loading();\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tangular.module('Tasks').factory('_Model', [function () {\n\t\tvar Model;\n\t\tModel = function () {\n\t\t\tfunction Model() {\n\t\t\t\tthis._data = [];\n\t\t\t\tthis._dataMap = {};\n\t\t\t\tthis._filterCache = {};\n\t\t\t}\n\n\t\t\tModel.prototype.handle = function (data) {\n\t\t\t\tvar item, _i, _len, _results;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = data.length; _i < _len; _i++) {\n\t\t\t\t\titem = data[_i];\n\t\t\t\t\t_results.push(this.add(item));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tModel.prototype.add = function (data, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tif (clearCache) {\n\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t}\n\t\t\t\tif (angular.isDefined(this._dataMap[data.id])) {\n\t\t\t\t\treturn this.update(data, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\tthis._data.push(data);\n\t\t\t\t\tthis._dataMap[data.id] = data;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tModel.prototype.update = function (data, clearCache) {\n\t\t\t\tvar entry, key, value, _results;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tif (clearCache) {\n\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t}\n\t\t\t\tentry = this.getById(data.id);\n\t\t\t\t_results = [];\n\t\t\t\tfor (key in data) {\n\t\t\t\t\tvalue = data[key];\n\t\t\t\t\tif (key === 'id') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_results.push(entry[key] = value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tModel.prototype.getById = function (id) {\n\t\t\t\treturn this._dataMap[id];\n\t\t\t};\n\n\t\t\tModel.prototype.getAll = function () {\n\t\t\t\treturn this._data;\n\t\t\t};\n\n\t\t\tModel.prototype.removeById = function (id, clearCache) {\n\t\t\t\tvar counter, data, entry, _i, _len, _ref;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\t_ref = this._data;\n\t\t\t\tfor (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) {\n\t\t\t\t\tentry = _ref[counter];\n\t\t\t\t\tif (entry.id === id) {\n\t\t\t\t\t\tthis._data.splice(counter, 1);\n\t\t\t\t\t\tdata = this._dataMap[id];\n\t\t\t\t\t\tdelete this._dataMap[id];\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tModel.prototype.clear = function () {\n\t\t\t\tthis._data.length = 0;\n\t\t\t\tthis._dataMap = {};\n\t\t\t\treturn this._invalidateCache();\n\t\t\t};\n\n\t\t\tModel.prototype._invalidateCache = function () {\n\t\t\t\tthis._filterCache = {};\n\t\t\t};\n\n\t\t\tModel.prototype.get = function (query) {\n\t\t\t\tvar hash;\n\t\t\t\thash = query.hashCode();\n\t\t\t\tif (!angular.isDefined(this._filterCache[hash])) {\n\t\t\t\t\tthis._filterCache[hash] = query.exec(this._data);\n\t\t\t\t}\n\t\t\t\treturn this._filterCache[hash];\n\t\t\t};\n\n\t\t\tModel.prototype.size = function () {\n\t\t\t\treturn this._data.length;\n\t\t\t};\n\n\t\t\treturn Model;\n\t\t}();\n\t\treturn Model;\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').factory('Persistence', ['Request', 'Loading', '$rootScope', '$q', 'CalendarService', function (Request, Loading, $rootScope, $q, CalendarService) {\n\t'use strict';\n\n\tvar Persistence = function () {\n\t\tfunction Persistence(_request, _Loading, _$rootScope, _CalendarService) {\n\t\t\tthis._request = _request;\n\t\t\tthis._Loading = _Loading;\n\t\t\tthis._$rootScope = _$rootScope;\n\t\t\tthis._CalendarService = _CalendarService;\n\t\t}\n\n\t\tPersistence.prototype.init = function () {\n\t\t\tvar successCallback,\n\t\t\t _this = this;\n\t\t\tthis.deferred = $q.defer();\n\t\t\tsuccessCallback = function successCallback() {\n\t\t\t\treturn _this.deferred.resolve();\n\t\t\t};\n\t\t\tthis.getCollections();\n\t\t\tthis.getSettings();\n\t\t\treturn this.deferred.promise;\n\t\t};\n\n\t\tPersistence.prototype.getCollections = function (onSuccess, showLoading) {\n\t\t\tvar failureCallbackWrapper,\n\t\t\t params,\n\t\t\t successCallbackWrapper,\n\t\t\t _this = this;\n\t\t\tif (showLoading === null) {\n\t\t\t\tshowLoading = true;\n\t\t\t}\n\t\t\tif (!onSuccess) {\n\t\t\t\tonSuccess = function onSuccess() {};\n\t\t\t}\n\t\t\tif (showLoading) {\n\t\t\t\tthis._Loading.increase();\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\tonSuccess();\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\treturn onSuccess();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {};\n\t\t\t}\n\t\t\tparams = {\n\t\t\t\tonSuccess: successCallbackWrapper,\n\t\t\t\tonFailure: failureCallbackWrapper\n\t\t\t};\n\t\t\treturn this._request.get('/apps/tasks/collections', params);\n\t\t};\n\n\t\tPersistence.prototype.getSettings = function (onSuccess, showLoading) {\n\t\t\tvar failureCallbackWrapper,\n\t\t\t params,\n\t\t\t successCallbackWrapper,\n\t\t\t _this = this;\n\t\t\tif (showLoading === null) {\n\t\t\t\tshowLoading = true;\n\t\t\t}\n\t\t\tif (!onSuccess) {\n\t\t\t\tonSuccess = function onSuccess() {};\n\t\t\t}\n\t\t\tif (showLoading) {\n\t\t\t\tthis._Loading.increase();\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\tonSuccess();\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\treturn onSuccess();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {};\n\t\t\t}\n\t\t\tparams = {\n\t\t\t\tonSuccess: successCallbackWrapper,\n\t\t\t\tonFailure: failureCallbackWrapper\n\t\t\t};\n\t\t\treturn this._request.get('/apps/tasks/settings', params);\n\t\t};\n\n\t\tPersistence.prototype.setVisibility = function (collectionID, visibility) {\n\t\t\tvar params = {\n\t\t\t\trouteParams: {\n\t\t\t\t\tcollectionID: collectionID,\n\t\t\t\t\tvisibility: visibility\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn this._request.post('/apps/tasks/collection/{collectionID}/visibility/{visibility}', params);\n\t\t};\n\n\t\tPersistence.prototype.setting = function (type, setting, value) {\n\t\t\tvar params = {\n\t\t\t\trouteParams: {\n\t\t\t\t\ttype: type,\n\t\t\t\t\tsetting: setting,\n\t\t\t\t\tvalue: value\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn this._request.post('/apps/tasks/settings/{type}/{setting}/{value}', params);\n\t\t};\n\t\treturn Persistence;\n\t}();\n\treturn new Persistence(Request, Loading, $rootScope, CalendarService);\n}]);","'use strict';\n\nangular.module('Tasks').factory('Publisher', ['CollectionsModel', 'SettingsModel', function (CollectionsModel, SettingsModel) {\n\t'use strict';\n\n\tvar Publisher = function () {\n\t\tfunction Publisher(_$collectionsmodel, _$settingsmodel) {\n\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._subscriptions = {};\n\t\t\tthis.subscribeObjectTo(this._$collectionsmodel, 'collections');\n\t\t\tthis.subscribeObjectTo(this._$settingsmodel, 'settings');\n\t\t}\n\n\t\tPublisher.prototype.subscribeObjectTo = function (object, name) {\n\t\t\tvar base = this._subscriptions;\n\t\t\tif (!base[name]) {\n\t\t\t\tbase[name] = [];\n\t\t\t}\n\t\t\treturn this._subscriptions[name].push(object);\n\t\t};\n\n\t\tPublisher.prototype.publishDataTo = function (data, name) {\n\t\t\tvar ref, results, subscriber, _i, _len;\n\t\t\tref = this._subscriptions[name] || [];\n\t\t\tresults = [];\n\t\t\tfor (_i = 0, _len = ref.length; _i < _len; _i++) {\n\t\t\t\tsubscriber = ref[_i];\n\t\t\t\tresults.push(subscriber.handle(data));\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\treturn Publisher;\n\t}();\n\treturn new Publisher(CollectionsModel, SettingsModel);\n}]);","'use strict';\n\nangular.module('Tasks').factory('RandomStringService', function () {\n 'use strict';\n\n return {\n generate: function generate() {\n return Math.random().toString(36).substr(2);\n }\n };\n});","'use strict';\n\nangular.module('Tasks').factory('Request', ['$http', 'Publisher', function ($http, Publisher) {\n\t'use strict';\n\n\tvar Request = function () {\n\t\tfunction Request($http, publisher) {\n\t\t\tthis.$http = $http;\n\t\t\tthis.publisher = publisher;\n\t\t\tthis.count = 0;\n\t\t\tthis.initialized = false;\n\t\t\tthis.shelvedRequests = [];\n\t\t\tthis.initialized = true;\n\t\t\tthis._executeShelvedRequests();\n\t\t}\n\n\t\tRequest.prototype.request = function (route, data) {\n\t\t\tvar defaultConfig, defaultData, url;\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tdefaultData = {\n\t\t\t\trouteParams: {},\n\t\t\t\tdata: {},\n\t\t\t\tonSuccess: function onSuccess() {\n\t\t\t\t\treturn {};\n\t\t\t\t},\n\t\t\t\tonFailure: function onFailure() {\n\t\t\t\t\treturn {};\n\t\t\t\t},\n\t\t\t\tconfig: {}\n\t\t\t};\n\t\t\tangular.extend(defaultData, data);\n\t\t\tif (!this.initialized) {\n\t\t\t\tthis._shelveRequest(route, defaultData);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\turl = OC.generateUrl(route, defaultData.routeParams);\n\t\t\tdefaultConfig = {\n\t\t\t\turl: url,\n\t\t\t\tdata: defaultData.data\n\t\t\t};\n\t\t\tangular.extend(defaultConfig, defaultData.config);\n\t\t\tif (defaultConfig.method === 'GET') {\n\t\t\t\tdefaultConfig.params = defaultConfig.data;\n\t\t\t}\n\t\t\treturn this.$http(defaultConfig).then(function (_this) {\n\t\t\t\treturn function (response) {\n\t\t\t\t\tvar name, ref, value;\n\t\t\t\t\tref = response.data.data;\n\t\t\t\t\tfor (name in ref) {\n\t\t\t\t\t\tvalue = ref[name];\n\t\t\t\t\t\t_this.publisher.publishDataTo(value, name);\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultData.onSuccess(response.data, response.status, response.headers, response.config);\n\t\t\t\t};\n\t\t\t}(this)).catch(function (response) {\n\t\t\t\treturn defaultData.onFailure(response.data, response.status, response.headers, response.config);\n\t\t\t});\n\t\t};\n\n\t\tRequest.prototype.post = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'POST';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype.get = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'GET';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype.put = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'PUT';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype[\"delete\"] = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'DELETE';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype._shelveRequest = function (route, data) {\n\t\t\tvar request = {\n\t\t\t\troute: route,\n\t\t\t\tdata: data\n\t\t\t};\n\t\t\treturn this.shelvedRequests.push(request);\n\t\t};\n\n\t\tRequest.prototype._executeShelvedRequests = function () {\n\t\t\tvar r, ref, results, _i, _len;\n\t\t\tref = this.shelvedRequests;\n\t\t\tresults = [];\n\t\t\tfor (_i = 0, _len = ref.length; _i < _len; _i++) {\n\t\t\t\tr = ref[_i];\n\t\t\t\tresults.push(this.request(r.route, r.data));\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\treturn Request;\n\t}();\n\treturn new Request($http, Publisher);\n}]);","'use strict';\n\nangular.module('Tasks').factory('Status', [function () {\n 'use strict';\n\n var Status;\n Status = function () {\n function Status() {\n this._$status = {\n addingList: false,\n focusTaskInput: false\n };\n }\n\n Status.prototype.getStatus = function () {\n return this._$status;\n };\n\n return Status;\n }();\n return new Status();\n}]);","'use strict';\n\nangular.module('Tasks').service('VTodoService', ['DavClient', 'RandomStringService', '$timeout', function (DavClient, RandomStringService, $timeout) {\n\t'use strict';\n\n\tvar _this = this;\n\n\tthis.getAll = function (calendar, completed, parent) {\n\t\tif (completed === null) {\n\t\t\tcompleted = false;\n\t\t}\n\t\tif (parent === null) {\n\t\t\tparent = false;\n\t\t}\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar cCalQuery = xmlDoc.createElement('c:calendar-query');\n\t\tcCalQuery.setAttribute('xmlns:c', 'urn:ietf:params:xml:ns:caldav');\n\t\tcCalQuery.setAttribute('xmlns:d', 'DAV:');\n\t\tcCalQuery.setAttribute('xmlns:a', 'http://apple.com/ns/ical/');\n\t\tcCalQuery.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(cCalQuery);\n\n\t\tvar dProp = xmlDoc.createElement('d:prop');\n\t\tcCalQuery.appendChild(dProp);\n\n\t\tvar dGetEtag = xmlDoc.createElement('d:getetag');\n\t\tdProp.appendChild(dGetEtag);\n\n\t\tvar cCalendarData = xmlDoc.createElement('c:calendar-data');\n\t\tdProp.appendChild(cCalendarData);\n\n\t\tvar cFilter = xmlDoc.createElement('c:filter');\n\t\tcCalQuery.appendChild(cFilter);\n\n\t\tvar cCompFilterVCal = xmlDoc.createElement('c:comp-filter');\n\t\tcCompFilterVCal.setAttribute('name', 'VCALENDAR');\n\t\tcFilter.appendChild(cCompFilterVCal);\n\n\t\tvar cCompFilterVTodo = xmlDoc.createElement('c:comp-filter');\n\t\tcCompFilterVTodo.setAttribute('name', 'VTODO');\n\t\tcCompFilterVCal.appendChild(cCompFilterVTodo);\n\n\t\tvar cPropFilterCompleted = xmlDoc.createElement('c:prop-filter');\n\t\tcPropFilterCompleted.setAttribute('name', 'COMPLETED');\n\t\tcCompFilterVTodo.appendChild(cPropFilterCompleted);\n\n\t\tif (!completed) {\n\t\t\tvar cIsNotDefined = xmlDoc.createElement('c:is-not-defined');\n\t\t\tcPropFilterCompleted.appendChild(cIsNotDefined);\n\t\t}\n\n\t\tif (parent) {\n\t\t\tvar cPropFilterRelated = xmlDoc.createElement('c:prop-filter');\n\t\t\tcPropFilterRelated.setAttribute('name', 'RELATED-TO');\n\t\t\tcCompFilterVTodo.appendChild(cPropFilterRelated);\n\t\t\tvar cTextMatch = xmlDoc.createElement('c:text-match');\n\t\t\tvar cTextMatchValue = xmlDoc.createTextNode(parent.uid);\n\t\t\tcTextMatch.appendChild(cTextMatchValue);\n\t\t\tcPropFilterRelated.appendChild(cTextMatch);\n\t\t}\n\n\t\t// var cPropFilterStatus = xmlDoc.createElement('c:prop-filter');\n\t\t// cPropFilterStatus.setAttribute('name', 'STATUS');\n\t\t// cCompFilterVTodo.appendChild(cPropFilterStatus);\n\n\t\t// var cTextMatch = xmlDoc.createElement('c:text-match');\n\t\t// cTextMatch.setAttribute('negate-condition', 'yes');\n\t\t// var cTextMatchValue = xmlDoc.createTextNode('CANCELLED');\n\t\t// cTextMatch.appendChild(cTextMatchValue);\n\t\t// cPropFilterStatus.appendChild(cTextMatch);\n\n\t\t// var cTimeRange = xmlDoc.createElement('c:time-range');\n\t\t// cTimeRange.setAttribute('start', this._getTimeRangeStamp(start));\n\t\t// cTimeRange.setAttribute('end', this._getTimeRangeStamp(end));\n\t\t// cCompFilterVTodo.appendChild(cTimeRange);\n\n\t\tvar url = calendar.url;\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\t'Depth': 1,\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\t\tvar body = cCalQuery.outerHTML;\n\n\t\treturn DavClient.request('REPORT', url, headers, body).then(function (response) {\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\t//TODO - something went wrong\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar vTodos = [];\n\n\t\t\tfor (var i in response.body) {\n\t\t\t\tvar object = response.body[i];\n\t\t\t\tvar properties = object.propStat[0].properties;\n\n\t\t\t\tvar uri = object.href.substr(object.href.lastIndexOf('/') + 1);\n\n\t\t\t\tvar vTodo = {\n\t\t\t\t\tcalendar: calendar,\n\t\t\t\t\tproperties: properties,\n\t\t\t\t\turi: uri\n\t\t\t\t};\n\t\t\t\tvTodos.push(vTodo);\n\t\t\t}\n\n\t\t\treturn vTodos;\n\t\t});\n\t};\n\n\tthis.get = function (calendar, uri) {\n\t\tvar url = calendar.url + uri;\n\t\treturn DavClient.request('GET', url, { 'requesttoken': OC.requestToken }, '').then(function (response) {\n\t\t\tvar vTodo = {\n\t\t\t\tcalendar: calendar,\n\t\t\t\tproperties: {\n\t\t\t\t\t'{urn:ietf:params:xml:ns:caldav}calendar-data': response.body,\n\t\t\t\t\t'{DAV:}getetag': response.xhr.getResponseHeader('ETag') },\n\t\t\t\turi: uri\n\t\t\t};\n\t\t\treturn vTodo;\n\t\t});\n\t};\n\n\tthis.create = function (calendar, data, returnTodo) {\n\t\tif (typeof returnTodo === 'undefined') {\n\t\t\treturnTodo = true;\n\t\t}\n\n\t\tvar headers = {\n\t\t\t'Content-Type': 'text/calendar; charset=utf-8',\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\t\tvar uri = this._generateRandomUri();\n\t\tvar url = calendar.url + uri;\n\n\t\treturn DavClient.request('PUT', url, headers, data).then(function (response) {\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\tconsole.log(response);\n\t\t\t\treturn false;\n\t\t\t\t// TODO - something went wrong, do smth about it\n\t\t\t}\n\n\t\t\treturn returnTodo ? _this.get(calendar, uri) : true;\n\t\t});\n\t};\n\n\tthis.update = function (task) {\n\t\tvar url = task.calendar.url + task.uri;\n\t\tvar headers = {\n\t\t\t'Content-Type': 'text/calendar; charset=utf-8',\n\t\t\t'If-Match': task.etag,\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\t\t$timeout.cancel(task.timers.update);\n\t\treturn DavClient.request('PUT', url, headers, task.data).then(function (response) {\n\t\t\ttask.etag = response.xhr.getResponseHeader('ETag');\n\t\t\treturn DavClient.wasRequestSuccessful(response.status);\n\t\t});\n\t};\n\n\tthis.delete = function (task) {\n\t\tvar url = task.calendar.url + task.uri;\n\t\tvar headers = {\n\t\t\t'If-Match': task.etag,\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\n\t\treturn DavClient.request('DELETE', url, headers, '').then(function (response) {\n\t\t\treturn DavClient.wasRequestSuccessful(response.status);\n\t\t});\n\t};\n\n\tthis._generateRandomUri = function () {\n\t\tvar uri = 'Nextcloud-';\n\t\turi += RandomStringService.generate();\n\t\turi += RandomStringService.generate();\n\t\turi += '.ics';\n\n\t\treturn uri;\n\t};\n\n\t// this._getTimeRangeStamp = function(momentObject) {\n\t// \treturn momentObject.format('YYYYMMDD') + 'T' + momentObject.format('HHmmss') + 'Z';\n\t// };\n}]);","'use strict';\n\nangular.module('Tasks').factory('ListsBusinessLayer', ['ListsModel', 'Persistence', 'TasksBusinessLayer', 'CalendarService', function (ListsModel, Persistence, TasksBusinessLayer, CalendarService) {\n\t'use strict';\n\n\tvar ListsBusinessLayer;\n\tListsBusinessLayer = function () {\n\t\tfunction ListsBusinessLayer(_$listsmodel, _persistence, _$tasksbusinesslayer, _$calendarservice) {\n\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$tasksbusinesslayer = _$tasksbusinesslayer;\n\t\t\tthis._$calendarservice = _$calendarservice;\n\t\t}\n\n\t\tListsBusinessLayer.prototype.init = function () {\n\t\t\treturn this._$calendarservice.getAll().then(function (calendars) {\n\t\t\t\tvar calendar, _i, _len, _results;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = calendars.length; _i < _len; _i++) {\n\t\t\t\t\tcalendar = calendars[_i];\n\t\t\t\t\tListsModel.add(calendar);\n\t\t\t\t\t_results.push(TasksBusinessLayer.getAll(calendar));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t});\n\t\t};\n\n\t\tListsBusinessLayer.prototype.add = function (calendar, color) {\n\t\t\treturn this._$calendarservice.create(calendar, color, ['vtodo']).then(function (calendar) {\n\t\t\t\tListsModel.add(calendar);\n\t\t\t\treturn calendar;\n\t\t\t});\n\t\t};\n\n\t\tListsBusinessLayer.prototype[\"delete\"] = function (calendar) {\n\t\t\treturn this._$calendarservice[\"delete\"](calendar).then(function () {\n\t\t\t\treturn ListsModel[\"delete\"](calendar);\n\t\t\t});\n\t\t};\n\n\t\tListsBusinessLayer.prototype.rename = function (calendar) {\n\t\t\tthis._$calendarservice.update(calendar).then(function (calendar) {\n\t\t\t\tcalendar.dropPreviousState();\n\t\t\t});\n\t\t};\n\n\t\treturn ListsBusinessLayer;\n\t}();\n\treturn new ListsBusinessLayer(ListsModel, Persistence, TasksBusinessLayer, CalendarService);\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __bind = function __bind(fn, me) {\n\t\treturn function () {\n\t\t\treturn fn.apply(me, arguments);\n\t\t};\n\t};\n\n\tangular.module('Tasks').factory('SearchBusinessLayer', ['ListsModel', 'Persistence', 'TasksModel', '$rootScope', '$routeParams', '$location', function (ListsModel, Persistence, TasksModel, $rootScope, $routeParams, $location) {\n\t\tvar SearchBusinessLayer;\n\t\tSearchBusinessLayer = function () {\n\t\t\tfunction SearchBusinessLayer(_$listsmodel, _persistence, _$tasksmodel, _$rootScope, _$routeparams, _$location) {\n\t\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\t\tthis._persistence = _persistence;\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._$rootScope = _$rootScope;\n\t\t\t\tthis._$routeparams = _$routeparams;\n\t\t\t\tthis._$location = _$location;\n\t\t\t\tthis.getFilter = __bind(this.getFilter, this);\n\t\t\t\tthis.setFilter = __bind(this.setFilter, this);\n\t\t\t\tthis.attach = __bind(this.attach, this);\n\t\t\t\tthis.initialize();\n\t\t\t\tthis._$searchString = '';\n\t\t\t}\n\n\t\t\tSearchBusinessLayer.prototype.attach = function (search) {\n\t\t\t\tvar _this = this;\n\t\t\t\tsearch.setFilter('tasks', function (query) {\n\t\t\t\t\treturn _this._$rootScope.$apply(function () {\n\t\t\t\t\t\treturn _this.setFilter(query);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tsearch.setRenderer('task', this.renderTaskResult.bind(this));\n\t\t\t\treturn search.setHandler('task', this.handleTaskClick.bind(this));\n\t\t\t};\n\n\t\t\tSearchBusinessLayer.prototype.setFilter = function (query) {\n\t\t\t\tthis._$searchString = query;\n\t\t\t};\n\n\t\t\tSearchBusinessLayer.prototype.getFilter = function () {\n\t\t\t\treturn this._$searchString;\n\t\t\t};\n\n\t\t\tSearchBusinessLayer.prototype.initialize = function () {\n\t\t\t\tvar _this = this;\n\t\t\t\tthis.handleTaskClick = function ($row, result, event) {\n\t\t\t\t\treturn _this._$location.path('/lists/' + result.calendarid + '/tasks/' + result.id);\n\t\t\t\t};\n\t\t\t\tthis.renderTaskResult = function ($row, result) {\n\t\t\t\t\tvar $template;\n\t\t\t\t\tif (!_this._$tasksmodel.filterTasks(result, _this._$routeparams.listID) || !_this._$tasksmodel.isLoaded(result)) {\n\t\t\t\t\t\t$template = $('div.task-item.template');\n\t\t\t\t\t\t$template = $template.clone();\n\t\t\t\t\t\t$row = $('<tr class=\"result\"></tr>').append($template.removeClass('template'));\n\t\t\t\t\t\t$row.data('result', result);\n\t\t\t\t\t\t$row.find('span.title').text(result.name);\n\t\t\t\t\t\tif (result.starred) {\n\t\t\t\t\t\t\t$row.find('span.task-star').addClass('task-starred');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.completed) {\n\t\t\t\t\t\t\t$row.find('div.task-item').addClass('done');\n\t\t\t\t\t\t\t$row.find('span.task-checkbox').addClass('svg-checkmark');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.complete) {\n\t\t\t\t\t\t\t$row.find('div.percentdone').css({\n\t\t\t\t\t\t\t\t'width': result.complete + '%',\n\t\t\t\t\t\t\t\t'background-color': '' + _this._$listsmodel.getColor(result.calendarid)\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.note) {\n\t\t\t\t\t\t\t$row.find('div.title-wrapper').addClass('attachment');\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $row;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn OC.Plugins.register('OCA.Search', this);\n\t\t\t};\n\n\t\t\treturn SearchBusinessLayer;\n\t\t}();\n\t\treturn new SearchBusinessLayer(ListsModel, Persistence, TasksModel, $rootScope, $routeParams, $location);\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').factory('SettingsBusinessLayer', ['Persistence', 'SettingsModel', function (Persistence, SettingsModel) {\n\t'use strict';\n\n\tvar SettingsBusinessLayer = function () {\n\t\tfunction SettingsBusinessLayer(_persistence, _$settingsmodel) {\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t}\n\n\t\tSettingsBusinessLayer.prototype.updateModel = function () {\n\t\t\tvar success,\n\t\t\t _this = this;\n\t\t\tsuccess = function success() {};\n\t\t\treturn this._persistence.getCollections(success, true);\n\t\t};\n\n\t\tSettingsBusinessLayer.prototype.setVisibility = function (collectionID, visibility) {\n\t\t\treturn this._persistence.setVisibility(collectionID, visibility);\n\t\t};\n\n\t\tSettingsBusinessLayer.prototype.toggle = function (type, setting) {\n\t\t\tthis._$settingsmodel.toggle(type, setting);\n\t\t\tvar value = this._$settingsmodel.getById(type)[setting];\n\t\t\treturn this._persistence.setting(type, setting, +value);\n\t\t};\n\n\t\tSettingsBusinessLayer.prototype.set = function (type, setting, value) {\n\t\t\treturn this._persistence.setting(type, setting, value);\n\t\t};\n\n\t\treturn SettingsBusinessLayer;\n\t}();\n\treturn new SettingsBusinessLayer(Persistence, SettingsModel);\n}]);","'use strict';\n\nangular.module('Tasks').factory('TasksBusinessLayer', ['TasksModel', 'Persistence', 'VTodoService', 'VTodo', '$timeout', function (TasksModel, Persistence, VTodoService, VTodo, $timeout) {\n\t'use strict';\n\n\tvar TasksBusinessLayer;\n\tTasksBusinessLayer = function () {\n\t\tfunction TasksBusinessLayer(_$tasksmodel, _persistence, _$vtodoservice, _$vtodo, $timeout) {\n\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$vtodoservice = _$vtodoservice;\n\t\t}\n\n\t\tTasksBusinessLayer.prototype.getAll = function (calendar, completed, parent) {\n\t\t\treturn this._$vtodoservice.getAll(calendar, completed, parent).then(function (tasks) {\n\t\t\t\tvar task, _i, _len, _results;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tvar vTodo = new VTodo(task.calendar, task.properties, task.uri);\n\t\t\t\t\t_results.push(TasksModel.ad(vTodo));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.add = function (task) {\n\t\t\treturn this._$vtodoservice.create(task.calendar, task.data).then(function (task) {\n\t\t\t\tvar vTodo = new VTodo(task.calendar, task.properties, task.uri);\n\t\t\t\tTasksModel.ad(vTodo);\n\t\t\t\treturn vTodo;\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.getTask = function (calendar, uri) {\n\t\t\treturn this._$vtodoservice.get(calendar, uri).then(function (task) {\n\t\t\t\tTasksModel.ad(task);\n\t\t\t\treturn task;\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setPriority = function (task, priority) {\n\t\t\tif (task.calendar.writable) {\n\t\t\t\ttask.priority = priority;\n\t\t\t\tthis.doUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setPercentComplete = function (task, percentComplete) {\n\t\t\tif (task.calendar.writable) {\n\t\t\t\tif (percentComplete < 100) {\n\t\t\t\t\tthis.uncompleteParents(task.related);\n\t\t\t\t} else {\n\t\t\t\t\tthis.completeChildren(task);\n\t\t\t\t}\n\t\t\t\ttask.complete = percentComplete;\n\t\t\t\tthis.triggerUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.triggerUpdate = function (task, duration) {\n\t\t\tif (!duration) {\n\t\t\t\tduration = 1000;\n\t\t\t}\n\t\t\tif (task.timers.update) {\n\t\t\t\t$timeout.cancel(task.timers.update);\n\t\t\t}\n\t\t\ttask.timers.update = $timeout(function (task) {\n\t\t\t\tVTodoService.update(task);\n\t\t\t}, duration, true, task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.doUpdate = function (task) {\n\t\t\treturn this._$vtodoservice.update(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.completeChildren = function (task) {\n\t\t\tvar child, _i, _len;\n\t\t\tvar children = this._$tasksmodel.getChildren(task);\n\t\t\tvar _results = [];\n\t\t\tfor (_i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\tchild = children[_i];\n\t\t\t\t_results.push(this.setPercentComplete(child, 100));\n\t\t\t}\n\t\t\treturn _results;\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.uncompleteParents = function (uid) {\n\t\t\tif (uid) {\n\t\t\t\tvar parent = this._$tasksmodel.getByUid(uid);\n\t\t\t\tif (parent.completed) {\n\t\t\t\t\treturn this.setPercentComplete(parent, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setHideSubtasks = function (task, hide) {\n\t\t\ttask.hideSubtasks = hide;\n\t\t\tif (task.calendar.writable) {\n\t\t\t\tthis.doUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setHideCompletedSubtasks = function (task, hide) {\n\t\t\ttask.hideCompletedSubtasks = hide;\n\t\t\tif (task.calendar.writable) {\n\t\t\t\tthis.doUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteTask = function (task) {\n\t\t\tvar child, children, _i, _len;\n\t\t\tchildren = this._$tasksmodel.getChildren(task);\n\t\t\tfor (_i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\tchild = children[_i];\n\t\t\t\tthis.deleteTask(child);\n\t\t\t}\n\t\t\treturn this._$vtodoservice[\"delete\"](task).then(function () {\n\t\t\t\treturn TasksModel[\"delete\"](task);\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.momentToICALTime = function (moment, asDate) {\n\t\t\tif (asDate) {\n\t\t\t\treturn ICAL.Time.fromDateString(moment.format('YYYY-MM-DD'));\n\t\t\t} else {\n\t\t\t\treturn ICAL.Time.fromDateTimeString(moment.format('YYYY-MM-DDTHH:mm:ss'));\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.initDueDate = function (task) {\n\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tif (!due.isValid()) {\n\t\t\t\tvar reference = start.isAfter() ? start : moment();\n\t\t\t\tif (task.allDay) {\n\t\t\t\t\treference.startOf('day').add(1, 'd');\n\t\t\t\t} else {\n\t\t\t\t\treference.startOf('hour').add(1, 'h');\n\t\t\t\t}\n\t\t\t\treturn this.setDue(task, reference, 'all');\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setDue = function (task, date, type) {\n\t\t\tif (type === null) {\n\t\t\t\ttype = 'day';\n\t\t\t}\n\t\t\tvar allDay = task.allDay;\n\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar olddue = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar due = olddue.clone();\n\t\t\tif (type === 'day') {\n\t\t\t\tif (moment(due).isValid()) {\n\t\t\t\t\tdue.year(date.year()).month(date.month()).date(date.date());\n\t\t\t\t} else {\n\t\t\t\t\tdue = date.add(12, 'h');\n\t\t\t\t}\n\t\t\t} else if (type === 'time') {\n\t\t\t\tif (moment(due).isValid()) {\n\t\t\t\t\tdue.hour(date.hour()).minute(date.minute());\n\t\t\t\t} else {\n\t\t\t\t\tdue = date;\n\t\t\t\t}\n\t\t\t} else if (type === 'all') {\n\t\t\t\tdue = date;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (due.isBefore(start) || due.isSame(start)) {\n\t\t\t\tstart.subtract(olddue.diff(due), 'ms');\n\t\t\t\ttask.start = this.momentToICALTime(start, allDay);\n\t\t\t}\n\t\t\ttask.due = this.momentToICALTime(due, allDay);\n\t\t\t// this.checkReminderDate(task);\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteDueDate = function (task) {\n\t\t\t// var reminder = task.reminder;\n\t\t\t// if (reminder !== null && reminder.type === 'DURATION' && reminder.duration.params.related === 'END') {\n\t\t\t// this.deleteReminderDate(task);\n\t\t\t// }\n\t\t\ttask.due = null;\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.initStartDate = function (task) {\n\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tif (!start.isValid()) {\n\t\t\t\tvar reference = moment().add(1, 'h');\n\t\t\t\tif (due.isBefore(reference)) {\n\t\t\t\t\treference = due.subtract(1, 'm');\n\t\t\t\t}\n\t\t\t\treference.startOf(task.allDay ? 'day' : 'hour');\n\t\t\t\treturn this.setStart(task, reference, 'all');\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setStart = function (task, date, type) {\n\t\t\tif (type === null) {\n\t\t\t\ttype = 'day';\n\t\t\t}\n\t\t\tvar allDay = task.allDay;\n\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar oldstart = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar start = oldstart.clone();\n\t\t\tif (type === 'day') {\n\t\t\t\tif (moment(start).isValid()) {\n\t\t\t\t\tstart.year(date.year()).month(date.month()).date(date.date());\n\t\t\t\t} else {\n\t\t\t\t\tstart = date.add(12, 'h');\n\t\t\t\t}\n\t\t\t} else if (type === 'time') {\n\t\t\t\tif (moment(start).isValid()) {\n\t\t\t\t\tstart.hour(date.hour()).minute(date.minute());\n\t\t\t\t} else {\n\t\t\t\t\tstart = date;\n\t\t\t\t}\n\t\t\t} else if (type === 'all') {\n\t\t\t\tstart = date;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (start.isAfter(due) || start.isSame(due)) {\n\t\t\t\tdue.add(start.diff(oldstart), 'ms');\n\t\t\t\ttask.due = this.momentToICALTime(due, allDay);\n\t\t\t}\n\t\t\ttask.start = this.momentToICALTime(start, allDay);\n\t\t\t// this.checkReminderDate(taskID);\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteStartDate = function (task) {\n\t\t\t// var reminder = task.reminder;\n\t\t\t// if (reminder !== null && reminder.type === 'DURATION' && reminder.duration.params.related === 'START') {\n\t\t\t// this.deleteReminderDate(task);\n\t\t\t// }\n\t\t\ttask.start = null;\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setAllDay = function (task, allDay) {\n\t\t\ttask.allDay = allDay;\n\t\t\tif (allDay) {\n\t\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\tif (start.isAfter(due) || start.isSame(due)) {\n\t\t\t\t\tstart = moment(due).subtract(1, 'day');\n\t\t\t\t\ttask.start = this.momentToICALTime(start, allDay);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.initReminder = function (taskID) {\n\t\t\tvar p, task;\n\t\t\tif (!this.checkReminderDate(taskID)) {\n\t\t\t\ttask = this._$tasksmodel.getById(taskID);\n\t\t\t\ttask.reminder = {\n\t\t\t\t\ttype: 'DURATION',\n\t\t\t\t\taction: 'DISPLAY',\n\t\t\t\t\tduration: {\n\t\t\t\t\t\ttoken: 'week',\n\t\t\t\t\t\tweek: 0,\n\t\t\t\t\t\tday: 0,\n\t\t\t\t\t\thour: 0,\n\t\t\t\t\t\tminute: 0,\n\t\t\t\t\t\tsecond: 0,\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tinvert: true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tif (moment(task.start, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\t\tp = task.reminder.duration.params;\n\t\t\t\t\tp.related = 'START';\n\t\t\t\t\tp.id = '10';\n\t\t\t\t} else if (moment(task.due, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\t\tp = task.reminder.duration.params;\n\t\t\t\t\tp.related = 'END';\n\t\t\t\t\tp.id = '11';\n\t\t\t\t} else {\n\t\t\t\t\ttask.reminder.type = 'DATE-TIME';\n\t\t\t\t\ttask.reminder.date = moment().startOf('hour').add(1, 'h').format('YYYYMMDDTHHmmss');\n\t\t\t\t}\n\t\t\t\treturn this.setReminder(taskID);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setReminderDate = function (taskID, date, type) {\n\t\t\tvar newreminder, reminder, reminderdate;\n\t\t\tif (type === null) {\n\t\t\t\ttype = 'day';\n\t\t\t}\n\t\t\treminder = this._$tasksmodel.getById(taskID).reminder;\n\t\t\tnewreminder = {\n\t\t\t\ttype: 'DATE-TIME',\n\t\t\t\taction: 'DISPLAY',\n\t\t\t\tduration: null\n\t\t\t};\n\t\t\tif (type === 'day') {\n\t\t\t\tif (this.checkReminderDate(taskID) || reminder === null) {\n\t\t\t\t\treminderdate = moment(reminder.date, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\tnewreminder.action = reminder.action;\n\t\t\t\t\tif (reminderdate.isValid() && reminder.type === 'DATE-TIME') {\n\t\t\t\t\t\treminderdate.year(date.year()).month(date.month()).date(date.date());\n\t\t\t\t\t} else {\n\t\t\t\t\t\treminderdate = date.add(12, 'h');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treminderdate = date.add(12, 'h');\n\t\t\t\t}\n\t\t\t} else if (type === 'time') {\n\t\t\t\tif (this.checkReminderDate(taskID) || reminder === null) {\n\t\t\t\t\treminderdate = moment(reminder.date, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\tnewreminder.action = reminder.action;\n\t\t\t\t\tif (reminderdate.isValid() && reminder.type === 'DATE-TIME') {\n\t\t\t\t\t\treminderdate.hour(date.hour()).minute(date.minute());\n\t\t\t\t\t} else {\n\t\t\t\t\t\treminderdate = date;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treminderdate = date;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnewreminder.date = reminderdate.format('YYYYMMDDTHHmmss');\n\t\t\tthis._$tasksmodel.setReminder(taskID, newreminder);\n\t\t\treturn this._persistence.setReminder(taskID, newreminder);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setReminder = function (taskID) {\n\t\t\tvar reminder;\n\t\t\tif (this.checkReminderDate(taskID)) {\n\t\t\t\treminder = this._$tasksmodel.getById(taskID).reminder;\n\t\t\t\treturn this._persistence.setReminder(taskID, reminder);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.checkReminderDate = function (taskID) {\n\t\t\tvar d, date, duration, rel, related, reminder, seg, task, token;\n\t\t\ttask = this._$tasksmodel.getById(taskID);\n\t\t\treminder = task.reminder;\n\t\t\tif (reminder !== null && reminder.type === 'DURATION') {\n\t\t\t\tif (!reminder.duration) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (reminder.duration.params.related === 'START') {\n\t\t\t\t\ttoken = 'start';\n\t\t\t\t} else if (reminder.duration.params.related === 'END') {\n\t\t\t\t\ttoken = 'due';\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tdate = moment(task[token], \"YYYYMMDDTHHmmss\");\n\t\t\t\tduration = reminder.duration;\n\t\t\t\td = {\n\t\t\t\t\tw: duration.week,\n\t\t\t\t\td: duration.day,\n\t\t\t\t\th: duration.hour,\n\t\t\t\t\tm: duration.minute,\n\t\t\t\t\ts: duration.second\n\t\t\t\t};\n\t\t\t\tif (duration.params.invert) {\n\t\t\t\t\tdate = date.subtract(d);\n\t\t\t\t} else {\n\t\t\t\t\tdate = date.add(d);\n\t\t\t\t}\n\t\t\t\ttask.reminder.date = date.format('YYYYMMDDTHHmmss');\n\t\t\t} else if (reminder !== null && reminder.type === 'DATE-TIME') {\n\t\t\t\tduration = reminder.duration;\n\t\t\t\tdate = moment(reminder.date, \"YYYYMMDDTHHmmss\");\n\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (duration) {\n\t\t\t\t\tif (duration.params.related === 'START') {\n\t\t\t\t\t\trelated = moment(task.start, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\trelated = moment(task.due, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t}\n\t\t\t\t\tseg = this.secondsToSegments(date.diff(related, 'seconds'));\n\t\t\t\t\tduration.params.invert = seg.invert;\n\t\t\t\t\tduration.token = 'week';\n\t\t\t\t\tduration.week = seg.week;\n\t\t\t\t\tduration.day = seg.day;\n\t\t\t\t\tduration.hour = seg.hour;\n\t\t\t\t\tduration.minute = seg.minute;\n\t\t\t\t\tduration.second = seg.second;\n\t\t\t\t} else {\n\t\t\t\t\tif (task.start) {\n\t\t\t\t\t\trelated = moment(task.start, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t\trel = 'START';\n\t\t\t\t\t\td = 0;\n\t\t\t\t\t} else if (task.due) {\n\t\t\t\t\t\trelated = moment(task.due, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t\trel = 'END';\n\t\t\t\t\t\td = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tseg = this.secondsToSegments(date.diff(related, 'seconds'));\n\t\t\t\t\treminder.duration = {\n\t\t\t\t\t\ttoken: 'week',\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\trelated: rel,\n\t\t\t\t\t\t\tinvert: seg.invert,\n\t\t\t\t\t\t\tid: +seg.invert + '' + d\n\t\t\t\t\t\t},\n\t\t\t\t\t\tweek: seg.week,\n\t\t\t\t\t\tday: seg.day,\n\t\t\t\t\t\thour: seg.hour,\n\t\t\t\t\t\tminute: seg.minute,\n\t\t\t\t\t\tsecond: seg.second\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.secondsToSegments = function (s) {\n\t\t\tvar d, h, i, m, w;\n\t\t\tif (s < 0) {\n\t\t\t\ts *= -1;\n\t\t\t\ti = true;\n\t\t\t} else {\n\t\t\t\ti = false;\n\t\t\t}\n\t\t\tw = Math.floor(s / 604800);\n\t\t\ts -= w * 604800;\n\t\t\td = Math.floor(s / 86400);\n\t\t\ts -= d * 86400;\n\t\t\th = Math.floor(s / 3600);\n\t\t\ts -= h * 3600;\n\t\t\tm = Math.floor(s / 60);\n\t\t\ts -= m * 60;\n\t\t\treturn {\n\t\t\t\tweek: w,\n\t\t\t\tday: d,\n\t\t\t\thour: h,\n\t\t\t\tminute: m,\n\t\t\t\tsecond: s,\n\t\t\t\tinvert: i\n\t\t\t};\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteReminderDate = function (taskID) {\n\t\t\tthis._$tasksmodel.setReminder(taskID, null);\n\t\t\treturn this._persistence.setReminder(taskID, false);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.changeCalendar = function (task, newCalendar) {\n\t\t\tif (task.calendar !== newCalendar && newCalendar.writable) {\n\t\t\t\tvar newTask = angular.copy(task);\n\t\t\t\tnewTask.calendar = newCalendar;\n\t\t\t\tif (!TasksModel.hasNoParent(newTask)) {\n\t\t\t\t\tvar parent = TasksModel.getByUid(newTask.related);\n\t\t\t\t\tif (parent.calendar.uri !== newTask.calendar.uri) {\n\t\t\t\t\t\tnewTask.related = null;\n\t\t\t\t\t\tTasksBusinessLayer.prototype.setPercentComplete(newTask, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn VTodoService.create(newCalendar, newTask.data).then(function (newVTodo) {\n\t\t\t\t\tvar vTodo = new VTodo(newVTodo.calendar, newVTodo.properties, newVTodo.uri);\n\t\t\t\t\tTasksModel.ad(vTodo);\n\t\t\t\t\treturn VTodoService[\"delete\"](task).then(function () {\n\t\t\t\t\t\tTasksModel[\"delete\"](task);\n\t\t\t\t\t\tvar queries = [];\n\t\t\t\t\t\tvar children = TasksModel.getChildren(newTask);\n\t\t\t\t\t\tvar _i, _len, child;\n\t\t\t\t\t\tfor (_i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\t\t\t\tchild = children[_i];\n\t\t\t\t\t\t\tif (child.calendar.uri !== newTask.calendar.uri) {\n\t\t\t\t\t\t\t\tqueries.push(TasksBusinessLayer.prototype.changeCalendar(child, newTask.calendar));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Promise.all(queries);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn Promise.resolve(true);\n\t\t\t}\n\t\t};\n\n\t\t// called from outside\n\t\tTasksBusinessLayer.prototype.changeCollection = function (taskID, collectionID) {\n\t\t\tvar task = this._$tasksmodel.getById(taskID);\n\t\t\tswitch (collectionID) {\n\t\t\t\tcase 'starred':\n\t\t\t\t\ttask.priority = 9;\n\t\t\t\t\treturn this.doUpdate(task);\n\t\t\t\tcase 'completed':\n\t\t\t\t\treturn this.setPercentComplete(task, 100);\n\t\t\t\tcase 'uncompleted':\n\t\t\t\t\tif (task.completed) {\n\t\t\t\t\t\treturn this.setPercentComplete(task, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'today':\n\t\t\t\t\treturn this.setDue(task, moment().startOf('day').add(12, 'h'), 'all');\n\t\t\t\tcase 'week':\n\t\t\t\tcase 'all':\n\t\t\t\t\treturn false;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.changeParent = function (task, parent) {\n\t\t\tif (parent.calendar.writable) {\n\t\t\t\ttask.related = parent.uid;\n\t\t\t\tparent.hideSubtasks = 0;\n\t\t\t\tif (parent.completed && !task.completed) {\n\t\t\t\t\tthis.setPercentComplete(parent, 0);\n\t\t\t\t} else {\n\t\t\t\t\tthis.doUpdate(parent);\n\t\t\t\t}\n\t\t\t\tif (parent.calendar.uri !== task.calendar.uri) {\n\t\t\t\t\tthis.changeCalendar(task, parent.calendar);\n\t\t\t\t} else {\n\t\t\t\t\tthis.doUpdate(task);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.makeRootTask = function (task, newCalendar, collectionID) {\n\t\t\tif (newCalendar.writable) {\n\t\t\t\tvar requests = [];\n\t\t\t\ttask.related = null;\n\t\t\t\tif (collectionID !== \"completed\" && task.completed) {\n\t\t\t\t\ttask.complete = 0;\n\t\t\t\t}\n\t\t\t\trequests.push(this.changeCollection(task.uri, collectionID));\n\t\t\t\tif (task.calendar !== newCalendar) {\n\t\t\t\t\trequests.push(this.changeCalendar(task, newCalendar));\n\t\t\t\t} else {\n\t\t\t\t\trequests.push(this.doUpdate(task));\n\t\t\t\t}\n\t\t\t\treturn requests;\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.addComment = function (comment, onSuccess, onFailure) {\n\t\t\tvar success,\n\t\t\t _this = this;\n\t\t\tif (!onSuccess) {\n\t\t\t\tonSuccess = function onSuccess() {};\n\t\t\t}\n\t\t\tif (!onFailure) {\n\t\t\t\tonFailure = function onFailure() {};\n\t\t\t}\n\t\t\tthis._$tasksmodel.addComment(comment);\n\t\t\tsuccess = function success(response) {\n\t\t\t\tif (response.status === 'error') {\n\t\t\t\t\treturn onFailure();\n\t\t\t\t} else {\n\t\t\t\t\treturn onSuccess(response.data);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn this._persistence.addComment(comment, success);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteComment = function (taskID, commentID) {\n\t\t\tthis._$tasksmodel.deleteComment(taskID, commentID);\n\t\t\treturn this._persistence.deleteComment(taskID, commentID);\n\t\t};\n\n\t\treturn TasksBusinessLayer;\n\t}();\n\treturn new TasksBusinessLayer(TasksModel, Persistence, VTodoService, VTodo, $timeout);\n}]);","'use strict';\n\nangular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', '$window', function ($rootScope, $filter, $window) {\n\t'use strict';\n\n\tfunction Calendar(url, props, uri) {\n\t\tvar _this = this;\n\n\t\tprops.color = props['{http://apple.com/ns/ical/}calendar-color'];\n\t\tif (typeof props.color !== 'undefined') {\n\t\t\tif (props.color.length === 9) {\n\t\t\t\tprops.color = props.color.substr(0, 7);\n\t\t\t}\n\t\t} else {\n\t\t\tprops.color = '#1d2d44';\n\t\t}\n\n\t\tangular.extend(this, {\n\t\t\t_propertiesBackup: {},\n\t\t\t_properties: {\n\t\t\t\turl: url,\n\t\t\t\turi: uri,\n\t\t\t\tenabled: props['{http://owncloud.org/ns}calendar-enabled'] === '1',\n\t\t\t\tdisplayname: props['{DAV:}displayname'] || t('tasks', 'Unnamed'),\n\t\t\t\tcolor: props.color,\n\t\t\t\torder: parseInt(props['{http://apple.com/ns/ical/}calendar-order']) || 0,\n\t\t\t\tcomponents: {\n\t\t\t\t\tvevent: false,\n\t\t\t\t\tvjournal: false,\n\t\t\t\t\tvtodo: false\n\t\t\t\t},\n\t\t\t\twritable: props.canWrite,\n\t\t\t\tshareable: props.canWrite,\n\t\t\t\tsharedWith: {\n\t\t\t\t\tusers: [],\n\t\t\t\t\tgroups: []\n\t\t\t\t},\n\t\t\t\towner: '',\n\t\t\t\tloadedCompleted: false\n\t\t\t},\n\t\t\t_updatedProperties: []\n\t\t});\n\t\tthis._propertiesBackup = angular.copy(this._properties);\n\n\t\t// angular.extend(this, {\n\t\t// \ttmpId: null,\n\t\t// \tfcEventSource: {\n\t\t// \t\tevents: function (start, end, timezone, callback) {\n\t\t// \t\t\t// console.log('querying events ...');\n\t\t// \t\t\t// TimezoneService.get(timezone).then(function(tz) {\n\t\t// \t\t\t// \t_this.list.loading = true;\n\t\t// \t\t\t// \t$rootScope.$broadcast('reloadCalendarList');\n\n\t\t// \t\t\t// \tVEventService.getAll(_this, start, end).then(function(events) {\n\t\t// \t\t\t// \t\tvar vevents = [];\n\t\t// \t\t\t// \t\tfor (var i = 0; i < events.length; i++) {\n\t\t// \t\t\t// \t\t\tvevents = vevents.concat(events[i].getFcEvent(start, end, tz));\n\t\t// \t\t\t// \t\t}\n\n\t\t// \t\t\t// \t\tcallback(vevents);\n\n\t\t// \t\t\t// \t\t_this.list.loading = false;\n\t\t// \t\t\t// \t\t$rootScope.$broadcast('reloadCalendarList');\n\t\t// \t\t\t// \t});\n\t\t// \t\t\t// });\n\t\t// \t\t},\n\t\t// \t\teditable: this._properties.writable,\n\t\t// \t\tcalendar: this\n\t\t// \t},\n\t\t// \tlist: {\n\t\t// \t\tedit: false,\n\t\t// \t\tloading: this.enabled,\n\t\t// \t\tlocked: false,\n\t\t// \t\teditingShares: false\n\t\t// \t}\n\t\t// });\n\n\t\tvar components = props['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set'];\n\t\tfor (var i = 0; i < components.length; i++) {\n\t\t\tvar name = components[i].attributes.getNamedItem('name').textContent.toLowerCase();\n\t\t\tif (this._properties.components.hasOwnProperty(name)) {\n\t\t\t\tthis._properties.components[name] = true;\n\t\t\t}\n\t\t}\n\n\t\tvar shares = props['{http://owncloud.org/ns}invite'];\n\t\tif (typeof shares !== 'undefined') {\n\t\t\tfor (var j = 0; j < shares.length; j++) {\n\t\t\t\tvar href = shares[j].getElementsByTagNameNS('DAV:', 'href');\n\t\t\t\tif (href.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thref = href[0].textContent;\n\n\t\t\t\tvar access = shares[j].getElementsByTagNameNS('http://owncloud.org/ns', 'access');\n\t\t\t\tif (access.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\taccess = access[0];\n\n\t\t\t\tvar readWrite = access.getElementsByTagNameNS('http://owncloud.org/ns', 'read-write');\n\t\t\t\treadWrite = readWrite.length !== 0;\n\n\t\t\t\tif (href.startsWith('principal:principals/users/')) {\n\t\t\t\t\tthis._properties.sharedWith.users.push({\n\t\t\t\t\t\tid: href.substr(27),\n\t\t\t\t\t\tdisplayname: href.substr(27),\n\t\t\t\t\t\twritable: readWrite\n\t\t\t\t\t});\n\t\t\t\t} else if (href.startsWith('principal:principals/groups/')) {\n\t\t\t\t\tthis._properties.sharedWith.groups.push({\n\t\t\t\t\t\tid: href.substr(28),\n\t\t\t\t\t\tdisplayname: href.substr(28),\n\t\t\t\t\t\twritable: readWrite\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar owner = props['{DAV:}owner'];\n\t\tif (typeof owner !== 'undefined' && owner.length !== 0) {\n\t\t\towner = owner[0].textContent.slice(0, -1);\n\t\t\tif (owner.startsWith('/remote.php/dav/principals/users/')) {\n\t\t\t\tthis._properties.owner = owner.substr(33);\n\t\t\t}\n\t\t}\n\n\t\t// this.tmpId = RandomStringService.generate();\n\t}\n\n\tCalendar.prototype = {\n\t\tget url() {\n\t\t\treturn this._properties.url;\n\t\t},\n\t\tget caldav() {\n\t\t\treturn $window.location.origin + this.url;\n\t\t},\n\t\tget exportUrl() {\n\t\t\tvar url = this.url;\n\t\t\t// cut off last slash to have a fancy name for the ics\n\t\t\tif (url.slice(url.length - 1) === '/') {\n\t\t\t\turl = url.slice(0, url.length - 1);\n\t\t\t}\n\t\t\turl += '?export';\n\t\t\treturn url;\n\t\t},\n\t\tget enabled() {\n\t\t\treturn this._properties.enabled;\n\t\t},\n\t\tget uri() {\n\t\t\treturn this._properties.uri;\n\t\t},\n\t\tget components() {\n\t\t\treturn this._properties.components;\n\t\t},\n\t\tset enabled(enabled) {\n\t\t\tthis._properties.enabled = enabled;\n\t\t\tthis._setUpdated('enabled');\n\t\t},\n\t\tget displayname() {\n\t\t\treturn this._properties.displayname;\n\t\t},\n\t\tset displayname(displayname) {\n\t\t\tthis._properties.displayname = displayname;\n\t\t\tthis._setUpdated('displayname');\n\t\t},\n\t\tget color() {\n\t\t\treturn this._properties.color;\n\t\t},\n\t\tset color(color) {\n\t\t\tthis._properties.color = color;\n\t\t\tthis._setUpdated('color');\n\t\t},\n\t\tget sharedWith() {\n\t\t\treturn this._properties.sharedWith;\n\t\t},\n\t\tset sharedWith(sharedWith) {\n\t\t\tthis._properties.sharedWith = sharedWith;\n\t\t},\n\t\tget textColor() {\n\t\t\tvar color = this.color;\n\t\t\tvar fallbackColor = '#fff';\n\t\t\tvar c;\n\t\t\tswitch (color.length) {\n\t\t\t\tcase 4:\n\t\t\t\t\tc = color.match(/^#([0-9a-f]{3})$/i)[1];\n\t\t\t\t\tif (c) {\n\t\t\t\t\t\treturn this._generateTextColor(parseInt(c.charAt(0), 16) * 0x11, parseInt(c.charAt(1), 16) * 0x11, parseInt(c.charAt(2), 16) * 0x11);\n\t\t\t\t\t}\n\t\t\t\t\treturn fallbackColor;\n\n\t\t\t\tcase 7:\n\t\t\t\tcase 9:\n\t\t\t\t\tvar regex = new RegExp('^#([0-9a-f]{' + (color.length - 1) + '})$', 'i');\n\t\t\t\t\tc = color.match(regex)[1];\n\t\t\t\t\tif (c) {\n\t\t\t\t\t\treturn this._generateTextColor(parseInt(c.substr(0, 2), 16), parseInt(c.substr(2, 2), 16), parseInt(c.substr(4, 2), 16));\n\t\t\t\t\t}\n\t\t\t\t\treturn fallbackColor;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fallbackColor;\n\t\t\t}\n\t\t},\n\t\tget order() {\n\t\t\treturn this._properties.order;\n\t\t},\n\t\tset order(order) {\n\t\t\tthis._properties.order = order;\n\t\t\tthis._setUpdated('order');\n\t\t},\n\t\tget writable() {\n\t\t\treturn this._properties.writable;\n\t\t},\n\t\tget shareable() {\n\t\t\treturn this._properties.shareable;\n\t\t},\n\t\tget owner() {\n\t\t\treturn this._properties.owner;\n\t\t},\n\t\tget loadedCompleted() {\n\t\t\treturn this._properties.loadedCompleted;\n\t\t},\n\t\tset loadedCompleted(loadedCompleted) {\n\t\t\tthis._properties.loadedCompleted = loadedCompleted;\n\t\t},\n\t\t_setUpdated: function _setUpdated(propName) {\n\t\t\tif (this._updatedProperties.indexOf(propName) === -1) {\n\t\t\t\tthis._updatedProperties.push(propName);\n\t\t\t}\n\t\t},\n\t\tget updatedProperties() {\n\t\t\treturn this._updatedProperties;\n\t\t},\n\t\tresetUpdatedProperties: function resetUpdatedProperties() {\n\t\t\tthis._updatedProperties = [];\n\t\t},\n\t\tprepareUpdate: function prepareUpdate() {\n\t\t\tthis._propertiesBackup = angular.copy(this._properties);\n\t\t},\n\t\tresetToPreviousState: function resetToPreviousState() {\n\t\t\tthis._properties = angular.copy(this._propertiesBackup);\n\t\t\tthis._propertiesBackup = {};\n\t\t},\n\t\tdropPreviousState: function dropPreviousState() {\n\t\t\tthis._propertiesBackup = {};\n\t\t},\n\t\ttoggleSharesEditor: function toggleSharesEditor() {\n\t\t\tthis.list.editingShares = !this.list.editingShares;\n\t\t},\n\t\t_generateTextColor: function _generateTextColor(r, g, b) {\n\t\t\tvar brightness = (r * 299 + g * 587 + b * 114) / 1000;\n\t\t\treturn brightness > 130 ? '#000000' : '#FAFAFA';\n\t\t}\n\t};\n\n\treturn Calendar;\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('CollectionsModel', ['TasksModel', '_Model', function (TasksModel, _Model) {\n\t\tvar CollectionsModel = function (_super) {\n\n\t\t\tfunction CollectionsModel(_$tasksmodel) {\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._nameCache = {};\n\t\t\t\tCollectionsModel.__super__.constructor.call(this);\n\t\t\t}\n\n\t\t\t__extends(CollectionsModel, _super);\n\n\t\t\tCollectionsModel.prototype.add = function (data, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tthis._nameCache[data.displayname] = data;\n\t\t\t\tif (angular.isDefined(data.id)) {\n\t\t\t\t\treturn CollectionsModel.__super__.add.call(this, data, clearCache);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tCollectionsModel.prototype.getCount = function (collectionID, filter) {\n\t\t\t\tvar count, task, tasks, _i, _len;\n\t\t\t\tif (filter === null) {\n\t\t\t\t\tfilter = '';\n\t\t\t\t}\n\t\t\t\tcount = 0;\n\t\t\t\ttasks = this._$tasksmodel.filteredTasks(filter);\n\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tcount += this._$tasksmodel.filterTasks(task, collectionID) && !task.related;\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t};\n\n\t\t\treturn CollectionsModel;\n\t\t}(_Model);\n\t\treturn new CollectionsModel(TasksModel);\n\t}]);\n}).call(undefined);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('ListsModel', ['TasksModel', '_Model', function (TasksModel, _Model) {\n\t\tvar ListsModel = function (_super) {\n\n\t\t\tfunction ListsModel(_$tasksmodel) {\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._tmpUriCache = {};\n\t\t\t\tthis._data = [];\n\t\t\t\tthis._dataMap = {};\n\t\t\t\tthis._filterCache = {};\n\t\t\t}\n\n\t\t\t__extends(ListsModel, _super);\n\n\t\t\tListsModel.prototype.add = function (calendar, clearCache) {\n\t\t\t\tvar updateByUri;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tupdateByUri = angular.isDefined(calendar.uri) && angular.isDefined(this.getByUri(calendar.uri));\n\t\t\t\tif (updateByUri) {\n\t\t\t\t\treturn this.update(calendar, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\tif (angular.isDefined(calendar.uri)) {\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!angular.isDefined(this._dataMap[calendar.uri])) {\n\t\t\t\t\t\t\tthis._data.push(calendar);\n\t\t\t\t\t\t\tthis._dataMap[calendar.uri] = calendar;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.getByUri = function (uri) {\n\t\t\t\treturn this._dataMap[uri];\n\t\t\t};\n\n\t\t\tListsModel.prototype.update = function (list, clearCache) {\n\t\t\t\tvar tmplist;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\ttmplist = this._tmpIdCache[list.tmpID];\n\t\t\t\tif (angular.isDefined(list.id) && angular.isDefined(tmplist) && angular.isUndefined(tmplist.id)) {\n\t\t\t\t\ttmplist.id = list.id;\n\t\t\t\t\tthis._dataMap[list.id] = tmplist;\n\t\t\t\t}\n\t\t\t\tlist[\"void\"] = false;\n\t\t\t\treturn ListsModel.__super__.update.call(this, list, clearCache);\n\t\t\t};\n\n\t\t\tListsModel.prototype[\"delete\"] = function (calendar, clearCache) {\n\t\t\t\tvar counter, data, entry, _i, _len, _ref;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\t_ref = this._data;\n\t\t\t\tfor (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) {\n\t\t\t\t\tentry = _ref[counter];\n\t\t\t\t\tif (entry === calendar) {\n\t\t\t\t\t\tthis._data.splice(counter, 1);\n\t\t\t\t\t\tdata = this._dataMap[calendar.uri];\n\t\t\t\t\t\tdelete this._dataMap[calendar.uri];\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.getStandardList = function () {\n\t\t\t\tvar calendars;\n\t\t\t\tif (this.size()) {\n\t\t\t\t\tcalendars = this.getAll();\n\t\t\t\t\treturn calendars[0];\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.isNameAlreadyTaken = function (displayname, uri) {\n\t\t\t\tvar calendar, calendars, ret, _i, _len;\n\t\t\t\tcalendars = this.getAll();\n\t\t\t\tret = false;\n\t\t\t\tfor (_i = 0, _len = calendars.length; _i < _len; _i++) {\n\t\t\t\t\tcalendar = calendars[_i];\n\t\t\t\t\tif (calendar.displayname === displayname && calendar.uri !== uri) {\n\t\t\t\t\t\tret = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t};\n\n\t\t\tListsModel.prototype.getCount = function (calendarID, collectionID, filter) {\n\t\t\t\tvar count, task, tasks, _i, _len;\n\t\t\t\tif (filter === null) {\n\t\t\t\t\tfilter = '';\n\t\t\t\t}\n\t\t\t\tcount = 0;\n\t\t\t\ttasks = this._$tasksmodel.filteredTasks(filter);\n\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tcount += this._$tasksmodel.filterTasks(task, collectionID) && task.calendar.uri === calendarID && !task.related;\n\t\t\t\t}\n\t\t\t\t// if (collectionID === 'completed' && filter === '') {\n\t\t\t\t// count += this.notLoaded(calendarID);\n\t\t\t\t// }\n\t\t\t\treturn count;\n\t\t\t};\n\n\t\t\tListsModel.prototype.loadedCompleted = function (calendarID) {\n\t\t\t\tif (angular.isUndefined(this.getById(calendarID))) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn this.getById(calendarID).loadedCompleted;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.setLoadedCompleted = function (calendarID) {\n\t\t\t\tthis.getById(calendarID).loadedCompleted = true;\n\t\t\t};\n\n\t\t\tListsModel.prototype.getColor = function (calendarID) {\n\t\t\t\tif (angular.isUndefined(this.getById(calendarID))) {\n\t\t\t\t\treturn '#CCCCCC';\n\t\t\t\t} else {\n\t\t\t\t\treturn this.getById(calendarID).calendarcolor;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.getName = function (calendarID) {\n\t\t\t\tif (angular.isUndefined(this.getById(calendarID))) {\n\t\t\t\t\treturn '';\n\t\t\t\t} else {\n\t\t\t\t\treturn this.getById(calendarID).displayname;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn ListsModel;\n\t\t}(_Model);\n\t\treturn new ListsModel(TasksModel);\n\t}]);\n}).call(undefined);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('SettingsModel', ['_Model', function (_Model) {\n\t\tvar SettingsModel = function (_super) {\n\n\t\t\tfunction SettingsModel() {\n\t\t\t\tthis._nameCache = {};\n\t\t\t\tSettingsModel.__super__.constructor.call(this);\n\t\t\t}\n\n\t\t\t__extends(SettingsModel, _super);\n\n\t\t\tSettingsModel.prototype.add = function (data, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tthis._nameCache[data.displayname] = data;\n\t\t\t\tif (angular.isDefined(data.id)) {\n\t\t\t\t\treturn SettingsModel.__super__.add.call(this, data, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\treturn this._data.push(data);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tSettingsModel.prototype.toggle = function (type, setting) {\n\t\t\t\tvar set;\n\t\t\t\tset = this.getById(type);\n\t\t\t\tthis.getById(type)[setting] = !set[setting];\n\t\t\t};\n\t\t\treturn SettingsModel;\n\t\t}(_Model);\n\t\treturn new SettingsModel();\n\t}]);\n}).call(undefined);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('TasksModel', ['_Model', function (_Model) {\n\t\tvar TasksModel = function (_super) {\n\n\t\t\tfunction TasksModel() {\n\t\t\t\tthis._tmpIdCache = {};\n\t\t\t\tTasksModel.__super__.constructor.call(this);\n\t\t\t}\n\n\t\t\t__extends(TasksModel, _super);\n\n\t\t\tTasksModel.prototype.ad = function (task, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tvar updateByUri = angular.isDefined(task.uri) && angular.isDefined(this.getByUri(task.uri));\n\t\t\t\tif (updateByUri) {\n\t\t\t\t\treturn this.update(task, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\tif (angular.isDefined(task.uri)) {\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!angular.isDefined(this._dataMap[task.uri])) {\n\t\t\t\t\t\t\tthis._data.push(task);\n\t\t\t\t\t\t\tthis._dataMap[task.uri] = task;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getByUri = function (uri) {\n\t\t\t\treturn this._dataMap[uri];\n\t\t\t};\n\n\t\t\tTasksModel.prototype.update = function (task, clearCache) {\n\n\t\t\t\tvar entry, key, value, _results;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tif (clearCache) {\n\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t}\n\t\t\t\tentry = this.getByUri(task.uri);\n\t\t\t\tentry.components = task.components;\n\t\t\t\tentry.components.toString();\n\t\t\t\treturn entry;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.removeById = function (taskID) {\n\t\t\t\treturn TasksModel.__super__.removeById.call(this, taskID);\n\t\t\t};\n\n\t\t\tTasksModel.prototype[\"delete\"] = function (task, clearCache) {\n\t\t\t\tvar counter, data, entry, _i, _len, _ref;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\t_ref = this._data;\n\t\t\t\tfor (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) {\n\t\t\t\t\tentry = _ref[counter];\n\t\t\t\t\tif (entry === task) {\n\t\t\t\t\t\tthis._data.splice(counter, 1);\n\t\t\t\t\t\tdata = this._dataMap[task.uri];\n\t\t\t\t\t\tdelete this._dataMap[task.uri];\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.removeByList = function (listID) {\n\t\t\t\tvar id, task, taskIDs, tasks, _results;\n\t\t\t\ttasks = this.getAll();\n\t\t\t\ttaskIDs = [];\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tif (task.calendarid === listID) {\n\t\t\t\t\t\ttaskIDs.push(task.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_results = [];\n\t\t\t\tfor (var _j = 0, _len1 = taskIDs.length; _j < _len1; _j++) {\n\t\t\t\t\tid = taskIDs[_j];\n\t\t\t\t\t_results.push(this.removeById(id));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.taskAtDay = function (task, date) {\n\t\t\t\tvar diff, due, duediff, start, startdiff;\n\t\t\t\tstart = moment(task.start, \"YYYYMMDDTHHmmss\");\n\t\t\t\tdue = moment(task.due, \"YYYYMMDDTHHmmss\");\n\t\t\t\tif (start.isValid() && !due.isValid()) {\n\t\t\t\t\tdiff = start.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tif (!date && diff < date + 1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (diff < date + 1 && diff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (due.isValid() && !start.isValid()) {\n\t\t\t\t\tdiff = due.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tif (!date && diff < date + 1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (diff < date + 1 && diff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (start.isValid() && due.isValid()) {\n\t\t\t\t\tstartdiff = start.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tduediff = due.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tif (!date && (startdiff < date + 1 || duediff < date + 1)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (startdiff < date + 1 && startdiff >= date && duediff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (duediff < date + 1 && duediff >= date && startdiff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.isLoaded = function (task) {\n\t\t\t\tif (this.getById(task.id)) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.hasSubtasks = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.related === uid) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.hasCompletedSubtasks = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.related === uid && task.completed) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.hasNoParent = function (task) {\n\t\t\t\tif (!task.related) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tvar tasks = this.getAll();\n\t\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\tvar t = tasks[_i];\n\t\t\t\t\t\tif (task.related === t.uid && task !== t) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getIdByUid = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.uid === uid) {\n\t\t\t\t\t\treturn task.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getByUid = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.uid === uid) {\n\t\t\t\t\t\treturn task;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getChildren = function (task) {\n\t\t\t\tvar children, t, tasks;\n\t\t\t\ttasks = this.getAll();\n\t\t\t\tchildren = [];\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tt = tasks[_i];\n\t\t\t\t\tif (t.related === task.uid && t !== task) {\n\t\t\t\t\t\tchildren.push(t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn children;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getDescendantIDs = function (task) {\n\t\t\t\tvar child, children, descendantIDs;\n\t\t\t\tchildren = this.getChildren(task);\n\t\t\t\tdescendantIDs = [];\n\t\t\t\tfor (var _i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\t\tchild = children[_i];\n\t\t\t\t\tdescendantIDs = descendantIDs.concat(child.uri);\n\t\t\t\t\tdescendantIDs = descendantIDs.concat(this.getDescendantIDs(child));\n\t\t\t\t}\n\t\t\t\treturn descendantIDs;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.filterTasks = function (task, filter) {\n\t\t\t\tswitch (filter) {\n\t\t\t\t\tcase 'completed':\n\t\t\t\t\t\treturn task.completed === true;\n\t\t\t\t\tcase 'all':\n\t\t\t\t\t\treturn task.completed === false;\n\t\t\t\t\tcase 'current':\n\t\t\t\t\t\treturn task.completed === false && this.current(task.start, task.due);\n\t\t\t\t\tcase 'starred':\n\t\t\t\t\t\treturn task.completed === false && task.priority > 5;\n\t\t\t\t\tcase 'today':\n\t\t\t\t\t\treturn task.completed === false && (this.today(task.start) || this.today(task.due));\n\t\t\t\t\tcase 'week':\n\t\t\t\t\t\treturn task.completed === false && (this.week(task.start) || this.week(task.due));\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn '' + task.calendar.uri === '' + filter;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.filteredTasks = function (needle) {\n\t\t\t\tvar ancestors, parentID, ret, task, tasks;\n\t\t\t\tret = [];\n\t\t\t\ttasks = this.getAll();\n\t\t\t\tif (!needle) {\n\t\t\t\t\tret = tasks;\n\t\t\t\t} else {\n\t\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\t\tif (this.filterTasksByString(task, needle)) {\n\t\t\t\t\t\t\tif (this.objectExists(task, ret)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tret.push(task);\n\t\t\t\t\t\t\tparentID = this.getIdByUid(task.related);\n\t\t\t\t\t\t\tancestors = this.getAncestor(parentID, ret);\n\t\t\t\t\t\t\tif (ancestors) {\n\t\t\t\t\t\t\t\tret = ret.concat(ancestors);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.objectExists = function (task, ret) {\n\t\t\t\tfor (var _i = 0, _len = ret.length; _i < _len; _i++) {\n\t\t\t\t\tvar re = ret[_i];\n\t\t\t\t\tif (re.id === task.id) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.filterTasksByString = function (task, filter) {\n\t\t\t\tvar key, keys, value;\n\t\t\t\tkeys = ['name', 'note', 'location', 'categories', 'comments'];\n\t\t\t\tfilter = filter.toLowerCase();\n\t\t\t\tfor (key in task) {\n\t\t\t\t\tvalue = task[key];\n\t\t\t\t\tif (__indexOf.call(keys, key) >= 0) {\n\t\t\t\t\t\tif (key === 'comments') {\n\t\t\t\t\t\t\tif (this.searchComments(task.comments, filter)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (key === 'categories') {\n\t\t\t\t\t\t\tif (this.searchCategories(task.categories, filter)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (value.toLowerCase().indexOf(filter) !== -1) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.searchComments = function (comments, filter) {\n\t\t\t\tfor (var _i = 0, _len = comments.length; _i < _len; _i++) {\n\t\t\t\t\tvar comment = comments[_i];\n\t\t\t\t\tif (comment.comment.toLowerCase().indexOf(filter) !== -1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.searchCategories = function (categories, filter) {\n\t\t\t\tfor (var _i = 0, _len = categories.length; _i < _len; _i++) {\n\t\t\t\t\tvar category = categories[_i];\n\t\t\t\t\tif (category.toLowerCase().indexOf(filter) !== -1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.setReminder = function (taskID, reminder) {\n\t\t\t\treturn this.update({\n\t\t\t\t\tid: taskID,\n\t\t\t\t\treminder: reminder\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tTasksModel.prototype.overdue = function (due) {\n\t\t\t\treturn moment(due, \"YYYYMMDDTHHmmss\").isValid() && moment(due, \"YYYYMMDDTHHmmss\").diff(moment()) < 0;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.due = function (due) {\n\t\t\t\treturn moment(due, 'YYYYMMDDTHHmmss').isValid();\n\t\t\t};\n\n\t\t\tTasksModel.prototype.today = function (due) {\n\t\t\t\treturn moment(due, \"YYYYMMDDTHHmmss\").isValid() && moment(due, \"YYYYMMDDTHHmmss\").diff(moment().startOf('day'), 'days', true) < 1;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.week = function (due) {\n\t\t\t\treturn moment(due, \"YYYYMMDDTHHmmss\").isValid() && moment(due, \"YYYYMMDDTHHmmss\").diff(moment().startOf('day'), 'days', true) < 7;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.current = function (start, due) {\n\t\t\t\treturn !moment(start, \"YYYYMMDDTHHmmss\").isValid() || moment(start, \"YYYYMMDDTHHmmss\").diff(moment(), 'days', true) < 0 || moment(due, \"YYYYMMDDTHHmmss\").diff(moment(), 'days', true) < 0;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.addComment = function (comment) {\n\t\t\t\tvar task;\n\t\t\t\ttask = this.getById(comment.taskID);\n\t\t\t\tif (task.comments) {\n\t\t\t\t\ttask.comments.push(comment);\n\t\t\t\t} else {\n\t\t\t\t\ttask.comments = [comment];\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.updateComment = function (comment) {\n\t\t\t\tvar com, i, task, _i, _len, _ref, _results;\n\t\t\t\ttask = this.getById(comment.taskID);\n\t\t\t\ti = 0;\n\t\t\t\t_ref = task.comments;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t\t\t\tcom = _ref[_i];\n\t\t\t\t\tif (com.tmpID === comment.tmpID) {\n\t\t\t\t\t\ttask.comments[i] = comment;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t_results.push(i++);\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.deleteComment = function (taskID, commentID) {\n\t\t\t\tvar comment, i, task, _i, _len, _ref, _results;\n\t\t\t\ttask = this.getById(taskID);\n\t\t\t\ti = 0;\n\t\t\t\t_ref = task.comments;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t\t\t\tcomment = _ref[_i];\n\t\t\t\t\tif (comment.id === commentID) {\n\t\t\t\t\t\ttask.comments.splice(i, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t_results.push(i++);\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\treturn TasksModel;\n\t\t}(_Model);\n\t\treturn new TasksModel();\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').factory('VTodo', ['$filter', 'ICalFactory', 'RandomStringService', function ($filter, icalfactory, RandomStringService) {\n\t'use strict';\n\n\tfunction VTodo(calendar, props, uri) {\n\t\tvar _this = this;\n\n\t\tangular.extend(this, {\n\t\t\tcalendar: calendar,\n\t\t\tdata: props['{urn:ietf:params:xml:ns:caldav}calendar-data'],\n\t\t\turi: uri,\n\t\t\tetag: props['{DAV:}getetag'] || null,\n\t\t\ttimers: [],\n\t\t\tloaded: false\n\t\t});\n\n\t\tthis.jCal = ICAL.parse(this.data);\n\t\tthis.components = new ICAL.Component(this.jCal);\n\n\t\tif (this.components.jCal.length === 0) {\n\t\t\tthrow \"invalid calendar\";\n\t\t}\n\t}\n\n\tVTodo.prototype = {\n\t\tget summary() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('summary');\n\t\t},\n\t\tset summary(summary) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('summary', summary);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget priority() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar priority = vtodos[0].getFirstPropertyValue('priority');\n\t\t\treturn (10 - priority) % 10;\n\t\t},\n\t\tset priority(priority) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('priority', (10 - priority) % 10);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget complete() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('percent-complete') || 0;\n\t\t},\n\t\tset complete(complete) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('percent-complete', complete);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t\tif (complete < 100) {\n\t\t\t\tthis.completed = null;\n\t\t\t\tif (complete === 0) {\n\t\t\t\t\tthis.status = 'NEEDS-ACTION';\n\t\t\t\t} else {\n\t\t\t\t\tthis.status = 'IN-PROCESS';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.completed = ICAL.Time.now();\n\t\t\t\tthis.status = 'COMPLETED';\n\t\t\t}\n\t\t},\n\t\tget completed() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar comp = vtodos[0].getFirstPropertyValue('completed');\n\t\t\tif (comp) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tset completed(completed) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (completed) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('completed', completed);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('completed');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget completed_date() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar comp = vtodos[0].getFirstPropertyValue('completed');\n\t\t\tif (comp) {\n\t\t\t\treturn comp.toJSDate();\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t},\n\t\tget status() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('status');\n\t\t},\n\t\tset status(status) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('status', status);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget note() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('description') || '';\n\t\t},\n\t\tset note(note) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('description', note);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget uid() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('uid') || '';\n\t\t},\n\t\tget related() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('related-to') || null;\n\t\t},\n\t\tset related(related) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (related) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('related-to', related);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('related-to');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget hideSubtasks() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn +vtodos[0].getFirstPropertyValue('x-oc-hidesubtasks') || 0;\n\t\t},\n\t\tset hideSubtasks(hide) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('x-oc-hidesubtasks', +hide);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget hideCompletedSubtasks() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn +vtodos[0].getFirstPropertyValue('x-oc-hidecompletedsubtasks') || 0;\n\t\t},\n\t\tset hideCompletedSubtasks(hide) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('x-oc-hidecompletedsubtasks', +hide);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget reminder() {\n\t\t\treturn null;\n\t\t},\n\t\tget categories() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar categories = vtodos[0].getFirstProperty('categories');\n\t\t\tif (categories) {\n\t\t\t\treturn categories.getValues();\n\t\t\t} else {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\tset categories(cats) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar categories = vtodos[0].getFirstProperty('categories');\n\t\t\tif (cats.length > 0) {\n\t\t\t\tif (categories) {\n\t\t\t\t\tcategories.setValues(cats);\n\t\t\t\t} else {\n\t\t\t\t\tvar prop = new ICAL.Property('categories');\n\t\t\t\t\tprop.setValues(cats);\n\t\t\t\t\tcategories = vtodos[0].addProperty(prop);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('categories');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget start() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('dtstart');\n\t\t},\n\t\tset start(start) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (start) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('dtstart', start);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('dtstart');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget due() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('due');\n\t\t},\n\t\tset due(due) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (due) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('due', due);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('due');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget allDay() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar start = vtodos[0].getFirstPropertyValue('dtstart');\n\t\t\tvar due = vtodos[0].getFirstPropertyValue('due');\n\t\t\tvar d = due ? due : start;\n\t\t\treturn d !== null && d.isDate;\n\t\t},\n\t\tset allDay(allDay) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar start = vtodos[0].getFirstPropertyValue('dtstart');\n\t\t\tif (start) {\n\t\t\t\tstart.isDate = allDay;\n\t\t\t\tvtodos[0].updatePropertyWithValue('dtstart', start);\n\t\t\t}\n\t\t\tvar due = vtodos[0].getFirstPropertyValue('due');\n\t\t\tif (due) {\n\t\t\t\tdue.isDate = allDay;\n\t\t\t\tvtodos[0].updatePropertyWithValue('due', due);\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget comments() {\n\t\t\treturn null;\n\t\t},\n\t\tget loadedCompleted() {\n\t\t\treturn this.loaded;\n\t\t},\n\t\tset loadedCompleted(loadedCompleted) {\n\t\t\tthis.loaded = loadedCompleted;\n\t\t},\n\t\tupdateLastModified: function updateLastModified() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('last-modified', ICAL.Time.now());\n\t\t\tvtodos[0].updatePropertyWithValue('dtstamp', ICAL.Time.now());\n\t\t}\n\t};\n\n\tVTodo.create = function (task) {\n\t\tvar comp = icalfactory.new();\n\n\t\tvar vtodo = new ICAL.Component('vtodo');\n\t\tcomp.addSubcomponent(vtodo);\n\t\tvtodo.updatePropertyWithValue('created', ICAL.Time.now());\n\t\tvtodo.updatePropertyWithValue('dtstamp', ICAL.Time.now());\n\t\tvtodo.updatePropertyWithValue('last-modified', ICAL.Time.now());\n\t\tvtodo.updatePropertyWithValue('uid', RandomStringService.generate());\n\t\tvtodo.updatePropertyWithValue('summary', task.summary);\n\t\tvtodo.updatePropertyWithValue('priority', task.priority);\n\t\tvtodo.updatePropertyWithValue('percent-complete', task.complete);\n\t\tvtodo.updatePropertyWithValue('x-oc-hidesubtasks', 0);\n\t\tif (task.related) {\n\t\t\tvtodo.updatePropertyWithValue('related-to', task.related);\n\t\t}\n\t\tif (task.note) {\n\t\t\tvtodo.updatePropertyWithValue('description', task.note);\n\t\t}\n\t\tif (task.due) {\n\t\t\tvtodo.updatePropertyWithValue('due', task.due);\n\t\t}\n\t\tif (task.start) {\n\t\t\tvtodo.updatePropertyWithValue('dtstart', task.start);\n\t\t}\n\n\t\treturn new VTodo(task.calendar, {\n\t\t\t'{urn:ietf:params:xml:ns:caldav}calendar-data': comp.toString(),\n\t\t\t'{DAV:}getetag': null\n\t\t}, null);\n\t};\n\n\treturn VTodo;\n}]);"]}
\ No newline at end of file +{"version":3,"sources":["app.js","controllers/appcontroller.js","controllers/detailscontroller.js","controllers/listcontroller.js","controllers/settingscontroller.js","controllers/taskscontroller.js","directives/appnavigationentryutils.js","directives/autofocusoninsert.js","directives/avatar.js","directives/colorpickerDirective.js","directives/confirmation.js","directives/datepicker.js","directives/occlickfocus.js","directives/timepicker.js","directives/watchtop.js","filters/counterFormatter.js","filters/dateDetails.js","filters/dateDetailsShort.js","filters/dateFromNow.js","filters/dateTaskList.js","filters/day.js","filters/dayTaskList.js","filters/percentDetails.js","filters/priorityDetails.js","filters/reminderDetails.js","filters/startDetails.js","filters/timeTaskList.js","services/calendarservice.js","services/davclient.js","services/icalfactory.js","services/loading.js","services/model.js","services/persistence.js","services/publisher.js","services/randomstringservice.js","services/request.js","services/status.js","services/vtodoservice.js","services/businesslayer/listsbusinesslayer.js","services/businesslayer/searchbusinesslayer.js","services/businesslayer/settingsbusinesslayer.js","services/businesslayer/tasksbusinesslayer.js","services/models/calendar.js","services/models/collectionsmodel.js","services/models/listsmodel.js","services/models/settingsmodel.js","services/models/tasksmodel.js","services/models/vtodo.js"],"names":["$","oc_requesttoken","undefined","config","$provide","$routeProvider","$interpolateProvider","$httpProvider","value","defaults","headers","common","requesttoken","when","otherwise","_update","run","$document","$rootScope","Config","$timeout","TasksBusinessLayer","ListsBusinessLayer","SearchBusinessLayer","timeOutUpdate","init","taskUpdateInterval","OCA","Search","tasks","moment","locale","event","calendar","$broadcast","sameDay","lastWeek","t","nextWeek","sameElse","diff","this","m","mm","h","hh","d","dd","M","MM","y","yy","AppController","controller","$scope","$route","status","$location","$routeParams","Loading","SettingsModel","Persistence","_$listsbusinesslayer","_$route","_$scope","_$status","_$timeout","_$location","_$routeparams","_Loading","_$settingsmodel","_persistence","newListName","settingsmodel","then","Promise","results","all","target","listparameter","length","route","calendarID","is","$event","closest","angular","isUndefined","path","collectionID","focusTaskInput","addingList","addSubtaskTo","isLoading","DetailsController","$window","TasksModel","ListsModel","_$window","_$tasksmodel","_tasksbusinesslayer","_$listsmodel","task","getById","taskID","getByUri","cats","categories","found","add","id","isAddingComment","names","timers","durations","name","loadTask","TaskState","related","params","invert","slice","start","deleteTask","$apply","editName","writable","setEditRoute","currentTarget","initDueDate","initStartDate","initReminder","endEdit","resetRoute","keyCode","type","deletePercent","deleteReminder","deleteReminderDate","toggleCompleted","setPercentComplete","toggleStarred","complete","setPriority","isDue","date","isOverDue","overdue","setstartday","setstarttime","setStart","deleteStartDate","setdueday","setduetime","setDue","deleteDueDate","isAllDayPossible","toggleAllDay","setAllDay","allDay","due","setreminderday","setremindertime","setReminderDate","reminderType","reminder","isValid","setReminder","addComment","comment","CommentContent","tmpID","time","Date","now","data","sendComment","deleteComment","commentStrings","commentID","input","button","addCategory","default_categories","indexOf","category","model","doUpdate","push","removeCategory","ListController","CollectionsModel","CalendarService","_$routeParams","_$tasksbusinesslayer","_$collectionsmodel","_$searchbusinesslayer","_$calendarservice","collections","draggedTasks","nameError","getAll","color","deleteMessage","replace","displayname","getStandardList","uri","startCreate","tooltip","isAddingList","startEdit","prepareUpdate","download","url","open","checkNew","checkEdit","cancelEdit","checkName","allowed","$input","isNameAllowed","check","preventDefault","msg","placement","trigger","$on","s","calendarUri","resetToPreviousState","saveEdit","rename","isNameAlreadyTaken","getCount","filter","hideCollection","collection","show","getFilter","dragoverList","listID","index","attr","dropList","item","changeCalendar","dragoverCollection","effectAllowed","dataTransfer","ctrlKey","dropCollection","changeCollection","dropEffect","SettingsController","Status","SettingsBusinessLayer","_$settingsbusinesslayer","collectionOptions","getStatus","startOfWeekOptions","setVisibility","setStartOfWeek","set","__indexOf","i","l","module","TasksController","_settingsbusinesslayer","_searchbusinesslayer","VTodo","vtodo","_vtodo","calendars","days","isAddingTask","focusInputField","addTask","taskName","_ref","parent","summary","priority","completed","note","startOf","format","openDetails","focusSubtaskInput","subtaskName","getAddString","isDefined","showSubtaskInput","taskname","hideSubtasks","uid","descendantIDs","loadedCompleted","toggle","filterTasks","getSubTasks","_i","_len","hideCompletedSubtasks","ret","hasNoParent","hasCompletedSubtasks","toggleSubtasks","toggleCompletedSubtasks","filterTasksByString","filteredTasks","dayHasEntry","taskAtDay","day","filterLists","getCountString","checkTaskInput","setLoadedCompleted","sortDue","sortStart","sortOrder","getSortOrderIcon","order","sortDirection","dropAsSubtask","parentID","changeParent","removeClass","newCalendar","queries","makeRootTask","children","addClass","allow","dragStart","dragEnd","directive","elm","find","menu","toggleClass","scope","focus","avatar","userid","$observe","size","saturation","hue","isArray","lightness","huePrime","red","chroma","Math","abs","floor","blue","secondComponent","green","lightnessAdjustment","rgbToHex","round","r","g","b","Array","listofcolours","toString","parseInt","randColour","String","random","hslToRgb","toHsl","prototype","forEach","hsl","hash","hslcolour","restrict","templateUrl","filePath","colors","selected","element","randomizeColour","pick","confirmationFunction","confirmationMessage","ConfirmationController","$element","$attrs","$compile","countdown","message","hasClass","stopPropagation","activate","bind","e","html","documentClick","unbind","onSelect","datepicker","inst","beforeShow","marginLeft","outerWidth","dp","css","margin-left","left","startOfWeek","minDate","options","selector","click","timeout","timepicker","atPosition","myPosition","minuteText","hourText","divTop","$watch","prev","outerHeight","count","isDate","fromNow","percent","string","ds","duration","token","tokenName","after","_this","service","DavClient","Calendar","discoverHome","callback","propFind","buildUrl","OC","linkToRemoteBase","NS_DAV","requestToken","response","props","propStat","wasRequestSuccessful","textContent","_currentUserPrincipal","NS_IETF","body","properties","_CALENDAR_HOME","split","_PROPERTIES","NS_APPLE","NS_OWNCLOUD","responseCode","getResponseCodeFromHTTPResponse","doesSupportVTodo","components","attributes","getNamedItem","j","toLowerCase","get","href","substr","create","document","cMkcalendar","setAttribute","createDocument","createElement","xmlDoc","appendChild","dProp","dSet","_createXMLForProperty","outerHTML","_suggestUri","request","enabled","_takenUrls","update","dPropUpdate","updatedProperties","resetUpdatedProperties","delete","oShare","shareType","shareWith","existingShare","implementation","oSet","dHref","Share","SHARE_TYPE_USER","SHARE_TYPE_GROUP","oSummary","owner","oRW","Content-Type","users","sharedWith","oRemove","user","groups","propName","oEnabled","dDisplayname","aOrder","aColor","cComponents","cComp","toUpperCase","acl","canWrite","getElementsByTagNameNS","k","writeNode","_isUriAlreadyTaken","lastPart","positionLastDash","match","firstPart","client","xmlNamespaces","dav","Client","linkToRemote","DAV:","urn:ietf:params:xml:ns:caldav","http://apple.com/ns/ical/","http://owncloud.org/ns","http://nextcloud.com/ns","NS_NEXTCLOUD","NS_CALENDARSERVER","location","protocol","window","host","root","updatePropertyWithValue","version","factory","decrease","Model","_dataMap","_filterCache","_data","_results","clearCache","_invalidateCache","entry","key","removeById","counter","splice","query","hashCode","exec","Request","$q","_$rootScope","_CalendarService","deferred","defer","successCallback","getCollections","getSettings","resolve","successCallbackWrapper","onSuccess","showLoading","failureCallbackWrapper","_request","onFailure","visibility","routeParams","setting","post","Publisher","_subscriptions","subscribeObjectTo","object","base","publishDataTo","ref","subscriber","handle","generate","$http","publisher","initialized","shelvedRequests","_executeShelvedRequests","defaultConfig","defaultData","extend","method","catch","put","_shelveRequest","RandomStringService","cCalQuery","dGetEtag","cCalendarData","cFilter","cCompFilterVCal","cCompFilterVTodo","cPropFilterCompleted","cIsNotDefined","cTextMatch","cPropFilterRelated","cTextMatchValue","createTextNode","Depth","vTodos","lastIndexOf","vTodo","{urn:ietf:params:xml:ns:caldav}calendar-data","{DAV:}getetag","xhr","getResponseHeader","returnTodo","_generateRandomUri","console","log","cancel","etag","__bind","fn","me","setFilter","attach","initialize","_$searchString","search","setRenderer","result","renderTaskResult","$row","$template","calendarid","isLoaded","clone","append","text","width","background-color","getColor","success","updateModel","VTodoService","_$vtodoservice","_$vtodo","ad","getTask","uncompleteParents","percentComplete","triggerUpdate","completeChildren","child","getChildren","getByUid","setHideSubtasks","hide","setHideCompletedSubtasks","momentToICALTime","asDate","ICAL","Time","fromDateString","reference","isAfter","olddue","year","month","hour","minute","isBefore","isSame","subtract","oldstart","checkReminderDate","second","p","newreminder","reminderdate","action","rel","seg","week","secondsToSegments","w","newTask","newVTodo","requests","$filter","vjournal","vevent","shareable","_updatedProperties","_properties","hasOwnProperty","shares","access","readWrite","startsWith","origin","_setUpdated","c","regex","_generateTextColor","_propertiesBackup","copy","dropPreviousState","toggleSharesEditor","list","brightness","editingShares","__hasProp","call","Ctor","_Model","__super__","__extends","_super","_nameCache","updateByUri","tmplist","_tmpIdCache","calendarcolor","getName","removeByList","taskIDs","_j","_len1","startdiff","duediff","hasSubtasks","getIdByUid","getDescendantIDs","concat","current","today","needle","ancestors","objectExists","getAncestor","keys","searchComments","comments","searchCategories","updateComment","com","icalfactory","loaded","jCal","Component","getAllSubcomponents","getFirstPropertyValue","updateLastModified","vtodos","removeProperty","completed_date","toJSDate","comp","getFirstProperty","getValues","setValues","prop","Property","addProperty","addSubcomponent"],"mappings":"CAAA,SAAAA,EAAYC,EAAAC,wBAKPC,OAAM,SAAA,UAAA,YAAA,YAAA,aAAA,aAAAA,QAAA,WAAA,iBAAA,uBAAA,gBAAA,SAAAC,EAAAC,EAAAC,EAAAC,GAIVH,EAAEI,MAAA,UACFD,gBAAcE,IACdJ,mBAAoB,MAEpBE,EAAEE,SAAAC,QAAAC,OAAAC,aAAAX,EACFI,EAAEQ,KAAA,6BAAAA,KAAA,iDAAAA,KAAA,2CAAAA,KAAA,oDAAAA,KAAA,2DAAAA,KAAA,+CAAAA,KAAA,wDAAAA,KAAA,+DAAAA,KAAA,iCAAAA,KAAA,4BAAAA,KAAA,0CAAAA,KAAA,0DAAAC,sDAKEC,OAAO,SAAAC,KAAA,YAAA,aAAA,SAAA,WAAA,qBAAA,qBAAA,sBAAA,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,MAGVR,GACAS,GAAAA,WACQJ,WACR,GAACI,EAKFP,OAJCQ,GAAW,W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AAO6D,KAAAA,KAAAA,OACrCrV,EAAMwR,wBAAwB,UAAWnc,KAAKqL,KAAAA,OAC9CV,EAAMwR,wBAAwB,gBAAiB7Q,KAAAA,KAAS9G,OACxDmG,EAAMwR,wBAAwB,MAAA6D,EAAyBxd,YACvDmI,EAAMwR,wBAAwB,UAAAnc,EAAAqL,SAC9BV,EAAI3K,wBAAc,WAAAA,EAAAsL,YACZ6Q,wBAAwB,mBAAoBnb,EAAAA,UAClD2J,EAAAwR,wBAAA,oBAAA,GACInc,EAAKwL,SACRb,EAAMwR,wBAAwB,aAAanc,EAAMgB,SAE9ChB,EAAK0D,MACRiH,EAAMwR,wBAAwB,cAAenc,EAACwL,MAE3CxL,EAAKoB,KACRuJ,EAAMwR,wBAAwB,MAAAnc,EAAWA,cAG1C2K,EAAOwR,wBAAuB,UAAEnc,EAAAoB,OAGzB,GAACsJ,GAAA1K,EAAArE,UACRslB,+CAAAmJ,EAAAxZ,iCAED","file":"app.min.js","sourcesContent":["'use strict';\n\nangular.module('Tasks', ['ngRoute', 'ngAnimate', 'ui.select', 'ngSanitize', 'dndLists']).config(['$provide', '$routeProvider', '$interpolateProvider', '$httpProvider', function ($provide, $routeProvider, $interpolateProvider, $httpProvider) {\n\t'use strict';\n\n\tvar config;\n\t$provide.value('Config', config = {\n\t\tmarkReadTimeout: 500,\n\t\ttaskUpdateInterval: 1000 * 600\n\t});\n\t$httpProvider.defaults.headers.common.requesttoken = oc_requesttoken;\n\t$routeProvider.when('/calendars/:calendarID', {}).when('/calendars/:calendarID/edit/:listparameter', {}).when('/calendars/:calendarID/tasks/:taskID', {}).when('/calendars/:calendarID/tasks/:taskID/settings', {}).when('/calendars/:calendarID/tasks/:taskID/edit/:parameter', {}).when('/collections/:collectionID/tasks/:taskID', {}).when('/collections/:collectionID/tasks/:taskID/settings', {}).when('/collections/:collectionID/tasks/:taskID/edit/:parameter', {}).when('/collections/:collectionID', {}).when('/search/:searchString', {}).when('/search/:searchString/tasks/:taskID', {}).when('/search/:searchString/tasks/:taskID/edit/:parameter', {}).otherwise({\n\t\tredirectTo: '/collections/all'\n\t});\n}]);\n\nangular.module('Tasks').run(['$document', '$rootScope', 'Config', '$timeout', 'ListsBusinessLayer', 'TasksBusinessLayer', 'SearchBusinessLayer', function ($document, $rootScope, Config, $timeout, TasksBusinessLayer, ListsBusinessLayer, SearchBusinessLayer) {\n\t'use strict';\n\n\tvar _update;\n\tvar init = false;\n\t(_update = function update() {\n\t\tvar timeOutUpdate;\n\t\ttimeOutUpdate = function timeOutUpdate() {\n\t\t\treturn $timeout(_update, Config.taskUpdateInterval);\n\t\t};\n\t\tinit = true;\n\t\treturn timeOutUpdate();\n\t}).call();\n\tOCA.Search.tasks = SearchBusinessLayer;\n\t$document.click(function (event) {\n\t\t$rootScope.$broadcast('documentClicked', event);\n\t});\n\tmoment.locale('details', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Due yesterday') + '], HH:mm',\n\t\t\tsameDay: '[' + t('tasks', 'Due today') + '], HH:mm',\n\t\t\tnextDay: '[' + t('tasks', 'Due tomorrow') + '], HH:mm',\n\t\t\tlastWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tnextWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tsameElse: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY, HH:mm'\n\t\t}\n\t});\n\tmoment.locale('details_allday', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Due yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Due today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Due tomorrow') + ']',\n\t\t\tlastWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY',\n\t\t\tnextWeek: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY',\n\t\t\tsameElse: '[' + t('tasks', 'Due on') + '] MMM DD, YYYY'\n\t\t}\n\t});\n\tmoment.locale('start', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Started yesterday') + '], HH:mm',\n\t\t\tsameDay: '[' + t('tasks', 'Starts today') + '], HH:mm',\n\t\t\tnextDay: '[' + t('tasks', 'Starts tomorrow') + '], HH:mm',\n\t\t\tlastWeek: '[' + t('tasks', 'Started on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tnextWeek: '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY, HH:mm',\n\t\t\tsameElse: function sameElse() {\n\t\t\t\tif (this.diff(moment()) > 0) {\n\t\t\t\t\treturn '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY, HH:mm';\n\t\t\t\t} else {\n\t\t\t\t\treturn '[' + t('tasks', 'Started on') + '] MMM DD, YYYY, HH:mm';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tmoment.locale('start_allday', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Started yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Starts today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Starts tomorrow') + ']',\n\t\t\tlastWeek: '[' + t('tasks', 'Started on') + '] MMM DD, YYYY',\n\t\t\tnextWeek: '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY',\n\t\t\tsameElse: function sameElse() {\n\t\t\t\tif (this.diff(moment()) > 0) {\n\t\t\t\t\treturn '[' + t('tasks', 'Starts on') + '] MMM DD, YYYY';\n\t\t\t\t} else {\n\t\t\t\t\treturn '[' + t('tasks', 'Started on') + '] MMM DD, YYYY';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tmoment.locale('reminder', {\n\t\tcalendar: {\n\t\t\tlastDay: t('tasks', '[Remind me yesterday at ]HH:mm'),\n\t\t\tsameDay: t('tasks', '[Remind me today at ]HH:mm'),\n\t\t\tnextDay: t('tasks', '[Remind me tomorrow at ]HH:mm'),\n\t\t\tlastWeek: t('tasks', '[Remind me on ]MMM DD, YYYY,[ at ]HH:mm'),\n\t\t\tnextWeek: t('tasks', '[Remind me on ]MMM DD, YYYY,[ at ]HH:mm'),\n\t\t\tsameElse: t('tasks', '[Remind me on ]MMM DD, YYYY,[ at ]HH:mm')\n\t\t}\n\t});\n\tmoment.locale('tasks', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Tomorrow') + ']',\n\t\t\tlastWeek: 'DD.MM.YYYY',\n\t\t\tnextWeek: 'DD.MM.YYYY',\n\t\t\tsameElse: 'DD.MM.YYYY'\n\t\t}\n\t});\n\tmoment.locale('details_short', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Today') + ']',\n\t\t\tnextDay: '[' + t('tasks', 'Tomorrow') + ']',\n\t\t\tlastWeek: 'MMM DD, YYYY',\n\t\t\tnextWeek: 'MMM DD, YYYY',\n\t\t\tsameElse: 'MMM DD, YYYY'\n\t\t}\n\t});\n\tmoment.locale('list_week', {\n\t\tcalendar: {\n\t\t\tlastDay: '[' + t('tasks', 'Yesterday') + ']',\n\t\t\tsameDay: '[' + t('tasks', 'Today') + '], MMM. DD',\n\t\t\tnextDay: '[' + t('tasks', 'Tomorrow') + '], MMM. DD',\n\t\t\tlastWeek: 'ddd, MMM. DD',\n\t\t\tnextWeek: 'ddd, MMM. DD',\n\t\t\tsameElse: 'ddd, MMM. DD'\n\t\t}\n\t});\n\treturn moment.locale('en', {\n\t\trelativeTime: {\n\t\t\tfuture: t('tasks', \"in %s\"),\n\t\t\tpast: t('tasks', \"%s ago\"),\n\t\t\ts: t('tasks', \"seconds\"),\n\t\t\tm: t('tasks', \"a minute\"),\n\t\t\tmm: t('tasks', \"%d minutes\"),\n\t\t\th: t('tasks', \"an hour\"),\n\t\t\thh: t('tasks', \"%d hours\"),\n\t\t\td: t('tasks', \"a day\"),\n\t\t\tdd: t('tasks', \"%d days\"),\n\t\t\tM: t('tasks', \"a month\"),\n\t\t\tMM: t('tasks', \"%d months\"),\n\t\t\ty: t('tasks', \"a year\"),\n\t\t\tyy: t('tasks', \"%d years\")\n\t\t}\n\t});\n}]);","'use strict';\n\nangular.module('Tasks').controller('AppController', ['$scope', '$rootScope', 'ListsBusinessLayer', '$route', 'Status', '$timeout', '$location', '$routeParams', 'Loading', 'SettingsModel', 'Persistence', function ($scope, $rootScope, ListsBusinessLayer, $route, status, $timeout, $location, $routeParams, Loading, SettingsModel, Persistence) {\n\t'use strict';\n\n\tvar AppController = function () {\n\t\tfunction AppController(_$scope, $rootScope, _$listsbusinesslayer, _$route, _$status, _$timeout, _$location, _$routeparams, _Loading, _$settingsmodel, _persistence) {\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$listsbusinesslayer = _$listsbusinesslayer;\n\t\t\tthis._$route = _$route;\n\t\t\tthis._$status = _$status;\n\t\t\tthis._$timeout = _$timeout;\n\t\t\tthis._$location = _$location;\n\t\t\tthis._$routeparams = _$routeparams;\n\t\t\tthis._Loading = _Loading;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$scope.status = this._$status.getStatus();\n\t\t\tthis._$scope.route = this._$routeparams;\n\t\t\tthis._$scope.status.newListName = \"\";\n\t\t\tthis._$scope.settingsmodel = this._$settingsmodel;\n\n\t\t\tthis._$listsbusinesslayer.init().then(function (results) {\n\t\t\t\tPromise.all(results).then(function () {\n\t\t\t\t\t$scope.$apply();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis._persistence.init();\n\n\t\t\tthis._$scope.closeAll = function ($event) {\n\t\t\t\tif ($($event.target).closest('.close-all').length || $($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\tif (!angular.isUndefined(_$scope.route.calendarID)) {\n\t\t\t\t\t\tif (_$scope.route.listparameter === 'name') {\n\t\t\t\t\t\t\t$rootScope.$broadcast('cancelEditCalendar', _$scope.route.calendarID);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t\t\t} else if (!angular.isUndefined(_$scope.route.collectionID)) {\n\t\t\t\t\t\t_$location.path('/collections/' + _$scope.route.collectionID);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_$location.path('/collections/all');\n\t\t\t\t\t}\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.status.focusTaskInput = false;\n\t\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t\t}\n\t\t\t\tif (!$($event.target).closest('.newList').length) {\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t\t}\n\t\t\t\tif (!$($event.target).closest('.add-subtask').length) {\n\t\t\t\t\t_$scope.status.addSubtaskTo = null;\n\t\t\t\t\t_$scope.status.focusSubtaskInput = false;\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.isLoading = function () {\n\t\t\t\treturn _Loading.isLoading();\n\t\t\t};\n\t\t}\n\t\treturn AppController;\n\t}();\n\treturn new AppController($scope, $rootScope, ListsBusinessLayer, $route, status, $timeout, $location, $routeParams, Loading, SettingsModel, Persistence);\n}]);","'use strict';\n\nangular.module('Tasks').controller('DetailsController', ['$scope', '$window', 'TasksModel', 'TasksBusinessLayer', '$route', '$location', '$timeout', '$routeParams', 'SettingsModel', 'Loading', 'ListsModel', function ($scope, $window, TasksModel, TasksBusinessLayer, $route, $location, $timeout, $routeParams, SettingsModel, Loading, ListsModel) {\n\t'use strict';\n\n\tvar DetailsController = function () {\n\t\tfunction DetailsController(_$scope, _$window, _$tasksmodel, _tasksbusinesslayer, _$route, _$location, _$timeout, _$routeparams, _$settingsmodel, _Loading, _$listsmodel) {\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$window = _$window;\n\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\tthis._tasksbusinesslayer = _tasksbusinesslayer;\n\t\t\tthis._$route = _$route;\n\t\t\tthis._$location = _$location;\n\t\t\tthis._$timeout = _$timeout;\n\t\t\tthis._$routeparams = _$routeparams;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._Loading = _Loading;\n\t\t\tthis._$scope.task = _$tasksmodel.getById(_$scope.route.taskID);\n\t\t\tthis._$scope.found = true;\n\t\t\tthis._$scope.$on('$routeChangeSuccess', function () {\n\t\t\t\tvar task = _$tasksmodel.getByUri(_$scope.route.taskID);\n\n\t\t\t\tif (!(angular.isUndefined(task) || task === null)) {\n\t\t\t\t\t_$scope.task = task;\n\t\t\t\t\t// Bind categories to task.cats as angular.ui/ui-select seems to have problems with Getter/Setter\n\t\t\t\t\t_$scope.task.cats = task.categories;\n\t\t\t\t\t_$scope.found = true;\n\t\t\t\t} else if (_$scope.route.taskID !== void 0) {\n\t\t\t\t\t_$scope.found = false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._$scope.settingsmodel = this._$settingsmodel;\n\t\t\tthis._$scope.settingsmodel.add({\n\t\t\t\t'id': 'various',\n\t\t\t\t'categories': []\n\t\t\t});\n\t\t\tthis._$scope.isAddingComment = false;\n\t\t\tthis._$scope.timers = [];\n\t\t\tthis._$scope.durations = [{\n\t\t\t\tname: t('tasks', 'week'),\n\t\t\t\tnames: t('tasks', 'weeks'),\n\t\t\t\tid: 'week'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'day'),\n\t\t\t\tnames: t('tasks', 'days'),\n\t\t\t\tid: 'day'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'hour'),\n\t\t\t\tnames: t('tasks', 'hours'),\n\t\t\t\tid: 'hour'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'minute'),\n\t\t\t\tnames: t('tasks', 'minutes'),\n\t\t\t\tid: 'minute'\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'second'),\n\t\t\t\tnames: t('tasks', 'seconds'),\n\t\t\t\tid: 'second'\n\t\t\t}];\n\t\t\tthis._$scope.loadTask = function (taskID) {\n\t\t\t\tvar task = _$tasksmodel.getByUri(_$scope.route.taskID);\n\t\t\t\tif (!(angular.isUndefined(task) || task === null)) {\n\t\t\t\t\t_$scope.task = task;\n\t\t\t\t\t_$scope.found = true;\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.TaskState = function () {\n\t\t\t\tif (_$scope.found) {\n\t\t\t\t\treturn 'found';\n\t\t\t\t} else {\n\t\t\t\t\tif (_Loading.isLoading()) {\n\t\t\t\t\t\treturn 'loading';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.params = [{\n\t\t\t\tname: t('tasks', 'before beginning'),\n\t\t\t\tinvert: true,\n\t\t\t\trelated: 'START',\n\t\t\t\tid: \"10\"\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'after beginning'),\n\t\t\t\tinvert: false,\n\t\t\t\trelated: 'START',\n\t\t\t\tid: \"00\"\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'before end'),\n\t\t\t\tinvert: true,\n\t\t\t\trelated: 'END',\n\t\t\t\tid: \"11\"\n\t\t\t}, {\n\t\t\t\tname: t('tasks', 'after end'),\n\t\t\t\tinvert: false,\n\t\t\t\trelated: 'END',\n\t\t\t\tid: \"01\"\n\t\t\t}];\n\t\t\tthis._$scope.filterParams = function (params) {\n\t\t\t\tvar task;\n\t\t\t\ttask = _$tasksmodel.getById(_$scope.route.taskID);\n\t\t\t\tif (!(angular.isUndefined(task) || task === null)) {\n\t\t\t\t\tif (task.due && task.start) {\n\t\t\t\t\t\treturn params;\n\t\t\t\t\t} else if (task.start) {\n\t\t\t\t\t\treturn params.slice(0, 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn params.slice(2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.deleteTask = function (task) {\n\t\t\t\treturn _$timeout(function () {\n\t\t\t\t\treturn _tasksbusinesslayer.deleteTask(task).then(function () {\n\t\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t}, 500);\n\t\t\t};\n\t\t\tthis._$scope.triggerUpdate = function (task) {\n\t\t\t\t_tasksbusinesslayer.triggerUpdate(task);\n\t\t\t};\n\t\t\tthis._$scope.editName = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif (!$($event.target).is('a')) {\n\t\t\t\t\t\t_$scope.setEditRoute('name');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editDueDate = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('duedate');\n\t\t\t\t\t\t_tasksbusinesslayer.initDueDate(task);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editStart = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('startdate');\n\t\t\t\t\t\t_tasksbusinesslayer.initStartDate(task);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editReminder = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('reminer');\n\t\t\t\t\t\treturn _tasksbusinesslayer.initReminder(_$scope.route.taskID);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editNote = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\tif (!$($event.target).is('a')) {\n\t\t\t\t\t\t\t_$scope.setEditRoute('note');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editPriority = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('priority');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.editPercent = function ($event, task) {\n\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\tif ($($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\t_$scope.setEditRoute('percent');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.endEdit = function ($event) {\n\t\t\t\tif ($($event.target).closest('.end-edit').length || $($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t_$scope.resetRoute();\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.endName = function ($event) {\n\t\t\t\tif ($event.keyCode === 13) {\n\t\t\t\t\t$event.preventDefault();\n\t\t\t\t\t_$scope.resetRoute();\n\t\t\t\t}\n\t\t\t\tif ($event.keyCode === 27) {\n\t\t\t\t\treturn _$scope.resetRoute();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.setEditRoute = function (type) {\n\t\t\t\tvar calendarID = _$scope.route.calendarID;\n\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\tif (calendarID) {\n\t\t\t\t\t$location.path('/calendars/' + calendarID + '/tasks/' + _$scope.route.taskID + '/edit/' + type);\n\t\t\t\t} else if (collectionID) {\n\t\t\t\t\t$location.path('/collections/' + collectionID + '/tasks/' + _$scope.route.taskID + '/edit/' + type);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.resetRoute = function () {\n\t\t\t\tvar calendarID = _$scope.route.calendarID;\n\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\tif (calendarID) {\n\t\t\t\t\t$location.path('/calendars/' + calendarID + '/tasks/' + _$scope.route.taskID);\n\t\t\t\t} else if (collectionID) {\n\t\t\t\t\t$location.path('/collections/' + collectionID + '/tasks/' + _$scope.route.taskID);\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.deletePercent = function (task) {\n\t\t\t\treturn _tasksbusinesslayer.setPercentComplete(task, 0);\n\t\t\t};\n\t\t\tthis._$scope.deleteReminder = function () {\n\t\t\t\treturn _tasksbusinesslayer.deleteReminderDate(_$scope.route.taskID);\n\t\t\t};\n\n\t\t\tthis._$scope.toggleCompleted = function (task) {\n\t\t\t\tif (task.completed) {\n\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 0);\n\t\t\t\t} else {\n\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 100);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.setPercentComplete = function (task, complete) {\n\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, complete);\n\t\t\t};\n\n\t\t\tthis._$scope.toggleStarred = function (task) {\n\t\t\t\tif (task.priority > 5) {\n\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 0);\n\t\t\t\t} else {\n\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 9);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.deletePriority = function (task) {\n\t\t\t\treturn _tasksbusinesslayer.setPriority(task, 0);\n\t\t\t};\n\t\t\tthis._$scope.isDue = function (date) {\n\t\t\t\treturn _$tasksmodel.due(date);\n\t\t\t};\n\t\t\tthis._$scope.isOverDue = function (date) {\n\t\t\t\treturn _$tasksmodel.overdue(date);\n\t\t\t};\n\n\t\t\tthis._$scope.setstartday = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setStart(_$scope.task, moment(date, 'MM/DD/YYYY'), 'day');\n\t\t\t};\n\t\t\tthis._$scope.setstarttime = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setStart(_$scope.task, moment(date, 'HH:mm'), 'time');\n\t\t\t};\n\t\t\tthis._$scope.deleteStartDate = function (task) {\n\t\t\t\t_tasksbusinesslayer.deleteStartDate(task);\n\t\t\t};\n\n\t\t\tthis._$scope.setdueday = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setDue(_$scope.task, moment(date, 'MM/DD/YYYY'), 'day');\n\t\t\t};\n\t\t\tthis._$scope.setduetime = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setDue(_$scope.task, moment(date, 'HH:mm'), 'time');\n\t\t\t};\n\t\t\tthis._$scope.deleteDueDate = function (task) {\n\t\t\t\t_tasksbusinesslayer.deleteDueDate(task);\n\t\t\t};\n\n\t\t\tthis._$scope.isAllDayPossible = function (task) {\n\t\t\t\treturn !angular.isUndefined(task) && task.calendar.writable && (task.due || task.start);\n\t\t\t};\n\t\t\tthis._$scope.toggleAllDay = function (task) {\n\t\t\t\t_tasksbusinesslayer.setAllDay(task, !task.allDay);\n\t\t\t};\n\n\t\t\tthis._$scope.setreminderday = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setReminderDate(_$scope.route.taskID, moment(date, 'MM/DD/YYYY'), 'day');\n\t\t\t};\n\t\t\tthis._$scope.setremindertime = function (date) {\n\t\t\t\treturn _tasksbusinesslayer.setReminderDate(_$scope.route.taskID, moment(date, 'HH:mm'), 'time');\n\t\t\t};\n\t\t\tthis._$scope.reminderType = function (task) {\n\t\t\t\tif (!angular.isUndefined(task)) {\n\t\t\t\t\tif (task.reminder === null) {\n\t\t\t\t\t\tif (moment(task.start, \"YYYYMMDDTHHmmss\").isValid() || moment(task.due, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\t\t\t\treturn 'DURATION';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn 'DATE-TIME';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.reminder.type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.changeReminderType = function (task) {\n\t\t\t\t_tasksbusinesslayer.checkReminderDate(task.id);\n\t\t\t\tif (this.reminderType(task) === 'DURATION') {\n\t\t\t\t\tif (task.reminder) {\n\t\t\t\t\t\ttask.reminder.type = 'DATE-TIME';\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttask.reminder = {\n\t\t\t\t\t\t\ttype: 'DATE-TIME'\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (task.reminder) {\n\t\t\t\t\t\ttask.reminder.type = 'DURATION';\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttask.reminder = {\n\t\t\t\t\t\t\ttype: 'DURATION'\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _tasksbusinesslayer.setReminder(task.id);\n\t\t\t};\n\t\t\tthis._$scope.setReminderDuration = function (taskID) {\n\t\t\t\treturn _tasksbusinesslayer.setReminder(_$scope.route.taskID);\n\t\t\t};\n\t\t\tthis._$scope.addComment = function () {\n\t\t\t\tvar comment,\n\t\t\t\t _this = this;\n\t\t\t\tif (_$scope.CommentContent) {\n\t\t\t\t\t_$scope.isAddingComment = true;\n\t\t\t\t\tcomment = {\n\t\t\t\t\t\ttmpID: 'newComment' + Date.now(),\n\t\t\t\t\t\tcomment: _$scope.CommentContent,\n\t\t\t\t\t\ttaskID: _$scope.route.taskID,\n\t\t\t\t\t\ttime: moment().format('YYYYMMDDTHHmmss'),\n\t\t\t\t\t\tname: $('#expandDisplayName').text()\n\t\t\t\t\t};\n\t\t\t\t\t_tasksbusinesslayer.addComment(comment, function (data) {\n\t\t\t\t\t\t_$tasksmodel.updateComment(data);\n\t\t\t\t\t\t_$scope.isAddingComment = false;\n\t\t\t\t\t}, function () {\n\t\t\t\t\t\t_$scope.isAddingComment = false;\n\t\t\t\t\t});\n\t\t\t\t\t_$scope.CommentContent = '';\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.sendComment = function (event) {\n\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\treturn _$scope.addComment();\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._$scope.deleteComment = function (commentID) {\n\t\t\t\treturn _tasksbusinesslayer.deleteComment(_$scope.route.taskID, commentID);\n\t\t\t};\n\t\t\tthis._$scope.commentStrings = function () {\n\t\t\t\treturn {\n\t\t\t\t\tbutton: t('tasks', 'Comment'),\n\t\t\t\t\tinput: t('tasks', 'Add a comment')\n\t\t\t\t};\n\t\t\t};\n\t\t\tthis._$scope.addCategory = function (category, model) {\n\t\t\t\t_$scope.task.categories = _$scope.task.cats;\n\t\t\t\tvar default_categories = _$scope.settingsmodel.getById('various').categories;\n\t\t\t\tif (default_categories.indexOf(category) < 0) {\n\t\t\t\t\tdefault_categories.push(category);\n\t\t\t\t}\n\t\t\t\t_tasksbusinesslayer.doUpdate(_$scope.task);\n\t\t\t};\n\t\t\tthis._$scope.removeCategory = function (category, model) {\n\t\t\t\t_$scope.task.categories = _$scope.task.cats;\n\t\t\t\t_tasksbusinesslayer.doUpdate(_$scope.task);\n\t\t\t};\n\t\t}\n\n\t\treturn DetailsController;\n\t}();\n\treturn new DetailsController($scope, $window, TasksModel, TasksBusinessLayer, $route, $location, $timeout, $routeParams, SettingsModel, Loading, ListsModel);\n}]);","'use strict';\n\nangular.module('Tasks').controller('ListController', ['$scope', '$rootScope', '$window', '$routeParams', 'ListsModel', 'TasksBusinessLayer', 'CollectionsModel', 'ListsBusinessLayer', '$location', 'SearchBusinessLayer', 'CalendarService', 'TasksModel', '$timeout', function ($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location, SearchBusinessLayer, CalendarService, TasksModel, $timeout) {\n\t'use strict';\n\n\tvar ListController;\n\tListController = function () {\n\t\tfunction ListController(_$scope, $rootScope, _$window, _$routeParams, _$listsmodel, _$tasksbusinesslayer, _$collectionsmodel, _$listsbusinesslayer, $location, _$searchbusinesslayer, _$calendarservice, _$tasksmodel, _$timeout) {\n\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$window = _$window;\n\t\t\tthis._$routeParams = _$routeParams;\n\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\tthis._$tasksbusinesslayer = _$tasksbusinesslayer;\n\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\tthis._$listsbusinesslayer = _$listsbusinesslayer;\n\t\t\tthis.$location = $location;\n\t\t\tthis._$timeout = _$timeout;\n\t\t\tthis._$searchbusinesslayer = _$searchbusinesslayer;\n\t\t\tthis._$calendarservice = _$calendarservice;\n\t\t\tthis._$scope.collections = this._$collectionsmodel.getAll();\n\t\t\tthis._$scope.calendars = this._$listsmodel.getAll();\n\t\t\tthis._$scope.draggedTasks = [];\n\t\t\tthis._$scope.TasksBusinessLayer = this._$tasksbusinesslayer;\n\t\t\tthis._$scope.nameError = false;\n\t\t\tthis._$scope.color = '#31CC7C';\n\n\t\t\tthis._$scope.deleteMessage = function (calendar) {\n\t\t\t\treturn t('tasks', 'This will delete the Calendar \"%s\" and all of its entries.').replace('%s', calendar.displayname);\n\t\t\t};\n\n\t\t\tthis._$scope[\"delete\"] = function (calendar) {\n\t\t\t\treturn _$listsbusinesslayer[\"delete\"](calendar).then(function () {\n\t\t\t\t\t$location.path('/calendars/' + _$listsmodel.getStandardList().uri);\n\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis._$scope.startCreate = function () {\n\t\t\t\t_$scope.status.addingList = true;\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\t_$timeout(function () {\n\t\t\t\t\t$('#newList').focus();\n\t\t\t\t}, 50);\n\t\t\t};\n\n\t\t\tthis._$scope.create = function () {\n\t\t\t\tvar check = _$scope.isNameAllowed(_$scope.status.newListName);\n\t\t\t\tif (check.allowed) {\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.isAddingList = true;\n\t\t\t\t\t_$listsbusinesslayer.add(_$scope.status.newListName, _$scope.color).then(function (calendar) {\n\t\t\t\t\t\t$location.path('/calendars/' + calendar.uri);\n\t\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t\t_$scope.status.newListName = '';\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.cancelCreate = function () {\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t};\n\n\t\t\tthis._$scope.startEdit = function (calendar) {\n\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\tcalendar.prepareUpdate();\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID + '/edit/name');\n\t\t\t\t_$timeout(function () {\n\t\t\t\t\t$('#list_' + calendar.uri + ' input.edit').focus();\n\t\t\t\t}, 50);\n\t\t\t};\n\n\t\t\tthis._$scope.showCalDAVUrl = function (calendar) {\n\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID + '/edit/caldav');\n\t\t\t\t_$timeout(function () {\n\t\t\t\t\t$('#list_' + calendar.uri + ' input.caldav').focus();\n\t\t\t\t}, 50);\n\t\t\t};\n\n\t\t\tthis._$scope.hideCalDAVUrl = function () {\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t};\n\n\t\t\tthis._$scope.download = function (calendar) {\n\t\t\t\tvar url = calendar.url;\n\t\t\t\t// cut off last slash to have a fancy name for the ics\n\t\t\t\tif (url.slice(url.length - 1) === '/') {\n\t\t\t\t\turl = url.slice(0, url.length - 1);\n\t\t\t\t}\n\t\t\t\turl += '?export';\n\t\t\t\t$window.open(url);\n\t\t\t};\n\n\t\t\tthis._$scope.checkNew = function (event, name) {\n\t\t\t\t_$scope.checkName(event, name);\n\t\t\t};\n\n\t\t\tthis._$scope.checkEdit = function (event, calendar) {\n\t\t\t\t_$scope.checkName(event, calendar.displayname, calendar.uri);\n\t\t\t\tif (event.keyCode === 27) {\n\t\t\t\t\t_$scope.cancelEdit(calendar);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.checkName = function (event, name, uri) {\n\t\t\t\tvar check = _$scope.isNameAllowed(name, uri);\n\t\t\t\tvar $input = $(event.currentTarget);\n\t\t\t\tif (!check.allowed) {\n\t\t\t\t\t$input.attr('title', check.msg).tooltip({ placement: 'bottom', trigger: 'manual' }).tooltip('fixTitle').tooltip('show');\n\t\t\t\t\t_$scope.nameError = true;\n\t\t\t\t} else {\n\t\t\t\t\t$input.tooltip('hide');\n\t\t\t\t\t_$scope.nameError = false;\n\t\t\t\t}\n\t\t\t\tif (event.keyCode === 27) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t$input.tooltip('hide');\n\t\t\t\t\t_$scope.status.addingList = false;\n\t\t\t\t\t_$scope.status.newListName = \"\";\n\t\t\t\t\t_$scope.nameError = false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t$rootScope.$on('cancelEditCalendar', function (s, calendarUri) {\n\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarUri);\n\t\t\t\t_$scope.cancelEdit(calendar);\n\t\t\t});\n\n\t\t\tthis._$scope.cancelEdit = function (calendar) {\n\t\t\t\tcalendar.resetToPreviousState();\n\t\t\t\t$('.hasTooltip').tooltip('hide');\n\t\t\t\t_$scope.nameError = false;\n\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t};\n\n\t\t\tthis._$scope.saveEdit = function (calendar) {\n\t\t\t\tvar check = _$scope.isNameAllowed(calendar.displayname, calendar.uri);\n\t\t\t\tif (check.allowed) {\n\t\t\t\t\t_$listsbusinesslayer.rename(calendar);\n\t\t\t\t\t$location.path('/calendars/' + _$scope.route.calendarID);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.isNameAllowed = function (name, uri) {\n\t\t\t\tvar check = {\n\t\t\t\t\tallowed: false,\n\t\t\t\t\tmsg: ''\n\t\t\t\t};\n\t\t\t\tif (_$listsmodel.isNameAlreadyTaken(name, uri)) {\n\t\t\t\t\tcheck.msg = t('tasks', 'The name \"%s\" is already used.').replace('%s', name);\n\t\t\t\t} else if (!name) {\n\t\t\t\t\tcheck.msg = t('tasks', 'An empty name is not allowed.');\n\t\t\t\t} else {\n\t\t\t\t\tcheck.allowed = true;\n\t\t\t\t}\n\t\t\t\treturn check;\n\t\t\t};\n\n\t\t\tthis._$scope.getCollectionCount = function (collectionID) {\n\t\t\t\tvar filter;\n\t\t\t\tfilter = _$searchbusinesslayer.getFilter();\n\t\t\t\treturn _$collectionsmodel.getCount(collectionID, filter);\n\t\t\t};\n\n\t\t\tthis._$scope.hideCollection = function (collectionID) {\n\t\t\t\tvar collection;\n\t\t\t\tcollection = _$collectionsmodel.getById(collectionID);\n\t\t\t\tswitch (collection.show) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\treturn this.getCollectionCount(collectionID) < 1;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.getCollectionString = function (collectionID) {\n\t\t\t\tvar filter;\n\t\t\t\tif (collectionID !== 'completed') {\n\t\t\t\t\tfilter = _$searchbusinesslayer.getFilter();\n\t\t\t\t\treturn _$collectionsmodel.getCount(collectionID, filter);\n\t\t\t\t} else {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis._$scope.getListCount = function (listID, type) {\n\t\t\t\tvar filter;\n\t\t\t\tfilter = _$searchbusinesslayer.getFilter();\n\t\t\t\treturn _$listsmodel.getCount(listID, type, filter);\n\t\t\t};\n\n\t\t\tthis._$scope.dragoverList = function ($event, index) {\n\t\t\t\tvar calendarID = $($event.target).closest('li.list').attr('calendarID');\n\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\treturn calendar.writable;\n\t\t\t};\n\n\t\t\tthis._$scope.dropList = function ($event, index, item) {\n\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\t// we can't simply use item as task, since the directive seems to not copy all properties --> task.calendar.uri == undefined\n\t\t\t\t\tvar task = _$tasksmodel.getByUri(item.uri);\n\t\t\t\t\tvar calendarID = $($event.target).closest('li.list').attr('calendarID');\n\t\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\t\t_$tasksbusinesslayer.changeCalendar(task, calendar).then(function () {\n\t\t\t\t\t\t_$scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tthis._$scope.dragoverCollection = function ($event, index) {\n\t\t\t\tif ($event.dataTransfer.effectAllowed === 'copy' || $event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tvar collectionID;\n\t\t\t\tcollectionID = $($event.target).closest('li.collection').attr('collectionID');\n\t\t\t\treturn collectionID === 'starred' || collectionID === 'completed' || collectionID === 'today';\n\t\t\t};\n\n\t\t\tthis._$scope.dropCollection = function ($event, index, item) {\n\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\tvar collectionID = $($event.target).closest('li.collection').attr('collectionID');\n\t\t\t\t\t_$tasksbusinesslayer.changeCollection(item.uri, collectionID);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\t\t}\n\t\treturn ListController;\n\t}();\n\treturn new ListController($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location, SearchBusinessLayer, CalendarService, TasksModel, $timeout);\n}]);","'use strict';\n\nangular.module('Tasks').controller('SettingsController', ['$scope', '$window', 'Status', '$location', 'CollectionsModel', 'SettingsBusinessLayer', 'SettingsModel', function ($scope, $window, Status, $location, CollectionsModel, SettingsBusinessLayer, SettingsModel) {\n\t'use strict';\n\n\tvar SettingsController;\n\tSettingsController = function () {\n\t\tfunction SettingsController(_$scope, _$window, _$status, _$location, _$collectionsmodel, _$settingsbusinesslayer, _$settingsmodel) {\n\t\t\tvar _this = this;\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$window = _$window;\n\t\t\tthis._$status = _$status;\n\t\t\tthis._$location = _$location;\n\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\tthis._$settingsbusinesslayer = _$settingsbusinesslayer;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._$scope.status = this._$status.getStatus();\n\t\t\tthis._$scope.collections = this._$collectionsmodel.getAll();\n\t\t\tthis._$scope.settingsmodel = this._$settingsmodel;\n\t\t\tthis._$scope.collectionOptions = [{\n\t\t\t\tid: 0,\n\t\t\t\tname: t('tasks', 'Hidden')\n\t\t\t}, {\n\t\t\t\tid: 1,\n\t\t\t\tname: t('tasks', 'Visible')\n\t\t\t}, {\n\t\t\t\tid: 2,\n\t\t\t\tname: t('tasks', 'Automatic')\n\t\t\t}];\n\t\t\tthis._$scope.startOfWeekOptions = [{\n\t\t\t\tid: 0,\n\t\t\t\tname: t('tasks', 'Sunday')\n\t\t\t}, {\n\t\t\t\tid: 1,\n\t\t\t\tname: t('tasks', 'Monday')\n\t\t\t}, {\n\t\t\t\tid: 2,\n\t\t\t\tname: t('tasks', 'Tuesday')\n\t\t\t}, {\n\t\t\t\tid: 3,\n\t\t\t\tname: t('tasks', 'Wednesday')\n\t\t\t}, {\n\t\t\t\tid: 4,\n\t\t\t\tname: t('tasks', 'Thursday')\n\t\t\t}, {\n\t\t\t\tid: 5,\n\t\t\t\tname: t('tasks', 'Friday')\n\t\t\t}, {\n\t\t\t\tid: 6,\n\t\t\t\tname: t('tasks', 'Saturday')\n\t\t\t}];\n\t\t\tthis._$scope.setVisibility = function (collectionID) {\n\t\t\t\tvar collection;\n\t\t\t\tcollection = _$collectionsmodel.getById(collectionID);\n\t\t\t\treturn _$settingsbusinesslayer.setVisibility(collectionID, collection.show);\n\t\t\t};\n\t\t\tthis._$scope.setStartOfWeek = function () {\n\t\t\t\treturn _$settingsbusinesslayer.set('various', 'startOfWeek', _$settingsmodel.getById('various').startOfWeek);\n\t\t\t};\n\t\t}\n\n\t\treturn SettingsController;\n\t}();\n\treturn new SettingsController($scope, $window, Status, $location, CollectionsModel, SettingsBusinessLayer, SettingsModel);\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').controller('TasksController', ['$scope', '$window', '$routeParams', 'TasksModel', 'ListsModel', 'CollectionsModel', 'TasksBusinessLayer', '$location', 'SettingsBusinessLayer', 'SearchBusinessLayer', 'VTodo', 'SettingsModel', function ($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer, SearchBusinessLayer, VTodo, SettingsModel) {\n\t\tvar TasksController;\n\t\tTasksController = function () {\n\t\t\tfunction TasksController(_$scope, _$window, _$routeParams, _$tasksmodel, _$listsmodel, _$collectionsmodel, _tasksbusinesslayer, $location, _settingsbusinesslayer, _searchbusinesslayer, vtodo, _$settingsmodel) {\n\t\t\t\tvar _this = this;\n\t\t\t\tthis._$scope = _$scope;\n\t\t\t\tthis._$window = _$window;\n\t\t\t\tthis._$routeParams = _$routeParams;\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\t\tthis._tasksbusinesslayer = _tasksbusinesslayer;\n\t\t\t\tthis.$location = $location;\n\t\t\t\tthis._settingsbusinesslayer = _settingsbusinesslayer;\n\t\t\t\tthis._searchbusinesslayer = _searchbusinesslayer;\n\t\t\t\tthis._vtodo = vtodo;\n\t\t\t\tthis._$scope.tasks = this._$tasksmodel.getAll();\n\t\t\t\tthis._$scope.draggedTasks = [];\n\t\t\t\tthis._$scope.calendars = this._$listsmodel.getAll();\n\t\t\t\tthis._$scope.days = [0, 1, 2, 3, 4, 5, 6];\n\t\t\t\tthis._$scope.isAddingTask = false;\n\t\t\t\tthis._$scope.focusInputField = false;\n\t\t\t\tthis._$scope.TasksModel = this._$tasksmodel;\n\t\t\t\tthis._$scope.TasksBusinessLayer = this._tasksbusinesslayer;\n\t\t\t\tthis._$settingsmodel = _$settingsmodel;\n\n\t\t\t\tthis._$scope.addTask = function (taskName, related, calendar, parent) {\n\t\t\t\t\tvar _ref,\n\t\t\t\t\t _this = this;\n\t\t\t\t\tif (calendar === null) {\n\t\t\t\t\t\tcalendar = '';\n\t\t\t\t\t}\n\t\t\t\t\t_$scope.isAddingTask = true;\n\t\t\t\t\tvar task = {\n\t\t\t\t\t\tcalendar: null,\n\t\t\t\t\t\trelated: related,\n\t\t\t\t\t\tsummary: taskName,\n\t\t\t\t\t\tpriority: '0',\n\t\t\t\t\t\tdue: false,\n\t\t\t\t\t\tstart: false,\n\t\t\t\t\t\treminder: null,\n\t\t\t\t\t\tcompleted: false,\n\t\t\t\t\t\tcomplete: '0',\n\t\t\t\t\t\tnote: ''\n\t\t\t\t\t};\n\t\t\t\t\tif ((_ref = _$scope.route.collectionID) === 'starred' || _ref === 'today' || _ref === 'week' || _ref === 'all' || _ref === 'completed' || _ref === 'current') {\n\t\t\t\t\t\tif (related) {\n\t\t\t\t\t\t\ttask.calendar = calendar;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttask.calendar = _$listsmodel.getStandardList();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_$scope.route.collectionID === 'starred') {\n\t\t\t\t\t\t\ttask.priority = '1';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_$scope.route.collectionID === 'today') {\n\t\t\t\t\t\t\ttask.due = moment().startOf('day').format(\"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_$scope.route.collectionID === 'current') {\n\t\t\t\t\t\t\ttask.start = moment().format(\"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttask.calendar = _$listsmodel.getByUri(_$scope.route.calendarID);\n\t\t\t\t\t}\n\t\t\t\t\ttask = VTodo.create(task);\n\t\t\t\t\t_tasksbusinesslayer.add(task).then(function (task) {\n\t\t\t\t\t\t_$scope.isAddingTask = false;\n\t\t\t\t\t\t_$scope.openDetails(task.uri, null);\n\t\t\t\t\t\treturn $scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t_tasksbusinesslayer.setHideSubtasks(parent, 0);\n\t\t\t\t\t}\n\t\t\t\t\t_$scope.status.focusTaskInput = false;\n\t\t\t\t\t_$scope.status.focusSubtaskInput = false;\n\t\t\t\t\t_$scope.status.addSubtaskTo = null;\n\t\t\t\t\t_$scope.status.taskName = '';\n\t\t\t\t\t_$scope.status.subtaskName = '';\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getAddString = function () {\n\t\t\t\t\tvar calendar = _$listsmodel.getStandardList();\n\t\t\t\t\tif (angular.isDefined(calendar)) {\n\t\t\t\t\t\tif (angular.isDefined(_$scope.route.collectionID)) {\n\t\t\t\t\t\t\tswitch (_$scope.route.collectionID) {\n\t\t\t\t\t\t\t\tcase 'starred':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add an important item in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'today':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add an item due today in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'all':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add an item in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'current':\n\t\t\t\t\t\t\t\t\treturn t('tasks', 'Add a current item in \"%s\"...').replace('%s', calendar.displayname);\n\t\t\t\t\t\t\t\tcase 'completed':\n\t\t\t\t\t\t\t\tcase 'week':\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (angular.isDefined(_$listsmodel.getByUri(_$scope.route.calendarID))) {\n\t\t\t\t\t\t\t\treturn t('tasks', 'Add an item in \"%s\"...').replace('%s', _$listsmodel.getByUri(_$scope.route.calendarID).displayname);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSubAddString = function (taskname) {\n\t\t\t\t\treturn t('tasks', 'Add a subtask to \"%s\"...').replace('%s', taskname);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.showSubtaskInput = function (uid) {\n\t\t\t\t\t_$scope.status.addSubtaskTo = uid;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hideSubtasks = function (task) {\n\t\t\t\t\tvar taskID = _$scope.route.taskID;\n\t\t\t\t\tvar descendantIDs = _$tasksmodel.getDescendantIDs(task);\n\t\t\t\t\tif (task.uri === taskID) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if (__indexOf.call(descendantIDs, taskID) >= 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.hideSubtasks;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.showInput = function () {\n\t\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\t\tvar calendar = _$listsmodel.getByUri(_$scope.route.calendarID);\n\t\t\t\t\tif (collectionID === 'completed' || collectionID === 'week') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (angular.isDefined(calendar)) {\n\t\t\t\t\t\treturn calendar.writable;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.focusTaskInput = function () {\n\t\t\t\t\t_$scope.status.focusTaskInput = true;\n\t\t\t\t};\n\t\t\t\tthis._$scope.focusSubtaskInput = function () {\n\t\t\t\t\t_$scope.status.focusSubtaskInput = true;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.openDetails = function (id, $event) {\n\t\t\t\t\tvar calendarID = _$scope.route.calendarID;\n\t\t\t\t\tvar collectionID = _$scope.route.collectionID;\n\t\t\t\t\tif ($event === null || $($event.currentTarget).is($($event.target).closest('.handler'))) {\n\t\t\t\t\t\tvar parent = _$tasksmodel.getByUri(id);\n\t\t\t\t\t\tif (!parent.loadedCompleted) {\n\t\t\t\t\t\t\t_tasksbusinesslayer.getAll(parent.calendar, true, parent).then(function () {\n\t\t\t\t\t\t\t\tparent.loadedCompleted = true;\n\t\t\t\t\t\t\t\t$scope.$apply();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (calendarID) {\n\t\t\t\t\t\t\t$location.path('/calendars/' + calendarID + '/tasks/' + id);\n\t\t\t\t\t\t} else if (collectionID) {\n\t\t\t\t\t\t\t$location.path('/collections/' + collectionID + '/tasks/' + id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleCompleted = function (task) {\n\t\t\t\t\tif (task.completed) {\n\t\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_tasksbusinesslayer.setPercentComplete(task, 100);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleStarred = function (task) {\n\t\t\t\t\tif (task.priority > 5) {\n\t\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_tasksbusinesslayer.setPriority(task, 9);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleHidden = function () {\n\t\t\t\t\treturn _settingsbusinesslayer.toggle('various', 'showHidden');\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.filterTasks = function (task, filter) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\treturn _$tasksmodel.filterTasks(task, filter);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSubTasks = function (tasks, parent) {\n\t\t\t\t\tvar ret, task, _i, _len;\n\t\t\t\t\tret = [];\n\t\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\t\tif (task.related === parent.uid && task !== parent && !(parent.hideCompletedSubtasks && task.completed)) {\n\t\t\t\t\t\t\tret.push(task);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn ret;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hasNoParent = function (task) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\treturn _$tasksmodel.hasNoParent(task);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hasSubtasks = function (task) {\n\t\t\t\t\treturn _$tasksmodel.hasSubtasks(task.uid);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.hasCompletedSubtasks = function (task) {\n\t\t\t\t\treturn _$tasksmodel.hasCompletedSubtasks(task.uid);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleSubtasks = function (task) {\n\t\t\t\t\t_tasksbusinesslayer.setHideSubtasks(task, !task.hideSubtasks);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.toggleCompletedSubtasks = function (task) {\n\t\t\t\t\t_tasksbusinesslayer.setHideCompletedSubtasks(task, !task.hideCompletedSubtasks);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.filterTasksByString = function (task) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\tvar filter = _searchbusinesslayer.getFilter();\n\t\t\t\t\t\treturn _$tasksmodel.filterTasksByString(task, filter);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.filteredTasks = function () {\n\t\t\t\t\tvar filter;\n\t\t\t\t\tfilter = _searchbusinesslayer.getFilter();\n\t\t\t\t\treturn _$tasksmodel.filteredTasks(filter);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dayHasEntry = function () {\n\t\t\t\t\treturn function (date) {\n\t\t\t\t\t\tvar filter, task, tasks, _i, _len;\n\t\t\t\t\t\tfilter = _searchbusinesslayer.getFilter();\n\t\t\t\t\t\ttasks = _$tasksmodel.filteredTasks(filter);\n\t\t\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\t\t\tif (task.completed || !_$tasksmodel.hasNoParent(task)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (_$tasksmodel.taskAtDay(task, date)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tthis._$scope.taskAtDay = function (task, day) {\n\t\t\t\t\treturn function (task) {\n\t\t\t\t\t\treturn _$tasksmodel.taskAtDay(task, day);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tthis._$scope.filterLists = function () {\n\t\t\t\t\treturn function (calendar) {\n\t\t\t\t\t\treturn _$scope.getCount(calendar.uri, _$scope.route.collectionID);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getCount = function (calendarID, type) {\n\t\t\t\t\tvar filter = _searchbusinesslayer.getFilter();\n\t\t\t\t\treturn _$listsmodel.getCount(calendarID, type, filter);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getCountString = function (calendarID, type) {\n\t\t\t\t\tvar filter = _searchbusinesslayer.getFilter();\n\t\t\t\t\treturn n('tasks', '%n Completed Task', '%n Completed Tasks', _$listsmodel.getCount(calendarID, type, filter));\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.checkTaskInput = function ($event) {\n\t\t\t\t\tif ($event.keyCode === 27) {\n\t\t\t\t\t\t$($event.currentTarget).blur();\n\t\t\t\t\t\t_$scope.status.taskName = '';\n\t\t\t\t\t\t_$scope.status.subtaskName = '';\n\t\t\t\t\t\t_$scope.status.addSubtaskTo = null;\n\t\t\t\t\t\t_$scope.status.focusTaskInput = false;\n\t\t\t\t\t\t_$scope.status.focusSubtaskInput = false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getCompletedTasks = function (calendarID) {\n\t\t\t\t\tvar calendar = _$listsmodel.getById(calendarID);\n\t\t\t\t\t_tasksbusinesslayer.getAll(calendar, true).then(function () {\n\t\t\t\t\t\t_$listsmodel.setLoadedCompleted(calendarID);\n\t\t\t\t\t\t$scope.$apply();\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.loadedCompleted = function (calendarID) {\n\t\t\t\t\treturn _$listsmodel.loadedCompleted(calendarID);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.sortDue = function (task) {\n\t\t\t\t\tif (task.due === null) {\n\t\t\t\t\t\treturn 'last';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.due;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.sortStart = function (task) {\n\t\t\t\t\tif (task.start === null) {\n\t\t\t\t\t\treturn 'last';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn task.start;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSortOrder = function () {\n\t\t\t\t\tswitch (_$scope.settingsmodel.getById('various').sortOrder) {\n\t\t\t\t\t\tcase 'due':\n\t\t\t\t\t\t\treturn _$scope.sortDue;\n\t\t\t\t\t\tcase 'start':\n\t\t\t\t\t\t\treturn _$scope.sortStart;\n\t\t\t\t\t\tcase 'priority':\n\t\t\t\t\t\t\treturn '-priority';\n\t\t\t\t\t\tcase 'alphabetically':\n\t\t\t\t\t\t\treturn 'summary';\n\t\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t\treturn 'manual';\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn ['completed', _$scope.sortDue, '-priority', _$scope.sortStart, 'summary'];\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.getSortOrderIcon = function () {\n\t\t\t\t\tswitch (_$scope.settingsmodel.getById('various').sortOrder) {\n\t\t\t\t\t\tcase 'due':\n\t\t\t\t\t\tcase 'start':\n\t\t\t\t\t\t\treturn 'icon-calendar';\n\t\t\t\t\t\tcase 'priority':\n\t\t\t\t\t\t\treturn 'icon-task-star';\n\t\t\t\t\t\tcase 'alphabetically':\n\t\t\t\t\t\t\treturn 'icon-alphabetically';\n\t\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t\treturn 'icon-manual';\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn 'icon-menu';\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.setSortOrder = function ($event, order) {\n\t\t\t\t\t_$scope.settingsmodel.getById('various').sortDirection = _$scope.settingsmodel.getById('various').sortOrder === order ? +!_$scope.settingsmodel.getById('various').sortDirection : 0;\n\t\t\t\t\t_$scope.settingsmodel.getById('various').sortOrder = order;\n\t\t\t\t\t_settingsbusinesslayer.set('various', 'sortOrder', order);\n\t\t\t\t\t_settingsbusinesslayer.set('various', 'sortDirection', _$scope.settingsmodel.getById('various').sortDirection);\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dropAsSubtask = function ($event, item, index) {\n\t\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\t\tvar parentID = $($event.target).closest('.task-item').attr('taskID');\n\t\t\t\t\t\tvar task = _$tasksmodel.getByUri(item.uri);\n\t\t\t\t\t\tvar parent = _$tasksmodel.getByUri(parentID);\n\t\t\t\t\t\t_tasksbusinesslayer.changeParent(task, parent);\n\t\t\t\t\t}\n\t\t\t\t\t$('.subtasks-container').removeClass('dropzone-visible');\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dropAsRootTask = function ($event, item, index) {\n\t\t\t\t\tif ($event.dataTransfer.dropEffect === 'move') {\n\t\t\t\t\t\tvar task = _$tasksmodel.getByUri(item.uri);\n\t\t\t\t\t\tvar collectionID = $($event.target).closest('ol[dnd-list]').attr('collectionID');\n\t\t\t\t\t\tvar calendarID = $($event.target).closest('ol[dnd-list]').attr('calendarID');\n\t\t\t\t\t\tvar newCalendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\t\t\tvar queries = _tasksbusinesslayer.makeRootTask(task, newCalendar, collectionID);\n\t\t\t\t\t\tPromise.all(queries).then(function () {\n\t\t\t\t\t\t\t$scope.$apply();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t$('.subtasks-container').removeClass('dropzone-visible');\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dragover = function ($event, item, index) {\n\t\t\t\t\t$('.subtasks-container').removeClass('dropzone-visible');\n\t\t\t\t\tvar calendarID = $($event.target).closest('ol[dnd-list]').attr('calendarID');\n\t\t\t\t\tvar calendar = _$listsmodel.getByUri(calendarID);\n\t\t\t\t\tif (calendar.writable) {\n\t\t\t\t\t\t$($event.target).closest('.task-item').children('.subtasks-container').addClass('dropzone-visible');\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.allow = function (task) {\n\t\t\t\t\tif (task.calendar.writable) {\n\t\t\t\t\t\treturn \"copyMove\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn \"copy\";\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dragStart = function ($event) {\n\t\t\t\t\tif ($event.dataTransfer.effectAllowed === 'copy' || $event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey) {\n\t\t\t\t\t\t$($event.target).addClass('copy');\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._$scope.dragEnd = function ($event) {\n\t\t\t\t\t$($event.target).removeClass('copy');\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn TasksController;\n\t\t}();\n\t\treturn new TasksController($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer, SearchBusinessLayer, VTodo, SettingsModel);\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').directive('appNavigationEntryUtils', function () {\n 'use strict';\n\n return {\n restrict: 'C',\n link: function link(scope, elm) {\n var button, menu;\n menu = elm.siblings('.app-navigation-entry-menu');\n button = $(elm).find('.app-navigation-entry-utils-menu-button button');\n button.click(function () {\n menu.toggleClass('open');\n });\n scope.$on('documentClicked', function (scope, event) {\n if (event.target !== button[0]) {\n menu.removeClass('open');\n }\n });\n }\n };\n});","'use strict';\n\nangular.module('Tasks').directive('autofocusOnInsert', function () {\n 'use strict';\n\n return function (scope, elm) {\n return elm.focus();\n };\n});","'use strict';\n\nangular.module('Tasks').directive('avatar', function () {\n 'use strict';\n\n return {\n restrict: 'A',\n scope: false,\n link: function link(scope, elm, attr) {\n return attr.$observe('userid', function () {\n if (attr.userid) {\n return elm.avatar(attr.userid, attr.size);\n }\n });\n }\n };\n});","'use strict';\n\nvar hslToRgb = function hslToRgb(hue, saturation, lightness) {\n\t'use strict';\n\t// based on algorithm from http://en.wikipedia.org/wiki/HSL_and_HSV#Converting_to_RGB\n\n\tif (Array.isArray(hue)) {\n\t\tsaturation = hue[1];\n\t\tlightness = hue[2];\n\t\thue = hue[0];\n\t}\n\tif (hue === undefined) {\n\t\treturn [0, 0, 0];\n\t}\n\tsaturation /= 100;\n\tlightness /= 100;\n\n\tvar chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;\n\tvar huePrime = hue / 60;\n\tvar secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n\n\thuePrime = Math.floor(huePrime);\n\tvar red;\n\tvar green;\n\tvar blue;\n\n\tif (huePrime === 0) {\n\t\tred = chroma;\n\t\tgreen = secondComponent;\n\t\tblue = 0;\n\t} else if (huePrime === 1) {\n\t\tred = secondComponent;\n\t\tgreen = chroma;\n\t\tblue = 0;\n\t} else if (huePrime === 2) {\n\t\tred = 0;\n\t\tgreen = chroma;\n\t\tblue = secondComponent;\n\t} else if (huePrime === 3) {\n\t\tred = 0;\n\t\tgreen = secondComponent;\n\t\tblue = chroma;\n\t} else if (huePrime === 4) {\n\t\tred = secondComponent;\n\t\tgreen = 0;\n\t\tblue = chroma;\n\t} else if (huePrime === 5) {\n\t\tred = chroma;\n\t\tgreen = 0;\n\t\tblue = secondComponent;\n\t}\n\n\tvar lightnessAdjustment = lightness - chroma / 2;\n\tred += lightnessAdjustment;\n\tgreen += lightnessAdjustment;\n\tblue += lightnessAdjustment;\n\n\treturn [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];\n};\n\nvar rgbToHex = function rgbToHex(r, g, b) {\n\t'use strict';\n\n\tif (Array.isArray(r)) {\n\t\tg = r[1];\n\t\tb = r[2];\n\t\tr = r[0];\n\t}\n\treturn '#' + parseInt(r, 10).toString(16) + parseInt(g, 10).toString(16) + parseInt(b, 10).toString(16);\n};\n\nvar listofcolours = ['#31CC7C', '#317CCC', '#FF7A66', '#F1DB50', '#7C31CC', '#CC317C', '#3A3B3D', '#CACBCD'];\n\nvar randColour = function randColour() {\n\t'use strict';\n\n\tif (typeof String.prototype.toHsl === 'function') {\n\t\treturn rgbToHex(hslToRgb(Math.random().toString().toHsl()));\n\t} else {\n\t\treturn listofcolours[Math.floor(Math.random() * listofcolours.length)];\n\t}\n};\n\nangular.module('Tasks').directive('colorpicker', function () {\n\t'use strict';\n\n\tif (typeof String.prototype.toHsl === 'function') {\n\t\tvar hsl = \"\";\n\t\tvar hslcolour = \"\";\n\t\t//\t\t 0 40 80 120 160 200 240 280 320\n\t\tlistofcolours = [\"15\", \"9\", \"4\", \"b\", \"6\", \"11\", \"74\", \"f\", \"57\"];\n\t\tlistofcolours.forEach(function (hash, index) {\n\t\t\thsl = hash.toHsl();\n\t\t\thslcolour = hslToRgb(hsl);\n\t\t\tlistofcolours[index] = rgbToHex(hslcolour);\n\t\t});\n\t}\n\treturn {\n\t\tscope: {\n\t\t\tselected: '=',\n\t\t\tcustomizedColors: '=colors'\n\t\t},\n\t\trestrict: 'AE',\n\t\ttemplateUrl: OC.filePath('tasks', 'templates', 'colorpicker.html'),\n\t\tlink: function link(scope, element, attr) {\n\t\t\tscope.colors = scope.customizedColors || listofcolours;\n\t\t\tscope.selected = scope.selected || scope.colors[0];\n\t\t\tscope.random = \"#000000\";\n\n\t\t\tscope.randomizeColour = function () {\n\t\t\t\tscope.random = randColour();\n\t\t\t\tscope.pick(scope.random);\n\t\t\t};\n\n\t\t\tscope.pick = function (color) {\n\t\t\t\tscope.selected = color;\n\t\t\t};\n\t\t}\n\t};\n});","'use strict';\n\nangular.module('Tasks').directive('confirmation', function () {\n\t'use strict';\n\n\treturn {\n\t\tpriority: -1,\n\t\trestrict: 'A',\n\t\ttemplateUrl: OC.generateUrl('/apps/tasks/templates/confirmation', {}),\n\t\tscope: {\n\t\t\tconfirmationFunction: \"&confirmation\",\n\t\t\tconfirmationMessage: \"&confirmationMessage\"\n\n\t\t},\n\t\tcontroller: 'ConfirmationController'\n\t};\n});\n\nangular.module('Tasks').controller('ConfirmationController', ['$scope', '$rootScope', '$element', '$attrs', '$compile', '$document', '$window', '$timeout', function ($scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout) {\n\t'use strict';\n\n\tvar ConfirmationController = function () {\n\t\tfunction ConfirmationController(_$scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout) {\n\t\t\tthis._$scope = _$scope;\n\t\t\tthis._$scope.countdown = 3;\n\n\t\t\t$element.bind('click', function (e) {\n\t\t\t\t_$scope.countdown = 3;\n\t\t\t\t$element.removeClass('active');\n\t\t\t\tvar message = _$scope.confirmationMessage() ? _$scope.confirmationMessage() : \"Are you sure?\";\n\t\t\t\tif ($element.hasClass('confirmed')) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\te.stopPropagation();\n\t\t\t\t_$scope.activate();\n\t\t\t\t$element.children('.confirmation-confirm').tooltip({ title: message, container: 'body', placement: 'right' });\n\t\t\t\t$element.addClass(\"confirmed\");\n\t\t\t});\n\n\t\t\t$element.children('.confirmation-confirm').bind('click', function (e) {\n\t\t\t\tif ($element.hasClass('confirmed active')) {\n\t\t\t\t\t_$scope.confirmationFunction();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._$scope.documentClick = function () {\n\t\t\t\t$element.removeClass(\"confirmed\");\n\t\t\t};\n\n\t\t\tthis._$scope.activate = function () {\n\t\t\t\tif (_$scope.countdown) {\n\t\t\t\t\t$element.find('.countdown').html(_$scope.countdown + ' s');\n\t\t\t\t\t$timeout(function () {\n\t\t\t\t\t\t_$scope.activate();\n\t\t\t\t\t}, 1000);\n\t\t\t\t\t_$scope.countdown--;\n\t\t\t\t} else {\n\t\t\t\t\t$element.addClass('active');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t$document.bind('click', _$scope.documentClick);\n\t\t\t$document.bind('touchend', _$scope.documentClick);\n\n\t\t\t$scope.$on('$destroy', function () {\n\t\t\t\t$document.unbind('click', _$scope.documentClick);\n\t\t\t\t$document.unbind('touchend', _$scope.documentClick);\n\t\t\t});\n\t\t}\n\t\treturn ConfirmationController;\n\t}();\n\treturn new ConfirmationController($scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout);\n}]);","'use strict';\n\nangular.module('Tasks').directive('datepicker', function () {\n\t'use strict';\n\n\treturn {\n\t\trestrict: 'A',\n\t\tscope: false,\n\t\tlink: function link(scope, elm, attr) {\n\t\t\treturn elm.datepicker({\n\t\t\t\tonSelect: function onSelect(date, inst) {\n\t\t\t\t\tscope['set' + attr.datepicker + 'day'](date);\n\t\t\t\t\treturn scope.$apply();\n\t\t\t\t},\n\t\t\t\tbeforeShow: function beforeShow(input, inst) {\n\t\t\t\t\tvar dp, marginLeft;\n\t\t\t\t\tdp = $(inst).datepicker('widget');\n\t\t\t\t\tmarginLeft = -Math.abs($(input).outerWidth() - dp.outerWidth()) / 2 + 'px';\n\t\t\t\t\tdp.css({\n\t\t\t\t\t\t'margin-left': marginLeft\n\t\t\t\t\t});\n\t\t\t\t\t$(\"div.ui-datepicker:before\").css({\n\t\t\t\t\t\t'left': 100 + 'px'\n\t\t\t\t\t});\n\t\t\t\t\treturn $('.hasDatepicker').datepicker(\"option\", \"firstDay\", scope.settingsmodel.getById('various').startOfWeek);\n\t\t\t\t},\n\t\t\t\tbeforeShowDay: function beforeShowDay(date) {\n\t\t\t\t\tif (moment(date).startOf('day').diff(moment(scope.task[attr.datepicker], \"YYYYMMDDTHHmmss\").startOf('day'), 'days') === 0) {\n\t\t\t\t\t\treturn [1, \"selected\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn [1, \"\"];\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tminDate: null\n\t\t\t});\n\t\t}\n\t};\n});","'use strict';\n\nangular.module('Tasks').directive('ocClickFocus', ['$timeout', function ($timeout) {\n 'use strict';\n\n return function (scope, elm, attr) {\n var options;\n options = scope.$eval(attr.ocClickFocus);\n if (angular.isDefined(options) && angular.isDefined(options.selector)) {\n return elm.click(function () {\n if (angular.isDefined(options.timeout)) {\n return $timeout(function () {\n return $(options.selector).focus();\n }, options.timeout);\n } else {\n return $(options.selector).focus();\n }\n });\n }\n };\n}]);","'use strict';\n\nangular.module('Tasks').directive('timepicker', function () {\n 'use strict';\n\n return {\n restrict: 'A',\n link: function link(scope, elm, attr) {\n return elm.timepicker({\n onSelect: function onSelect(date, inst) {\n scope['set' + attr.timepicker + 'time'](date);\n return scope.$apply();\n },\n myPosition: 'center top',\n atPosition: 'center bottom',\n hourText: t('tasks', 'Hours'),\n minuteText: t('tasks', 'Minutes')\n });\n }\n };\n});","'use strict';\n\nangular.module('Tasks').directive('watchTop', function () {\n 'use strict';\n\n return {\n restrict: 'A',\n link: function link(scope, element, attr) {\n return scope.$watch(function () {\n scope.divTop = element.prev().outerHeight(true);\n });\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('counterFormatter', function () {\n 'use strict';\n\n return function (count) {\n switch (false) {\n case count !== 0:\n return '';\n case count < 999:\n return '999+';\n default:\n return count;\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateDetails', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale(due.isDate ? 'details_allday' : 'details').calendar();\n } else {\n return t('tasks', 'Set due date');\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateDetailsShort', function () {\n 'use strict';\n\n return function (reminder) {\n if (moment(reminder, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(reminder, \"YYYYMMDDTHHmmss\").locale('details_short').calendar();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateFromNow', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").fromNow();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dateTaskList', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale('tasks').calendar();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('day', function () {\n 'use strict';\n\n return function (i) {\n return moment().add('days', i).locale('list_week').calendar();\n };\n});","'use strict';\n\nangular.module('Tasks').filter('dayTaskList', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale('tasks').calendar();\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('percentDetails', function () {\n 'use strict';\n\n return function (percent) {\n return t('tasks', '%s %% completed').replace('%s', percent).replace('%%', '%');\n };\n});","'use strict';\n\nangular.module('Tasks').filter('priorityDetails', function () {\n 'use strict';\n\n return function (priority) {\n var string;\n string = t('tasks', 'priority %s: ').replace('%s', priority);\n if (+priority === 6 || +priority === 7 || +priority === 8 || +priority === 9) {\n return string + ' ' + t('tasks', 'high');\n } else if (+priority === 5) {\n return string + ' ' + t('tasks', 'medium');\n } else if (+priority === 1 || +priority === 2 || +priority === 3 || +priority === 4) {\n return string + ' ' + t('tasks', 'low');\n } else {\n return t('tasks', 'no priority assigned');\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('reminderDetails', function () {\n\t'use strict';\n\n\treturn function (reminder, scope) {\n\t\tfunction before(related) {\n\t\t\tif (related === 'END') {\n\t\t\t\treturn ' ' + t('tasks', 'before end');\n\t\t\t} else {\n\t\t\t\treturn ' ' + t('tasks', 'before beginning');\n\t\t\t}\n\t\t}\n\t\tfunction after(related) {\n\t\t\tif (related === 'END') {\n\t\t\t\treturn ' ' + t('tasks', 'after end');\n\t\t\t} else {\n\t\t\t\treturn ' ' + t('tasks', 'after beginning');\n\t\t\t}\n\t\t}\n\t\tfunction tokenName(reminder, token) {\n\t\t\tif (+reminder.duration[token.id] === 1) {\n\t\t\t\treturn token.name;\n\t\t\t} else {\n\t\t\t\treturn token.names;\n\t\t\t}\n\t\t}\n\t\tvar ds, time, token, _ref;\n\t\tif (!(angular.isUndefined(reminder) || reminder === null)) {\n\t\t\tif (reminder.type === 'DATE-TIME' && moment(reminder.date, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\treturn moment(reminder.date, \"YYYYMMDDTHHmmss\").locale('reminder').calendar();\n\t\t\t} else if (reminder.type === 'DURATION' && reminder.duration) {\n\t\t\t\tds = t('tasks', 'Remind me');\n\t\t\t\t_ref = scope.durations;\n\t\t\t\tfor (var _i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t\t\t\ttoken = _ref[_i];\n\t\t\t\t\tif (+reminder.duration[token.id]) {\n\t\t\t\t\t\ttime = 1;\n\t\t\t\t\t\tds += ' ' + reminder.duration[token.id] + ' ';\n\t\t\t\t\t\tds += tokenName(reminder, token);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!time) {\n\t\t\t\t\tif (reminder.duration.params.related === 'END') {\n\t\t\t\t\t\tds += ' ' + t('tasks', 'at the end');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tds += ' ' + t('tasks', 'at the beginning');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (reminder.duration.params.invert) {\n\t\t\t\t\t\tds += before(reminder.duration.params.related);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tds += after(reminder.duration.params.related);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ds;\n\t\t\t} else {\n\t\t\t\treturn t('tasks', 'Remind me');\n\t\t\t}\n\t\t} else {\n\t\t\treturn t('tasks', 'Remind me');\n\t\t}\n\t};\n});","'use strict';\n\nangular.module('Tasks').filter('startDetails', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").locale(due.isDate ? 'start_allday' : 'start').calendar();\n } else {\n return t('tasks', 'Set start date');\n }\n };\n});","'use strict';\n\nangular.module('Tasks').filter('timeTaskList', function () {\n 'use strict';\n\n return function (due) {\n if (moment(due, \"YYYYMMDDTHHmmss\").isValid()) {\n return moment(due, \"YYYYMMDDTHHmmss\").format('HH:mm');\n } else {\n return '';\n }\n };\n});","'use strict';\n\nangular.module('Tasks').service('CalendarService', ['DavClient', 'Calendar', function (DavClient, Calendar) {\n\t'use strict';\n\n\tvar _this = this;\n\n\tthis._CALENDAR_HOME = null;\n\n\tthis._currentUserPrincipal = null;\n\n\tthis._takenUrls = [];\n\n\tthis._PROPERTIES = ['{' + DavClient.NS_DAV + '}displayname', '{' + DavClient.NS_IETF + '}calendar-description', '{' + DavClient.NS_IETF + '}calendar-timezone', '{' + DavClient.NS_APPLE + '}calendar-order', '{' + DavClient.NS_APPLE + '}calendar-color', '{' + DavClient.NS_IETF + '}supported-calendar-component-set', '{' + DavClient.NS_OWNCLOUD + '}calendar-enabled', '{' + DavClient.NS_DAV + '}acl', '{' + DavClient.NS_DAV + '}owner', '{' + DavClient.NS_OWNCLOUD + '}invite'];\n\n\tfunction discoverHome(callback) {\n\t\treturn DavClient.propFind(DavClient.buildUrl(OC.linkToRemoteBase('dav')), ['{' + DavClient.NS_DAV + '}current-user-principal'], 0, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\tthrow \"CalDAV client could not be initialized - Querying current-user-principal failed\";\n\t\t\t}\n\n\t\t\tif (response.body.propStat.length < 1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar props = response.body.propStat[0].properties;\n\t\t\t_this._currentUserPrincipal = props['{' + DavClient.NS_DAV + '}current-user-principal'][0].textContent;\n\n\t\t\treturn DavClient.propFind(DavClient.buildUrl(_this._currentUserPrincipal), ['{' + DavClient.NS_IETF + '}calendar-home-set'], 0, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\t\tthrow \"CalDAV client could not be initialized - Querying calendar-home-set failed\";\n\t\t\t\t}\n\n\t\t\t\tif (response.body.propStat.length < 1) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar props = response.body.propStat[0].properties;\n\t\t\t\t_this._CALENDAR_HOME = props['{' + DavClient.NS_IETF + '}calendar-home-set'][0].textContent;\n\n\t\t\t\treturn callback();\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction getResponseCodeFromHTTPResponse(t) {\n\t\treturn parseInt(t.split(' ')[1]);\n\t}\n\n\tthis.getAll = function () {\n\t\tif (this._CALENDAR_HOME === null) {\n\t\t\treturn discoverHome(function () {\n\t\t\t\treturn _this.getAll();\n\t\t\t});\n\t\t}\n\n\t\tvar prom = DavClient.propFind(DavClient.buildUrl(this._CALENDAR_HOME), this._PROPERTIES, 1, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\tvar calendars = [];\n\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\tthrow \"CalDAV client could not be initialized - Querying calendars failed\";\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < response.body.length; i++) {\n\t\t\t\tvar body = response.body[i];\n\t\t\t\tif (body.propStat.length < 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t_this._takenUrls.push(body.href);\n\n\t\t\t\tvar responseCode = getResponseCodeFromHTTPResponse(body.propStat[0].status);\n\t\t\t\tif (!DavClient.wasRequestSuccessful(responseCode)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar doesSupportVTodo = false;\n\t\t\t\tvar components = body.propStat[0].properties['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set'];\n\t\t\t\tif (components) {\n\t\t\t\t\tfor (var j = 0; j < components.length; j++) {\n\t\t\t\t\t\tvar name = components[j].attributes.getNamedItem('name').textContent.toLowerCase();\n\t\t\t\t\t\tif (name === 'vtodo') {\n\t\t\t\t\t\t\tdoesSupportVTodo = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!doesSupportVTodo) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t_this._getACLFromResponse(body);\n\n\t\t\t\tvar uri = body.href.substr(_this._CALENDAR_HOME.length).replace(/[^\\w\\-]+/g, '');\n\n\t\t\t\tvar calendar = new Calendar(body.href, body.propStat[0].properties, uri);\n\t\t\t\tcalendars.push(calendar);\n\t\t\t}\n\n\t\t\treturn calendars;\n\t\t});\n\t\treturn prom;\n\t};\n\n\tthis.get = function (url) {\n\t\tif (this._CALENDAR_HOME === null) {\n\t\t\treturn discoverHome(function () {\n\t\t\t\treturn _this.get(url);\n\t\t\t});\n\t\t}\n\n\t\treturn DavClient.propFind(DavClient.buildUrl(url), this._PROPERTIES, 0, { 'requesttoken': OC.requestToken }).then(function (response) {\n\t\t\tvar body = response.body;\n\t\t\tif (body.propStat.length < 1) {\n\t\t\t\t//TODO - something went wrong\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar responseCode = getResponseCodeFromHTTPResponse(body.propStat[0].status);\n\t\t\tif (!DavClient.wasRequestSuccessful(responseCode)) {\n\t\t\t\t//TODO - something went wrong\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_this._getACLFromResponse(body);\n\n\t\t\tvar uri = body.href.substr(_this._CALENDAR_HOME.length).replace(/[^\\w\\-]+/g, '');\n\n\t\t\treturn new Calendar(body.href, body.propStat[0].properties, uri);\n\t\t});\n\t};\n\n\tthis.create = function (name, color, components) {\n\t\tif (this._CALENDAR_HOME === null) {\n\t\t\treturn discoverHome(function () {\n\t\t\t\treturn _this.create(name, color);\n\t\t\t});\n\t\t}\n\n\t\tif (typeof components === 'undefined') {\n\t\t\tcomponents = ['vtodo'];\n\t\t}\n\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar cMkcalendar = xmlDoc.createElement('c:mkcalendar');\n\t\tcMkcalendar.setAttribute('xmlns:c', 'urn:ietf:params:xml:ns:caldav');\n\t\tcMkcalendar.setAttribute('xmlns:d', 'DAV:');\n\t\tcMkcalendar.setAttribute('xmlns:a', 'http://apple.com/ns/ical/');\n\t\tcMkcalendar.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(cMkcalendar);\n\n\t\tvar dSet = xmlDoc.createElement('d:set');\n\t\tcMkcalendar.appendChild(dSet);\n\n\t\tvar dProp = xmlDoc.createElement('d:prop');\n\t\tdSet.appendChild(dProp);\n\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'displayname', name));\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'enabled', true));\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'color', color));\n\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, 'components', components));\n\n\t\tvar body = cMkcalendar.outerHTML;\n\n\t\tvar uri = this._suggestUri(name);\n\t\tvar url = this._CALENDAR_HOME + uri + '/';\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\n\t\treturn DavClient.request('MKCALENDAR', url, headers, body).then(function (response) {\n\t\t\tif (response.status === 201) {\n\t\t\t\t_this._takenUrls.push(url);\n\t\t\t\treturn _this.get(url).then(function (calendar) {\n\t\t\t\t\tcalendar.enabled = true;\n\t\t\t\t\treturn _this.update(calendar);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n\n\tthis.update = function (calendar) {\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar dPropUpdate = xmlDoc.createElement('d:propertyupdate');\n\t\tdPropUpdate.setAttribute('xmlns:c', 'urn:ietf:params:xml:ns:caldav');\n\t\tdPropUpdate.setAttribute('xmlns:d', 'DAV:');\n\t\tdPropUpdate.setAttribute('xmlns:a', 'http://apple.com/ns/ical/');\n\t\tdPropUpdate.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(dPropUpdate);\n\n\t\tvar dSet = xmlDoc.createElement('d:set');\n\t\tdPropUpdate.appendChild(dSet);\n\n\t\tvar dProp = xmlDoc.createElement('d:prop');\n\t\tdSet.appendChild(dProp);\n\n\t\tvar updatedProperties = calendar.updatedProperties;\n\t\tcalendar.resetUpdatedProperties();\n\t\tfor (var i = 0; i < updatedProperties.length; i++) {\n\t\t\tdProp.appendChild(this._createXMLForProperty(xmlDoc, updatedProperties[i], calendar[updatedProperties[i]]));\n\t\t}\n\n\t\tvar url = calendar.url;\n\t\tvar body = dPropUpdate.outerHTML;\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\n\t\treturn DavClient.request('PROPPATCH', url, headers, body).then(function (response) {\n\t\t\treturn calendar;\n\t\t});\n\t};\n\n\tthis.delete = function (calendar) {\n\t\treturn DavClient.request('DELETE', calendar.url, { 'requesttoken': OC.requestToken }, '').then(function (response) {\n\t\t\tif (response.status === 204) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// TODO - handle error case\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t};\n\n\tthis.share = function (calendar, shareType, shareWith, writable, existingShare) {\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar oShare = xmlDoc.createElement('o:share');\n\t\toShare.setAttribute('xmlns:d', 'DAV:');\n\t\toShare.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(oShare);\n\n\t\tvar oSet = xmlDoc.createElement('o:set');\n\t\toShare.appendChild(oSet);\n\n\t\tvar dHref = xmlDoc.createElement('d:href');\n\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\tdHref.textContent = 'principal:principals/users/';\n\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\tdHref.textContent = 'principal:principals/groups/';\n\t\t}\n\t\tdHref.textContent += shareWith;\n\t\toSet.appendChild(dHref);\n\n\t\tvar oSummary = xmlDoc.createElement('o:summary');\n\t\toSummary.textContent = t('calendar', '{calendar} shared by {owner}', {\n\t\t\tcalendar: calendar.displayname,\n\t\t\towner: calendar.owner\n\t\t});\n\t\toSet.appendChild(oSummary);\n\n\t\tif (writable) {\n\t\t\tvar oRW = xmlDoc.createElement('o:read-write');\n\t\t\toSet.appendChild(oRW);\n\t\t}\n\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\trequesttoken: oc_requesttoken\n\t\t};\n\t\tvar body = oShare.outerHTML;\n\t\treturn DavClient.request('POST', calendar.url, headers, body).then(function (response) {\n\t\t\tif (response.status === 200) {\n\t\t\t\tif (!existingShare) {\n\t\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\t\tcalendar.sharedWith.users.push({\n\t\t\t\t\t\t\tid: shareWith,\n\t\t\t\t\t\t\tdisplayname: shareWith,\n\t\t\t\t\t\t\twritable: writable\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\t\tcalendar.sharedWith.groups.push({\n\t\t\t\t\t\t\tid: shareWith,\n\t\t\t\t\t\t\tdisplayname: shareWith,\n\t\t\t\t\t\t\twritable: writable\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\tthis.unshare = function (calendar, shareType, shareWith) {\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar oShare = xmlDoc.createElement('o:share');\n\t\toShare.setAttribute('xmlns:d', 'DAV:');\n\t\toShare.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(oShare);\n\n\t\tvar oRemove = xmlDoc.createElement('o:remove');\n\t\toShare.appendChild(oRemove);\n\n\t\tvar dHref = xmlDoc.createElement('d:href');\n\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\tdHref.textContent = 'principal:principals/users/';\n\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\tdHref.textContent = 'principal:principals/groups/';\n\t\t}\n\t\tdHref.textContent += shareWith;\n\t\toRemove.appendChild(dHref);\n\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\trequesttoken: oc_requesttoken\n\t\t};\n\t\tvar body = oShare.outerHTML;\n\t\treturn DavClient.request('POST', calendar.url, headers, body).then(function (response) {\n\t\t\tif (response.status === 200) {\n\t\t\t\tif (shareType === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\tcalendar.sharedWith.users = calendar.sharedWith.users.filter(function (user) {\n\t\t\t\t\t\treturn user.id !== shareWith;\n\t\t\t\t\t});\n\t\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\tcalendar.sharedWith.groups = calendar.sharedWith.groups.filter(function (groups) {\n\t\t\t\t\t\treturn groups.id !== shareWith;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t//todo - remove entry from calendar object\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t};\n\n\tthis._createXMLForProperty = function (xmlDoc, propName, value) {\n\t\tswitch (propName) {\n\t\t\tcase 'enabled':\n\t\t\t\tvar oEnabled = xmlDoc.createElement('o:calendar-enabled');\n\t\t\t\toEnabled.textContent = value ? '1' : '0';\n\t\t\t\treturn oEnabled;\n\n\t\t\tcase 'displayname':\n\t\t\t\tvar dDisplayname = xmlDoc.createElement('d:displayname');\n\t\t\t\tdDisplayname.textContent = value;\n\t\t\t\treturn dDisplayname;\n\n\t\t\tcase 'order':\n\t\t\t\tvar aOrder = xmlDoc.createElement('a:calendar-color');\n\t\t\t\taOrder.textContent = value;\n\t\t\t\treturn aOrder;\n\n\t\t\tcase 'color':\n\t\t\t\tvar aColor = xmlDoc.createElement('a:calendar-color');\n\t\t\t\taColor.textContent = value;\n\t\t\t\treturn aColor;\n\n\t\t\tcase 'components':\n\t\t\t\tvar cComponents = xmlDoc.createElement('c:supported-calendar-component-set');\n\t\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\t\tvar cComp = xmlDoc.createElement('c:comp');\n\t\t\t\t\tcComp.setAttribute('name', value[i].toUpperCase());\n\t\t\t\t\tcComponents.appendChild(cComp);\n\t\t\t\t}\n\t\t\t\treturn cComponents;\n\t\t}\n\t};\n\n\tthis._getACLFromResponse = function (body) {\n\t\tvar canWrite = false;\n\t\tvar acl = body.propStat[0].properties['{' + DavClient.NS_DAV + '}acl'];\n\t\tif (acl) {\n\t\t\tfor (var k = 0; k < acl.length; k++) {\n\t\t\t\tvar href = acl[k].getElementsByTagNameNS('DAV:', 'href');\n\t\t\t\tif (href.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thref = href[0].textContent;\n\t\t\t\tif (href !== _this._currentUserPrincipal) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar writeNode = acl[k].getElementsByTagNameNS('DAV:', 'write');\n\t\t\t\tif (writeNode.length > 0) {\n\t\t\t\t\tcanWrite = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbody.propStat[0].properties.canWrite = canWrite;\n\t};\n\n\tthis._isUriAlreadyTaken = function (uri) {\n\t\treturn this._takenUrls.indexOf(this._CALENDAR_HOME + uri + '/') !== -1;\n\t};\n\n\tthis._suggestUri = function (displayname) {\n\t\tvar uri = displayname.toString().toLowerCase().replace(/\\s+/g, '-') // Replace spaces with -\n\t\t.replace(/[^\\w\\-]+/g, '') // Remove all non-word chars\n\t\t.replace(/\\-\\-+/g, '-') // Replace multiple - with single -\n\t\t.replace(/^-+/, '') // Trim - from start of text\n\t\t.replace(/-+$/, ''); // Trim - from end of text\n\n\t\tif (!this._isUriAlreadyTaken(uri)) {\n\t\t\treturn uri;\n\t\t}\n\n\t\tif (uri.indexOf('-') === -1) {\n\t\t\turi = uri + '-1';\n\t\t\tif (!this._isUriAlreadyTaken(uri)) {\n\t\t\t\treturn uri;\n\t\t\t}\n\t\t}\n\n\t\twhile (this._isUriAlreadyTaken(uri)) {\n\t\t\tvar positionLastDash = uri.lastIndexOf('-');\n\t\t\tvar firstPart = uri.substr(0, positionLastDash);\n\t\t\tvar lastPart = uri.substr(positionLastDash + 1);\n\n\t\t\tif (lastPart.match(/^\\d+$/)) {\n\t\t\t\tlastPart = parseInt(lastPart);\n\t\t\t\tlastPart++;\n\n\t\t\t\turi = firstPart + '-' + lastPart;\n\t\t\t} else if (lastPart === '') {\n\t\t\t\turi = uri + '1';\n\t\t\t} else {\n\t\t\t\turi = uri = '-1';\n\t\t\t}\n\t\t}\n\n\t\treturn uri;\n\t};\n}]);","'use strict';\n\nangular.module('Tasks').service('DavClient', [function () {\n\t'use strict';\n\n\tvar client;\n\tclient = new dav.Client({\n\t\tbaseUrl: OC.linkToRemote('dav/calendars'),\n\t\txmlNamespaces: {\n\t\t\t'DAV:': 'd',\n\t\t\t'urn:ietf:params:xml:ns:caldav': 'c',\n\t\t\t'http://apple.com/ns/ical/': 'aapl',\n\t\t\t'http://owncloud.org/ns': 'oc',\n\t\t\t'http://nextcloud.com/ns': 'nc',\n\t\t\t'http://calendarserver.org/ns/': 'cs'\n\t\t}\n\t});\n\tangular.extend(client, {\n\t\tNS_DAV: 'DAV:',\n\t\tNS_IETF: 'urn:ietf:params:xml:ns:caldav',\n\t\tNS_APPLE: 'http://apple.com/ns/ical/',\n\t\tNS_OWNCLOUD: 'http://owncloud.org/ns',\n\t\tNS_NEXTCLOUD: 'http://nextcloud.com/ns',\n\t\tNS_CALENDARSERVER: 'http://calendarserver.org/ns/',\n\t\tbuildUrl: function buildUrl(path) {\n\t\t\treturn window.location.protocol + '//' + window.location.host + path;\n\t\t},\n\t\twasRequestSuccessful: function wasRequestSuccessful(status) {\n\t\t\treturn status >= 200 && status <= 299;\n\t\t}\n\t});\n\treturn client;\n}]);","'use strict';\n\nangular.module('Tasks').service('ICalFactory', [function () {\n 'use strict';\n\n // creates a new ICAL root element with a product id property\n\n return {\n new: function _new() {\n var root = new ICAL.Component(['vcalendar', [], []]);\n\n var version = angular.element('#app').attr('data-appVersion');\n root.updatePropertyWithValue('prodid', '-//Nextcloud Tasks v' + version);\n\n return root;\n }\n };\n}]);","'use strict';\n\nangular.module('Tasks').factory('Loading', [function () {\n\t'use strict';\n\n\tvar Loading = function () {\n\t\tfunction Loading() {\n\t\t\tthis.count = 0;\n\t\t}\n\n\t\tLoading.prototype.increase = function () {\n\t\t\treturn this.count += 1;\n\t\t};\n\n\t\tLoading.prototype.decrease = function () {\n\t\t\treturn this.count -= 1;\n\t\t};\n\n\t\tLoading.prototype.getCount = function () {\n\t\t\treturn this.count;\n\t\t};\n\n\t\tLoading.prototype.isLoading = function () {\n\t\t\treturn this.count > 0;\n\t\t};\n\n\t\treturn Loading;\n\t}();\n\treturn new Loading();\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tangular.module('Tasks').factory('_Model', [function () {\n\t\tvar Model;\n\t\tModel = function () {\n\t\t\tfunction Model() {\n\t\t\t\tthis._data = [];\n\t\t\t\tthis._dataMap = {};\n\t\t\t\tthis._filterCache = {};\n\t\t\t}\n\n\t\t\tModel.prototype.handle = function (data) {\n\t\t\t\tvar item, _i, _len, _results;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = data.length; _i < _len; _i++) {\n\t\t\t\t\titem = data[_i];\n\t\t\t\t\t_results.push(this.add(item));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tModel.prototype.add = function (data, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tif (clearCache) {\n\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t}\n\t\t\t\tif (angular.isDefined(this._dataMap[data.id])) {\n\t\t\t\t\treturn this.update(data, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\tthis._data.push(data);\n\t\t\t\t\tthis._dataMap[data.id] = data;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tModel.prototype.update = function (data, clearCache) {\n\t\t\t\tvar entry, key, value, _results;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tif (clearCache) {\n\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t}\n\t\t\t\tentry = this.getById(data.id);\n\t\t\t\t_results = [];\n\t\t\t\tfor (key in data) {\n\t\t\t\t\tvalue = data[key];\n\t\t\t\t\tif (key === 'id') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_results.push(entry[key] = value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tModel.prototype.getById = function (id) {\n\t\t\t\treturn this._dataMap[id];\n\t\t\t};\n\n\t\t\tModel.prototype.getAll = function () {\n\t\t\t\treturn this._data;\n\t\t\t};\n\n\t\t\tModel.prototype.removeById = function (id, clearCache) {\n\t\t\t\tvar counter, data, entry, _i, _len, _ref;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\t_ref = this._data;\n\t\t\t\tfor (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) {\n\t\t\t\t\tentry = _ref[counter];\n\t\t\t\t\tif (entry.id === id) {\n\t\t\t\t\t\tthis._data.splice(counter, 1);\n\t\t\t\t\t\tdata = this._dataMap[id];\n\t\t\t\t\t\tdelete this._dataMap[id];\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tModel.prototype.clear = function () {\n\t\t\t\tthis._data.length = 0;\n\t\t\t\tthis._dataMap = {};\n\t\t\t\treturn this._invalidateCache();\n\t\t\t};\n\n\t\t\tModel.prototype._invalidateCache = function () {\n\t\t\t\tthis._filterCache = {};\n\t\t\t};\n\n\t\t\tModel.prototype.get = function (query) {\n\t\t\t\tvar hash;\n\t\t\t\thash = query.hashCode();\n\t\t\t\tif (!angular.isDefined(this._filterCache[hash])) {\n\t\t\t\t\tthis._filterCache[hash] = query.exec(this._data);\n\t\t\t\t}\n\t\t\t\treturn this._filterCache[hash];\n\t\t\t};\n\n\t\t\tModel.prototype.size = function () {\n\t\t\t\treturn this._data.length;\n\t\t\t};\n\n\t\t\treturn Model;\n\t\t}();\n\t\treturn Model;\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').factory('Persistence', ['Request', 'Loading', '$rootScope', '$q', 'CalendarService', function (Request, Loading, $rootScope, $q, CalendarService) {\n\t'use strict';\n\n\tvar Persistence = function () {\n\t\tfunction Persistence(_request, _Loading, _$rootScope, _CalendarService) {\n\t\t\tthis._request = _request;\n\t\t\tthis._Loading = _Loading;\n\t\t\tthis._$rootScope = _$rootScope;\n\t\t\tthis._CalendarService = _CalendarService;\n\t\t}\n\n\t\tPersistence.prototype.init = function () {\n\t\t\tvar successCallback,\n\t\t\t _this = this;\n\t\t\tthis.deferred = $q.defer();\n\t\t\tsuccessCallback = function successCallback() {\n\t\t\t\treturn _this.deferred.resolve();\n\t\t\t};\n\t\t\tthis.getCollections();\n\t\t\tthis.getSettings();\n\t\t\treturn this.deferred.promise;\n\t\t};\n\n\t\tPersistence.prototype.getCollections = function (onSuccess, showLoading) {\n\t\t\tvar failureCallbackWrapper,\n\t\t\t params,\n\t\t\t successCallbackWrapper,\n\t\t\t _this = this;\n\t\t\tif (showLoading === null) {\n\t\t\t\tshowLoading = true;\n\t\t\t}\n\t\t\tif (!onSuccess) {\n\t\t\t\tonSuccess = function onSuccess() {};\n\t\t\t}\n\t\t\tif (showLoading) {\n\t\t\t\tthis._Loading.increase();\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\tonSuccess();\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\treturn onSuccess();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {};\n\t\t\t}\n\t\t\tparams = {\n\t\t\t\tonSuccess: successCallbackWrapper,\n\t\t\t\tonFailure: failureCallbackWrapper\n\t\t\t};\n\t\t\treturn this._request.get('/apps/tasks/collections', params);\n\t\t};\n\n\t\tPersistence.prototype.getSettings = function (onSuccess, showLoading) {\n\t\t\tvar failureCallbackWrapper,\n\t\t\t params,\n\t\t\t successCallbackWrapper,\n\t\t\t _this = this;\n\t\t\tif (showLoading === null) {\n\t\t\t\tshowLoading = true;\n\t\t\t}\n\t\t\tif (!onSuccess) {\n\t\t\t\tonSuccess = function onSuccess() {};\n\t\t\t}\n\t\t\tif (showLoading) {\n\t\t\t\tthis._Loading.increase();\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\tonSuccess();\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {\n\t\t\t\t\treturn _this._Loading.decrease();\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tsuccessCallbackWrapper = function successCallbackWrapper(data) {\n\t\t\t\t\treturn onSuccess();\n\t\t\t\t};\n\t\t\t\tfailureCallbackWrapper = function failureCallbackWrapper(data) {};\n\t\t\t}\n\t\t\tparams = {\n\t\t\t\tonSuccess: successCallbackWrapper,\n\t\t\t\tonFailure: failureCallbackWrapper\n\t\t\t};\n\t\t\treturn this._request.get('/apps/tasks/settings', params);\n\t\t};\n\n\t\tPersistence.prototype.setVisibility = function (collectionID, visibility) {\n\t\t\tvar params = {\n\t\t\t\trouteParams: {\n\t\t\t\t\tcollectionID: collectionID,\n\t\t\t\t\tvisibility: visibility\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn this._request.post('/apps/tasks/collection/{collectionID}/visibility/{visibility}', params);\n\t\t};\n\n\t\tPersistence.prototype.setting = function (type, setting, value) {\n\t\t\tvar params = {\n\t\t\t\trouteParams: {\n\t\t\t\t\ttype: type,\n\t\t\t\t\tsetting: setting,\n\t\t\t\t\tvalue: value\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn this._request.post('/apps/tasks/settings/{type}/{setting}/{value}', params);\n\t\t};\n\t\treturn Persistence;\n\t}();\n\treturn new Persistence(Request, Loading, $rootScope, CalendarService);\n}]);","'use strict';\n\nangular.module('Tasks').factory('Publisher', ['CollectionsModel', 'SettingsModel', function (CollectionsModel, SettingsModel) {\n\t'use strict';\n\n\tvar Publisher = function () {\n\t\tfunction Publisher(_$collectionsmodel, _$settingsmodel) {\n\t\t\tthis._$collectionsmodel = _$collectionsmodel;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t\tthis._subscriptions = {};\n\t\t\tthis.subscribeObjectTo(this._$collectionsmodel, 'collections');\n\t\t\tthis.subscribeObjectTo(this._$settingsmodel, 'settings');\n\t\t}\n\n\t\tPublisher.prototype.subscribeObjectTo = function (object, name) {\n\t\t\tvar base = this._subscriptions;\n\t\t\tif (!base[name]) {\n\t\t\t\tbase[name] = [];\n\t\t\t}\n\t\t\treturn this._subscriptions[name].push(object);\n\t\t};\n\n\t\tPublisher.prototype.publishDataTo = function (data, name) {\n\t\t\tvar ref, results, subscriber, _i, _len;\n\t\t\tref = this._subscriptions[name] || [];\n\t\t\tresults = [];\n\t\t\tfor (_i = 0, _len = ref.length; _i < _len; _i++) {\n\t\t\t\tsubscriber = ref[_i];\n\t\t\t\tresults.push(subscriber.handle(data));\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\treturn Publisher;\n\t}();\n\treturn new Publisher(CollectionsModel, SettingsModel);\n}]);","'use strict';\n\nangular.module('Tasks').factory('RandomStringService', function () {\n 'use strict';\n\n return {\n generate: function generate() {\n return Math.random().toString(36).substr(2);\n }\n };\n});","'use strict';\n\nangular.module('Tasks').factory('Request', ['$http', 'Publisher', function ($http, Publisher) {\n\t'use strict';\n\n\tvar Request = function () {\n\t\tfunction Request($http, publisher) {\n\t\t\tthis.$http = $http;\n\t\t\tthis.publisher = publisher;\n\t\t\tthis.count = 0;\n\t\t\tthis.initialized = false;\n\t\t\tthis.shelvedRequests = [];\n\t\t\tthis.initialized = true;\n\t\t\tthis._executeShelvedRequests();\n\t\t}\n\n\t\tRequest.prototype.request = function (route, data) {\n\t\t\tvar defaultConfig, defaultData, url;\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tdefaultData = {\n\t\t\t\trouteParams: {},\n\t\t\t\tdata: {},\n\t\t\t\tonSuccess: function onSuccess() {\n\t\t\t\t\treturn {};\n\t\t\t\t},\n\t\t\t\tonFailure: function onFailure() {\n\t\t\t\t\treturn {};\n\t\t\t\t},\n\t\t\t\tconfig: {}\n\t\t\t};\n\t\t\tangular.extend(defaultData, data);\n\t\t\tif (!this.initialized) {\n\t\t\t\tthis._shelveRequest(route, defaultData);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\turl = OC.generateUrl(route, defaultData.routeParams);\n\t\t\tdefaultConfig = {\n\t\t\t\turl: url,\n\t\t\t\tdata: defaultData.data\n\t\t\t};\n\t\t\tangular.extend(defaultConfig, defaultData.config);\n\t\t\tif (defaultConfig.method === 'GET') {\n\t\t\t\tdefaultConfig.params = defaultConfig.data;\n\t\t\t}\n\t\t\treturn this.$http(defaultConfig).then(function (_this) {\n\t\t\t\treturn function (response) {\n\t\t\t\t\tvar name, ref, value;\n\t\t\t\t\tref = response.data.data;\n\t\t\t\t\tfor (name in ref) {\n\t\t\t\t\t\tvalue = ref[name];\n\t\t\t\t\t\t_this.publisher.publishDataTo(value, name);\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultData.onSuccess(response.data, response.status, response.headers, response.config);\n\t\t\t\t};\n\t\t\t}(this)).catch(function (response) {\n\t\t\t\treturn defaultData.onFailure(response.data, response.status, response.headers, response.config);\n\t\t\t});\n\t\t};\n\n\t\tRequest.prototype.post = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'POST';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype.get = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'GET';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype.put = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'PUT';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype[\"delete\"] = function (route, data) {\n\t\t\tif (data === null) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif (!data.config) {\n\t\t\t\tdata.config = {};\n\t\t\t}\n\t\t\tdata.config.method = 'DELETE';\n\t\t\treturn this.request(route, data);\n\t\t};\n\n\t\tRequest.prototype._shelveRequest = function (route, data) {\n\t\t\tvar request = {\n\t\t\t\troute: route,\n\t\t\t\tdata: data\n\t\t\t};\n\t\t\treturn this.shelvedRequests.push(request);\n\t\t};\n\n\t\tRequest.prototype._executeShelvedRequests = function () {\n\t\t\tvar r, ref, results, _i, _len;\n\t\t\tref = this.shelvedRequests;\n\t\t\tresults = [];\n\t\t\tfor (_i = 0, _len = ref.length; _i < _len; _i++) {\n\t\t\t\tr = ref[_i];\n\t\t\t\tresults.push(this.request(r.route, r.data));\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\treturn Request;\n\t}();\n\treturn new Request($http, Publisher);\n}]);","'use strict';\n\nangular.module('Tasks').factory('Status', [function () {\n 'use strict';\n\n var Status;\n Status = function () {\n function Status() {\n this._$status = {\n addingList: false,\n focusTaskInput: false\n };\n }\n\n Status.prototype.getStatus = function () {\n return this._$status;\n };\n\n return Status;\n }();\n return new Status();\n}]);","'use strict';\n\nangular.module('Tasks').service('VTodoService', ['DavClient', 'RandomStringService', '$timeout', function (DavClient, RandomStringService, $timeout) {\n\t'use strict';\n\n\tvar _this = this;\n\n\tthis.getAll = function (calendar, completed, parent) {\n\t\tif (completed === null) {\n\t\t\tcompleted = false;\n\t\t}\n\t\tif (parent === null) {\n\t\t\tparent = false;\n\t\t}\n\t\tvar xmlDoc = document.implementation.createDocument('', '', null);\n\t\tvar cCalQuery = xmlDoc.createElement('c:calendar-query');\n\t\tcCalQuery.setAttribute('xmlns:c', 'urn:ietf:params:xml:ns:caldav');\n\t\tcCalQuery.setAttribute('xmlns:d', 'DAV:');\n\t\tcCalQuery.setAttribute('xmlns:a', 'http://apple.com/ns/ical/');\n\t\tcCalQuery.setAttribute('xmlns:o', 'http://owncloud.org/ns');\n\t\txmlDoc.appendChild(cCalQuery);\n\n\t\tvar dProp = xmlDoc.createElement('d:prop');\n\t\tcCalQuery.appendChild(dProp);\n\n\t\tvar dGetEtag = xmlDoc.createElement('d:getetag');\n\t\tdProp.appendChild(dGetEtag);\n\n\t\tvar cCalendarData = xmlDoc.createElement('c:calendar-data');\n\t\tdProp.appendChild(cCalendarData);\n\n\t\tvar cFilter = xmlDoc.createElement('c:filter');\n\t\tcCalQuery.appendChild(cFilter);\n\n\t\tvar cCompFilterVCal = xmlDoc.createElement('c:comp-filter');\n\t\tcCompFilterVCal.setAttribute('name', 'VCALENDAR');\n\t\tcFilter.appendChild(cCompFilterVCal);\n\n\t\tvar cCompFilterVTodo = xmlDoc.createElement('c:comp-filter');\n\t\tcCompFilterVTodo.setAttribute('name', 'VTODO');\n\t\tcCompFilterVCal.appendChild(cCompFilterVTodo);\n\n\t\tvar cPropFilterCompleted = xmlDoc.createElement('c:prop-filter');\n\t\tcPropFilterCompleted.setAttribute('name', 'COMPLETED');\n\t\tcCompFilterVTodo.appendChild(cPropFilterCompleted);\n\n\t\tif (!completed) {\n\t\t\tvar cIsNotDefined = xmlDoc.createElement('c:is-not-defined');\n\t\t\tcPropFilterCompleted.appendChild(cIsNotDefined);\n\t\t}\n\n\t\tif (parent) {\n\t\t\tvar cPropFilterRelated = xmlDoc.createElement('c:prop-filter');\n\t\t\tcPropFilterRelated.setAttribute('name', 'RELATED-TO');\n\t\t\tcCompFilterVTodo.appendChild(cPropFilterRelated);\n\t\t\tvar cTextMatch = xmlDoc.createElement('c:text-match');\n\t\t\tvar cTextMatchValue = xmlDoc.createTextNode(parent.uid);\n\t\t\tcTextMatch.appendChild(cTextMatchValue);\n\t\t\tcPropFilterRelated.appendChild(cTextMatch);\n\t\t}\n\n\t\t// var cPropFilterStatus = xmlDoc.createElement('c:prop-filter');\n\t\t// cPropFilterStatus.setAttribute('name', 'STATUS');\n\t\t// cCompFilterVTodo.appendChild(cPropFilterStatus);\n\n\t\t// var cTextMatch = xmlDoc.createElement('c:text-match');\n\t\t// cTextMatch.setAttribute('negate-condition', 'yes');\n\t\t// var cTextMatchValue = xmlDoc.createTextNode('CANCELLED');\n\t\t// cTextMatch.appendChild(cTextMatchValue);\n\t\t// cPropFilterStatus.appendChild(cTextMatch);\n\n\t\t// var cTimeRange = xmlDoc.createElement('c:time-range');\n\t\t// cTimeRange.setAttribute('start', this._getTimeRangeStamp(start));\n\t\t// cTimeRange.setAttribute('end', this._getTimeRangeStamp(end));\n\t\t// cCompFilterVTodo.appendChild(cTimeRange);\n\n\t\tvar url = calendar.url;\n\t\tvar headers = {\n\t\t\t'Content-Type': 'application/xml; charset=utf-8',\n\t\t\t'Depth': 1,\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\t\tvar body = cCalQuery.outerHTML;\n\n\t\treturn DavClient.request('REPORT', url, headers, body).then(function (response) {\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\t//TODO - something went wrong\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar vTodos = [];\n\n\t\t\tfor (var i in response.body) {\n\t\t\t\tvar object = response.body[i];\n\t\t\t\tvar properties = object.propStat[0].properties;\n\n\t\t\t\tvar uri = object.href.substr(object.href.lastIndexOf('/') + 1);\n\n\t\t\t\tvar vTodo = {\n\t\t\t\t\tcalendar: calendar,\n\t\t\t\t\tproperties: properties,\n\t\t\t\t\turi: uri\n\t\t\t\t};\n\t\t\t\tvTodos.push(vTodo);\n\t\t\t}\n\n\t\t\treturn vTodos;\n\t\t});\n\t};\n\n\tthis.get = function (calendar, uri) {\n\t\tvar url = calendar.url + uri;\n\t\treturn DavClient.request('GET', url, { 'requesttoken': OC.requestToken }, '').then(function (response) {\n\t\t\tvar vTodo = {\n\t\t\t\tcalendar: calendar,\n\t\t\t\tproperties: {\n\t\t\t\t\t'{urn:ietf:params:xml:ns:caldav}calendar-data': response.body,\n\t\t\t\t\t'{DAV:}getetag': response.xhr.getResponseHeader('ETag') },\n\t\t\t\turi: uri\n\t\t\t};\n\t\t\treturn vTodo;\n\t\t});\n\t};\n\n\tthis.create = function (calendar, data, returnTodo) {\n\t\tif (typeof returnTodo === 'undefined') {\n\t\t\treturnTodo = true;\n\t\t}\n\n\t\tvar headers = {\n\t\t\t'Content-Type': 'text/calendar; charset=utf-8',\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\t\tvar uri = this._generateRandomUri();\n\t\tvar url = calendar.url + uri;\n\n\t\treturn DavClient.request('PUT', url, headers, data).then(function (response) {\n\t\t\tif (!DavClient.wasRequestSuccessful(response.status)) {\n\t\t\t\tconsole.log(response);\n\t\t\t\treturn false;\n\t\t\t\t// TODO - something went wrong, do smth about it\n\t\t\t}\n\n\t\t\treturn returnTodo ? _this.get(calendar, uri) : true;\n\t\t});\n\t};\n\n\tthis.update = function (task) {\n\t\tvar url = task.calendar.url + task.uri;\n\t\tvar headers = {\n\t\t\t'Content-Type': 'text/calendar; charset=utf-8',\n\t\t\t'If-Match': task.etag,\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\t\t$timeout.cancel(task.timers.update);\n\t\treturn DavClient.request('PUT', url, headers, task.data).then(function (response) {\n\t\t\ttask.etag = response.xhr.getResponseHeader('ETag');\n\t\t\treturn DavClient.wasRequestSuccessful(response.status);\n\t\t});\n\t};\n\n\tthis.delete = function (task) {\n\t\tvar url = task.calendar.url + task.uri;\n\t\tvar headers = {\n\t\t\t'If-Match': task.etag,\n\t\t\t'requesttoken': OC.requestToken\n\t\t};\n\n\t\treturn DavClient.request('DELETE', url, headers, '').then(function (response) {\n\t\t\treturn DavClient.wasRequestSuccessful(response.status);\n\t\t});\n\t};\n\n\tthis._generateRandomUri = function () {\n\t\tvar uri = 'Nextcloud-';\n\t\turi += RandomStringService.generate();\n\t\turi += RandomStringService.generate();\n\t\turi += '.ics';\n\n\t\treturn uri;\n\t};\n\n\t// this._getTimeRangeStamp = function(momentObject) {\n\t// \treturn momentObject.format('YYYYMMDD') + 'T' + momentObject.format('HHmmss') + 'Z';\n\t// };\n}]);","'use strict';\n\nangular.module('Tasks').factory('ListsBusinessLayer', ['ListsModel', 'Persistence', 'TasksBusinessLayer', 'CalendarService', function (ListsModel, Persistence, TasksBusinessLayer, CalendarService) {\n\t'use strict';\n\n\tvar ListsBusinessLayer;\n\tListsBusinessLayer = function () {\n\t\tfunction ListsBusinessLayer(_$listsmodel, _persistence, _$tasksbusinesslayer, _$calendarservice) {\n\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$tasksbusinesslayer = _$tasksbusinesslayer;\n\t\t\tthis._$calendarservice = _$calendarservice;\n\t\t}\n\n\t\tListsBusinessLayer.prototype.init = function () {\n\t\t\treturn this._$calendarservice.getAll().then(function (calendars) {\n\t\t\t\tvar calendar, _i, _len, _results;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = calendars.length; _i < _len; _i++) {\n\t\t\t\t\tcalendar = calendars[_i];\n\t\t\t\t\tListsModel.add(calendar);\n\t\t\t\t\t_results.push(TasksBusinessLayer.getAll(calendar));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t});\n\t\t};\n\n\t\tListsBusinessLayer.prototype.add = function (calendar, color) {\n\t\t\treturn this._$calendarservice.create(calendar, color, ['vtodo']).then(function (calendar) {\n\t\t\t\tListsModel.add(calendar);\n\t\t\t\treturn calendar;\n\t\t\t});\n\t\t};\n\n\t\tListsBusinessLayer.prototype[\"delete\"] = function (calendar) {\n\t\t\treturn this._$calendarservice[\"delete\"](calendar).then(function () {\n\t\t\t\treturn ListsModel[\"delete\"](calendar);\n\t\t\t});\n\t\t};\n\n\t\tListsBusinessLayer.prototype.rename = function (calendar) {\n\t\t\tthis._$calendarservice.update(calendar).then(function (calendar) {\n\t\t\t\tcalendar.dropPreviousState();\n\t\t\t});\n\t\t};\n\n\t\treturn ListsBusinessLayer;\n\t}();\n\treturn new ListsBusinessLayer(ListsModel, Persistence, TasksBusinessLayer, CalendarService);\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __bind = function __bind(fn, me) {\n\t\treturn function () {\n\t\t\treturn fn.apply(me, arguments);\n\t\t};\n\t};\n\n\tangular.module('Tasks').factory('SearchBusinessLayer', ['ListsModel', 'Persistence', 'TasksModel', '$rootScope', '$routeParams', '$location', function (ListsModel, Persistence, TasksModel, $rootScope, $routeParams, $location) {\n\t\tvar SearchBusinessLayer;\n\t\tSearchBusinessLayer = function () {\n\t\t\tfunction SearchBusinessLayer(_$listsmodel, _persistence, _$tasksmodel, _$rootScope, _$routeparams, _$location) {\n\t\t\t\tthis._$listsmodel = _$listsmodel;\n\t\t\t\tthis._persistence = _persistence;\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._$rootScope = _$rootScope;\n\t\t\t\tthis._$routeparams = _$routeparams;\n\t\t\t\tthis._$location = _$location;\n\t\t\t\tthis.getFilter = __bind(this.getFilter, this);\n\t\t\t\tthis.setFilter = __bind(this.setFilter, this);\n\t\t\t\tthis.attach = __bind(this.attach, this);\n\t\t\t\tthis.initialize();\n\t\t\t\tthis._$searchString = '';\n\t\t\t}\n\n\t\t\tSearchBusinessLayer.prototype.attach = function (search) {\n\t\t\t\tvar _this = this;\n\t\t\t\tsearch.setFilter('tasks', function (query) {\n\t\t\t\t\treturn _this._$rootScope.$apply(function () {\n\t\t\t\t\t\treturn _this.setFilter(query);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tsearch.setRenderer('task', this.renderTaskResult.bind(this));\n\t\t\t\treturn search.setHandler('task', this.handleTaskClick.bind(this));\n\t\t\t};\n\n\t\t\tSearchBusinessLayer.prototype.setFilter = function (query) {\n\t\t\t\tthis._$searchString = query;\n\t\t\t};\n\n\t\t\tSearchBusinessLayer.prototype.getFilter = function () {\n\t\t\t\treturn this._$searchString;\n\t\t\t};\n\n\t\t\tSearchBusinessLayer.prototype.initialize = function () {\n\t\t\t\tvar _this = this;\n\t\t\t\tthis.handleTaskClick = function ($row, result, event) {\n\t\t\t\t\treturn _this._$location.path('/lists/' + result.calendarid + '/tasks/' + result.id);\n\t\t\t\t};\n\t\t\t\tthis.renderTaskResult = function ($row, result) {\n\t\t\t\t\tvar $template;\n\t\t\t\t\tif (!_this._$tasksmodel.filterTasks(result, _this._$routeparams.listID) || !_this._$tasksmodel.isLoaded(result)) {\n\t\t\t\t\t\t$template = $('div.task-item.template');\n\t\t\t\t\t\t$template = $template.clone();\n\t\t\t\t\t\t$row = $('<tr class=\"result\"></tr>').append($template.removeClass('template'));\n\t\t\t\t\t\t$row.data('result', result);\n\t\t\t\t\t\t$row.find('span.title').text(result.name);\n\t\t\t\t\t\tif (result.starred) {\n\t\t\t\t\t\t\t$row.find('span.task-star').addClass('task-starred');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.completed) {\n\t\t\t\t\t\t\t$row.find('div.task-item').addClass('done');\n\t\t\t\t\t\t\t$row.find('span.task-checkbox').addClass('svg-checkmark');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.complete) {\n\t\t\t\t\t\t\t$row.find('div.percentdone').css({\n\t\t\t\t\t\t\t\t'width': result.complete + '%',\n\t\t\t\t\t\t\t\t'background-color': '' + _this._$listsmodel.getColor(result.calendarid)\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.note) {\n\t\t\t\t\t\t\t$row.find('div.title-wrapper').addClass('attachment');\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $row;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn OC.Plugins.register('OCA.Search', this);\n\t\t\t};\n\n\t\t\treturn SearchBusinessLayer;\n\t\t}();\n\t\treturn new SearchBusinessLayer(ListsModel, Persistence, TasksModel, $rootScope, $routeParams, $location);\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').factory('SettingsBusinessLayer', ['Persistence', 'SettingsModel', function (Persistence, SettingsModel) {\n\t'use strict';\n\n\tvar SettingsBusinessLayer = function () {\n\t\tfunction SettingsBusinessLayer(_persistence, _$settingsmodel) {\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$settingsmodel = _$settingsmodel;\n\t\t}\n\n\t\tSettingsBusinessLayer.prototype.updateModel = function () {\n\t\t\tvar success,\n\t\t\t _this = this;\n\t\t\tsuccess = function success() {};\n\t\t\treturn this._persistence.getCollections(success, true);\n\t\t};\n\n\t\tSettingsBusinessLayer.prototype.setVisibility = function (collectionID, visibility) {\n\t\t\treturn this._persistence.setVisibility(collectionID, visibility);\n\t\t};\n\n\t\tSettingsBusinessLayer.prototype.toggle = function (type, setting) {\n\t\t\tthis._$settingsmodel.toggle(type, setting);\n\t\t\tvar value = this._$settingsmodel.getById(type)[setting];\n\t\t\treturn this._persistence.setting(type, setting, +value);\n\t\t};\n\n\t\tSettingsBusinessLayer.prototype.set = function (type, setting, value) {\n\t\t\treturn this._persistence.setting(type, setting, value);\n\t\t};\n\n\t\treturn SettingsBusinessLayer;\n\t}();\n\treturn new SettingsBusinessLayer(Persistence, SettingsModel);\n}]);","'use strict';\n\nangular.module('Tasks').factory('TasksBusinessLayer', ['TasksModel', 'Persistence', 'VTodoService', 'VTodo', '$timeout', function (TasksModel, Persistence, VTodoService, VTodo, $timeout) {\n\t'use strict';\n\n\tvar TasksBusinessLayer;\n\tTasksBusinessLayer = function () {\n\t\tfunction TasksBusinessLayer(_$tasksmodel, _persistence, _$vtodoservice, _$vtodo, $timeout) {\n\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\tthis._persistence = _persistence;\n\t\t\tthis._$vtodoservice = _$vtodoservice;\n\t\t}\n\n\t\tTasksBusinessLayer.prototype.getAll = function (calendar, completed, parent) {\n\t\t\treturn this._$vtodoservice.getAll(calendar, completed, parent).then(function (tasks) {\n\t\t\t\tvar task, _i, _len, _results;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tvar vTodo = new VTodo(task.calendar, task.properties, task.uri);\n\t\t\t\t\t_results.push(TasksModel.ad(vTodo));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.add = function (task) {\n\t\t\treturn this._$vtodoservice.create(task.calendar, task.data).then(function (task) {\n\t\t\t\tvar vTodo = new VTodo(task.calendar, task.properties, task.uri);\n\t\t\t\tTasksModel.ad(vTodo);\n\t\t\t\treturn vTodo;\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.getTask = function (calendar, uri) {\n\t\t\treturn this._$vtodoservice.get(calendar, uri).then(function (task) {\n\t\t\t\tTasksModel.ad(task);\n\t\t\t\treturn task;\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setPriority = function (task, priority) {\n\t\t\tif (task.calendar.writable) {\n\t\t\t\ttask.priority = priority;\n\t\t\t\tthis.doUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setPercentComplete = function (task, percentComplete) {\n\t\t\tif (task.calendar.writable) {\n\t\t\t\tif (percentComplete < 100) {\n\t\t\t\t\tthis.uncompleteParents(task.related);\n\t\t\t\t} else {\n\t\t\t\t\tthis.completeChildren(task);\n\t\t\t\t}\n\t\t\t\ttask.complete = percentComplete;\n\t\t\t\tthis.triggerUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.triggerUpdate = function (task, duration) {\n\t\t\tif (!duration) {\n\t\t\t\tduration = 1000;\n\t\t\t}\n\t\t\tif (task.timers.update) {\n\t\t\t\t$timeout.cancel(task.timers.update);\n\t\t\t}\n\t\t\ttask.timers.update = $timeout(function (task) {\n\t\t\t\tVTodoService.update(task);\n\t\t\t}, duration, true, task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.doUpdate = function (task) {\n\t\t\treturn this._$vtodoservice.update(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.completeChildren = function (task) {\n\t\t\tvar child, _i, _len;\n\t\t\tvar children = this._$tasksmodel.getChildren(task);\n\t\t\tvar _results = [];\n\t\t\tfor (_i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\tchild = children[_i];\n\t\t\t\t_results.push(this.setPercentComplete(child, 100));\n\t\t\t}\n\t\t\treturn _results;\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.uncompleteParents = function (uid) {\n\t\t\tif (uid) {\n\t\t\t\tvar parent = this._$tasksmodel.getByUid(uid);\n\t\t\t\tif (parent.completed) {\n\t\t\t\t\treturn this.setPercentComplete(parent, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setHideSubtasks = function (task, hide) {\n\t\t\ttask.hideSubtasks = hide;\n\t\t\tif (task.calendar.writable) {\n\t\t\t\tthis.doUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setHideCompletedSubtasks = function (task, hide) {\n\t\t\ttask.hideCompletedSubtasks = hide;\n\t\t\tif (task.calendar.writable) {\n\t\t\t\tthis.doUpdate(task);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteTask = function (task) {\n\t\t\tvar child, children, _i, _len;\n\t\t\tchildren = this._$tasksmodel.getChildren(task);\n\t\t\tfor (_i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\tchild = children[_i];\n\t\t\t\tthis.deleteTask(child);\n\t\t\t}\n\t\t\treturn this._$vtodoservice[\"delete\"](task).then(function () {\n\t\t\t\treturn TasksModel[\"delete\"](task);\n\t\t\t});\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.momentToICALTime = function (moment, asDate) {\n\t\t\tif (asDate) {\n\t\t\t\treturn ICAL.Time.fromDateString(moment.format('YYYY-MM-DD'));\n\t\t\t} else {\n\t\t\t\treturn ICAL.Time.fromDateTimeString(moment.format('YYYY-MM-DDTHH:mm:ss'));\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.initDueDate = function (task) {\n\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tif (!due.isValid()) {\n\t\t\t\tvar reference = start.isAfter() ? start : moment();\n\t\t\t\tif (task.allDay) {\n\t\t\t\t\treference.startOf('day').add(1, 'd');\n\t\t\t\t} else {\n\t\t\t\t\treference.startOf('hour').add(1, 'h');\n\t\t\t\t}\n\t\t\t\treturn this.setDue(task, reference, 'all');\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setDue = function (task, date, type) {\n\t\t\tif (type === null) {\n\t\t\t\ttype = 'day';\n\t\t\t}\n\t\t\tvar allDay = task.allDay;\n\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar olddue = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar due = olddue.clone();\n\t\t\tif (type === 'day') {\n\t\t\t\tif (moment(due).isValid()) {\n\t\t\t\t\tdue.year(date.year()).month(date.month()).date(date.date());\n\t\t\t\t} else {\n\t\t\t\t\tdue = date.add(12, 'h');\n\t\t\t\t}\n\t\t\t} else if (type === 'time') {\n\t\t\t\tif (moment(due).isValid()) {\n\t\t\t\t\tdue.hour(date.hour()).minute(date.minute());\n\t\t\t\t} else {\n\t\t\t\t\tdue = date;\n\t\t\t\t}\n\t\t\t} else if (type === 'all') {\n\t\t\t\tdue = date;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (due.isBefore(start) || due.isSame(start)) {\n\t\t\t\tstart.subtract(olddue.diff(due), 'ms');\n\t\t\t\ttask.start = this.momentToICALTime(start, allDay);\n\t\t\t}\n\t\t\ttask.due = this.momentToICALTime(due, allDay);\n\t\t\t// this.checkReminderDate(task);\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteDueDate = function (task) {\n\t\t\t// var reminder = task.reminder;\n\t\t\t// if (reminder !== null && reminder.type === 'DURATION' && reminder.duration.params.related === 'END') {\n\t\t\t// this.deleteReminderDate(task);\n\t\t\t// }\n\t\t\ttask.due = null;\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.initStartDate = function (task) {\n\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tif (!start.isValid()) {\n\t\t\t\tvar reference = moment().add(1, 'h');\n\t\t\t\tif (due.isBefore(reference)) {\n\t\t\t\t\treference = due.subtract(1, 'm');\n\t\t\t\t}\n\t\t\t\treference.startOf(task.allDay ? 'day' : 'hour');\n\t\t\t\treturn this.setStart(task, reference, 'all');\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setStart = function (task, date, type) {\n\t\t\tif (type === null) {\n\t\t\t\ttype = 'day';\n\t\t\t}\n\t\t\tvar allDay = task.allDay;\n\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar oldstart = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\tvar start = oldstart.clone();\n\t\t\tif (type === 'day') {\n\t\t\t\tif (moment(start).isValid()) {\n\t\t\t\t\tstart.year(date.year()).month(date.month()).date(date.date());\n\t\t\t\t} else {\n\t\t\t\t\tstart = date.add(12, 'h');\n\t\t\t\t}\n\t\t\t} else if (type === 'time') {\n\t\t\t\tif (moment(start).isValid()) {\n\t\t\t\t\tstart.hour(date.hour()).minute(date.minute());\n\t\t\t\t} else {\n\t\t\t\t\tstart = date;\n\t\t\t\t}\n\t\t\t} else if (type === 'all') {\n\t\t\t\tstart = date;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (start.isAfter(due) || start.isSame(due)) {\n\t\t\t\tdue.add(start.diff(oldstart), 'ms');\n\t\t\t\ttask.due = this.momentToICALTime(due, allDay);\n\t\t\t}\n\t\t\ttask.start = this.momentToICALTime(start, allDay);\n\t\t\t// this.checkReminderDate(taskID);\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteStartDate = function (task) {\n\t\t\t// var reminder = task.reminder;\n\t\t\t// if (reminder !== null && reminder.type === 'DURATION' && reminder.duration.params.related === 'START') {\n\t\t\t// this.deleteReminderDate(task);\n\t\t\t// }\n\t\t\ttask.start = null;\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setAllDay = function (task, allDay) {\n\t\t\ttask.allDay = allDay;\n\t\t\tif (allDay) {\n\t\t\t\tvar due = moment(task.due, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\tvar start = moment(task.start, \"YYYY-MM-DDTHH:mm:ss\");\n\t\t\t\tif (start.isAfter(due) || start.isSame(due)) {\n\t\t\t\t\tstart = moment(due).subtract(1, 'day');\n\t\t\t\t\ttask.start = this.momentToICALTime(start, allDay);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.doUpdate(task);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.initReminder = function (taskID) {\n\t\t\tvar p, task;\n\t\t\tif (!this.checkReminderDate(taskID)) {\n\t\t\t\ttask = this._$tasksmodel.getById(taskID);\n\t\t\t\ttask.reminder = {\n\t\t\t\t\ttype: 'DURATION',\n\t\t\t\t\taction: 'DISPLAY',\n\t\t\t\t\tduration: {\n\t\t\t\t\t\ttoken: 'week',\n\t\t\t\t\t\tweek: 0,\n\t\t\t\t\t\tday: 0,\n\t\t\t\t\t\thour: 0,\n\t\t\t\t\t\tminute: 0,\n\t\t\t\t\t\tsecond: 0,\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tinvert: true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tif (moment(task.start, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\t\tp = task.reminder.duration.params;\n\t\t\t\t\tp.related = 'START';\n\t\t\t\t\tp.id = '10';\n\t\t\t\t} else if (moment(task.due, \"YYYYMMDDTHHmmss\").isValid()) {\n\t\t\t\t\tp = task.reminder.duration.params;\n\t\t\t\t\tp.related = 'END';\n\t\t\t\t\tp.id = '11';\n\t\t\t\t} else {\n\t\t\t\t\ttask.reminder.type = 'DATE-TIME';\n\t\t\t\t\ttask.reminder.date = moment().startOf('hour').add(1, 'h').format('YYYYMMDDTHHmmss');\n\t\t\t\t}\n\t\t\t\treturn this.setReminder(taskID);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setReminderDate = function (taskID, date, type) {\n\t\t\tvar newreminder, reminder, reminderdate;\n\t\t\tif (type === null) {\n\t\t\t\ttype = 'day';\n\t\t\t}\n\t\t\treminder = this._$tasksmodel.getById(taskID).reminder;\n\t\t\tnewreminder = {\n\t\t\t\ttype: 'DATE-TIME',\n\t\t\t\taction: 'DISPLAY',\n\t\t\t\tduration: null\n\t\t\t};\n\t\t\tif (type === 'day') {\n\t\t\t\tif (this.checkReminderDate(taskID) || reminder === null) {\n\t\t\t\t\treminderdate = moment(reminder.date, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\tnewreminder.action = reminder.action;\n\t\t\t\t\tif (reminderdate.isValid() && reminder.type === 'DATE-TIME') {\n\t\t\t\t\t\treminderdate.year(date.year()).month(date.month()).date(date.date());\n\t\t\t\t\t} else {\n\t\t\t\t\t\treminderdate = date.add(12, 'h');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treminderdate = date.add(12, 'h');\n\t\t\t\t}\n\t\t\t} else if (type === 'time') {\n\t\t\t\tif (this.checkReminderDate(taskID) || reminder === null) {\n\t\t\t\t\treminderdate = moment(reminder.date, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\tnewreminder.action = reminder.action;\n\t\t\t\t\tif (reminderdate.isValid() && reminder.type === 'DATE-TIME') {\n\t\t\t\t\t\treminderdate.hour(date.hour()).minute(date.minute());\n\t\t\t\t\t} else {\n\t\t\t\t\t\treminderdate = date;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treminderdate = date;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnewreminder.date = reminderdate.format('YYYYMMDDTHHmmss');\n\t\t\tthis._$tasksmodel.setReminder(taskID, newreminder);\n\t\t\treturn this._persistence.setReminder(taskID, newreminder);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.setReminder = function (taskID) {\n\t\t\tvar reminder;\n\t\t\tif (this.checkReminderDate(taskID)) {\n\t\t\t\treminder = this._$tasksmodel.getById(taskID).reminder;\n\t\t\t\treturn this._persistence.setReminder(taskID, reminder);\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.checkReminderDate = function (taskID) {\n\t\t\tvar d, date, duration, rel, related, reminder, seg, task, token;\n\t\t\ttask = this._$tasksmodel.getById(taskID);\n\t\t\treminder = task.reminder;\n\t\t\tif (reminder !== null && reminder.type === 'DURATION') {\n\t\t\t\tif (!reminder.duration) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (reminder.duration.params.related === 'START') {\n\t\t\t\t\ttoken = 'start';\n\t\t\t\t} else if (reminder.duration.params.related === 'END') {\n\t\t\t\t\ttoken = 'due';\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tdate = moment(task[token], \"YYYYMMDDTHHmmss\");\n\t\t\t\tduration = reminder.duration;\n\t\t\t\td = {\n\t\t\t\t\tw: duration.week,\n\t\t\t\t\td: duration.day,\n\t\t\t\t\th: duration.hour,\n\t\t\t\t\tm: duration.minute,\n\t\t\t\t\ts: duration.second\n\t\t\t\t};\n\t\t\t\tif (duration.params.invert) {\n\t\t\t\t\tdate = date.subtract(d);\n\t\t\t\t} else {\n\t\t\t\t\tdate = date.add(d);\n\t\t\t\t}\n\t\t\t\ttask.reminder.date = date.format('YYYYMMDDTHHmmss');\n\t\t\t} else if (reminder !== null && reminder.type === 'DATE-TIME') {\n\t\t\t\tduration = reminder.duration;\n\t\t\t\tdate = moment(reminder.date, \"YYYYMMDDTHHmmss\");\n\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (duration) {\n\t\t\t\t\tif (duration.params.related === 'START') {\n\t\t\t\t\t\trelated = moment(task.start, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\trelated = moment(task.due, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t}\n\t\t\t\t\tseg = this.secondsToSegments(date.diff(related, 'seconds'));\n\t\t\t\t\tduration.params.invert = seg.invert;\n\t\t\t\t\tduration.token = 'week';\n\t\t\t\t\tduration.week = seg.week;\n\t\t\t\t\tduration.day = seg.day;\n\t\t\t\t\tduration.hour = seg.hour;\n\t\t\t\t\tduration.minute = seg.minute;\n\t\t\t\t\tduration.second = seg.second;\n\t\t\t\t} else {\n\t\t\t\t\tif (task.start) {\n\t\t\t\t\t\trelated = moment(task.start, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t\trel = 'START';\n\t\t\t\t\t\td = 0;\n\t\t\t\t\t} else if (task.due) {\n\t\t\t\t\t\trelated = moment(task.due, \"YYYYMMDDTHHmmss\");\n\t\t\t\t\t\trel = 'END';\n\t\t\t\t\t\td = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tseg = this.secondsToSegments(date.diff(related, 'seconds'));\n\t\t\t\t\treminder.duration = {\n\t\t\t\t\t\ttoken: 'week',\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\trelated: rel,\n\t\t\t\t\t\t\tinvert: seg.invert,\n\t\t\t\t\t\t\tid: +seg.invert + '' + d\n\t\t\t\t\t\t},\n\t\t\t\t\t\tweek: seg.week,\n\t\t\t\t\t\tday: seg.day,\n\t\t\t\t\t\thour: seg.hour,\n\t\t\t\t\t\tminute: seg.minute,\n\t\t\t\t\t\tsecond: seg.second\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.secondsToSegments = function (s) {\n\t\t\tvar d, h, i, m, w;\n\t\t\tif (s < 0) {\n\t\t\t\ts *= -1;\n\t\t\t\ti = true;\n\t\t\t} else {\n\t\t\t\ti = false;\n\t\t\t}\n\t\t\tw = Math.floor(s / 604800);\n\t\t\ts -= w * 604800;\n\t\t\td = Math.floor(s / 86400);\n\t\t\ts -= d * 86400;\n\t\t\th = Math.floor(s / 3600);\n\t\t\ts -= h * 3600;\n\t\t\tm = Math.floor(s / 60);\n\t\t\ts -= m * 60;\n\t\t\treturn {\n\t\t\t\tweek: w,\n\t\t\t\tday: d,\n\t\t\t\thour: h,\n\t\t\t\tminute: m,\n\t\t\t\tsecond: s,\n\t\t\t\tinvert: i\n\t\t\t};\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteReminderDate = function (taskID) {\n\t\t\tthis._$tasksmodel.setReminder(taskID, null);\n\t\t\treturn this._persistence.setReminder(taskID, false);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.changeCalendar = function (task, newCalendar) {\n\t\t\tif (task.calendar !== newCalendar && newCalendar.writable) {\n\t\t\t\tvar newTask = angular.copy(task);\n\t\t\t\tnewTask.calendar = newCalendar;\n\t\t\t\tif (!TasksModel.hasNoParent(newTask)) {\n\t\t\t\t\tvar parent = TasksModel.getByUid(newTask.related);\n\t\t\t\t\tif (parent.calendar.uri !== newTask.calendar.uri) {\n\t\t\t\t\t\tnewTask.related = null;\n\t\t\t\t\t\tTasksBusinessLayer.prototype.setPercentComplete(newTask, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn VTodoService.create(newCalendar, newTask.data).then(function (newVTodo) {\n\t\t\t\t\tvar vTodo = new VTodo(newVTodo.calendar, newVTodo.properties, newVTodo.uri);\n\t\t\t\t\tTasksModel.ad(vTodo);\n\t\t\t\t\treturn VTodoService[\"delete\"](task).then(function () {\n\t\t\t\t\t\tTasksModel[\"delete\"](task);\n\t\t\t\t\t\tvar queries = [];\n\t\t\t\t\t\tvar children = TasksModel.getChildren(newTask);\n\t\t\t\t\t\tvar _i, _len, child;\n\t\t\t\t\t\tfor (_i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\t\t\t\tchild = children[_i];\n\t\t\t\t\t\t\tif (child.calendar.uri !== newTask.calendar.uri) {\n\t\t\t\t\t\t\t\tqueries.push(TasksBusinessLayer.prototype.changeCalendar(child, newTask.calendar));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Promise.all(queries);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn Promise.resolve(true);\n\t\t\t}\n\t\t};\n\n\t\t// called from outside\n\t\tTasksBusinessLayer.prototype.changeCollection = function (taskID, collectionID) {\n\t\t\tvar task = this._$tasksmodel.getById(taskID);\n\t\t\tswitch (collectionID) {\n\t\t\t\tcase 'starred':\n\t\t\t\t\ttask.priority = 9;\n\t\t\t\t\treturn this.doUpdate(task);\n\t\t\t\tcase 'completed':\n\t\t\t\t\treturn this.setPercentComplete(task, 100);\n\t\t\t\tcase 'uncompleted':\n\t\t\t\t\tif (task.completed) {\n\t\t\t\t\t\treturn this.setPercentComplete(task, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'today':\n\t\t\t\t\treturn this.setDue(task, moment().startOf('day').add(12, 'h'), 'all');\n\t\t\t\tcase 'week':\n\t\t\t\tcase 'all':\n\t\t\t\t\treturn false;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.changeParent = function (task, parent) {\n\t\t\tif (parent.calendar.writable) {\n\t\t\t\ttask.related = parent.uid;\n\t\t\t\tparent.hideSubtasks = 0;\n\t\t\t\tif (parent.completed && !task.completed) {\n\t\t\t\t\tthis.setPercentComplete(parent, 0);\n\t\t\t\t} else {\n\t\t\t\t\tthis.doUpdate(parent);\n\t\t\t\t}\n\t\t\t\tif (parent.calendar.uri !== task.calendar.uri) {\n\t\t\t\t\tthis.changeCalendar(task, parent.calendar);\n\t\t\t\t} else {\n\t\t\t\t\tthis.doUpdate(task);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.makeRootTask = function (task, newCalendar, collectionID) {\n\t\t\tif (newCalendar.writable) {\n\t\t\t\tvar requests = [];\n\t\t\t\ttask.related = null;\n\t\t\t\tif (collectionID !== \"completed\" && task.completed) {\n\t\t\t\t\ttask.complete = 0;\n\t\t\t\t}\n\t\t\t\trequests.push(this.changeCollection(task.uri, collectionID));\n\t\t\t\tif (task.calendar !== newCalendar) {\n\t\t\t\t\trequests.push(this.changeCalendar(task, newCalendar));\n\t\t\t\t} else {\n\t\t\t\t\trequests.push(this.doUpdate(task));\n\t\t\t\t}\n\t\t\t\treturn requests;\n\t\t\t}\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.addComment = function (comment, onSuccess, onFailure) {\n\t\t\tvar success,\n\t\t\t _this = this;\n\t\t\tif (!onSuccess) {\n\t\t\t\tonSuccess = function onSuccess() {};\n\t\t\t}\n\t\t\tif (!onFailure) {\n\t\t\t\tonFailure = function onFailure() {};\n\t\t\t}\n\t\t\tthis._$tasksmodel.addComment(comment);\n\t\t\tsuccess = function success(response) {\n\t\t\t\tif (response.status === 'error') {\n\t\t\t\t\treturn onFailure();\n\t\t\t\t} else {\n\t\t\t\t\treturn onSuccess(response.data);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn this._persistence.addComment(comment, success);\n\t\t};\n\n\t\tTasksBusinessLayer.prototype.deleteComment = function (taskID, commentID) {\n\t\t\tthis._$tasksmodel.deleteComment(taskID, commentID);\n\t\t\treturn this._persistence.deleteComment(taskID, commentID);\n\t\t};\n\n\t\treturn TasksBusinessLayer;\n\t}();\n\treturn new TasksBusinessLayer(TasksModel, Persistence, VTodoService, VTodo, $timeout);\n}]);","'use strict';\n\nangular.module('Tasks').factory('Calendar', ['$rootScope', '$filter', '$window', function ($rootScope, $filter, $window) {\n\t'use strict';\n\n\tfunction Calendar(url, props, uri) {\n\t\tvar _this = this;\n\n\t\tprops.color = props['{http://apple.com/ns/ical/}calendar-color'];\n\t\tif (typeof props.color !== 'undefined') {\n\t\t\tif (props.color.length === 9) {\n\t\t\t\tprops.color = props.color.substr(0, 7);\n\t\t\t}\n\t\t} else {\n\t\t\tprops.color = '#1d2d44';\n\t\t}\n\n\t\tangular.extend(this, {\n\t\t\t_propertiesBackup: {},\n\t\t\t_properties: {\n\t\t\t\turl: url,\n\t\t\t\turi: uri,\n\t\t\t\tenabled: props['{http://owncloud.org/ns}calendar-enabled'] === '1',\n\t\t\t\tdisplayname: props['{DAV:}displayname'] || t('tasks', 'Unnamed'),\n\t\t\t\tcolor: props.color,\n\t\t\t\torder: parseInt(props['{http://apple.com/ns/ical/}calendar-order']) || 0,\n\t\t\t\tcomponents: {\n\t\t\t\t\tvevent: false,\n\t\t\t\t\tvjournal: false,\n\t\t\t\t\tvtodo: false\n\t\t\t\t},\n\t\t\t\twritable: props.canWrite,\n\t\t\t\tshareable: props.canWrite,\n\t\t\t\tsharedWith: {\n\t\t\t\t\tusers: [],\n\t\t\t\t\tgroups: []\n\t\t\t\t},\n\t\t\t\towner: '',\n\t\t\t\tloadedCompleted: false\n\t\t\t},\n\t\t\t_updatedProperties: []\n\t\t});\n\t\tthis._propertiesBackup = angular.copy(this._properties);\n\n\t\t// angular.extend(this, {\n\t\t// \ttmpId: null,\n\t\t// \tfcEventSource: {\n\t\t// \t\tevents: function (start, end, timezone, callback) {\n\t\t// \t\t\t// console.log('querying events ...');\n\t\t// \t\t\t// TimezoneService.get(timezone).then(function(tz) {\n\t\t// \t\t\t// \t_this.list.loading = true;\n\t\t// \t\t\t// \t$rootScope.$broadcast('reloadCalendarList');\n\n\t\t// \t\t\t// \tVEventService.getAll(_this, start, end).then(function(events) {\n\t\t// \t\t\t// \t\tvar vevents = [];\n\t\t// \t\t\t// \t\tfor (var i = 0; i < events.length; i++) {\n\t\t// \t\t\t// \t\t\tvevents = vevents.concat(events[i].getFcEvent(start, end, tz));\n\t\t// \t\t\t// \t\t}\n\n\t\t// \t\t\t// \t\tcallback(vevents);\n\n\t\t// \t\t\t// \t\t_this.list.loading = false;\n\t\t// \t\t\t// \t\t$rootScope.$broadcast('reloadCalendarList');\n\t\t// \t\t\t// \t});\n\t\t// \t\t\t// });\n\t\t// \t\t},\n\t\t// \t\teditable: this._properties.writable,\n\t\t// \t\tcalendar: this\n\t\t// \t},\n\t\t// \tlist: {\n\t\t// \t\tedit: false,\n\t\t// \t\tloading: this.enabled,\n\t\t// \t\tlocked: false,\n\t\t// \t\teditingShares: false\n\t\t// \t}\n\t\t// });\n\n\t\tvar components = props['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set'];\n\t\tfor (var i = 0; i < components.length; i++) {\n\t\t\tvar name = components[i].attributes.getNamedItem('name').textContent.toLowerCase();\n\t\t\tif (this._properties.components.hasOwnProperty(name)) {\n\t\t\t\tthis._properties.components[name] = true;\n\t\t\t}\n\t\t}\n\n\t\tvar shares = props['{http://owncloud.org/ns}invite'];\n\t\tif (typeof shares !== 'undefined') {\n\t\t\tfor (var j = 0; j < shares.length; j++) {\n\t\t\t\tvar href = shares[j].getElementsByTagNameNS('DAV:', 'href');\n\t\t\t\tif (href.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thref = href[0].textContent;\n\n\t\t\t\tvar access = shares[j].getElementsByTagNameNS('http://owncloud.org/ns', 'access');\n\t\t\t\tif (access.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\taccess = access[0];\n\n\t\t\t\tvar readWrite = access.getElementsByTagNameNS('http://owncloud.org/ns', 'read-write');\n\t\t\t\treadWrite = readWrite.length !== 0;\n\n\t\t\t\tif (href.startsWith('principal:principals/users/')) {\n\t\t\t\t\tthis._properties.sharedWith.users.push({\n\t\t\t\t\t\tid: href.substr(27),\n\t\t\t\t\t\tdisplayname: href.substr(27),\n\t\t\t\t\t\twritable: readWrite\n\t\t\t\t\t});\n\t\t\t\t} else if (href.startsWith('principal:principals/groups/')) {\n\t\t\t\t\tthis._properties.sharedWith.groups.push({\n\t\t\t\t\t\tid: href.substr(28),\n\t\t\t\t\t\tdisplayname: href.substr(28),\n\t\t\t\t\t\twritable: readWrite\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar owner = props['{DAV:}owner'];\n\t\tif (typeof owner !== 'undefined' && owner.length !== 0) {\n\t\t\towner = owner[0].textContent.slice(0, -1);\n\t\t\tif (owner.startsWith('/remote.php/dav/principals/users/')) {\n\t\t\t\tthis._properties.owner = owner.substr(33);\n\t\t\t}\n\t\t}\n\n\t\t// this.tmpId = RandomStringService.generate();\n\t}\n\n\tCalendar.prototype = {\n\t\tget url() {\n\t\t\treturn this._properties.url;\n\t\t},\n\t\tget caldav() {\n\t\t\treturn $window.location.origin + this.url;\n\t\t},\n\t\tget exportUrl() {\n\t\t\tvar url = this.url;\n\t\t\t// cut off last slash to have a fancy name for the ics\n\t\t\tif (url.slice(url.length - 1) === '/') {\n\t\t\t\turl = url.slice(0, url.length - 1);\n\t\t\t}\n\t\t\turl += '?export';\n\t\t\treturn url;\n\t\t},\n\t\tget enabled() {\n\t\t\treturn this._properties.enabled;\n\t\t},\n\t\tget uri() {\n\t\t\treturn this._properties.uri;\n\t\t},\n\t\tget components() {\n\t\t\treturn this._properties.components;\n\t\t},\n\t\tset enabled(enabled) {\n\t\t\tthis._properties.enabled = enabled;\n\t\t\tthis._setUpdated('enabled');\n\t\t},\n\t\tget displayname() {\n\t\t\treturn this._properties.displayname;\n\t\t},\n\t\tset displayname(displayname) {\n\t\t\tthis._properties.displayname = displayname;\n\t\t\tthis._setUpdated('displayname');\n\t\t},\n\t\tget color() {\n\t\t\treturn this._properties.color;\n\t\t},\n\t\tset color(color) {\n\t\t\tthis._properties.color = color;\n\t\t\tthis._setUpdated('color');\n\t\t},\n\t\tget sharedWith() {\n\t\t\treturn this._properties.sharedWith;\n\t\t},\n\t\tset sharedWith(sharedWith) {\n\t\t\tthis._properties.sharedWith = sharedWith;\n\t\t},\n\t\tget textColor() {\n\t\t\tvar color = this.color;\n\t\t\tvar fallbackColor = '#fff';\n\t\t\tvar c;\n\t\t\tswitch (color.length) {\n\t\t\t\tcase 4:\n\t\t\t\t\tc = color.match(/^#([0-9a-f]{3})$/i)[1];\n\t\t\t\t\tif (c) {\n\t\t\t\t\t\treturn this._generateTextColor(parseInt(c.charAt(0), 16) * 0x11, parseInt(c.charAt(1), 16) * 0x11, parseInt(c.charAt(2), 16) * 0x11);\n\t\t\t\t\t}\n\t\t\t\t\treturn fallbackColor;\n\n\t\t\t\tcase 7:\n\t\t\t\tcase 9:\n\t\t\t\t\tvar regex = new RegExp('^#([0-9a-f]{' + (color.length - 1) + '})$', 'i');\n\t\t\t\t\tc = color.match(regex)[1];\n\t\t\t\t\tif (c) {\n\t\t\t\t\t\treturn this._generateTextColor(parseInt(c.substr(0, 2), 16), parseInt(c.substr(2, 2), 16), parseInt(c.substr(4, 2), 16));\n\t\t\t\t\t}\n\t\t\t\t\treturn fallbackColor;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn fallbackColor;\n\t\t\t}\n\t\t},\n\t\tget order() {\n\t\t\treturn this._properties.order;\n\t\t},\n\t\tset order(order) {\n\t\t\tthis._properties.order = order;\n\t\t\tthis._setUpdated('order');\n\t\t},\n\t\tget writable() {\n\t\t\treturn this._properties.writable;\n\t\t},\n\t\tget shareable() {\n\t\t\treturn this._properties.shareable;\n\t\t},\n\t\tget owner() {\n\t\t\treturn this._properties.owner;\n\t\t},\n\t\tget loadedCompleted() {\n\t\t\treturn this._properties.loadedCompleted;\n\t\t},\n\t\tset loadedCompleted(loadedCompleted) {\n\t\t\tthis._properties.loadedCompleted = loadedCompleted;\n\t\t},\n\t\t_setUpdated: function _setUpdated(propName) {\n\t\t\tif (this._updatedProperties.indexOf(propName) === -1) {\n\t\t\t\tthis._updatedProperties.push(propName);\n\t\t\t}\n\t\t},\n\t\tget updatedProperties() {\n\t\t\treturn this._updatedProperties;\n\t\t},\n\t\tresetUpdatedProperties: function resetUpdatedProperties() {\n\t\t\tthis._updatedProperties = [];\n\t\t},\n\t\tprepareUpdate: function prepareUpdate() {\n\t\t\tthis._propertiesBackup = angular.copy(this._properties);\n\t\t},\n\t\tresetToPreviousState: function resetToPreviousState() {\n\t\t\tthis._properties = angular.copy(this._propertiesBackup);\n\t\t\tthis._propertiesBackup = {};\n\t\t},\n\t\tdropPreviousState: function dropPreviousState() {\n\t\t\tthis._propertiesBackup = {};\n\t\t},\n\t\ttoggleSharesEditor: function toggleSharesEditor() {\n\t\t\tthis.list.editingShares = !this.list.editingShares;\n\t\t},\n\t\t_generateTextColor: function _generateTextColor(r, g, b) {\n\t\t\tvar brightness = (r * 299 + g * 587 + b * 114) / 1000;\n\t\t\treturn brightness > 130 ? '#000000' : '#FAFAFA';\n\t\t}\n\t};\n\n\treturn Calendar;\n}]);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('CollectionsModel', ['TasksModel', '_Model', function (TasksModel, _Model) {\n\t\tvar CollectionsModel = function (_super) {\n\n\t\t\tfunction CollectionsModel(_$tasksmodel) {\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._nameCache = {};\n\t\t\t\tCollectionsModel.__super__.constructor.call(this);\n\t\t\t}\n\n\t\t\t__extends(CollectionsModel, _super);\n\n\t\t\tCollectionsModel.prototype.add = function (data, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tthis._nameCache[data.displayname] = data;\n\t\t\t\tif (angular.isDefined(data.id)) {\n\t\t\t\t\treturn CollectionsModel.__super__.add.call(this, data, clearCache);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tCollectionsModel.prototype.getCount = function (collectionID, filter) {\n\t\t\t\tvar count, task, tasks, _i, _len;\n\t\t\t\tif (filter === null) {\n\t\t\t\t\tfilter = '';\n\t\t\t\t}\n\t\t\t\tcount = 0;\n\t\t\t\ttasks = this._$tasksmodel.filteredTasks(filter);\n\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tcount += this._$tasksmodel.filterTasks(task, collectionID) && !task.related;\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t};\n\n\t\t\treturn CollectionsModel;\n\t\t}(_Model);\n\t\treturn new CollectionsModel(TasksModel);\n\t}]);\n}).call(undefined);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('ListsModel', ['TasksModel', '_Model', function (TasksModel, _Model) {\n\t\tvar ListsModel = function (_super) {\n\n\t\t\tfunction ListsModel(_$tasksmodel) {\n\t\t\t\tthis._$tasksmodel = _$tasksmodel;\n\t\t\t\tthis._tmpUriCache = {};\n\t\t\t\tthis._data = [];\n\t\t\t\tthis._dataMap = {};\n\t\t\t\tthis._filterCache = {};\n\t\t\t}\n\n\t\t\t__extends(ListsModel, _super);\n\n\t\t\tListsModel.prototype.add = function (calendar, clearCache) {\n\t\t\t\tvar updateByUri;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tupdateByUri = angular.isDefined(calendar.uri) && angular.isDefined(this.getByUri(calendar.uri));\n\t\t\t\tif (updateByUri) {\n\t\t\t\t\treturn this.update(calendar, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\tif (angular.isDefined(calendar.uri)) {\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!angular.isDefined(this._dataMap[calendar.uri])) {\n\t\t\t\t\t\t\tthis._data.push(calendar);\n\t\t\t\t\t\t\tthis._dataMap[calendar.uri] = calendar;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.getByUri = function (uri) {\n\t\t\t\treturn this._dataMap[uri];\n\t\t\t};\n\n\t\t\tListsModel.prototype.update = function (list, clearCache) {\n\t\t\t\tvar tmplist;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\ttmplist = this._tmpIdCache[list.tmpID];\n\t\t\t\tif (angular.isDefined(list.id) && angular.isDefined(tmplist) && angular.isUndefined(tmplist.id)) {\n\t\t\t\t\ttmplist.id = list.id;\n\t\t\t\t\tthis._dataMap[list.id] = tmplist;\n\t\t\t\t}\n\t\t\t\tlist[\"void\"] = false;\n\t\t\t\treturn ListsModel.__super__.update.call(this, list, clearCache);\n\t\t\t};\n\n\t\t\tListsModel.prototype[\"delete\"] = function (calendar, clearCache) {\n\t\t\t\tvar counter, data, entry, _i, _len, _ref;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\t_ref = this._data;\n\t\t\t\tfor (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) {\n\t\t\t\t\tentry = _ref[counter];\n\t\t\t\t\tif (entry === calendar) {\n\t\t\t\t\t\tthis._data.splice(counter, 1);\n\t\t\t\t\t\tdata = this._dataMap[calendar.uri];\n\t\t\t\t\t\tdelete this._dataMap[calendar.uri];\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.getStandardList = function () {\n\t\t\t\tvar calendars;\n\t\t\t\tif (this.size()) {\n\t\t\t\t\tcalendars = this.getAll();\n\t\t\t\t\treturn calendars[0];\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.isNameAlreadyTaken = function (displayname, uri) {\n\t\t\t\tvar calendar, calendars, ret, _i, _len;\n\t\t\t\tcalendars = this.getAll();\n\t\t\t\tret = false;\n\t\t\t\tfor (_i = 0, _len = calendars.length; _i < _len; _i++) {\n\t\t\t\t\tcalendar = calendars[_i];\n\t\t\t\t\tif (calendar.displayname === displayname && calendar.uri !== uri) {\n\t\t\t\t\t\tret = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t};\n\n\t\t\tListsModel.prototype.getCount = function (calendarID, collectionID, filter) {\n\t\t\t\tvar count, task, tasks, _i, _len;\n\t\t\t\tif (filter === null) {\n\t\t\t\t\tfilter = '';\n\t\t\t\t}\n\t\t\t\tcount = 0;\n\t\t\t\ttasks = this._$tasksmodel.filteredTasks(filter);\n\t\t\t\tfor (_i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tcount += this._$tasksmodel.filterTasks(task, collectionID) && task.calendar.uri === calendarID && !task.related;\n\t\t\t\t}\n\t\t\t\t// if (collectionID === 'completed' && filter === '') {\n\t\t\t\t// count += this.notLoaded(calendarID);\n\t\t\t\t// }\n\t\t\t\treturn count;\n\t\t\t};\n\n\t\t\tListsModel.prototype.loadedCompleted = function (calendarID) {\n\t\t\t\tif (angular.isUndefined(this.getById(calendarID))) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn this.getById(calendarID).loadedCompleted;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.setLoadedCompleted = function (calendarID) {\n\t\t\t\tthis.getById(calendarID).loadedCompleted = true;\n\t\t\t};\n\n\t\t\tListsModel.prototype.getColor = function (calendarID) {\n\t\t\t\tif (angular.isUndefined(this.getById(calendarID))) {\n\t\t\t\t\treturn '#CCCCCC';\n\t\t\t\t} else {\n\t\t\t\t\treturn this.getById(calendarID).calendarcolor;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListsModel.prototype.getName = function (calendarID) {\n\t\t\t\tif (angular.isUndefined(this.getById(calendarID))) {\n\t\t\t\t\treturn '';\n\t\t\t\t} else {\n\t\t\t\t\treturn this.getById(calendarID).displayname;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn ListsModel;\n\t\t}(_Model);\n\t\treturn new ListsModel(TasksModel);\n\t}]);\n}).call(undefined);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('SettingsModel', ['_Model', function (_Model) {\n\t\tvar SettingsModel = function (_super) {\n\n\t\t\tfunction SettingsModel() {\n\t\t\t\tthis._nameCache = {};\n\t\t\t\tSettingsModel.__super__.constructor.call(this);\n\t\t\t}\n\n\t\t\t__extends(SettingsModel, _super);\n\n\t\t\tSettingsModel.prototype.add = function (data, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tthis._nameCache[data.displayname] = data;\n\t\t\t\tif (angular.isDefined(data.id)) {\n\t\t\t\t\treturn SettingsModel.__super__.add.call(this, data, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\treturn this._data.push(data);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tSettingsModel.prototype.toggle = function (type, setting) {\n\t\t\t\tvar set;\n\t\t\t\tset = this.getById(type);\n\t\t\t\tthis.getById(type)[setting] = !set[setting];\n\t\t\t};\n\t\t\treturn SettingsModel;\n\t\t}(_Model);\n\t\treturn new SettingsModel();\n\t}]);\n}).call(undefined);","'use strict';\n\n(function () {\n\t'use strict';\n\n\tvar __hasProp = {}.hasOwnProperty,\n\t __extends = function __extends(child, parent) {\n\t\tfor (var key in parent) {\n\t\t\tif (__hasProp.call(parent, key)) {\n\t\t\t\tchild[key] = parent[key];\n\t\t\t}\n\t\t}\n\t\tfunction Ctor() {\n\t\t\tthis.constructor = child;\n\t\t}\n\t\tCtor.prototype = parent.prototype;\n\t\tchild.prototype = new Ctor();\n\t\tchild.__super__ = parent.prototype;\n\t\treturn child;\n\t},\n\t __indexOf = [].indexOf || function (item) {\n\t\tfor (var i = 0, l = this.length; i < l; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n\n\tangular.module('Tasks').factory('TasksModel', ['_Model', function (_Model) {\n\t\tvar TasksModel = function (_super) {\n\n\t\t\tfunction TasksModel() {\n\t\t\t\tthis._tmpIdCache = {};\n\t\t\t\tTasksModel.__super__.constructor.call(this);\n\t\t\t}\n\n\t\t\t__extends(TasksModel, _super);\n\n\t\t\tTasksModel.prototype.ad = function (task, clearCache) {\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tvar updateByUri = angular.isDefined(task.uri) && angular.isDefined(this.getByUri(task.uri));\n\t\t\t\tif (updateByUri) {\n\t\t\t\t\treturn this.update(task, clearCache);\n\t\t\t\t} else {\n\t\t\t\t\tif (angular.isDefined(task.uri)) {\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!angular.isDefined(this._dataMap[task.uri])) {\n\t\t\t\t\t\t\tthis._data.push(task);\n\t\t\t\t\t\t\tthis._dataMap[task.uri] = task;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getByUri = function (uri) {\n\t\t\t\treturn this._dataMap[uri];\n\t\t\t};\n\n\t\t\tTasksModel.prototype.update = function (task, clearCache) {\n\n\t\t\t\tvar entry, key, value, _results;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\tif (clearCache) {\n\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t}\n\t\t\t\tentry = this.getByUri(task.uri);\n\t\t\t\tentry.components = task.components;\n\t\t\t\tentry.components.toString();\n\t\t\t\treturn entry;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.removeById = function (taskID) {\n\t\t\t\treturn TasksModel.__super__.removeById.call(this, taskID);\n\t\t\t};\n\n\t\t\tTasksModel.prototype[\"delete\"] = function (task, clearCache) {\n\t\t\t\tvar counter, data, entry, _i, _len, _ref;\n\t\t\t\tif (clearCache === null) {\n\t\t\t\t\tclearCache = true;\n\t\t\t\t}\n\t\t\t\t_ref = this._data;\n\t\t\t\tfor (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) {\n\t\t\t\t\tentry = _ref[counter];\n\t\t\t\t\tif (entry === task) {\n\t\t\t\t\t\tthis._data.splice(counter, 1);\n\t\t\t\t\t\tdata = this._dataMap[task.uri];\n\t\t\t\t\t\tdelete this._dataMap[task.uri];\n\t\t\t\t\t\tif (clearCache) {\n\t\t\t\t\t\t\tthis._invalidateCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.removeByList = function (listID) {\n\t\t\t\tvar id, task, taskIDs, tasks, _results;\n\t\t\t\ttasks = this.getAll();\n\t\t\t\ttaskIDs = [];\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\tif (task.calendarid === listID) {\n\t\t\t\t\t\ttaskIDs.push(task.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_results = [];\n\t\t\t\tfor (var _j = 0, _len1 = taskIDs.length; _j < _len1; _j++) {\n\t\t\t\t\tid = taskIDs[_j];\n\t\t\t\t\t_results.push(this.removeById(id));\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.taskAtDay = function (task, date) {\n\t\t\t\tvar diff, due, duediff, start, startdiff;\n\t\t\t\tstart = moment(task.start, \"YYYYMMDDTHHmmss\");\n\t\t\t\tdue = moment(task.due, \"YYYYMMDDTHHmmss\");\n\t\t\t\tif (start.isValid() && !due.isValid()) {\n\t\t\t\t\tdiff = start.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tif (!date && diff < date + 1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (diff < date + 1 && diff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (due.isValid() && !start.isValid()) {\n\t\t\t\t\tdiff = due.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tif (!date && diff < date + 1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (diff < date + 1 && diff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (start.isValid() && due.isValid()) {\n\t\t\t\t\tstartdiff = start.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tduediff = due.diff(moment().startOf('day'), 'days', true);\n\t\t\t\t\tif (!date && (startdiff < date + 1 || duediff < date + 1)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (startdiff < date + 1 && startdiff >= date && duediff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (duediff < date + 1 && duediff >= date && startdiff >= date) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.isLoaded = function (task) {\n\t\t\t\tif (this.getById(task.id)) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.hasSubtasks = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.related === uid) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.hasCompletedSubtasks = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.related === uid && task.completed) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.hasNoParent = function (task) {\n\t\t\t\tif (!task.related) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tvar tasks = this.getAll();\n\t\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\tvar t = tasks[_i];\n\t\t\t\t\t\tif (task.related === t.uid && task !== t) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getIdByUid = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.uid === uid) {\n\t\t\t\t\t\treturn task.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getByUid = function (uid) {\n\t\t\t\tvar tasks = this.getAll();\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tvar task = tasks[_i];\n\t\t\t\t\tif (task.uid === uid) {\n\t\t\t\t\t\treturn task;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getChildren = function (task) {\n\t\t\t\tvar children, t, tasks;\n\t\t\t\ttasks = this.getAll();\n\t\t\t\tchildren = [];\n\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\tt = tasks[_i];\n\t\t\t\t\tif (t.related === task.uid && t !== task) {\n\t\t\t\t\t\tchildren.push(t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn children;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.getDescendantIDs = function (task) {\n\t\t\t\tvar child, children, descendantIDs;\n\t\t\t\tchildren = this.getChildren(task);\n\t\t\t\tdescendantIDs = [];\n\t\t\t\tfor (var _i = 0, _len = children.length; _i < _len; _i++) {\n\t\t\t\t\tchild = children[_i];\n\t\t\t\t\tdescendantIDs = descendantIDs.concat(child.uri);\n\t\t\t\t\tdescendantIDs = descendantIDs.concat(this.getDescendantIDs(child));\n\t\t\t\t}\n\t\t\t\treturn descendantIDs;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.filterTasks = function (task, filter) {\n\t\t\t\tswitch (filter) {\n\t\t\t\t\tcase 'completed':\n\t\t\t\t\t\treturn task.completed === true;\n\t\t\t\t\tcase 'all':\n\t\t\t\t\t\treturn task.completed === false;\n\t\t\t\t\tcase 'current':\n\t\t\t\t\t\treturn task.completed === false && this.current(task.start, task.due);\n\t\t\t\t\tcase 'starred':\n\t\t\t\t\t\treturn task.completed === false && task.priority > 5;\n\t\t\t\t\tcase 'today':\n\t\t\t\t\t\treturn task.completed === false && (this.today(task.start) || this.today(task.due));\n\t\t\t\t\tcase 'week':\n\t\t\t\t\t\treturn task.completed === false && (this.week(task.start) || this.week(task.due));\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn '' + task.calendar.uri === '' + filter;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.filteredTasks = function (needle) {\n\t\t\t\tvar ancestors, parentID, ret, task, tasks;\n\t\t\t\tret = [];\n\t\t\t\ttasks = this.getAll();\n\t\t\t\tif (!needle) {\n\t\t\t\t\tret = tasks;\n\t\t\t\t} else {\n\t\t\t\t\tfor (var _i = 0, _len = tasks.length; _i < _len; _i++) {\n\t\t\t\t\t\ttask = tasks[_i];\n\t\t\t\t\t\tif (this.filterTasksByString(task, needle)) {\n\t\t\t\t\t\t\tif (this.objectExists(task, ret)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tret.push(task);\n\t\t\t\t\t\t\tparentID = this.getIdByUid(task.related);\n\t\t\t\t\t\t\tancestors = this.getAncestor(parentID, ret);\n\t\t\t\t\t\t\tif (ancestors) {\n\t\t\t\t\t\t\t\tret = ret.concat(ancestors);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.objectExists = function (task, ret) {\n\t\t\t\tfor (var _i = 0, _len = ret.length; _i < _len; _i++) {\n\t\t\t\t\tvar re = ret[_i];\n\t\t\t\t\tif (re.id === task.id) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.filterTasksByString = function (task, filter) {\n\t\t\t\tvar key, keys, value;\n\t\t\t\tkeys = ['name', 'note', 'location', 'categories', 'comments'];\n\t\t\t\tfilter = filter.toLowerCase();\n\t\t\t\tfor (key in task) {\n\t\t\t\t\tvalue = task[key];\n\t\t\t\t\tif (__indexOf.call(keys, key) >= 0) {\n\t\t\t\t\t\tif (key === 'comments') {\n\t\t\t\t\t\t\tif (this.searchComments(task.comments, filter)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (key === 'categories') {\n\t\t\t\t\t\t\tif (this.searchCategories(task.categories, filter)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (value.toLowerCase().indexOf(filter) !== -1) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.searchComments = function (comments, filter) {\n\t\t\t\tfor (var _i = 0, _len = comments.length; _i < _len; _i++) {\n\t\t\t\t\tvar comment = comments[_i];\n\t\t\t\t\tif (comment.comment.toLowerCase().indexOf(filter) !== -1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.searchCategories = function (categories, filter) {\n\t\t\t\tfor (var _i = 0, _len = categories.length; _i < _len; _i++) {\n\t\t\t\t\tvar category = categories[_i];\n\t\t\t\t\tif (category.toLowerCase().indexOf(filter) !== -1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.setReminder = function (taskID, reminder) {\n\t\t\t\treturn this.update({\n\t\t\t\t\tid: taskID,\n\t\t\t\t\treminder: reminder\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tTasksModel.prototype.overdue = function (due) {\n\t\t\t\treturn moment(due, \"YYYYMMDDTHHmmss\").isValid() && moment(due, \"YYYYMMDDTHHmmss\").diff(moment()) < 0;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.due = function (due) {\n\t\t\t\treturn moment(due, 'YYYYMMDDTHHmmss').isValid();\n\t\t\t};\n\n\t\t\tTasksModel.prototype.today = function (due) {\n\t\t\t\treturn moment(due, \"YYYYMMDDTHHmmss\").isValid() && moment(due, \"YYYYMMDDTHHmmss\").diff(moment().startOf('day'), 'days', true) < 1;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.week = function (due) {\n\t\t\t\treturn moment(due, \"YYYYMMDDTHHmmss\").isValid() && moment(due, \"YYYYMMDDTHHmmss\").diff(moment().startOf('day'), 'days', true) < 7;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.current = function (start, due) {\n\t\t\t\treturn !moment(start, \"YYYYMMDDTHHmmss\").isValid() || moment(start, \"YYYYMMDDTHHmmss\").diff(moment(), 'days', true) < 0 || moment(due, \"YYYYMMDDTHHmmss\").diff(moment(), 'days', true) < 0;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.addComment = function (comment) {\n\t\t\t\tvar task;\n\t\t\t\ttask = this.getById(comment.taskID);\n\t\t\t\tif (task.comments) {\n\t\t\t\t\ttask.comments.push(comment);\n\t\t\t\t} else {\n\t\t\t\t\ttask.comments = [comment];\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tTasksModel.prototype.updateComment = function (comment) {\n\t\t\t\tvar com, i, task, _i, _len, _ref, _results;\n\t\t\t\ttask = this.getById(comment.taskID);\n\t\t\t\ti = 0;\n\t\t\t\t_ref = task.comments;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t\t\t\tcom = _ref[_i];\n\t\t\t\t\tif (com.tmpID === comment.tmpID) {\n\t\t\t\t\t\ttask.comments[i] = comment;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t_results.push(i++);\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\tTasksModel.prototype.deleteComment = function (taskID, commentID) {\n\t\t\t\tvar comment, i, task, _i, _len, _ref, _results;\n\t\t\t\ttask = this.getById(taskID);\n\t\t\t\ti = 0;\n\t\t\t\t_ref = task.comments;\n\t\t\t\t_results = [];\n\t\t\t\tfor (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t\t\t\tcomment = _ref[_i];\n\t\t\t\t\tif (comment.id === commentID) {\n\t\t\t\t\t\ttask.comments.splice(i, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t_results.push(i++);\n\t\t\t\t}\n\t\t\t\treturn _results;\n\t\t\t};\n\n\t\t\treturn TasksModel;\n\t\t}(_Model);\n\t\treturn new TasksModel();\n\t}]);\n}).call(undefined);","'use strict';\n\nangular.module('Tasks').factory('VTodo', ['$filter', 'ICalFactory', 'RandomStringService', function ($filter, icalfactory, RandomStringService) {\n\t'use strict';\n\n\tfunction VTodo(calendar, props, uri) {\n\t\tvar _this = this;\n\n\t\tangular.extend(this, {\n\t\t\tcalendar: calendar,\n\t\t\tdata: props['{urn:ietf:params:xml:ns:caldav}calendar-data'],\n\t\t\turi: uri,\n\t\t\tetag: props['{DAV:}getetag'] || null,\n\t\t\ttimers: [],\n\t\t\tloaded: false\n\t\t});\n\n\t\tthis.jCal = ICAL.parse(this.data);\n\t\tthis.components = new ICAL.Component(this.jCal);\n\n\t\tif (this.components.jCal.length === 0) {\n\t\t\tthrow \"invalid calendar\";\n\t\t}\n\t}\n\n\tVTodo.prototype = {\n\t\tget summary() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('summary');\n\t\t},\n\t\tset summary(summary) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('summary', summary);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget priority() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar priority = vtodos[0].getFirstPropertyValue('priority');\n\t\t\treturn (10 - priority) % 10;\n\t\t},\n\t\tset priority(priority) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('priority', (10 - priority) % 10);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget complete() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('percent-complete') || 0;\n\t\t},\n\t\tset complete(complete) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('percent-complete', complete);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t\tif (complete < 100) {\n\t\t\t\tthis.completed = null;\n\t\t\t\tif (complete === 0) {\n\t\t\t\t\tthis.status = 'NEEDS-ACTION';\n\t\t\t\t} else {\n\t\t\t\t\tthis.status = 'IN-PROCESS';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.completed = ICAL.Time.now();\n\t\t\t\tthis.status = 'COMPLETED';\n\t\t\t}\n\t\t},\n\t\tget completed() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar comp = vtodos[0].getFirstPropertyValue('completed');\n\t\t\tif (comp) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tset completed(completed) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (completed) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('completed', completed);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('completed');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget completed_date() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar comp = vtodos[0].getFirstPropertyValue('completed');\n\t\t\tif (comp) {\n\t\t\t\treturn comp.toJSDate();\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t},\n\t\tget status() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('status');\n\t\t},\n\t\tset status(status) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('status', status);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget note() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('description') || '';\n\t\t},\n\t\tset note(note) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('description', note);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget uid() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('uid') || '';\n\t\t},\n\t\tget related() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('related-to') || null;\n\t\t},\n\t\tset related(related) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (related) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('related-to', related);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('related-to');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget hideSubtasks() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn +vtodos[0].getFirstPropertyValue('x-oc-hidesubtasks') || 0;\n\t\t},\n\t\tset hideSubtasks(hide) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('x-oc-hidesubtasks', +hide);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget hideCompletedSubtasks() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn +vtodos[0].getFirstPropertyValue('x-oc-hidecompletedsubtasks') || 0;\n\t\t},\n\t\tset hideCompletedSubtasks(hide) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('x-oc-hidecompletedsubtasks', +hide);\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget reminder() {\n\t\t\treturn null;\n\t\t},\n\t\tget categories() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar categories = vtodos[0].getFirstProperty('categories');\n\t\t\tif (categories) {\n\t\t\t\treturn categories.getValues();\n\t\t\t} else {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\tset categories(cats) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar categories = vtodos[0].getFirstProperty('categories');\n\t\t\tif (cats.length > 0) {\n\t\t\t\tif (categories) {\n\t\t\t\t\tcategories.setValues(cats);\n\t\t\t\t} else {\n\t\t\t\t\tvar prop = new ICAL.Property('categories');\n\t\t\t\t\tprop.setValues(cats);\n\t\t\t\t\tcategories = vtodos[0].addProperty(prop);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('categories');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget start() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('dtstart');\n\t\t},\n\t\tset start(start) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (start) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('dtstart', start);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('dtstart');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget due() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\treturn vtodos[0].getFirstPropertyValue('due');\n\t\t},\n\t\tset due(due) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tif (due) {\n\t\t\t\tvtodos[0].updatePropertyWithValue('due', due);\n\t\t\t} else {\n\t\t\t\tvtodos[0].removeProperty('due');\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget allDay() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar start = vtodos[0].getFirstPropertyValue('dtstart');\n\t\t\tvar due = vtodos[0].getFirstPropertyValue('due');\n\t\t\tvar d = due ? due : start;\n\t\t\treturn d !== null && d.isDate;\n\t\t},\n\t\tset allDay(allDay) {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvar start = vtodos[0].getFirstPropertyValue('dtstart');\n\t\t\tif (start) {\n\t\t\t\tstart.isDate = allDay;\n\t\t\t\tvtodos[0].updatePropertyWithValue('dtstart', start);\n\t\t\t}\n\t\t\tvar due = vtodos[0].getFirstPropertyValue('due');\n\t\t\tif (due) {\n\t\t\t\tdue.isDate = allDay;\n\t\t\t\tvtodos[0].updatePropertyWithValue('due', due);\n\t\t\t}\n\t\t\tthis.updateLastModified();\n\t\t\tthis.data = this.components.toString();\n\t\t},\n\t\tget comments() {\n\t\t\treturn null;\n\t\t},\n\t\tget loadedCompleted() {\n\t\t\treturn this.loaded;\n\t\t},\n\t\tset loadedCompleted(loadedCompleted) {\n\t\t\tthis.loaded = loadedCompleted;\n\t\t},\n\t\tupdateLastModified: function updateLastModified() {\n\t\t\tvar vtodos = this.components.getAllSubcomponents('vtodo');\n\t\t\tvtodos[0].updatePropertyWithValue('last-modified', ICAL.Time.now());\n\t\t\tvtodos[0].updatePropertyWithValue('dtstamp', ICAL.Time.now());\n\t\t}\n\t};\n\n\tVTodo.create = function (task) {\n\t\tvar comp = icalfactory.new();\n\n\t\tvar vtodo = new ICAL.Component('vtodo');\n\t\tcomp.addSubcomponent(vtodo);\n\t\tvtodo.updatePropertyWithValue('created', ICAL.Time.now());\n\t\tvtodo.updatePropertyWithValue('dtstamp', ICAL.Time.now());\n\t\tvtodo.updatePropertyWithValue('last-modified', ICAL.Time.now());\n\t\tvtodo.updatePropertyWithValue('uid', RandomStringService.generate());\n\t\tvtodo.updatePropertyWithValue('summary', task.summary);\n\t\tvtodo.updatePropertyWithValue('priority', task.priority);\n\t\tvtodo.updatePropertyWithValue('percent-complete', task.complete);\n\t\tvtodo.updatePropertyWithValue('x-oc-hidesubtasks', 0);\n\t\tif (task.related) {\n\t\t\tvtodo.updatePropertyWithValue('related-to', task.related);\n\t\t}\n\t\tif (task.note) {\n\t\t\tvtodo.updatePropertyWithValue('description', task.note);\n\t\t}\n\t\tif (task.due) {\n\t\t\tvtodo.updatePropertyWithValue('due', task.due);\n\t\t}\n\t\tif (task.start) {\n\t\t\tvtodo.updatePropertyWithValue('dtstart', task.start);\n\t\t}\n\n\t\treturn new VTodo(task.calendar, {\n\t\t\t'{urn:ietf:params:xml:ns:caldav}calendar-data': comp.toString(),\n\t\t\t'{DAV:}getetag': null\n\t\t}, null);\n\t};\n\n\treturn VTodo;\n}]);"]}
\ No newline at end of file |