-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated styles. Rewrited js on classes and imorts
- Loading branch information
1 parent
312f988
commit 3f326dd
Showing
8 changed files
with
402 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/** | ||
* API methods | ||
*/ | ||
export class TodolistAPI { | ||
constructor () {} | ||
|
||
/** | ||
* Get list of all groups | ||
* | ||
* @returns jqXHR | ||
*/ | ||
getGroupsList () { | ||
return $.get('/api/group/list', {}, 'json'); | ||
} | ||
|
||
/** | ||
* Delete group by name | ||
* | ||
* @param {string} group | ||
* @returns jqXHR | ||
*/ | ||
deleteGroup (group) { | ||
return $.get('/api/group/delete', { | ||
group: group | ||
}, 'json'); | ||
} | ||
|
||
/** | ||
* Get all todos | ||
* | ||
* @returns jqXHR | ||
*/ | ||
getAllTodos () { | ||
return $.get('/api/todos/all', {}, 'json'); | ||
} | ||
|
||
/** | ||
* Get todos by group name | ||
* | ||
* @param {string} group | ||
* @returns jqXHR | ||
*/ | ||
getTodosByGroup (group) { | ||
return $.get('/api/todos', { | ||
group: group | ||
}, 'json'); | ||
} | ||
|
||
/** | ||
* Change todo status | ||
* | ||
* @param {string} group | ||
* @param {number} id | ||
* @param {string} status | ||
* @returns jqXHR | ||
*/ | ||
changeTodoStatus (group, id, status) { | ||
return $.get('/api/todos/status/change', { | ||
group: group, | ||
todoid: id, | ||
status: status | ||
}, 'json'); | ||
}; | ||
|
||
/** | ||
* Create new todo in group | ||
* | ||
* @param {string} group | ||
* @param {string} text | ||
* @returns jqXHR | ||
*/ | ||
createNewTodo (group, text) { | ||
return $.get('/api/todos/add', { | ||
group: group, | ||
text: text, | ||
}, 'json'); | ||
}; | ||
|
||
/** | ||
* Delete todo item | ||
* | ||
* @param {string} group | ||
* @param {number} todoid | ||
* @returns jqXHR | ||
*/ | ||
deleteTodo (group, todoid) { | ||
return $.get('/api/todos/delete', { | ||
group: group, | ||
todoid: todoid, | ||
}, 'json'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { TodolistAPI } from "./api.js"; | ||
import { TodolistUI } from "./ui.js"; | ||
|
||
const api = new TodolistAPI(); | ||
const ui = new TodolistUI(api); | ||
ui.init(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.