Docs update

This commit is contained in:
Francisco Hodge 2018-11-24 20:12:52 -05:00
parent 822e7a97b7
commit 3b93f37cb2
5 changed files with 55425 additions and 49015 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1345,7 +1345,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber121">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber123">source</a></span></span>
</span>
</h3>
@ -1388,7 +1388,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber535">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber541">source</a></span></span>
</span>
</h3>
@ -1433,7 +1433,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber613">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber619">source</a></span></span>
</span>
</h3>
@ -1477,7 +1477,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber623">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber629">source</a></span></span>
</span>
</h3>
@ -1521,7 +1521,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber272">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber274">source</a></span></span>
</span>
</h3>
@ -1564,7 +1564,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber233">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber235">source</a></span></span>
</span>
</h3>
@ -1607,7 +1607,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber768">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber783">source</a></span></span>
</span>
</h3>
@ -1651,7 +1651,7 @@ As keys are pressed, text will be added/removed at that position within the inpu
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber110">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber112">source</a></span></span>
</span>
</h3>
@ -1731,7 +1731,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber222">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber224">source</a></span></span>
</span>
</h3>
@ -1818,7 +1818,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber116">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber118">source</a></span></span>
</span>
</h3>
@ -1861,7 +1861,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber69">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber71">source</a></span></span>
</span>
</h3>
@ -1904,7 +1904,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber150">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber152">source</a></span></span>
</span>
</h3>
@ -1948,7 +1948,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber61">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber62">source</a></span></span>
</span>
</h3>
@ -2065,6 +2065,13 @@ keyboard.clearInput();</code></pre>
<td data-ice="description"><p>Enable highlighting of keys pressed on physical keyboard.</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" class="code" data-depth="0">preventMouseDownDefault</td>
<td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>Calling preventDefault for the mousedown events keeps the focus on the input.</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" class="code" data-depth="0">physicalKeyboardHighlightTextColor</td>
<td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
@ -2148,7 +2155,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber145">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber147">source</a></span></span>
</span>
</h3>
@ -2192,7 +2199,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber579">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber585">source</a></span></span>
</span>
</h3>
@ -2236,7 +2243,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber350">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber352">source</a></span></span>
</span>
</h3>
@ -2327,7 +2334,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber386">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber388">source</a></span></span>
</span>
</h3>
@ -2407,7 +2414,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber519">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber521">source</a></span></span>
</span>
</h3>
@ -2467,7 +2474,7 @@ keyboard.clearInput();</code></pre>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber360">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber362">source</a></span></span>
</span>
</h3>
@ -2512,7 +2519,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber295">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber297">source</a></span></span>
</span>
</h3>
@ -2573,7 +2580,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber370">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber372">source</a></span></span>
</span>
</h3>
@ -2646,7 +2653,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber488">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber490">source</a></span></span>
</span>
</h3>
@ -2719,7 +2726,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber310">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber312">source</a></span></span>
</span>
</h3>
@ -2792,7 +2799,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber158">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber160">source</a></span></span>
</span>
</h3>
@ -2865,7 +2872,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber265">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber267">source</a></span></span>
</span>
</h3>
@ -2925,7 +2932,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber218">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber220">source</a></span></span>
</span>
</h3>
@ -2991,7 +2998,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber255">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber257">source</a></span></span>
</span>
</h3>
@ -3035,7 +3042,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber506">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber508">source</a></span></span>
</span>
</h3>
@ -3079,7 +3086,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber589">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber595">source</a></span></span>
</span>
</h3>
@ -3123,7 +3130,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber546">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber552">source</a></span></span>
</span>
</h3>
@ -3167,7 +3174,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber571">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber577">source</a></span></span>
</span>
</h3>
@ -3211,7 +3218,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber563">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber569">source</a></span></span>
</span>
</h3>
@ -3255,7 +3262,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber436">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber438">source</a></span></span>
</span>
</h3>
@ -3335,7 +3342,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber630">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber636">source</a></span></span>
</span>
</h3>
@ -3379,7 +3386,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber342">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber344">source</a></span></span>
</span>
</h3>
@ -3440,7 +3447,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber327">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber329">source</a></span></span>
</span>
</h3>
@ -3508,7 +3515,7 @@ Used interally between re-renders.</p>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber285">source</a></span></span>
<span data-ice="source"><span><a href="file/src/lib/components/Keyboard.js.html#lineNumber287">source</a></span></span>
</span>
</h3>

