Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DJTB committed Mar 2, 2023
1 parent 3a524ac commit 6233fe3
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion assets/js/wanakana.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/wanakana.min.js.map

Large diffs are not rendered by default.

23 changes: 17 additions & 6 deletions docs/bind.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,25 @@ <h1 class="page-title">
)})`
);
}
if (element.hasAttribute('data-wanakana-id')) {
return;
}
const onInput = makeOnInput(options);
const id = newId();
element.setAttribute('data-wanakana-id', id);
element.setAttribute('lang', 'ja');
element.setAttribute('autoCapitalize', 'none');
element.setAttribute('autoCorrect', 'off');
element.setAttribute('autoComplete', 'off');
element.setAttribute('spellCheck', 'false');
const attributes = [
{ name: 'data-wanakana-id', value: id },
{ name: 'lang', value: 'ja' },
{ name: 'autoCapitalize', value: 'none' },
{ name: 'autoCorrect', value: 'off' },
{ name: 'autoComplete', value: 'off' },
{ name: 'spellCheck', value: 'false' },
];
const previousAttributes = {};
attributes.forEach((attribute) => {
previousAttributes[attribute.name] = element.getAttribute(attribute.name);
element.setAttribute(attribute.name, attribute.value);
});
element.dataset.previousAttributes = JSON.stringify(previousAttributes);
element.addEventListener('input', onInput);
element.addEventListener('compositionupdate', onComposition);
element.addEventListener('compositionend', onComposition);
Expand Down
2 changes: 1 addition & 1 deletion docs/constants.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h1 class="page-title">

<section>
<article>
<pre class="prettyprint source linenums"><code>export const VERSION = '5.0.2';
<pre class="prettyprint source linenums"><code>export const VERSION = '5.1.0';

export const TO_KANA_METHODS = {
HIRAGANA: 'toHiragana',
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ <h2>Ports</h2>
<li>Rust (<a href="https://github.com/PSeitz/wana_kana_rust">PSeitz/wana_kana_rust</a>)</li>
<li>Swift (<a href="https://github.com/profburke/WanaKanaSwift">profburke/WanaKanaSwift</a>)</li>
<li>Kotlin (<a href="https://github.com/esnaultdev/wanakana-kt">esnaultdev/wanakana-kt</a>)</li>
<li>C# (<a href="https://github.com/kmoroz/WanaKanaShaapu">kmoroz/WanaKanaShaapu</a>)</li>
</ul>
</article>
</section>
Expand Down
10 changes: 9 additions & 1 deletion docs/unbind.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,15 @@ <h1 class="page-title">
);
}
const { inputHandler, compositionHandler } = listeners;
element.removeAttribute('data-wanakana-id');
const attributes = JSON.parse(element.dataset.previousAttributes);
Object.keys(attributes).forEach((key) => {
if (attributes[key]) {
element.setAttribute(key, attributes[key]);
} else {
element.removeAttribute(key);
}
});
element.removeAttribute('data-previous-attributes');
element.removeAttribute('data-ignore-composition');
element.removeEventListener('input', inputHandler);
element.removeEventListener('compositionstart', compositionHandler);
Expand Down
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ <h2>Community Library Ports</h2>
<td>
<a href="https://github.com/esnaultdev/wanakana-kt" title="View WanaKanaKotlin">WanaKanaKotlin</a>
</td>
</tr>
<tr>
<td>C#</td>
<td>
<a href="https://github.com/kmoroz/WanaKanaShaapu" title="View WanaKanaShaapu">WanaKanaShaapu</a>
</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 6233fe3

Please sign in to comment.