summaryrefslogtreecommitdiff
path: root/src/web/app/dev
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/app/dev')
-rw-r--r--src/web/app/dev/tags/new-app-form.tag68
-rw-r--r--src/web/app/dev/tags/pages/app.tag18
-rw-r--r--src/web/app/dev/tags/pages/apps.tag16
3 files changed, 51 insertions, 51 deletions
diff --git a/src/web/app/dev/tags/new-app-form.tag b/src/web/app/dev/tags/new-app-form.tag
index 86e694e94e..c75eec37dd 100644
--- a/src/web/app/dev/tags/new-app-form.tag
+++ b/src/web/app/dev/tags/new-app-form.tag
@@ -178,66 +178,66 @@
</style>
<script>
- @mixin \api
+ this.mixin('api');
- @nid-state = null
+ this.nid-state = null
- @on-change-nid = ~>
- nid = @refs.nid.value
+ this.on-change-nid = () => {
+ nid = this.refs.nid.value
if nid == ''
- @nid-state = null
- @update!
+ this.nid-state = null
+ this.update();
return
err = switch
- | not nid.match /^[a-zA-Z0-9\-]+$/ => \invalid-format
- | nid.length < 3chars => \min-range
- | nid.length > 30chars => \max-range
+ | not nid.match /^[a-zA-Z0-9\-]+$/ => 'invalid-format'
+ | nid.length < 3chars => 'min-range'
+ | nid.length > 30chars => 'max-range'
| _ => null
if err?
- @nid-state = err
- @update!
+ this.nid-state = err
+ this.update();
else
- @nid-state = \wait
- @update!
+ this.nid-state = 'wait'
+ this.update();
- @api \app/name_id/available do
+ this.api('app/name_id/available', {
name_id: nid
- .then (result) ~>
+ }).then((result) => {
if result.available
- @nid-state = \ok
+ this.nid-state = 'ok'
else
- @nid-state = \unavailable
- @update!
- .catch (err) ~>
- @nid-state = \error
- @update!
+ this.nid-state = 'unavailable'
+ this.update();
+ .catch (err) =>
+ this.nid-state = 'error'
+ this.update();
- @onsubmit = ~>
- name = @refs.name.value
- nid = @refs.nid.value
- description = @refs.description.value
- cb = @refs.cb.value
+ this.onsubmit = () => {
+ name = this.refs.name.value
+ nid = this.refs.nid.value
+ description = this.refs.description.value
+ cb = this.refs.cb.value
permission = []
- @refs.permission.query-selector-all \input .for-each (el) ~>
+ this.refs.permission.query-selector-all 'input' .forEach (el) =>
if el.checked then permission.push el.value
- locker = document.body.append-child document.create-element \mk-locker
-
- @api \app/create do
+ locker = document.body.appendChild(document.createElement('mk-locker'));
+
+ this.api('app/create', {
name: name
name_id: nid
description: description
callback_url: cb
- permission: permission.join \,
- .then ~>
+ permission: permission.join ','
+ }).then(() => {
location.href = '/apps'
- .catch ~>
+ .catch =>
alert 'アプリの作成に失敗しました。再度お試しください。'
- locker.parent-node.remove-child locker
+ locker.parentNode.removeChild locker
</script>
</mk-new-app-form>
diff --git a/src/web/app/dev/tags/pages/app.tag b/src/web/app/dev/tags/pages/app.tag
index 7eaf9decf6..e6cadab1bc 100644
--- a/src/web/app/dev/tags/pages/app.tag
+++ b/src/web/app/dev/tags/pages/app.tag
@@ -15,16 +15,16 @@
</style>
<script>
- @mixin \api
+ this.mixin('api');
- @fetching = true
+ this.fetching = true
- @on \mount ~>
- @api \app/show do
- app_id: @opts.app
- .then (app) ~>
- @app = app
- @fetching = false
- @update!
+ this.on('mount', () => {
+ this.api('app/show', {
+ app_id: this.opts.app
+ }).then((app) => {
+ this.app = app
+ this.fetching = false
+ this.update();
</script>
</mk-app-page>
diff --git a/src/web/app/dev/tags/pages/apps.tag b/src/web/app/dev/tags/pages/apps.tag
index 03806c6da5..c87141711f 100644
--- a/src/web/app/dev/tags/pages/apps.tag
+++ b/src/web/app/dev/tags/pages/apps.tag
@@ -16,15 +16,15 @@
</style>
<script>
- @mixin \api
+ this.mixin('api');
- @fetching = true
+ this.fetching = true
- @on \mount ~>
- @api \my/apps
- .then (apps) ~>
- @fetching = false
- @apps = apps
- @update!
+ this.on('mount', () => {
+ this.api 'my/apps'
+ }).then((apps) => {
+ this.fetching = false
+ this.apps = apps
+ this.update();
</script>
</mk-apps-page>