. _IgoIME_ is based on _Ajax IME_ by taku (Taku Kudo).
They are not legally open-source, as _Ajax IME_ is available only under the terms of: `(C) Taku Kudo, all rights reserve rd. Personal use only!`
-_nekotsume IME_ is only being distributed in good faith and in the spirit of the fair use doctrine, in the hopes that it can be useful.
+_nekotsume IME_ is only being distributed in good faith and in the spirit of the fair use doctrine, in the hopes that it can be useful, but without any warranty.
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..ba98e60
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+
+# Get dependencies
+git submodule update --init --recursive
+
+# Build lib/igo.min.js
+cd lib/igo-javascript
+npm install
+cd build
+node build.js
+cp igo.min.js ../../igo.min.js
+cd ../../..
+
+# Build lib/zip.min.js
+cd lib/zipjs
+echo 'Uin32Array=Uint32Array;' > ../zip.min.js
+cat zip.js jsinflate.js sjis.js >> ../zip.min.js
+cd ../..
+
+# Build WebExtension package
+npm install web-ext
+web-ext build --overwrite-dest --ignore-files *.xcf lib/*/
diff --git a/demo.html b/demo.html
new file mode 100644
index 0000000..add5323
--- /dev/null
+++ b/demo.html
@@ -0,0 +1,44 @@
+
+
+
+ nekotsume IME Demo
+
+
+
+
+
+
+
+
+
+ nekotsume IME | ネコツメIME
+
+ Efficient Japanese IME for (almost) any website in your web browser!
+
+ For more information please visit the Git repository:
+ https://gitlab.com/octospacc/nekotsume-ime .
+
+ Demo
+
+ IME Status: Loading
+ Toggle IME
+
+
+
+
+
diff --git a/ime.js b/ime.js
index fc0bb50..f2cf9ba 100644
--- a/ime.js
+++ b/ime.js
@@ -177,7 +177,7 @@ function AjaxIME(doc) {
ImeDocument_.ImeRequestCallback = ImeRequestCallback;
ImeDocument_.ImeChangeMode = ImeChangeMode;
- addEvent(ImeDocument_, 'keydown', ImeDocumentKeyDown);
+ //addEvent(ImeDocument_, 'keydown', ImeDocumentKeyDown);
addEvent(ImePreEdit_, 'keydown', ImePreEditKeyDown);
addEvent(ImePreEdit_, 'keyup', ImePreEditKeyUp);
@@ -682,15 +682,17 @@ function ImeRequestCallback(result, source) {
ImeCurrentDocument_.ImeRequestCallback(result, source);
}
-browser.runtime.onMessage.addListener(function(data){
- if (data.browserAction) {
- ImeInit();
- if (!ImeEnabled_ || data.browserAction === 'ImeChangeMode') {
- ImeChangeMode();
- }
- return;
- }
- ImeRequestCallback(data.result, data.source);
-});
-
addEvent(window, 'load', ImeInit);
+
+if (typeof browser !== 'undefined' && typeof browser.runtime !== 'undefined' && typeof browser.runtime.onMessage !== 'undefined') {
+ browser.runtime.onMessage.addListener(function(data){
+ if (data.browserAction) {
+ ImeInit();
+ if (!ImeEnabled_ || data.browserAction === 'ImeChangeMode') {
+ ImeChangeMode();
+ }
+ return;
+ }
+ ImeRequestCallback(data.result, data.source);
+ });
+}
diff --git a/loader.js b/loader.js
index a634170..97deb59 100644
--- a/loader.js
+++ b/loader.js
@@ -30,7 +30,7 @@ function initRuntime () {
}
var worker = new Worker('worker.js');
- igo.getServerFileToArrayBufffer("skkdic.zip", function(buffer){
+ igo.getServerFileToArrayBufffer('skkdic.bin', function(buffer){
event({event: 'downloaded'});
var blob = new Blob([new Uint8Array(buffer)]);
worker.postMessage({method: 'setdic', dic: blob});
@@ -46,7 +46,9 @@ function initRuntime () {
postToWorker = function(data) {
worker.postMessage(data);
}
- browser.runtime.onMessage.addListener(postToWorker);
+ if (typeof browser !== 'undefined' && typeof browser.runtime !== 'undefined' && typeof browser.runtime.onMessage !== 'undefined') {
+ browser.runtime.onMessage.addListener(postToWorker);
+ }
}
if (document.readyState === 'loading') {
@@ -55,4 +57,4 @@ if (document.readyState === 'loading') {
initRuntime();
}
-})();
\ No newline at end of file
+})();
diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000..b93c65f
Binary files /dev/null and b/screenshot.png differ
diff --git a/skkdic.zip b/skkdic.bin
similarity index 100%
rename from skkdic.zip
rename to skkdic.bin