Skip to content

Lab8 - #9

Open
aadereiko wants to merge 23 commits into
masterfrom
lab8
Open

Lab8#9
aadereiko wants to merge 23 commits into
masterfrom
lab8

Conversation

@aadereiko

Copy link
Copy Markdown
Owner

No description provided.

Comment thread public/index.html
<script src="./js/EventsModule.js"></script>
<script src ="./js/ViewModule.js"></script>
<script src="./js/ApplicationModule.js"></script>
<script src="./js/scrypt.js"></script>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrypt ??

Comment thread public/index.html
<select class="filter-blocks" name="Популярные хэштеги" title="Популярные хэштеги" size="1" id = "selectFilter">
<option disabled> Выберите популярный хэштег</option>
<option value =""></option>
<option>Закат</option>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лишние option почистить если не используются
Здесь только дефолт.

Comment thread public/index.html
</header>
<!--block of filters-->
<div class="filters">
<div class="filter-blocks"><label>Логин: <input class="filter-input" type="text" name="firstname" id="login">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name="firstname" в инпутах либо убрать совсем, либо использовать форму

Comment thread public/index.html
</label></div>
<div class="filter-blocks"><label>Дата: <input class="filter-input" type="text" name="firstname" id="date">
</label></div>
<select class="filter-blocks" name="Популярные хэштеги" title="Популярные хэштеги" size="1" id = "selectFilter">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name="Популярные хэштеги" -
name - технический атрибут со фполне четкими вариантами использования, никакой кирилицы!!! Называем аккуратно как и переменные.

getPhotoPosts: function (skip, top, filterConfing) {
let result = ApplicationModule.photoPosts;

if(!result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

скобочки либо в 1 линию

Comment thread public/js/EventsModule.js
let img = document.createElement('img');
img.src = reader.result;
gallery.appendChild(img);
photoLnk = reader.result;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side effect?
Не лучший вариант, сильно и не очень ожидаемо менять контекст.

Comment thread public/js/EventsModule.js
},

editPost: function(e) {
inputDescriptionEdit.value = '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А точно одну форму ни как не переюзать?
Ну вообще я знаю чтоответ нет неправильный, но коль уж времени мало на это можно забить.

Comment thread public/js/EventsModule.js
if (index !== -1) {
if (ApplicationModule.users[index].password === pass) {
ViewModule.loginView(name);
document.getElementById('exitBtn').addEventListener('click', EventsModule.unAuthorization);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Просто заметка: Динамически добавлять листенеры плохая идея в реальной ситуации, если мы не уверены что онибудут откреплены в нужный момент.

Comment thread public/js/EventsModule.js
initializeLikeButtons: function(){
let likeButtons = document.querySelectorAll('.likePost');
for(let i = 0; i < likeButtons.length; i++){
likeButtons[i].addEventListener('click', EventsModule.pressLike);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No No No!!!!
ни в коем разе не добавлять листенеры на элементы постов напрямую
Плиз читай "делегация событий".

Comment thread public/js/EventsModule.js
let editButtons = document.querySelectorAll('.editPost');
let deleteButtons = document.querySelectorAll('.deletePost');
for(let i = 0; i < editButtons.length; i++){
editButtons[i].addEventListener('click', EventsModule.editPost);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

аналогично

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants