vue updates ^_^

Former-commit-id: 336b37cf681ec2337a1e4d577213aa45f12b81d6 [formerly d8cbb6ff242f9ab3e5c857da6f6758abb0f4fc1a] [formerly 8b9089c816fae3608bf5ef8592cb776fa420a6f6 [formerly e2077efbc6a49a82c9f0fc8741304fd2fc9c7e93]]
Former-commit-id: 30b063fdab7de6f2c1c5f46dd8a1dd354897f5b6 [formerly 8f83b525334b9430ddbe779c6eae3251a5590b75]
Former-commit-id: bbe19a047d103531a542bebb1fe0263bec4cbd88
This commit is contained in:
Henrique Dias
2017-06-28 16:05:30 +01:00
parent bf4739697f
commit 834ce7ac4a
21 changed files with 532 additions and 452 deletions

View File

@@ -16,7 +16,6 @@
</template>
<script>
// Remove the last directory of an url
var removeLastDirectoryPartOf = function (url) {
var arr = url.split('/')
@@ -26,7 +25,7 @@ var removeLastDirectoryPartOf = function (url) {
return (arr.join('/'))
}
var data = window.data
var user = window.info.user
var ssl = window.ssl
export default {
@@ -48,8 +47,8 @@ export default {
},
methods: {
reset: function () {
if (data.user.AllowCommands && data.user.Commands.length > 0) {
this.box.innerHTML = `Search or use one of your supported commands: ${data.user.Commands.join(', ')}.`
if (user.allowCommands && user.commands.length > 0) {
this.box.innerHTML = `Search or use one of your supported commands: ${user.commands.join(', ')}.`
} else {
this.box.innerHTML = 'Type and press enter to search.'
}
@@ -58,8 +57,8 @@ export default {
let value = this.input.value
let pieces = value.split(' ')
for (let i = 0; i < data.user.Commands.length; i++) {
if (pieces[0] === data.user.Commands[0]) {
for (let i = 0; i < user.commands.length; i++) {
if (pieces[0] === user.commands[0]) {
return true
}
}
@@ -78,7 +77,7 @@ export default {
return
}
if (!this.supported() || !data.user.AllowCommands) {
if (!this.supported() || !user.allowCommands) {
this.box.innerHTML = 'Press enter to search.'
} else {
this.box.innerHTML = 'Press enter to execute.'
@@ -96,7 +95,7 @@ export default {
let protocol = ssl ? 'wss:' : 'ws:'
if (this.supported() && data.user.AllowCommands) {
if (this.supported() && user.allowCommands) {
let conn = new window.WebSocket(`${protocol}//${url}?command=true`)
conn.onopen = () => {