-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
executable file
·94 lines (82 loc) · 4.07 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Langly</title>
<link rel="stylesheet" href="bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app" v-cloak class="container-fluid">
<header class="d-md-flex">
<div class="mr-3" style="width:40px;"><img class="logo" alt="Langly" title="Langly" src="icons/icon.png" srcset="icons/icon.png 1x, icons/[email protected] 2x"></div>
<div class="mr-3">
<input type="search" v-model="query" class="form-control" placeholder="Search for key">
</div>
<div v-if="numLangs > 0" class="btn-group mr-3">
<select class="form-control" v-model="selectedLangKey">
<option v-for="(lang, lang_key) in langs" :value="lang_key">
{{ lang_key }}
</option>
</select>
</div>
<div class="input-group mr-3" style="flex:0;">
<input style="width:50px" @keydown.enter="addLang()" type="text" class="form-control" placeholder="xx" v-model="newLangName">
<span class="input-group-btn">
<button @click="addLang()" class="btn btn-secondary">➕</button>
</span>
</div>
<div class="d-flex ml-auto">
<button class="btn btn-secondary mr-3" @click="open()">Open</button>
<button class="btn btn-secondary mr-3" @click="reload()">Reload</button>
<button class="btn btn-primary" @click="save()">Save</button>
</div>
</header>
<div v-if="rootDir">
<div class="lang-items" v-if="selectedLangKey">
<div :class="{'has-warning': !item.value || item.value == ''}" class="form-group row" v-for="(item, index) of filteredLangItems">
<label :for="'key-'+index" class="col-form-label col-sm-6 text-right">
<span class="badge badge-danger" v-if="missingKeys.indexOf(item.key) > -1">Not in lang file</span>
<span class="badge badge-info" v-if="extraKeys.indexOf(item.key) > -1">Not in app</span>
<a style="color:#fff; float:left;" @click="showFound(item.key)" class="badge badge-info" v-if="scannedKeysFound[item.key]">{{ scannedKeysFound[item.key].length }}</a>
{{ item.key }}
</label>
<div class="col-sm-6">
<textarea rows="1" :id="'key-'+index" class="form-control" :value="item.value" @input="updateValue(item.key, $event.target.value);"></textarea>
</div>
</div>
<div v-if="filteredLangItems.length == 0" class="text-muted">
<span v-if="query != ''">Your search for '{{ query }}' didn't match any keys</span>
<span v-else>No keys found</span>
</div>
</div>
<div v-else class="text-muted">
Found {{ allKeys.length }} keys in the app. Start by adding a lang file
</div>
</div>
<div v-else class="text-muted">
Select a Laravel app or just drop the directory in the app
</div>
<div class="custom-modal-backdrop" v-show="showModal" @click.self="closeModal">
<div class="custom-modal" v-show="showModal">
<button type="button" class="close" title="Close" @click.prevent="closeModal">
<span aria-hidden="true">×</span>
</button>
<div v-if="scannedKeysFoundSelected">
<h3>Found in</h3>
<table>
<tr v-for="(value, key) in scannedKeysFoundSelected">
<td><span class="badge badge-info">{{ value }}</span></td>
<td>{{ key }}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</body>
<script src="node_modules/vue/dist/vue.min.js"></script>
<script>
require('./renderer.js');
</script>
</html>