-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex02.html
More file actions
198 lines (176 loc) · 6.79 KB
/
index02.html
File metadata and controls
198 lines (176 loc) · 6.79 KB
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
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- reset browser styles -->
<link rel="assets/stylesheet" type="text/css" media="screen" href="styles/reset.css" />
<link href="https://fonts.googleapis.com/css?family=Galada|Oleo+Script+Swash+Caps|Tulpen+One" rel="stylesheet">
<!-- bootstrap links -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" media="screen" href="styles/main.css" />
<!-- liking into some common/popular google fonts, because -->
<link href="https://fonts.googleapis.com/css?family=Abril+Fatface|Comfortaa|Dancing+Script|Great+Vibes|Kaushan+Script|Lato|Lobster|Lobster+Two|Marck+Script|Monoton|Open+Sans|Playfair+Display|Roboto|Roboto+Mono|Roboto+Slab|Rozha+One|Sacramento|Shrikhand|Slabo+27px|Source+Code+Pro"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
<!-- adding jQuery -->
<style>
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="scripts/main03.js"></script>
<script>
</script>
</head>
<body>
<header id="header-the">
<div id="logo">
<img id="logo-image" src="images/logo-01.png" alt="Obnoxious logo here">
</div>
<div id="logo-name">
<span id="logo-table">table</span>
<span id="logo-Maker">Maker</span>
</div>
<div id="self-promotion-holder">
<div id="self-promotion">
<span id="logo-copy">There's not much that's more tedious than generating HTML tables. That's why there's
<em>table
<b>Maker</b>
</em>
</span>
</div>
</div>
<!-- <span id="logo-table">table</span>
<span id="logo-Maker">Maker</span>.</div> -->
<nav id="menu-main">menu items here</nav>
</header>
<div id="wrapper">
<div id="input">
<div id="left-side">
<form id="table-input">
<h2 id="enter-table-structure" class="h-no-margin">Enter Table Structure</h2>
<h4 id="number-of-rows">Number of Rows:</h4>
<input type="text" value='' id='count-row' size='4'>
<h4 id="number-of-cols">Number of Columns:</h4>
<input type="text" value='' id='count-column' size='4'>
<h4>Is there a row of column headers (i.e., a column labels):</h4>
<div id="check-box-holder">
<input id="yes-headers" name="colheaders" type="checkbox" value=''>
</div>
<div id="radio-btn-holder">
<span class="radio-btn">Yes</span>
<input id="yesHeaders" name="colheaders" type="radio" value=''>
<span class="radio-btn">No</span>
</div>
<input type="submit" class="gen-table" value="Generate Table">
</form>
</div>
<div id="right-side">
<h2 class="h-no-margin">Enter column labels:</h2>
<!-- to be replaced with dynamic input panel -->
<div id="enter-column-labels"></div>
</div>
</div>
<div id="output">
<div id="code-HTML-holder">
<h3> the html</h3>
<div id="code-HTML">
<!-- raw html goes here -->
</div>
</div>
<div id="wysiwyg-HTML-holder">
<h3> and what it should look like...</h3>
<div id="wysiwyg-HTML">
<!-- wysiwyg html goes here -->
</div>
</div>
</div>
<script>
$(document).ready(function() {
var cols = 4;
var rows = 5;
$("#right-side").fadeTo(0, 0.1)
$("#count-column").on('blur', function () {
makeHeadInputRow($("#count-column").val());
})
$("#count-column").on('keyup', function () {
makeHeadInputRow($("#count-column").val());
})
// $("#yesHeaders").on('click', function () {
// $("#right-side").fadeTo(0, 1)
// })
// $("#noHeaders").on('click', function () {
// $("#right-side").fadeTo(0, 0.1)
// })
$("#yes-headers").on("change", function() {
console.log("changed");
if ($("#yes-headers").is(':checked')) {
$("#right-side").fadeTo(0, 1);
} else {
$("#right-side").fadeTo(0, 0);
}
})
$("#table-input").submit(function () {
event.preventDefault();
console.log("submit clicked");
rows = $("#count-row").val();
cols = $("#count-column").val();
console.log(rows, cols)
$("#wysiwyg-HTML").html('')
var outputTable = makeTable(rows, cols);
showTable(outputTable);
showCode(outputTable);
});
var currentCell = null;
// handle clicks on spreadsheet...
$("#enter-column-labels").on('click', function(evt) {
// if ($("#enter-column-labels").attr("opacity") != 1) {
// todo TODO
if ($('input[name="colheaders"]:checked').val()) {
return;
}
var cellClicked = evt.target.id;
// if there's another activeCell currentCell, we need to kill it.
if (currentCell != cellClicked) {
// run clean up routine on old current box
if (cellClicked == 'current-box') {
//do nothing
} else if (currentCell == null) {
console.log("current box not yet defined")
} else {
releasecurrentCell(currentCell, cellClicked);
}
}
if (cellClicked != 'current-box') {
console.log("!!!!!!!!!!!!!!!");
currentCell = cellClicked;
if ($("#"+currentCell).html().length > 0) {
var existingHTML = $("#"+currentCell).html();
$("#"+cellClicked).html("<input id='current-box' type='text' value='"+existingHTML+"'autofocus>")
// console.log("ouch you're erasng me")
} else {
$("#"+cellClicked).html("<input id='current-box' type='text' autofocus>")
}
// function() {
$('#current-box').focus();
// });
}
});
});
function releasecurrentCell(oldCellID, newCellID) {
console.log("releasing prior box")
var HtmlToBe = $("#current-box").val();
console.log('$("#current-box").val() is '+HtmlToBe)
$("#current-box").remove();
$("#"+oldCellID).html(HtmlToBe);
}
</script>
</div>
</body>
</html>