-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
185 lines (175 loc) · 8.08 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Excel → Text Converter</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="resources/bootstrap4/custom.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="resources/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="index.css">
<!-- YourJS (JS) and jQuery (used by Bootstrap and just in general) -->
<script type="text/JavaScript">
// Load YourJS (JS)
var JS = require('./resources/YourJS.JS.min.js');
// Load jQuery (jQuery)
var jQuery = require('./resources/jquery.min.js'), $ = jQuery;
// Load Vue
var Vue = require('./resources/vue.min.js');
// Load the index and loader scripts
require('./index');
</script>
</head>
<body>
<h1 id="app-title"></h1>
<div id="myVue">
<div class="container">
<div class="row">
<label for="btnBrowse" class="col-md-auto col-form-label text-nowrap">Folder</label>
<div class="col-md">
<div class="input-group">
<input type="text" readonly class="form-control" v-model="folderPath" placeholder="Select the folder...">
<div class="input-group-btn">
<button id="btnBrowse" class="btn btn-outline-secondary" type="button" v-on:click="browse">Browse for Folder</button>
</div>
</div>
<table v-if="workbooks.length" class="table table-striped table-hover mt-3">
<tbody>
<tr v-for="workbook in workbooks" v-bind:class="workbook.include ? '' : 'table-danger'">
<td style="width: 1px;" title="Uncheck the workbooks you don't want to include."><input type="checkbox" v-model="workbook.include"></td>
<td>{{workbook.path}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr>
<div class="row">
<label for="txtNamingScheme" class="col-md-auto col-form-label text-nowrap">CSV Naming Scheme</label>
<div class="col-md">
<div>
<input id="txtNamingScheme" type="text" class="form-control" v-model="namingScheme" v-bind:placeholder="DEFAULT_NAMING_SCHEME">
</div>
<div class="alert alert-danger mt-3" role="alert" v-if="namingSchemeError">{{namingSchemeError}}</div>
<div>
<div class="lead">Any of the following can be included in the naming scheme:</div>
<ul>
<li><b><code><WORKBOOK></code></b> - name of the workbook</li>
<li><b><code><SHEET></code></b> - name of the worksheet (tab)</li>
<li><b><code><SHEET_NUMBER></code></b> - number of the worksheet (tab)</li>
<li><b><code><EXTENSION></code></b> - file extension of the workbook</li>
</ul>
</div>
</div>
</div>
<hr>
<div class="row">
<label for="txtFilters" class="col-md-auto col-form-label text-nowrap">Sheet Filters</label>
<div class="col-md">
<table class="table table-striped table-hover">
<thead>
<tr>
<th style="width: 1px;">RegExp</th>
<th>Filter Text</th>
</tr>
</thead>
<tbody>
<tr v-for="(sheetFilter, sheetFilterIndex) in sheetFilters">
<td style="vertical-align: middle;" class="text-center">
<input type="checkbox" v-model="sheetFilter.isRegExp" v-on:change="onChangeSheetFilter(sheetFilter)">
</td>
<td>
<input type="text" class="form-control" style="font-family: monospace;"
v-model="sheetFilter.value"
v-bind:placeholder="sheetFilter.isRegExp ? 'eg. /Sheet#[1-3]$/i' : ('eg. Sheet ' + (sheetFilterIndex + 1))"
v-on:change="onChangeSheetFilter(sheetFilter)">
<div class="alert alert-danger mt-3" role="alert" v-if="sheetFilter.error">{{sheetFilter.error}}</div>
</td>
</tr>
</tbody>
</table>
<div>
<div class="lead">Use the above fields to specify which sheets to convert from the workbooks. Enter the names of the sheets that you want to include from any of the workbooks. Each name will be case sensitive. You may also add JavaScript regular expressions (eg. <code>/Sheet#[1-3]$/i</code>).</div>
</div>
</div>
</div>
<template v-if="preConversions.length">
<hr>
<div class="row">
<label for="txtFilters" class="col-md-auto col-form-label text-nowrap">Upcoming Files</label>
<div class="col-md">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Workbook</th>
<th>Sheet</th>
<th>New Path</th>
<th style="width: 1px;">Type</th>
</tr>
</thead>
<tbody>
<tr v-for="file in preConversions" v-bind:class="matchesFilters(file.sheetName) ? '' : 'table-danger'">
<td>{{file.workbookPath}}</td>
<td>{{file.sheetName}}</td>
<td>{{file.newFilePath}}</td>
<td>{{file.typeName}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<hr>
<div class="text-center">
<button v-on:click="convert" class="btn btn-primary" type="button" :disabled="!canConvert && !converting" title="Start converting the workbook(s)">{{converting ? 'Converting...' : 'Start Conversion'}}</button>
<button v-on:click="visitBlog" class="btn btn-secondary" type="button" title="Go to my blog at CWestBlog.com">Visit My Blog</button>
<button v-on:click="close" class="btn btn-danger" type="button" title="Close this app">Close</button>
</div>
</div>
<div id="modalMessage" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Conversion Complete</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>The following files were converted:</p>
<div style="overflow-x: auto;">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Workbook</th>
<th>Sheet</th>
<th>New Path</th>
<th style="width: 1px;">Type</th>
</tr>
</thead>
<tbody>
<tr v-for="file in preConversions" v-if="matchesFilters(file.sheetName)">
<td>{{file.workbookPath}}</td>
<td>{{file.sheetName}}</td>
<td>{{file.newFilePath}}</td>
<td>{{file.typeName}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap stuff -->
<script src="resources/popper.min.js"></script>
<script src="resources/bootstrap4/bootstrap.min.js"></script>
</body>
</html>