JS fixes.

This commit is contained in:
flash 2019-08-14 20:06:57 +02:00
parent 648b1ac5eb
commit a5d10e9bb1
3 changed files with 3 additions and 3 deletions

View file

@ -101,7 +101,7 @@ function colourFromRGB(red: number, green: number, blue: number): number {
}
function colourFromHex(hex: string): number {
if(hex.startsWith('#'))
if(hex.indexOf('#') === 0)
hex = hex.substr(1);
const length: number = hex.length;

View file

@ -232,7 +232,7 @@ function commentConstruct(comment: CommentPostInfo, layer: number = 0): HTMLElem
<form id={"comment-reply-" + comment.comment_id} class="comment comment--input comment--reply" method="post"
action="javascript:void(0);" onSubmit={commentPostEventHandler}>
<input type="hidden" name="comment[category]" value={comment.category_id} />
<input type="hidden" name="csrf[comments]" value={getCSRFToken('comments')} />
<input type="hidden" name="csrf[comments]" value={getCSRFToken()} />
<input type="hidden" name="comment[reply]" value={comment.comment_id} />
<div class="comment__container">
<div class="avatar comment__avatar"

View file

@ -122,6 +122,6 @@ function userRelationSet(
});
xhr.open('GET', urlFormat('user-relation-create', [{name: 'user', value: userId}, {name: 'type', value: relationType.toString()}]));
xhr.setRequestHeader('X-Misuzu-XHR', 'user_relation');
xhr.setRequestHeader('X-Misuzu-CSRF', getCSRFToken('user_relation'));
xhr.setRequestHeader('X-Misuzu-CSRF', getCSRFToken());
xhr.send();
}