View File

@ -92,6 +92,7 @@ class SimpleKeyboard {
* @property {object} maxLength Restrains simple-keyboard&#x2019;s individual inputs to a certain length. This should be used in addition to the input element&#x2019;s maxlengthattribute.
* @property {boolean} syncInstanceInputs When set to true, this option synchronizes the internal input of every simple-keyboard instance.
* @property {boolean} physicalKeyboardHighlight Enable highlighting of keys pressed on physical keyboard.
* @property {boolean} preventMouseDownDefault Calling preventDefault for the mousedown events keeps the focus on the input.
* @property {string} physicalKeyboardHighlightTextColor Define the text color that the physical keyboard highlighted key should have.
* @property {string} physicalKeyboardHighlightBgColor Define the background color that the physical keyboard highlighted key should have.
* @property {function(button: string):string} onKeyPress Executes the callback function on key press. Returns button layout name (i.e.: &#x201C;{shift}&#x201D;).
@ -104,6 +105,7 @@ class SimpleKeyboard {
this.options.layoutName = this.options.layoutName || &quot;default&quot;;
this.options.theme = this.options.theme || &quot;hg-theme-default&quot;;
this.options.inputName = this.options.inputName || &quot;default&quot;;
this.options.preventMouseDownDefault = this.options.preventMouseDownDefault === false ? false : true;
/**
* @type {object} Classes identifying loaded plugins
@ -336,7 +338,7 @@ class SimpleKeyboard {
*/
clearInput(inputName){
inputName = inputName || this.options.inputName;
this.input[this.options.inputName] = &apos;&apos;;
this.input[inputName] = &apos;&apos;;
/**
* Enforce syncInstanceInputs, if set
@ -561,6 +563,10 @@ class SimpleKeyboard {
caretEventHandler(event){
let targetTagName;
if(this.isMouseHold){
this.isMouseHold = false;
}
if(event.target.tagName){
targetTagName = event.target.tagName.toLowerCase();
}
@ -677,6 +683,7 @@ class SimpleKeyboard {
let layoutClass = this.options.layout ? &quot;hg-layout-custom&quot; : `hg-layout-${this.options.layoutName}`;
let layout = this.options.layout || KeyboardLayout.getDefaultLayout();
let useTouchEvents = this.options.useTouchEvents || false
/**
* Account for buttonTheme, if set
@ -742,11 +749,24 @@ class SimpleKeyboard {
*/
var buttonDOM = document.createElement(&apos;div&apos;);
buttonDOM.className += `hg-button ${fctBtnClass}${buttonThemeClass ? &quot; &quot;+buttonThemeClass : &quot;&quot;}`;
if (useTouchEvents) {
buttonDOM.ontouchstart = (e) =&gt; {
this.handleButtonClicked(button);
this.handleButtonMouseDown(button, e);
}
buttonDOM.ontouchend = e =&gt; this.handleButtonMouseUp();
buttonDOM.ontouchcancel = e =&gt; this.handleButtonMouseUp();
} else {
buttonDOM.onclick = () =&gt; {
this.isMouseHold = false;
this.handleButtonClicked(button);
}
buttonDOM.onmousedown = (e) =&gt; this.handleButtonMouseDown(button, e);
buttonDOM.onmousedown = (e) =&gt; {
if (this.options.preventMouseDownDefault) e.preventDefault();
this.handleButtonMouseDown(button, e);
}
}
/**
* Adding identifier
@ -798,17 +818,19 @@ class SimpleKeyboard {
*/
this.onRender();
/**
* Handling mouseup
*/
document.onmouseup = () =&gt; this.handleButtonMouseUp();
if(!this.initialized){
/**
* Ensures that onInit is only called once per instantiation
*/
this.initialized = true;
/**
* Handling mouseup
*/
if (!useTouchEvents) {
document.onmouseup = () =&gt; this.handleButtonMouseUp();
}
/**
* Calling onInit
*/

File diff suppressed because one or more lines are too long

View File

@ -60,7 +60,7 @@
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">8/8</span></td>
<td style="display: none;" data-ice="size">1919 byte</td>
<td style="display: none;" data-ice="lines">84</td>
<td style="display: none;" data-ice="updated">2018-11-02 22:34:11 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:54:03 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/demo/index.js.html">src/demo/index.js</a></span></td>
@ -68,15 +68,15 @@
<td class="coverage"><span data-ice="coverage">-</span></td>
<td style="display: none;" data-ice="size">70 byte</td>
<td style="display: none;" data-ice="lines">5</td>
<td style="display: none;" data-ice="updated">2018-09-02 03:31:31 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:54:03 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/components/Keyboard.js.html">src/lib/components/Keyboard.js</a></span></td>
<td data-ice="identifier" class="identifiers"><span><a href="class/src/lib/components/Keyboard.js~SimpleKeyboard.html">SimpleKeyboard</a></span></td>
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">41/41</span></td>
<td style="display: none;" data-ice="size">24942 byte</td>
<td style="display: none;" data-ice="lines">778</td>
<td style="display: none;" data-ice="updated">2018-11-06 15:50:43 (UTC)</td>
<td style="display: none;" data-ice="size">25831 byte</td>
<td style="display: none;" data-ice="lines">800</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:59:59 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/index.js.html">src/lib/index.js</a></span></td>
@ -84,7 +84,7 @@
<td class="coverage"><span data-ice="coverage">-</span></td>
<td style="display: none;" data-ice="size">85 byte</td>
<td style="display: none;" data-ice="lines">2</td>
<td style="display: none;" data-ice="updated">2018-06-06 23:02:53 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:54:03 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/services/KeyboardLayout.js.html">src/lib/services/KeyboardLayout.js</a></span></td>
@ -92,7 +92,7 @@
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">2/2</span></td>
<td style="display: none;" data-ice="size">746 byte</td>
<td style="display: none;" data-ice="lines">28</td>
<td style="display: none;" data-ice="updated">2018-10-03 02:14:58 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:54:03 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/services/PhysicalKeyboard.js.html">src/lib/services/PhysicalKeyboard.js</a></span></td>
@ -100,7 +100,7 @@
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">5/5</span></td>
<td style="display: none;" data-ice="size">2908 byte</td>
<td style="display: none;" data-ice="lines">96</td>
<td style="display: none;" data-ice="updated">2018-11-06 15:54:53 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:54:03 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/services/Utilities.js.html">src/lib/services/Utilities.js</a></span></td>
@ -108,7 +108,7 @@
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">15/15</span></td>
<td style="display: none;" data-ice="size">11188 byte</td>
<td style="display: none;" data-ice="lines">360</td>
<td style="display: none;" data-ice="updated">2018-11-02 22:28:58 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:54:03 (UTC)</td>
</tr>
<tr data-ice="file">
<td data-ice="filePath"><span><a href="file/src/lib/tests/TestUtility.js.html">src/lib/tests/TestUtility.js</a></span></td>
@ -116,7 +116,7 @@
<td class="coverage"><span data-ice="coverage">100 %</span><span data-ice="coverageCount" class="coverage-count">6/6</span></td>
<td style="display: none;" data-ice="size">2830 byte</td>
<td style="display: none;" data-ice="lines">106</td>
<td style="display: none;" data-ice="updated">2018-10-04 22:12:09 (UTC)</td>
<td style="display: none;" data-ice="updated">2018-11-01 00:54:03 (UTC)</td>
</tr>
</tbody>
</table>