-
Notifications
You must be signed in to change notification settings - Fork 0
Phone app #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
viskosa
wants to merge
19
commits into
master
Choose a base branch
from
phoneApp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Phone app #17
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4b321a5
phoneApp
viskosa 868b14d
start working with phoneapp
viskosa 314b6a1
it seems a phonebook is done
viskosa bc2c99e
rendering of contacts page was done
viskosa 6228af2
folders were deleted
viskosa 7ea8c7a
homeworks & classworks folders were returned
viskosa 5d8cc42
phoneApp was moved
viskosa f874edd
contacts page was virtualized
viskosa 84f468d
footer was make like a static content
viskosa ce0a090
keypad.js was done
viskosa 8a17850
edit-contact, user, add-user pages were virtualized
viskosa 7041908
refactoring
viskosa 37e75e9
refactoring v.2
viskosa 390e16a
try to make request
viskosa b3debda
some changes
viskosa 9f21e51
adding user was done
viskosa 1b3876b
opportuniry to edit & delete user added
viskosa 7309c63
webpack was added
viskosa f567994
phone number was formatted, trying to configure webpack
viskosa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -5,56 +5,48 @@ | |
| //При удалении всех символов отобразить снова весь список | ||
|
|
||
| class AddUser { | ||
| constructor(globalState){ | ||
| this.state = globalState; //стал равен this.state-у со страницы App.js | ||
| } | ||
| constructor(globalState) { | ||
| this.state = globalState; //стал равен this.state-у со страницы App.js | ||
| } | ||
|
|
||
| buttonsHandler(){ | ||
| let buttonsParent = document.querySelector('main'); | ||
| buttonsParent.addEventListener('click', this.clickHandler.bind(this)); | ||
| } | ||
| buttonsHandler() { | ||
| let buttonsParent = document.querySelector("main"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use const instead of let |
||
| buttonsParent.addEventListener("click", this.clickHandler.bind(this)); | ||
| } | ||
|
|
||
| clickHandler(e) { | ||
| clickHandler(e) { | ||
| let target = e && e.target; | ||
| if (!target) return; | ||
|
|
||
| let target = e && e.target; | ||
| if (!target) return; | ||
| let active = | ||
| e && | ||
| e.target && | ||
| (e.target.closest("button") || | ||
| e.target.classList.contains("add-btn")); | ||
| if (active == false) return; | ||
|
|
||
| let active = e && e.target && (e.target.closest('button') || e.target.classList.contains('add-btn')); | ||
| if (active == false) return; | ||
| let input = active.querySelector("input"); | ||
| input.style.backgroundColor = "lightgreen"; | ||
|
|
||
| let input = active.querySelector('input'); | ||
| input.style.backgroundColor = 'lightgreen'; | ||
| input.addEventListener("blur", () => { | ||
| input.removeAttribute("style"); | ||
| }); | ||
| } | ||
|
|
||
| input.addEventListener('blur', () => { | ||
| input.removeAttribute('style'); | ||
| }) | ||
|
|
||
| } | ||
|
|
||
| renderInfo(value) { | ||
| return `<div class="edit-field"> | ||
| renderInfo(value) { | ||
| return `<div class="edit-field"> | ||
| <button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span> | ||
| <input type="text" placeholder="${value}"></input> | ||
| </button> | ||
| </div>`; | ||
| } | ||
| } | ||
|
|
||
| renderLink(options) { | ||
| let {href, glyphicon, text, active} = options; | ||
| let activeClass = active ? 'active' : ''; | ||
| setHandlers() { | ||
| this.buttonsHandler(); | ||
| } | ||
|
|
||
| return `<a href="${href}.html" class="tab ${activeClass}"> | ||
| <span class="glyphicon glyphicon-${glyphicon}" aria-hidden="true"></span> | ||
| <span class = "tab-text">${text}</span> | ||
| </a> ` | ||
| } | ||
|
|
||
| setEvents(){ | ||
| this.buttonsHandler(); | ||
| } | ||
|
|
||
| render() { | ||
| return `<header class="header"> | ||
| render() { | ||
| return `<header class="header"> | ||
| <div class="container top-radius"> | ||
| <nav class="user-top-line"> | ||
| <a href="user.html">Cansel</a> | ||
|
|
@@ -73,28 +65,26 @@ class AddUser { | |
| </button> | ||
| </div> | ||
| <div class="main-info-holder"> | ||
| ${this.renderInfo('First Name')} | ||
| ${this.renderInfo('Last Name')} | ||
| ${this.renderInfo('Company')} | ||
| ${this.renderInfo("First Name")} | ||
| ${this.renderInfo("Last Name")} | ||
| ${this.renderInfo("Company")} | ||
| </div> | ||
| </div> | ||
| <div class="scroll-holder"> | ||
| <div class="edit-info"> | ||
| ${this.renderInfo('add mobile phone')} | ||
| ${this.renderInfo('add home phone')} | ||
| ${this.renderInfo('add email')} | ||
| ${this.renderInfo('add address')} | ||
| ${this.renderInfo('add birthday')} | ||
| ${this.renderInfo('add social profile')} | ||
| ${this.renderInfo('add field')} | ||
| ${this.renderInfo("add mobile phone")} | ||
| ${this.renderInfo("add home phone")} | ||
| ${this.renderInfo("add email")} | ||
| ${this.renderInfo("add address")} | ||
| ${this.renderInfo("add birthday")} | ||
| ${this.renderInfo("add social profile")} | ||
| ${this.renderInfo("add field")} | ||
| <div class="edit-field"> | ||
| <button href="#" class="delete-contact">delete contact</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </main>` | ||
|
|
||
| /*this.setEvents();*/ | ||
| } | ||
| </main>`; | ||
| } | ||
| } | ||
This file contains hidden or 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,22 @@ | ||
| /* | ||
| TASK 2 | ||
| phone-app. Первая страница. | ||
| Загружайте пользователей с сервера при загрузке странице. | ||
| */ | ||
|
|
||
| /* | ||
| // contentEditable | ||
| Сделайте, чтобы на странице add-user.html пользователь | ||
| добавлялся на сервер. | ||
| /* | ||
| Добавить возможность из формы, ДОБАВЛЯТЬ Пользователя на сервер | ||
| add-user | ||
| */ | ||
|
|
||
| // Для PhoneBook сделайте отдельный репозиторий + gh-pages | ||
|
|
||
| // Рекомендую - вам необходимо сделать 1 метод(или отдельный класс) | ||
| // который будет отправлять запросы | ||
| // доступ к этому сервису должен быть в каждом вашем классе | ||
| // url - должен быть константа, т.к url у вас изменяться не будет. | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so huge tabs