summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-20 10:44:44 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-20 10:44:44 +0900
commita9dfe278f8021455fb67c87437ce120a4d67dc3f (patch)
tree03844c48542324fd5d40d0788fd049a0c8b9b962
parentwip (diff)
downloadmisskey-a9dfe278f8021455fb67c87437ce120a4d67dc3f.tar.gz
misskey-a9dfe278f8021455fb67c87437ce120a4d67dc3f.tar.bz2
misskey-a9dfe278f8021455fb67c87437ce120a4d67dc3f.zip
wip
-rw-r--r--package.json2
-rw-r--r--src/web/app/common/tags/messaging/form.tag11
-rw-r--r--src/web/app/common/tags/messaging/index.tag9
-rw-r--r--src/web/app/common/tags/messaging/message.tag28
-rw-r--r--webpack.config.ts2
5 files changed, 29 insertions, 23 deletions
diff --git a/package.json b/package.json
index 04335daa42..b90efb8192 100644
--- a/package.json
+++ b/package.json
@@ -97,7 +97,6 @@
"gulp-babel": "6.1.2",
"gulp-cssnano": "2.1.2",
"gulp-imagemin": "3.1.1",
- "gulp-livescript": "3.0.1",
"gulp-pug": "3.2.0",
"gulp-rename": "1.2.2",
"gulp-replace": "0.5.4",
@@ -109,7 +108,6 @@
"is-root": "1.0.0",
"is-url": "1.2.2",
"js-yaml": "3.8.0",
- "livescript": "1.5.0",
"mime-types": "2.1.14",
"mocha": "3.2.0",
"mongodb": "2.2.24",
diff --git a/src/web/app/common/tags/messaging/form.tag b/src/web/app/common/tags/messaging/form.tag
index 8e74fbd350..4e5f5262af 100644
--- a/src/web/app/common/tags/messaging/form.tag
+++ b/src/web/app/common/tags/messaging/form.tag
@@ -128,17 +128,17 @@
this.upload(item.getAsFile());
}
}
- }
+ };
this.onkeypress = (e) => {
if ((e.which == 10 || e.which == 13) && e.ctrlKey) {
this.send();
}
- }
+ };
this.selectFile = () => {
this.refs.file.click();
- }
+ };
this.selectFileFromDrive = () => {
const browser = document.body.appendChild(document.createElement('mk-select-file-from-drive-window'));
@@ -150,7 +150,7 @@
event.one('selected', files => {
files.forEach(this.addFile);
});
- }
+ };
this.send = () => {
this.sending = true;
@@ -165,11 +165,12 @@
this.sending = false;
this.update();
});
+ };
this.clear = () => {
this.refs.text.value = '';
this.files = [];
this.update();
- }
+ };
</script>
</mk-messaging-form>
diff --git a/src/web/app/common/tags/messaging/index.tag b/src/web/app/common/tags/messaging/index.tag
index e7d110140a..74173b738e 100644
--- a/src/web/app/common/tags/messaging/index.tag
+++ b/src/web/app/common/tags/messaging/index.tag
@@ -303,7 +303,7 @@
this.history = history;
this.update();
});
- }
+ });
this.search = () => {
const q = this.refs.search.value;
@@ -322,14 +322,16 @@
this.update();
.catch (err) =>
console.error err
+ };
- this.on-search-keydown = (e) => {
- key = e.which
+ this.on-search-keydown = e => {
+ const key = e.which;
switch (key)
| 9, 40 => // Key[TAB] or Key[↓]
e.preventDefault();
e.stopPropagation();
this.refs.search-result.childNodes[0].focus();
+ };
this.on-search-result-keydown = (i, e) => {
key = e.which
@@ -350,6 +352,7 @@
e.preventDefault();
e.stopPropagation();
(this.refs.search-result.childNodes[i].next-element-sibling || this.refs.search-result.childNodes[0]).focus();
+ };
</script>
</mk-messaging>
diff --git a/src/web/app/common/tags/messaging/message.tag b/src/web/app/common/tags/messaging/message.tag
index 96b4e8dafd..de763c779a 100644
--- a/src/web/app/common/tags/messaging/message.tag
+++ b/src/web/app/common/tags/messaging/message.tag
@@ -206,25 +206,29 @@
this.mixin('i');
this.mixin('text');
- this.message = this.opts.message
- @message.is_me = @message.user.id == this.I.id
+ this.message = this.opts.message;
+ this.message.is_me = this.message.user.id == this.I.id;
this.on('mount', () => {
- if @message.text?
- tokens = @analyze @message.text
+ if (this.message.text) {
+ const tokens = this.analyze(this.message.text);
- this.refs.text.innerHTML = @compile tokens
+ this.refs.text.innerHTML = this.compile(tokens);
- this.refs.text.children.for-each (e) =>
- if e.tag-name == 'MK-URL'
- riot.mount e
+ this.refs.text.children.forEach(e => {
+ if (e.tagName == 'MK-URL') riot.mount(e);
+ });
// URLをプレビュー
tokens
- .filter (t) -> t.type == 'link'
- .map (t) =>
- this.preview = this.refs.text.appendChild document.createElement 'mk-url-preview'
- riot.mount @preview, do
+ .filter(t => t.type == 'link')
+ .map(t => {
+ const el = this.refs.text.appendChild(document.createElement('mk-url-preview'));
+ riot.mount(el, {
url: t.content
+ });
+ });
+ }
+ });
</script>
</mk-messaging-message>
diff --git a/webpack.config.ts b/webpack.config.ts
index 195c433a99..6928536ff2 100644
--- a/webpack.config.ts
+++ b/webpack.config.ts
@@ -31,7 +31,7 @@ module.exports = (config, commit, env) => {
loader: 'riot-tag-loader',
query: {
hot: false,
- type: 'livescript',
+ type: 'es6',
style: 'stylus',
expr: false,
compact: true,