summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/auth/script.ts (renamed from src/web/app/auth/script.js)0
-rw-r--r--src/web/app/auth/tags/index.ts (renamed from src/web/app/auth/tags/index.js)0
-rw-r--r--src/web/app/ch/router.ts (renamed from src/web/app/ch/router.js)4
-rw-r--r--src/web/app/ch/script.ts (renamed from src/web/app/ch/script.js)0
-rw-r--r--src/web/app/ch/tags/channel.tag4
-rw-r--r--src/web/app/ch/tags/index.ts (renamed from src/web/app/ch/tags/index.js)0
-rw-r--r--src/web/app/common/mixins/api.ts (renamed from src/web/app/common/mixins/api.js)2
-rw-r--r--src/web/app/common/mixins/i.ts (renamed from src/web/app/common/mixins/i.js)2
-rw-r--r--src/web/app/common/mixins/index.js13
-rw-r--r--src/web/app/common/mixins/index.ts14
-rw-r--r--src/web/app/common/scripts/api.ts (renamed from src/web/app/common/scripts/api.js)4
-rw-r--r--src/web/app/common/scripts/bytes-to-size.ts (renamed from src/web/app/common/scripts/bytes-to-size.js)4
-rw-r--r--src/web/app/common/scripts/channel-stream.ts (renamed from src/web/app/common/scripts/channel-stream.js)0
-rw-r--r--src/web/app/common/scripts/check-for-update.ts (renamed from src/web/app/common/scripts/check-for-update.js)4
-rw-r--r--src/web/app/common/scripts/config.ts (renamed from src/web/app/common/scripts/config.js)0
-rw-r--r--src/web/app/common/scripts/contains.ts (renamed from src/web/app/common/scripts/contains.js)0
-rw-r--r--src/web/app/common/scripts/copy-to-clipboard.ts (renamed from src/web/app/common/scripts/copy-to-clipboard.js)0
-rw-r--r--src/web/app/common/scripts/date-stringify.ts (renamed from src/web/app/common/scripts/date-stringify.js)0
-rw-r--r--src/web/app/common/scripts/gcd.ts (renamed from src/web/app/common/scripts/gcd.js)0
-rw-r--r--src/web/app/common/scripts/get-kao.ts (renamed from src/web/app/common/scripts/get-kao.js)2
-rw-r--r--src/web/app/common/scripts/home-stream.ts (renamed from src/web/app/common/scripts/home-stream.js)4
-rw-r--r--src/web/app/common/scripts/is-promise.ts (renamed from src/web/app/common/scripts/is-promise.js)0
-rw-r--r--src/web/app/common/scripts/loading.ts (renamed from src/web/app/common/scripts/loading.js)0
-rw-r--r--src/web/app/common/scripts/messaging-stream.ts (renamed from src/web/app/common/scripts/messaging-stream.js)2
-rw-r--r--src/web/app/common/scripts/server-stream-manager.ts31
-rw-r--r--src/web/app/common/scripts/server-stream.ts (renamed from src/web/app/common/scripts/server-stream.js)0
-rw-r--r--src/web/app/common/scripts/signout.ts (renamed from src/web/app/common/scripts/signout.js)0
-rw-r--r--src/web/app/common/scripts/stream-manager.ts33
-rw-r--r--src/web/app/common/scripts/stream.ts (renamed from src/web/app/common/scripts/stream.js)31
-rw-r--r--src/web/app/common/scripts/text-compiler.ts (renamed from src/web/app/common/scripts/text-compiler.js)4
-rw-r--r--src/web/app/common/tags/index.ts (renamed from src/web/app/common/tags/index.js)0
-rw-r--r--src/web/app/common/tags/messaging/message.tag2
-rw-r--r--src/web/app/desktop/mixins/index.ts (renamed from src/web/app/desktop/mixins/index.js)0
-rw-r--r--src/web/app/desktop/mixins/user-preview.ts (renamed from src/web/app/desktop/mixins/user-preview.js)2
-rw-r--r--src/web/app/desktop/mixins/widget.ts (renamed from src/web/app/desktop/mixins/widget.js)2
-rw-r--r--src/web/app/desktop/router.ts (renamed from src/web/app/desktop/router.js)6
-rw-r--r--src/web/app/desktop/script.ts (renamed from src/web/app/desktop/script.js)8
-rw-r--r--src/web/app/desktop/scripts/autocomplete.ts (renamed from src/web/app/desktop/scripts/autocomplete.js)26
-rw-r--r--src/web/app/desktop/scripts/dialog.ts (renamed from src/web/app/desktop/scripts/dialog.js)4
-rw-r--r--src/web/app/desktop/scripts/fuck-ad-block.ts (renamed from src/web/app/desktop/scripts/fuck-ad-block.js)2
-rw-r--r--src/web/app/desktop/scripts/input-dialog.ts (renamed from src/web/app/desktop/scripts/input-dialog.js)2
-rw-r--r--src/web/app/desktop/scripts/not-implemented-exception.ts (renamed from src/web/app/desktop/scripts/not-implemented-exception.js)0
-rw-r--r--src/web/app/desktop/scripts/notify.ts (renamed from src/web/app/desktop/scripts/notify.js)2
-rw-r--r--src/web/app/desktop/scripts/password-dialog.ts (renamed from src/web/app/desktop/scripts/password-dialog.js)2
-rw-r--r--src/web/app/desktop/scripts/update-avatar.ts (renamed from src/web/app/desktop/scripts/update-avatar.js)8
-rw-r--r--src/web/app/desktop/scripts/update-banner.ts (renamed from src/web/app/desktop/scripts/update-banner.js)8
-rw-r--r--src/web/app/desktop/tags/autocomplete-suggestion.tag2
-rw-r--r--src/web/app/desktop/tags/drive/browser.tag4
-rw-r--r--src/web/app/desktop/tags/drive/folder.tag2
-rw-r--r--src/web/app/desktop/tags/drive/nav-folder.tag2
-rw-r--r--src/web/app/desktop/tags/index.ts (renamed from src/web/app/desktop/tags/index.js)0
-rw-r--r--src/web/app/desktop/tags/post-detail-sub.tag2
-rw-r--r--src/web/app/desktop/tags/post-detail.tag2
-rw-r--r--src/web/app/desktop/tags/post-form.tag6
-rw-r--r--src/web/app/desktop/tags/sub-post-content.tag2
-rw-r--r--src/web/app/desktop/tags/timeline.tag2
-rw-r--r--src/web/app/dev/router.ts (renamed from src/web/app/dev/router.js)4
-rw-r--r--src/web/app/dev/script.ts (renamed from src/web/app/dev/script.js)0
-rw-r--r--src/web/app/dev/tags/index.ts (renamed from src/web/app/dev/tags/index.js)0
-rw-r--r--src/web/app/init.ts (renamed from src/web/app/init.js)28
-rw-r--r--src/web/app/mobile/router.ts (renamed from src/web/app/mobile/router.js)6
-rw-r--r--src/web/app/mobile/script.ts (renamed from src/web/app/mobile/script.js)0
-rw-r--r--src/web/app/mobile/scripts/open-post-form.ts (renamed from src/web/app/mobile/scripts/open-post-form.js)0
-rw-r--r--src/web/app/mobile/scripts/ui-event.ts (renamed from src/web/app/mobile/scripts/ui-event.js)0
-rw-r--r--src/web/app/mobile/tags/drive.tag2
-rw-r--r--src/web/app/mobile/tags/index.ts (renamed from src/web/app/mobile/tags/index.js)0
-rw-r--r--src/web/app/mobile/tags/post-detail.tag2
-rw-r--r--src/web/app/mobile/tags/post-form.tag4
-rw-r--r--src/web/app/mobile/tags/sub-post-content.tag2
-rw-r--r--src/web/app/mobile/tags/timeline.tag2
-rw-r--r--src/web/app/stats/script.ts (renamed from src/web/app/stats/script.js)0
-rw-r--r--src/web/app/stats/tags/index.ts (renamed from src/web/app/stats/tags/index.js)0
-rw-r--r--src/web/app/status/script.ts (renamed from src/web/app/status/script.js)0
-rw-r--r--src/web/app/status/tags/index.ts (renamed from src/web/app/status/tags/index.js)0
74 files changed, 150 insertions, 156 deletions
diff --git a/src/web/app/auth/script.js b/src/web/app/auth/script.ts
index fe7f9befe8..fe7f9befe8 100644
--- a/src/web/app/auth/script.js
+++ b/src/web/app/auth/script.ts
diff --git a/src/web/app/auth/tags/index.js b/src/web/app/auth/tags/index.ts
index 42dffe67d9..42dffe67d9 100644
--- a/src/web/app/auth/tags/index.js
+++ b/src/web/app/auth/tags/index.ts
diff --git a/src/web/app/ch/router.js b/src/web/app/ch/router.ts
index 424158f403..fe014d4e31 100644
--- a/src/web/app/ch/router.js
+++ b/src/web/app/ch/router.ts
@@ -1,5 +1,5 @@
import * as riot from 'riot';
-const route = require('page');
+import * as route from 'page';
let page = null;
export default me => {
@@ -22,7 +22,7 @@ export default me => {
}
// EXEC
- route();
+ (route as any)();
};
function mount(content) {
diff --git a/src/web/app/ch/script.js b/src/web/app/ch/script.ts
index 760d405c52..760d405c52 100644
--- a/src/web/app/ch/script.js
+++ b/src/web/app/ch/script.ts
diff --git a/src/web/app/ch/tags/channel.tag b/src/web/app/ch/tags/channel.tag
index 4ae62e7b39..48c5c705d3 100644
--- a/src/web/app/ch/tags/channel.tag
+++ b/src/web/app/ch/tags/channel.tag
@@ -343,7 +343,7 @@
};
this.changeFile = () => {
- this.refs.file.files.forEach(this.upload);
+ Array.from(this.refs.file.files).forEach(this.upload);
};
this.selectFile = () => {
@@ -367,7 +367,7 @@
};
this.onpaste = e => {
- e.clipboardData.items.forEach(item => {
+ Array.from(e.clipboardData.items).forEach(item => {
if (item.kind == 'file') {
this.upload(item.getAsFile());
}
diff --git a/src/web/app/ch/tags/index.js b/src/web/app/ch/tags/index.ts
index 12ffdaeb84..12ffdaeb84 100644
--- a/src/web/app/ch/tags/index.js
+++ b/src/web/app/ch/tags/index.ts
diff --git a/src/web/app/common/mixins/api.js b/src/web/app/common/mixins/api.ts
index 42d96db559..9726caf510 100644
--- a/src/web/app/common/mixins/api.js
+++ b/src/web/app/common/mixins/api.ts
@@ -2,7 +2,7 @@ import * as riot from 'riot';
import api from '../scripts/api';
export default me => {
- riot.mixin('api', {
+ (riot as any).mixin('api', {
api: api.bind(null, me ? me.token : null)
});
};
diff --git a/src/web/app/common/mixins/i.js b/src/web/app/common/mixins/i.ts
index 5225147766..0879d02d3d 100644
--- a/src/web/app/common/mixins/i.js
+++ b/src/web/app/common/mixins/i.ts
@@ -1,7 +1,7 @@
import * as riot from 'riot';
export default me => {
- riot.mixin('i', {
+ (riot as any).mixin('i', {
init: function() {
this.I = me;
this.SIGNIN = me != null;
diff --git a/src/web/app/common/mixins/index.js b/src/web/app/common/mixins/index.js
deleted file mode 100644
index 19e0690d72..0000000000
--- a/src/web/app/common/mixins/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import * as riot from 'riot';
-
-import activateMe from './i';
-import activateApi from './api';
-
-export default (me, stream, serverStreamManager) => {
- activateMe(me);
- activateApi(me);
-
- riot.mixin('stream', { stream });
-
- riot.mixin('server-stream', { serverStream: serverStreamManager });
-};
diff --git a/src/web/app/common/mixins/index.ts b/src/web/app/common/mixins/index.ts
new file mode 100644
index 0000000000..45427fb9d3
--- /dev/null
+++ b/src/web/app/common/mixins/index.ts
@@ -0,0 +1,14 @@
+import * as riot from 'riot';
+
+import activateMe from './i';
+import activateApi from './api';
+import ServerStreamManager from '../scripts/server-stream-manager';
+
+export default (me, stream) => {
+ activateMe(me);
+ activateApi(me);
+
+ (riot as any).mixin('stream', { stream });
+
+ (riot as any).mixin('server-stream', { serverStream: new ServerStreamManager() });
+};
diff --git a/src/web/app/common/scripts/api.js b/src/web/app/common/scripts/api.ts
index 4855f736c7..2a9d78e87d 100644
--- a/src/web/app/common/scripts/api.js
+++ b/src/web/app/common/scripts/api.ts
@@ -14,7 +14,7 @@ let pending = 0;
* @param {any} [data={}] Data
* @return {Promise<any>} Response
*/
-export default (i, endpoint, data = {}) => {
+export default (i, endpoint, data = {}): Promise<any> => {
if (++pending === 1) {
spinner = document.createElement('div');
spinner.setAttribute('id', 'wait');
@@ -22,7 +22,7 @@ export default (i, endpoint, data = {}) => {
}
// Append the credential
- if (i != null) data.i = typeof i === 'object' ? i.token : i;
+ if (i != null) (data as any).i = typeof i === 'object' ? i.token : i;
return new Promise((resolve, reject) => {
// Send request
diff --git a/src/web/app/common/scripts/bytes-to-size.js b/src/web/app/common/scripts/bytes-to-size.ts
index af0268dbd0..1d2b1e7ce3 100644
--- a/src/web/app/common/scripts/bytes-to-size.js
+++ b/src/web/app/common/scripts/bytes-to-size.ts
@@ -1,6 +1,6 @@
export default (bytes, digits = 0) => {
- var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0Byte';
- var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
+ const i = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, i)).toFixed(digits).replace(/\.0+$/, '') + sizes[i];
};
diff --git a/src/web/app/common/scripts/channel-stream.js b/src/web/app/common/scripts/channel-stream.ts
index 17944dbe45..17944dbe45 100644
--- a/src/web/app/common/scripts/channel-stream.js
+++ b/src/web/app/common/scripts/channel-stream.ts
diff --git a/src/web/app/common/scripts/check-for-update.js b/src/web/app/common/scripts/check-for-update.ts
index 7cb7839d29..99d8b5d059 100644
--- a/src/web/app/common/scripts/check-for-update.js
+++ b/src/web/app/common/scripts/check-for-update.ts
@@ -1,5 +1,7 @@
import CONFIG from './config';
+declare var VERSION: string;
+
export default function() {
fetch(CONFIG.apiUrl + '/meta', {
method: 'POST'
@@ -11,4 +13,4 @@ export default function() {
}
});
});
-};
+}
diff --git a/src/web/app/common/scripts/config.js b/src/web/app/common/scripts/config.ts
index c5015622f0..c5015622f0 100644
--- a/src/web/app/common/scripts/config.js
+++ b/src/web/app/common/scripts/config.ts
diff --git a/src/web/app/common/scripts/contains.js b/src/web/app/common/scripts/contains.ts
index a5071b3f25..a5071b3f25 100644
--- a/src/web/app/common/scripts/contains.js
+++ b/src/web/app/common/scripts/contains.ts
diff --git a/src/web/app/common/scripts/copy-to-clipboard.js b/src/web/app/common/scripts/copy-to-clipboard.ts
index 3d2741f8d7..3d2741f8d7 100644
--- a/src/web/app/common/scripts/copy-to-clipboard.js
+++ b/src/web/app/common/scripts/copy-to-clipboard.ts
diff --git a/src/web/app/common/scripts/date-stringify.js b/src/web/app/common/scripts/date-stringify.ts
index e51de8833d..e51de8833d 100644
--- a/src/web/app/common/scripts/date-stringify.js
+++ b/src/web/app/common/scripts/date-stringify.ts
diff --git a/src/web/app/common/scripts/gcd.js b/src/web/app/common/scripts/gcd.ts
index 9a19f9da66..9a19f9da66 100644
--- a/src/web/app/common/scripts/gcd.js
+++ b/src/web/app/common/scripts/gcd.ts
diff --git a/src/web/app/common/scripts/get-kao.js b/src/web/app/common/scripts/get-kao.ts
index 0b77ee285a..2168c5be88 100644
--- a/src/web/app/common/scripts/get-kao.js
+++ b/src/web/app/common/scripts/get-kao.ts
@@ -1,5 +1,5 @@
export default () => [
'(=^・・^=)',
'v(‘ω’)v',
- '🐡( '-' 🐡 )フグパンチ!!!!'
+ '🐡( \'-\' 🐡 )フグパンチ!!!!'
][Math.floor(Math.random() * 3)];
diff --git a/src/web/app/common/scripts/home-stream.js b/src/web/app/common/scripts/home-stream.ts
index de9ceb3b51..c549f2b936 100644
--- a/src/web/app/common/scripts/home-stream.js
+++ b/src/web/app/common/scripts/home-stream.ts
@@ -17,9 +17,9 @@ class Connection extends Stream {
this.send({ type: 'alive' });
}, 1000 * 60);
- this.on('i_updated', me.update);
+ (this as any).on('i_updated', me.update);
- this.on('my_token_regenerated', () => {
+ (this as any).on('my_token_regenerated', () => {
alert('%i18n:common.my-token-regenerated%');
signout();
});
diff --git a/src/web/app/common/scripts/is-promise.js b/src/web/app/common/scripts/is-promise.ts
index 3b4cd70b49..3b4cd70b49 100644
--- a/src/web/app/common/scripts/is-promise.js
+++ b/src/web/app/common/scripts/is-promise.ts
diff --git a/src/web/app/common/scripts/loading.js b/src/web/app/common/scripts/loading.ts
index c48e626648..c48e626648 100644
--- a/src/web/app/common/scripts/loading.js
+++ b/src/web/app/common/scripts/loading.ts
diff --git a/src/web/app/common/scripts/messaging-stream.js b/src/web/app/common/scripts/messaging-stream.ts
index 261525d5f6..63830f7b17 100644
--- a/src/web/app/common/scripts/messaging-stream.js
+++ b/src/web/app/common/scripts/messaging-stream.ts
@@ -12,7 +12,7 @@ class Connection extends Stream {
otherparty
});
- this.on('_connected_', () => {
+ (this as any).on('_connected_', () => {
this.send({
i: me.token
});
diff --git a/src/web/app/common/scripts/server-stream-manager.ts b/src/web/app/common/scripts/server-stream-manager.ts
index 54333c8cf5..a170daebb9 100644
--- a/src/web/app/common/scripts/server-stream-manager.ts
+++ b/src/web/app/common/scripts/server-stream-manager.ts
@@ -1,14 +1,7 @@
+import StreamManager from './stream-manager';
import Connection from './server-stream';
-import * as uuid from 'uuid';
-
-export default class ServerStreamManager {
- private connection = null;
-
- /**
- * コネクションを必要としているユーザー
- */
- private users = [];
+export default class ServerStreamManager extends StreamManager<Connection> {
public getConnection() {
if (this.connection == null) {
this.connection = new Connection();
@@ -16,24 +9,4 @@ export default class ServerStreamManager {
return this.connection;
}
-
- public use() {
- // ユーザーID生成
- const userId = uuid();
-
- this.users.push(userId);
-
- return userId;
- }
-
- public dispose(userId) {
- this.users = this.users.filter(id => id != userId);
-
- // 誰もコネクションの利用者がいなくなったら
- if (this.users.length == 0) {
- // コネクションを切断する
- this.connection.close();
- this.connection = null;
- }
- }
}
diff --git a/src/web/app/common/scripts/server-stream.js b/src/web/app/common/scripts/server-stream.ts
index a1c466b35d..a1c466b35d 100644
--- a/src/web/app/common/scripts/server-stream.js
+++ b/src/web/app/common/scripts/server-stream.ts
diff --git a/src/web/app/common/scripts/signout.js b/src/web/app/common/scripts/signout.ts
index 6c95cfbc9c..6c95cfbc9c 100644
--- a/src/web/app/common/scripts/signout.js
+++ b/src/web/app/common/scripts/signout.ts
diff --git a/src/web/app/common/scripts/stream-manager.ts b/src/web/app/common/scripts/stream-manager.ts
new file mode 100644
index 0000000000..4eaf0f9a45
--- /dev/null
+++ b/src/web/app/common/scripts/stream-manager.ts
@@ -0,0 +1,33 @@
+import * as uuid from 'uuid';
+import Connection from './stream';
+
+export default abstract class StreamManager<T extends Connection> {
+ protected connection: T = null;
+
+ /**
+ * コネクションを必要としているユーザー
+ */
+ private users = [];
+
+ public abstract getConnection(): T;
+
+ public use() {
+ // ユーザーID生成
+ const userId = uuid();
+
+ this.users.push(userId);
+
+ return userId;
+ }
+
+ public dispose(userId) {
+ this.users = this.users.filter(id => id != userId);
+
+ // 誰もコネクションの利用者がいなくなったら
+ if (this.users.length == 0) {
+ // コネクションを切断する
+ this.connection.close();
+ this.connection = null;
+ }
+ }
+}
diff --git a/src/web/app/common/scripts/stream.js b/src/web/app/common/scripts/stream.ts
index a03b7bf200..9595246879 100644
--- a/src/web/app/common/scripts/stream.js
+++ b/src/web/app/common/scripts/stream.ts
@@ -8,7 +8,11 @@ import CONFIG from './config';
* Misskey stream connection
*/
class Connection {
- constructor(endpoint, params) {
+ private state: string;
+ private buffer: any[];
+ private socket: ReconnectingWebsocket;
+
+ constructor(endpoint, params?) {
// BIND -----------------------------------
this.onOpen = this.onOpen.bind(this);
this.onClose = this.onClose.bind(this);
@@ -37,11 +41,10 @@ class Connection {
/**
* Callback of when open connection
- * @private
*/
- onOpen() {
+ private onOpen() {
this.state = 'connected';
- this.trigger('_connected_');
+ (this as any).trigger('_connected_');
// バッファーを処理
const _buffer = [].concat(this.buffer); // Shallow copy
@@ -53,45 +56,41 @@ class Connection {
/**
* Callback of when close connection
- * @private
*/
- onClose() {
+ private onClose() {
this.state = 'reconnecting';
- this.trigger('_closed_');
+ (this as any).trigger('_closed_');
}
/**
* Callback of when received a message from connection
- * @private
*/
- onMessage(message) {
+ private onMessage(message) {
try {
const msg = JSON.parse(message.data);
- if (msg.type) this.trigger(msg.type, msg.body);
- } catch(e) {
+ if (msg.type) (this as any).trigger(msg.type, msg.body);
+ } catch (e) {
// noop
}
}
/**
* Send a message to connection
- * @public
*/
- send(message) {
+ public send(message) {
// まだ接続が確立されていなかったらバッファリングして次に接続した時に送信する
if (this.state != 'connected') {
this.buffer.push(message);
return;
- };
+ }
this.socket.send(JSON.stringify(message));
}
/**
* Close this connection
- * @public
*/
- close() {
+ public close() {
this.socket.removeEventListener('open', this.onOpen);
this.socket.removeEventListener('message', this.onMessage);
}
diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.ts
index 0a9b8022df..8c65d6a068 100644
--- a/src/web/app/common/scripts/text-compiler.js
+++ b/src/web/app/common/scripts/text-compiler.ts
@@ -1,5 +1,5 @@
import * as riot from 'riot';
-const pictograph = require('pictograph');
+import * as pictograph from 'pictograph';
import CONFIG from './config';
const escape = text =>
@@ -12,7 +12,7 @@ export default (tokens, shouldBreak) => {
shouldBreak = true;
}
- const me = riot.mixin('i').me;
+ const me = (riot as any).mixin('i').me;
let text = tokens.map(token => {
switch (token.type) {
diff --git a/src/web/app/common/tags/index.js b/src/web/app/common/tags/index.ts
index 35a9f4586e..35a9f4586e 100644
--- a/src/web/app/common/tags/index.js
+++ b/src/web/app/common/tags/index.ts
diff --git a/src/web/app/common/tags/messaging/message.tag b/src/web/app/common/tags/messaging/message.tag
index d6db9070e2..ea1ea2310b 100644
--- a/src/web/app/common/tags/messaging/message.tag
+++ b/src/web/app/common/tags/messaging/message.tag
@@ -219,7 +219,7 @@
this.refs.text.innerHTML = compile(tokens);
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
diff --git a/src/web/app/desktop/mixins/index.js b/src/web/app/desktop/mixins/index.ts
index e0c94ec5ee..e0c94ec5ee 100644
--- a/src/web/app/desktop/mixins/index.js
+++ b/src/web/app/desktop/mixins/index.ts
diff --git a/src/web/app/desktop/mixins/user-preview.js b/src/web/app/desktop/mixins/user-preview.ts
index 3f483beb3a..614de72bea 100644
--- a/src/web/app/desktop/mixins/user-preview.js
+++ b/src/web/app/desktop/mixins/user-preview.ts
@@ -52,7 +52,7 @@ function attach(el) {
clearTimeout(showTimer);
hideTimer = setTimeout(close, 500);
});
- tag = riot.mount(document.body.appendChild(preview), {
+ tag = (riot as any).mount(document.body.appendChild(preview), {
user: user
})[0];
};
diff --git a/src/web/app/desktop/mixins/widget.js b/src/web/app/desktop/mixins/widget.ts
index cb04295fc5..04131cd8f0 100644
--- a/src/web/app/desktop/mixins/widget.js
+++ b/src/web/app/desktop/mixins/widget.ts
@@ -3,7 +3,7 @@ import * as riot from 'riot';
// ミックスインにオプションを渡せないのアレ
// SEE: https://github.com/riot/riot/issues/2434
-riot.mixin('widget', {
+(riot as any).mixin('widget', {
init: function() {
this.mixin('i');
this.mixin('api');
diff --git a/src/web/app/desktop/router.js b/src/web/app/desktop/router.ts
index 4675b967d6..a74299b281 100644
--- a/src/web/app/desktop/router.js
+++ b/src/web/app/desktop/router.ts
@@ -3,7 +3,7 @@
*/
import * as riot from 'riot';
-const route = require('page');
+import * as route from 'page';
let page = null;
export default me => {
@@ -83,12 +83,12 @@ export default me => {
mount(document.createElement('mk-not-found'));
}
- riot.mixin('page', {
+ (riot as any).mixin('page', {
page: route
});
// EXEC
- route();
+ (route as any)();
};
function mount(content) {
diff --git a/src/web/app/desktop/script.js b/src/web/app/desktop/script.ts
index 46a7fce700..a0453865ec 100644
--- a/src/web/app/desktop/script.js
+++ b/src/web/app/desktop/script.ts
@@ -11,7 +11,7 @@ import * as riot from 'riot';
import init from '../init';
import route from './router';
import fuckAdBlock from './scripts/fuck-ad-block';
-import getPostSummary from '../../../common/get-post-summary.ts';
+import getPostSummary from '../../../common/get-post-summary';
/**
* init
@@ -27,11 +27,11 @@ init(async (me, stream) => {
*/
if ('Notification' in window) {
// 許可を得ていなかったらリクエスト
- if (Notification.permission == 'default') {
+ if ((Notification as any).permission == 'default') {
await Notification.requestPermission();
}
- if (Notification.permission == 'granted') {
+ if ((Notification as any).permission == 'granted') {
registerNotifications(stream);
}
}
@@ -82,7 +82,7 @@ function registerNotifications(stream) {
});
n.onclick = () => {
n.close();
- riot.mount(document.body.appendChild(document.createElement('mk-messaging-room-window')), {
+ (riot as any).mount(document.body.appendChild(document.createElement('mk-messaging-room-window')), {
user: message.user
});
};
diff --git a/src/web/app/desktop/scripts/autocomplete.js b/src/web/app/desktop/scripts/autocomplete.ts
index 8ca516e2a9..9df7aae08d 100644
--- a/src/web/app/desktop/scripts/autocomplete.js
+++ b/src/web/app/desktop/scripts/autocomplete.ts
@@ -1,10 +1,12 @@
-const getCaretCoordinates = require('textarea-caret');
+import getCaretCoordinates = require('textarea-caret');
import * as riot from 'riot';
/**
* オートコンプリートを管理するクラス。
*/
class Autocomplete {
+ private suggestion: any;
+ private textarea: any;
/**
* 対象のテキストエリアを与えてインスタンスを初期化します。
@@ -23,22 +25,22 @@ class Autocomplete {
/**
* このインスタンスにあるテキストエリアの入力のキャプチャを開始します。
*/
- attach() {
+ public attach() {
this.textarea.addEventListener('input', this.onInput);
}
/**
* このインスタンスにあるテキストエリアの入力のキャプチャを解除します。
*/
- detach() {
+ public detach() {
this.textarea.removeEventListener('input', this.onInput);
this.close();
}
/**
- * [Private] テキスト入力時
+ * テキスト入力時
*/
- onInput() {
+ private onInput() {
this.close();
const caret = this.textarea.selectionStart;
@@ -56,9 +58,9 @@ class Autocomplete {
}
/**
- * [Private] サジェストを提示します。
+ * サジェストを提示します。
*/
- open(type, q) {
+ private open(type, q) {
// 既に開いているサジェストは閉じる
this.close();
@@ -81,7 +83,7 @@ class Autocomplete {
const el = document.body.appendChild(tag);
// マウント
- this.suggestion = riot.mount(el, {
+ this.suggestion = (riot as any).mount(el, {
textarea: this.textarea,
complete: this.complete,
close: this.close,
@@ -91,9 +93,9 @@ class Autocomplete {
}
/**
- * [Private] サジェストを閉じます。
+ * サジェストを閉じます。
*/
- close() {
+ private close() {
if (this.suggestion == null) return;
this.suggestion.unmount();
@@ -103,9 +105,9 @@ class Autocomplete {
}
/**
- * [Private] オートコンプリートする
+ * オートコンプリートする
*/
- complete(user) {
+ private complete(user) {
this.close();
const value = user.username;
diff --git a/src/web/app/desktop/scripts/dialog.js b/src/web/app/desktop/scripts/dialog.ts
index c502d3fcb8..816ba4b5f5 100644
--- a/src/web/app/desktop/scripts/dialog.js
+++ b/src/web/app/desktop/scripts/dialog.ts
@@ -1,9 +1,9 @@
import * as riot from 'riot';
-export default (title, text, buttons, canThrough, onThrough) => {
+export default (title, text, buttons, canThrough?, onThrough?) => {
const dialog = document.body.appendChild(document.createElement('mk-dialog'));
const controller = riot.observable();
- riot.mount(dialog, {
+ (riot as any).mount(dialog, {
controller: controller,
title: title,
text: text,
diff --git a/src/web/app/desktop/scripts/fuck-ad-block.js b/src/web/app/desktop/scripts/fuck-ad-block.ts
index ccfc43ce6e..3307ba2f30 100644
--- a/src/web/app/desktop/scripts/fuck-ad-block.js
+++ b/src/web/app/desktop/scripts/fuck-ad-block.ts
@@ -1,6 +1,8 @@
require('fuckadblock');
import dialog from './dialog';
+declare var fuckAdBlock: any;
+
export default () => {
if (fuckAdBlock === undefined) {
adBlockDetected();
diff --git a/src/web/app/desktop/scripts/input-dialog.js b/src/web/app/desktop/scripts/input-dialog.ts
index 954fabfb67..b06d011c6b 100644
--- a/src/web/app/desktop/scripts/input-dialog.js
+++ b/src/web/app/desktop/scripts/input-dialog.ts
@@ -2,7 +2,7 @@ import * as riot from 'riot';
export default (title, placeholder, defaultValue, onOk, onCancel) => {
const dialog = document.body.appendChild(document.createElement('mk-input-dialog'));
- return riot.mount(dialog, {
+ return (riot as any).mount(dialog, {
title: title,
placeholder: placeholder,
'default': defaultValue,
diff --git a/src/web/app/desktop/scripts/not-implemented-exception.js b/src/web/app/desktop/scripts/not-implemented-exception.ts
index dd00c7662f..dd00c7662f 100644
--- a/src/web/app/desktop/scripts/not-implemented-exception.js
+++ b/src/web/app/desktop/scripts/not-implemented-exception.ts
diff --git a/src/web/app/desktop/scripts/notify.js b/src/web/app/desktop/scripts/notify.ts
index e58a8e4d36..2e6cbdeed8 100644
--- a/src/web/app/desktop/scripts/notify.js
+++ b/src/web/app/desktop/scripts/notify.ts
@@ -2,7 +2,7 @@ import * as riot from 'riot';
export default message => {
const notification = document.body.appendChild(document.createElement('mk-ui-notification'));
- riot.mount(notification, {
+ (riot as any).mount(notification, {
message: message
});
};
diff --git a/src/web/app/desktop/scripts/password-dialog.js b/src/web/app/desktop/scripts/password-dialog.ts
index 2bdc93e421..39d7f3db7a 100644
--- a/src/web/app/desktop/scripts/password-dialog.js
+++ b/src/web/app/desktop/scripts/password-dialog.ts
@@ -2,7 +2,7 @@ import * as riot from 'riot';
export default (title, onOk, onCancel) => {
const dialog = document.body.appendChild(document.createElement('mk-input-dialog'));
- return riot.mount(dialog, {
+ return (riot as any).mount(dialog, {
title: title,
type: 'password',
onOk: onOk,
diff --git a/src/web/app/desktop/scripts/update-avatar.js b/src/web/app/desktop/scripts/update-avatar.ts
index 165c90567c..5fd7f2d3d1 100644
--- a/src/web/app/desktop/scripts/update-avatar.js
+++ b/src/web/app/desktop/scripts/update-avatar.ts
@@ -5,7 +5,7 @@ import api from '../../common/scripts/api';
export default (I, cb, file = null) => {
const fileSelected = file => {
- const cropper = riot.mount(document.body.appendChild(document.createElement('mk-crop-window')), {
+ const cropper = (riot as any).mount(document.body.appendChild(document.createElement('mk-crop-window')), {
file: file,
title: 'アバターとして表示する部分を選択',
aspectRatio: 1 / 1
@@ -37,7 +37,7 @@ export default (I, cb, file = null) => {
};
const upload = (data, folder) => {
- const progress = riot.mount(document.body.appendChild(document.createElement('mk-progress-dialog')), {
+ const progress = (riot as any).mount(document.body.appendChild(document.createElement('mk-progress-dialog')), {
title: '新しいアバターをアップロードしています'
})[0];
@@ -46,7 +46,7 @@ export default (I, cb, file = null) => {
const xhr = new XMLHttpRequest();
xhr.open('POST', CONFIG.apiUrl + '/drive/files/create', true);
xhr.onload = e => {
- const file = JSON.parse(e.target.response);
+ const file = JSON.parse((e.target as any).response);
progress.close();
set(file);
};
@@ -75,7 +75,7 @@ export default (I, cb, file = null) => {
if (file) {
fileSelected(file);
} else {
- const browser = riot.mount(document.body.appendChild(document.createElement('mk-select-file-from-drive-window')), {
+ const browser = (riot as any).mount(document.body.appendChild(document.createElement('mk-select-file-from-drive-window')), {
multiple: false,
title: '<i class="fa fa-picture-o"></i>アバターにする画像を選択'
})[0];
diff --git a/src/web/app/desktop/scripts/update-banner.js b/src/web/app/desktop/scripts/update-banner.ts
index d83b2bf1b1..23a671c44d 100644
--- a/src/web/app/desktop/scripts/update-banner.js
+++ b/src/web/app/desktop/scripts/update-banner.ts
@@ -5,7 +5,7 @@ import api from '../../common/scripts/api';
export default (I, cb, file = null) => {
const fileSelected = file => {
- const cropper = riot.mount(document.body.appendChild(document.createElement('mk-crop-window')), {
+ const cropper = (riot as any).mount(document.body.appendChild(document.createElement('mk-crop-window')), {
file: file,
title: 'バナーとして表示する部分を選択',
aspectRatio: 16 / 9
@@ -37,7 +37,7 @@ export default (I, cb, file = null) => {
};
const upload = (data, folder) => {
- const progress = riot.mount(document.body.appendChild(document.createElement('mk-progress-dialog')), {
+ const progress = (riot as any).mount(document.body.appendChild(document.createElement('mk-progress-dialog')), {
title: '新しいバナーをアップロードしています'
})[0];
@@ -46,7 +46,7 @@ export default (I, cb, file = null) => {
const xhr = new XMLHttpRequest();
xhr.open('POST', CONFIG.apiUrl + '/drive/files/create', true);
xhr.onload = e => {
- const file = JSON.parse(e.target.response);
+ const file = JSON.parse((e.target as any).response);
progress.close();
set(file);
};
@@ -75,7 +75,7 @@ export default (I, cb, file = null) => {
if (file) {
fileSelected(file);
} else {
- const browser = riot.mount(document.body.appendChild(document.createElement('mk-select-file-from-drive-window')), {
+ const browser = (riot as any).mount(document.body.appendChild(document.createElement('mk-select-file-from-drive-window')), {
multiple: false,
title: '<i class="fa fa-picture-o"></i>バナーにする画像を選択'
})[0];
diff --git a/src/web/app/desktop/tags/autocomplete-suggestion.tag b/src/web/app/desktop/tags/autocomplete-suggestion.tag
index b936360402..7311606694 100644
--- a/src/web/app/desktop/tags/autocomplete-suggestion.tag
+++ b/src/web/app/desktop/tags/autocomplete-suggestion.tag
@@ -177,7 +177,7 @@
};
this.applySelect = () => {
- this.refs.users.children.forEach(el => {
+ Array.from(this.refs.users.children).forEach(el => {
el.removeAttribute('data-selected');
});
diff --git a/src/web/app/desktop/tags/drive/browser.tag b/src/web/app/desktop/tags/drive/browser.tag
index be16a782d7..18e27f24bc 100644
--- a/src/web/app/desktop/tags/drive/browser.tag
+++ b/src/web/app/desktop/tags/drive/browser.tag
@@ -408,7 +408,7 @@
// ドロップされてきたものがファイルだったら
if (e.dataTransfer.files.length > 0) {
- e.dataTransfer.files.forEach(file => {
+ Array.from(e.dataTransfer.files).forEach(file => {
this.upload(file, this.folder);
});
return false;
@@ -510,7 +510,7 @@
};
this.changeFileInput = () => {
- this.refs.fileInput.files.forEach(file => {
+ Array.from(this.refs.fileInput.files).forEach(file => {
this.upload(file, this.folder);
});
};
diff --git a/src/web/app/desktop/tags/drive/folder.tag b/src/web/app/desktop/tags/drive/folder.tag
index e03c4e3534..1c361c8e4d 100644
--- a/src/web/app/desktop/tags/drive/folder.tag
+++ b/src/web/app/desktop/tags/drive/folder.tag
@@ -109,7 +109,7 @@
// ファイルだったら
if (e.dataTransfer.files.length > 0) {
- e.dataTransfer.files.forEach(file => {
+ Array.from(e.dataTransfer.files).forEach(file => {
this.browser.upload(file, this.folder);
});
return false;
diff --git a/src/web/app/desktop/tags/drive/nav-folder.tag b/src/web/app/desktop/tags/drive/nav-folder.tag
index c89d9edc1c..0a9421353c 100644
--- a/src/web/app/desktop/tags/drive/nav-folder.tag
+++ b/src/web/app/desktop/tags/drive/nav-folder.tag
@@ -55,7 +55,7 @@
// ファイルだったら
if (e.dataTransfer.files.length > 0) {
- e.dataTransfer.files.forEach(file => {
+ Array.from(e.dataTransfer.files).forEach(file => {
this.browser.upload(file, this.folder);
});
return false;
diff --git a/src/web/app/desktop/tags/index.js b/src/web/app/desktop/tags/index.ts
index 15677471c3..15677471c3 100644
--- a/src/web/app/desktop/tags/index.js
+++ b/src/web/app/desktop/tags/index.ts
diff --git a/src/web/app/desktop/tags/post-detail-sub.tag b/src/web/app/desktop/tags/post-detail-sub.tag
index 8a0ada5f2a..e22386df91 100644
--- a/src/web/app/desktop/tags/post-detail-sub.tag
+++ b/src/web/app/desktop/tags/post-detail-sub.tag
@@ -129,7 +129,7 @@
this.refs.text.innerHTML = compile(tokens);
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
}
diff --git a/src/web/app/desktop/tags/post-detail.tag b/src/web/app/desktop/tags/post-detail.tag
index ce7f81e32c..1a0eefe13e 100644
--- a/src/web/app/desktop/tags/post-detail.tag
+++ b/src/web/app/desktop/tags/post-detail.tag
@@ -273,7 +273,7 @@
this.refs.text.innerHTML = compile(tokens);
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
diff --git a/src/web/app/desktop/tags/post-form.tag b/src/web/app/desktop/tags/post-form.tag
index 5041078bee..e49beeedbc 100644
--- a/src/web/app/desktop/tags/post-form.tag
+++ b/src/web/app/desktop/tags/post-form.tag
@@ -405,7 +405,7 @@
// ファイルだったら
if (e.dataTransfer.files.length > 0) {
- e.dataTransfer.files.forEach(this.upload);
+ Array.from(e.dataTransfer.files).forEach(this.upload);
}
};
@@ -414,7 +414,7 @@
};
this.onpaste = e => {
- e.clipboardData.items.forEach(item => {
+ Array.from(e.clipboardData.items).forEach(item => {
if (item.kind == 'file') {
this.upload(item.getAsFile());
}
@@ -435,7 +435,7 @@
};
this.changeFile = () => {
- this.refs.file.files.forEach(this.upload);
+ Array.from(this.refs.file.files).forEach(this.upload);
};
this.upload = file => {
diff --git a/src/web/app/desktop/tags/sub-post-content.tag b/src/web/app/desktop/tags/sub-post-content.tag
index c75ae2911c..86269fdbe9 100644
--- a/src/web/app/desktop/tags/sub-post-content.tag
+++ b/src/web/app/desktop/tags/sub-post-content.tag
@@ -45,7 +45,7 @@
const tokens = this.post.ast;
this.refs.text.innerHTML = compile(tokens, false);
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
}
diff --git a/src/web/app/desktop/tags/timeline.tag b/src/web/app/desktop/tags/timeline.tag
index 44f3d5d8ec..5e3b883b47 100644
--- a/src/web/app/desktop/tags/timeline.tag
+++ b/src/web/app/desktop/tags/timeline.tag
@@ -498,7 +498,7 @@
this.refs.text.innerHTML = this.refs.text.innerHTML.replace('<p class="dummy"></p>', compile(tokens));
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
diff --git a/src/web/app/dev/router.js b/src/web/app/dev/router.ts
index 7fde30fa5c..532ec23c73 100644
--- a/src/web/app/dev/router.js
+++ b/src/web/app/dev/router.ts
@@ -1,5 +1,5 @@
import * as riot from 'riot';
-const route = require('page');
+import * as route from 'page';
let page = null;
export default me => {
@@ -32,7 +32,7 @@ export default me => {
}
// EXEC
- route();
+ (route as any)();
};
function mount(content) {
diff --git a/src/web/app/dev/script.js b/src/web/app/dev/script.ts
index 39d7fc891e..39d7fc891e 100644
--- a/src/web/app/dev/script.js
+++ b/src/web/app/dev/script.ts
diff --git a/src/web/app/dev/tags/index.js b/src/web/app/dev/tags/index.ts
index 1e0c73697e..1e0c73697e 100644
--- a/src/web/app/dev/tags/index.js
+++ b/src/web/app/dev/tags/index.ts
diff --git a/src/web/app/init.js b/src/web/app/init.ts
index d3817fe971..e68a7c9152 100644
--- a/src/web/app/init.js
+++ b/src/web/app/init.ts
@@ -2,14 +2,13 @@
* App initializer
*/
-'use strict';
+declare var VERSION: string;
+declare var LANG: string;
import * as riot from 'riot';
-import api from './common/scripts/api';
import signout from './common/scripts/signout';
import checkForUpdate from './common/scripts/check-for-update';
import Connection from './common/scripts/home-stream';
-import ServerStreamManager from './common/scripts/server-stream-manager.ts';
import Progress from './common/scripts/loading';
import mixin from './common/mixins';
import CONFIG from './common/scripts/config';
@@ -37,21 +36,7 @@ console.info(`Misskey v${VERSION} (葵 aoi)`);
document.domain = CONFIG.host;
// Set global configuration
-riot.mixin({ CONFIG });
-
-// ↓ NodeList、HTMLCollection、FileList、DataTransferItemListで forEach を使えるようにする
-if (NodeList.prototype.forEach === undefined) {
- NodeList.prototype.forEach = Array.prototype.forEach;
-}
-if (HTMLCollection.prototype.forEach === undefined) {
- HTMLCollection.prototype.forEach = Array.prototype.forEach;
-}
-if (FileList.prototype.forEach === undefined) {
- FileList.prototype.forEach = Array.prototype.forEach;
-}
-if (window.DataTransferItemList && DataTransferItemList.prototype.forEach === undefined) {
- DataTransferItemList.prototype.forEach = Array.prototype.forEach;
-}
+(riot as any).mixin({ CONFIG });
// iOSでプライベートモードだとlocalStorageが使えないので既存のメソッドを上書きする
try {
@@ -72,7 +57,7 @@ setTimeout(checkForUpdate, 3000);
// ユーザーをフェッチしてコールバックする
export default callback => {
// Get cached account data
- let cachedMe = JSON.parse(localStorage.getItem('me'));
+ const cachedMe = JSON.parse(localStorage.getItem('me'));
if (cachedMe) {
fetched(cachedMe);
@@ -112,11 +97,8 @@ export default callback => {
// Init home stream connection
const stream = me ? new Connection(me) : null;
- // Init server stream connection manager
- const serverStreamManager = new ServerStreamManager();
-
// ミックスイン初期化
- mixin(me, stream, serverStreamManager);
+ mixin(me, stream);
// ローディング画面クリア
const ini = document.getElementById('ini');
diff --git a/src/web/app/mobile/router.js b/src/web/app/mobile/router.ts
index 01eb3c8145..7fae9db547 100644
--- a/src/web/app/mobile/router.js
+++ b/src/web/app/mobile/router.ts
@@ -3,7 +3,7 @@
*/
import * as riot from 'riot';
-const route = require('page');
+import * as route from 'page';
let page = null;
export default me => {
@@ -131,12 +131,12 @@ export default me => {
mount(document.createElement('mk-not-found'));
}
- riot.mixin('page', {
+ (riot as any).mixin('page', {
page: route
});
// EXEC
- route();
+ (route as any)();
};
function mount(content) {
diff --git a/src/web/app/mobile/script.js b/src/web/app/mobile/script.ts
index 503e0fd673..503e0fd673 100644
--- a/src/web/app/mobile/script.js
+++ b/src/web/app/mobile/script.ts
diff --git a/src/web/app/mobile/scripts/open-post-form.js b/src/web/app/mobile/scripts/open-post-form.ts
index e0fae4d8ca..e0fae4d8ca 100644
--- a/src/web/app/mobile/scripts/open-post-form.js
+++ b/src/web/app/mobile/scripts/open-post-form.ts
diff --git a/src/web/app/mobile/scripts/ui-event.js b/src/web/app/mobile/scripts/ui-event.ts
index 2e406549a4..2e406549a4 100644
--- a/src/web/app/mobile/scripts/ui-event.js
+++ b/src/web/app/mobile/scripts/ui-event.ts
diff --git a/src/web/app/mobile/tags/drive.tag b/src/web/app/mobile/tags/drive.tag
index 6929c50ab1..870a451acb 100644
--- a/src/web/app/mobile/tags/drive.tag
+++ b/src/web/app/mobile/tags/drive.tag
@@ -561,7 +561,7 @@
};
this.changeLocalFile = () => {
- this.refs.file.files.forEach(f => this.refs.uploader.upload(f, this.folder));
+ Array.from(this.refs.file.files).forEach(f => this.refs.uploader.upload(f, this.folder));
};
</script>
</mk-drive>
diff --git a/src/web/app/mobile/tags/index.js b/src/web/app/mobile/tags/index.ts
index 19952c20cd..19952c20cd 100644
--- a/src/web/app/mobile/tags/index.js
+++ b/src/web/app/mobile/tags/index.ts
diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag
index 8a32101036..28071a5cac 100644
--- a/src/web/app/mobile/tags/post-detail.tag
+++ b/src/web/app/mobile/tags/post-detail.tag
@@ -285,7 +285,7 @@
this.refs.text.innerHTML = compile(tokens);
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
diff --git a/src/web/app/mobile/tags/post-form.tag b/src/web/app/mobile/tags/post-form.tag
index d7d382c9e2..2912bfdfa2 100644
--- a/src/web/app/mobile/tags/post-form.tag
+++ b/src/web/app/mobile/tags/post-form.tag
@@ -207,7 +207,7 @@
};
this.onpaste = e => {
- e.clipboardData.items.forEach(item => {
+ Array.from(e.clipboardData.items).forEach(item => {
if (item.kind == 'file') {
this.upload(item.getAsFile());
}
@@ -228,7 +228,7 @@
};
this.changeFile = () => {
- this.refs.file.files.forEach(this.upload);
+ Array.from(this.refs.file.files).forEach(this.upload);
};
this.upload = file => {
diff --git a/src/web/app/mobile/tags/sub-post-content.tag b/src/web/app/mobile/tags/sub-post-content.tag
index e32e245185..c14233d3b7 100644
--- a/src/web/app/mobile/tags/sub-post-content.tag
+++ b/src/web/app/mobile/tags/sub-post-content.tag
@@ -37,7 +37,7 @@
const tokens = this.post.ast;
this.refs.text.innerHTML = compile(tokens, false);
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
}
diff --git a/src/web/app/mobile/tags/timeline.tag b/src/web/app/mobile/tags/timeline.tag
index f9ec2cca60..52f6f27ea8 100644
--- a/src/web/app/mobile/tags/timeline.tag
+++ b/src/web/app/mobile/tags/timeline.tag
@@ -538,7 +538,7 @@
this.refs.text.innerHTML = this.refs.text.innerHTML.replace('<p class="dummy"></p>', compile(tokens));
- this.refs.text.children.forEach(e => {
+ Array.from(this.refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
diff --git a/src/web/app/stats/script.js b/src/web/app/stats/script.ts
index 75063501bb..75063501bb 100644
--- a/src/web/app/stats/script.js
+++ b/src/web/app/stats/script.ts
diff --git a/src/web/app/stats/tags/index.js b/src/web/app/stats/tags/index.ts
index f41151949f..f41151949f 100644
--- a/src/web/app/stats/tags/index.js
+++ b/src/web/app/stats/tags/index.ts
diff --git a/src/web/app/status/script.js b/src/web/app/status/script.ts
index 06d4d9a7a4..06d4d9a7a4 100644
--- a/src/web/app/status/script.js
+++ b/src/web/app/status/script.ts
diff --git a/src/web/app/status/tags/index.js b/src/web/app/status/tags/index.ts
index f41151949f..f41151949f 100644
--- a/src/web/app/status/tags/index.js
+++ b/src/web/app/status/tags/index.ts