Skip to content

Commit

Permalink
updated scroll behavior options on messageAddNew/Full
Browse files Browse the repository at this point in the history
  • Loading branch information
deftio committed Oct 20, 2024
1 parent e0ee4e3 commit 1711b64
Show file tree
Hide file tree
Showing 24 changed files with 335 additions and 265 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,3 @@ quikchat is licensed under the BSD-2 License.
## Home Page

[quikchat homepage and source code](https://github.com/deftio/quikchat)






38 changes: 19 additions & 19 deletions coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">85.22% </span>
<span class="strong">84.87% </span>
<span class="quiet">Statements</span>
<span class='fraction'>173/203</span>
<span class='fraction'>174/205</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">57.47% </span>
<span class="strong">57.77% </span>
<span class="quiet">Branches</span>
<span class='fraction'>50/87</span>
<span class='fraction'>52/90</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">78.43% </span>
<span class="strong">76.92% </span>
<span class="quiet">Functions</span>
<span class='fraction'>40/51</span>
<span class='fraction'>40/52</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">85.56% </span>
<span class="strong">85.2% </span>
<span class="quiet">Lines</span>
<span class='fraction'>166/194</span>
<span class='fraction'>167/196</span>
</div>


Expand Down Expand Up @@ -80,17 +80,17 @@ <h1>All files</h1>
</thead>
<tbody><tr>
<td class="file high" data-value="quikchat.js"><a href="quikchat.js.html">quikchat.js</a></td>
<td data-value="85.22" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 85%"></div><div class="cover-empty" style="width: 15%"></div></div>
<td data-value="84.87" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 84%"></div><div class="cover-empty" style="width: 16%"></div></div>
</td>
<td data-value="85.22" class="pct high">85.22%</td>
<td data-value="203" class="abs high">173/203</td>
<td data-value="57.47" class="pct medium">57.47%</td>
<td data-value="87" class="abs medium">50/87</td>
<td data-value="78.43" class="pct medium">78.43%</td>
<td data-value="51" class="abs medium">40/51</td>
<td data-value="85.56" class="pct high">85.56%</td>
<td data-value="194" class="abs high">166/194</td>
<td data-value="84.87" class="pct high">84.87%</td>
<td data-value="205" class="abs high">174/205</td>
<td data-value="57.77" class="pct medium">57.77%</td>
<td data-value="90" class="abs medium">52/90</td>
<td data-value="76.92" class="pct medium">76.92%</td>
<td data-value="52" class="abs medium">40/52</td>
<td data-value="85.2" class="pct high">85.2%</td>
<td data-value="196" class="abs high">167/196</td>
</tr>

</tbody>
Expand All @@ -101,7 +101,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-26T08:13:18.641Z
at 2024-10-20T06:34:06.697Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
38 changes: 19 additions & 19 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">85.22% </span>
<span class="strong">84.87% </span>
<span class="quiet">Statements</span>
<span class='fraction'>173/203</span>
<span class='fraction'>174/205</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">57.47% </span>
<span class="strong">57.77% </span>
<span class="quiet">Branches</span>
<span class='fraction'>50/87</span>
<span class='fraction'>52/90</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">78.43% </span>
<span class="strong">76.92% </span>
<span class="quiet">Functions</span>
<span class='fraction'>40/51</span>
<span class='fraction'>40/52</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">85.56% </span>
<span class="strong">85.2% </span>
<span class="quiet">Lines</span>
<span class='fraction'>166/194</span>
<span class='fraction'>167/196</span>
</div>


Expand Down Expand Up @@ -80,17 +80,17 @@ <h1>All files</h1>
</thead>
<tbody><tr>
<td class="file high" data-value="quikchat.js"><a href="quikchat.js.html">quikchat.js</a></td>
<td data-value="85.22" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 85%"></div><div class="cover-empty" style="width: 15%"></div></div>
<td data-value="84.87" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 84%"></div><div class="cover-empty" style="width: 16%"></div></div>
</td>
<td data-value="85.22" class="pct high">85.22%</td>
<td data-value="203" class="abs high">173/203</td>
<td data-value="57.47" class="pct medium">57.47%</td>
<td data-value="87" class="abs medium">50/87</td>
<td data-value="78.43" class="pct medium">78.43%</td>
<td data-value="51" class="abs medium">40/51</td>
<td data-value="85.56" class="pct high">85.56%</td>
<td data-value="194" class="abs high">166/194</td>
<td data-value="84.87" class="pct high">84.87%</td>
<td data-value="205" class="abs high">174/205</td>
<td data-value="57.77" class="pct medium">57.77%</td>
<td data-value="90" class="abs medium">52/90</td>
<td data-value="76.92" class="pct medium">76.92%</td>
<td data-value="52" class="abs medium">40/52</td>
<td data-value="85.2" class="pct high">85.2%</td>
<td data-value="196" class="abs high">167/196</td>
</tr>

</tbody>
Expand All @@ -101,7 +101,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-26T08:13:18.649Z
at 2024-10-20T06:34:06.704Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
50 changes: 34 additions & 16 deletions coverage/lcov-report/quikchat.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">85.22% </span>
<span class="strong">84.87% </span>
<span class="quiet">Statements</span>
<span class='fraction'>173/203</span>
<span class='fraction'>174/205</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">57.47% </span>
<span class="strong">57.77% </span>
<span class="quiet">Branches</span>
<span class='fraction'>50/87</span>
<span class='fraction'>52/90</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">78.43% </span>
<span class="strong">76.92% </span>
<span class="quiet">Functions</span>
<span class='fraction'>40/51</span>
<span class='fraction'>40/52</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">85.56% </span>
<span class="strong">85.2% </span>
<span class="quiet">Lines</span>
<span class='fraction'>166/194</span>
<span class='fraction'>167/196</span>
</div>


Expand Down Expand Up @@ -550,7 +550,13 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
<a name='L485'></a><a href='#L485'>485</a>
<a name='L486'></a><a href='#L486'>486</a>
<a name='L487'></a><a href='#L487'>487</a>
<a name='L488'></a><a href='#L488'>488</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<a name='L488'></a><a href='#L488'>488</a>
<a name='L489'></a><a href='#L489'>489</a>
<a name='L490'></a><a href='#L490'>490</a>
<a name='L491'></a><a href='#L491'>491</a>
<a name='L492'></a><a href='#L492'>492</a>
<a name='L493'></a><a href='#L493'>493</a>
<a name='L494'></a><a href='#L494'>494</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -789,6 +795,9 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
Expand Down Expand Up @@ -883,6 +892,9 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -1223,7 +1235,7 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
return this._messagesArea.classList.contains('quikchat-messages-area-alt');
}
// message functions
messageAddFull(input = <span class="branch-0 cbranch-no" title="branch not covered" >{ content: "", userString: "user", align: "right", role: "user", userID: -1, timestamp: false, updatedtime: false })</span> {
messageAddFull(input = <span class="branch-0 cbranch-no" title="branch not covered" >{ content: "", userString: "user", align: "right", role: "user", userID: -1, timestamp: false, updatedtime: false, scrollIntoView: false })</span> {
const msgid = this.msgid;
const messageDiv = document.createElement('div');
const msgidClass = 'quikchat-msgid-' + String(msgid).padStart(10, '0');
Expand All @@ -1245,7 +1257,7 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
this._messagesArea.appendChild(messageDiv);
&nbsp;
// Scroll to the last message only if the user is not actively scrolling up
<span class="missing-if-branch" title="else path not taken" >E</span>if (!this.userScrolledUp) {
<span class="missing-if-branch" title="else path not taken" >E</span>if ((!this.userScrolledUp) || <span class="branch-1 cbranch-no" title="branch not covered" >input.scrollIntoView)</span> {
this._messagesArea.lastElementChild.scrollIntoView();
}
&nbsp;
Expand All @@ -1271,10 +1283,13 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
}
&nbsp;

messageAddNew(content = <span class="branch-0 cbranch-no" title="branch not covered" >"",</span> userString = "user", align = "right", role = "user") {
return this.messageAddFull(
{ content: content, userString: userString, align: align, role: role }
messageAddNew(content = <span class="branch-0 cbranch-no" title="branch not covered" >"",</span> userString = "user", align = "right", role = "user", scrollIntoView = false) {
let retvalue = this.messageAddFull(
{ content: content, userString: userString, align: align, role: role, scrollIntoView: scrollIntoView }
);
// this.messageScrollToBottom();
return retvalue;
&nbsp;
}
messageRemove(n) {
// use css selector to remove the message
Expand Down Expand Up @@ -1369,6 +1384,9 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
return success;
}

<span class="fstat-no" title="function not covered" > me</span>ssageScrollToBottom() {
<span class="cstat-no" title="statement not covered" > this._messagesArea.lastElementChild.scrollIntoView();</span>
}
// history functions
/**
*
Expand Down Expand Up @@ -1456,7 +1474,7 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
* @returns {object} - Returns the version and license information for the library.
*/
static version() {
return { "version": "1.1.7", "license": "BSD-2", "url": "https://github/deftio/quikchat" };
return { "version": "1.1.8", "license": "BSD-2", "url": "https://github/deftio/quikchat" };
}
&nbsp;
/**
Expand Down Expand Up @@ -1531,7 +1549,7 @@ <h1><a href="index.html">All files</a> quikchat.js</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-26T08:13:18.649Z
at 2024-10-20T06:34:06.704Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
Loading

0 comments on commit 1711b64

Please sign in to comment.