-
Notifications
You must be signed in to change notification settings - Fork 158
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
Feature/video media read #410
Conversation
Harvel218
commented
Dec 21, 2021
Q | A |
---|---|
Bug fix? | no/yes |
New feature? | no/yes |
BC breaks? | no/yes |
Deprecations? | no/yes |
Related tickets | fixes #X, partially #Y, mentioned in #Z |
License | MIT |
Configure your Git not to submit |
} | ||
|
||
function htmlToString(item) { | ||
return String(item).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); |
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.
Add each .replace(
in newline
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.
its not longer than 120 chars - formatter isnt considering it to format (and i cant just maunaly do this because i have format on save :( )
Can it be ommited?
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.
can be omitted, however imho it adds readability to code
|
||
function checkName(item) { | ||
if (item) return item; | ||
else return 'Empty name'; |
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.
add newline between 23 and 24, else
is not needed
`<div class="media-list__item"> | ||
<label for="${media.code}" class="media-list__item__label"><strong>${trimValue( | ||
htmlToString(checkName(media.name)) | ||
)}</strong></strong> (${trimValue(media.code)})</label> |
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.
why double </strong></strong>
?
</div>` | ||
) | ||
.join(''); | ||
return output; |
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.
newline before return
|
||
function insertImageHtml(data) { | ||
const output = data | ||
.map( |
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.
.map(media =>
} | ||
}, | ||
error(jqXHR, textStatus, errorThrown) { | ||
console.log(`ajax error ${textStatus} ${errorThrown}`); |
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.
console.error
?
page: pageNumber, | ||
limit: limit, | ||
}; | ||
const shallowEncoded = $.param(myObject); |
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.
newline
|
||
$.ajax({ | ||
type: 'GET', | ||
url: route + '?' + shallowDecoded, |
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.
as above
totalPages = numPages(data.total); | ||
changePage(currentPage, 'video-btn-next', 'video-btn-prev', 'video-page-number'); | ||
const element = CKEDITOR.document.getById('media-video-list'); | ||
if (element) { |
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.
as above
controlStyle: 'width: 100%', | ||
onKeyUp: function () { | ||
phrase = this.getValue(); | ||
if (oldValue === phrase) { |
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.
newline before if
and after }