-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
545 lines (454 loc) · 18.7 KB
/
index.html
File metadata and controls
545 lines (454 loc) · 18.7 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Notes - New Note</title>
<link href="assets/index.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel='stylesheet prefetch' href='http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/monokai-sublime.min.css'>
<link rel='stylesheet prefetch' href='http://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css'>
<link rel='stylesheet prefetch' href='http://cdn.quilljs.com/1.3.4/quill.bubble.css'>
<link rel='stylesheet prefetch' href='http://cdn.quilljs.com/1.3.4/quill.snow.css'>
</head>
<script>
// Sets title of the Page
function updateTitlePage() {
document.getElementById('titlePage').innerHTML = document.title;
}
</script>
<div id="electron-titlebar" style="width: 100%;">
<div style="width: 100%; height: 100%; text-align: center; line-height: 22px; color: white; font-size: 13px;" id=titlePage>Title</div>
</div>
<body>
<div class='newNotePage' id=newNotePageId>
<div class=newNotePadding>
<i class="fa fa-times closeBtn" onclick="newNote(false)" aria-hidden="true" ></i>
</div>
<input autofocus="autofocus" type="text" id=newNoteName placeholder="Something Creative..."/>
<!-- <h2 class=addNoteEnter>Press enter to add note.</h2> -->
</div>
<div class='metaDateNote' id=metaDateNoteId>
<div class=metaDateNotePadding>
<input class="title">Settings</input>
<i class="fa fa-times closeBtn" onclick="metaTagsMenu(false)" aria-hidden="true" ></i>
<hr>
</div>
<div class=contentPage>
<p class=subTitle>Title</p>
<input type="text" id=metaDateNameInput placeholder="Something Creative..."/>
</div>
<!-- <h2 class=addNoteEnter>Press enter to add note.</h2> -->
</div>
<div class='settingPage' id=settingPageID>
<div class=settingPadding>
<p class="title">Settings</p>
<i class="fa fa-times closeBtn" onclick="settingMenuClose()" aria-hidden="true" ></i>
<hr>
<div class="left settings">
<container class=settings>
<p class="subTitle">Night Mode</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch" />
<label for="switch"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
<p class="explincation">Have a late night? Enable night mode for an eye saving dark theme acrossed all of your note editor. Stay up just a little later and finish that essay.</p>
</container>
<hr class=tools>
<container class=settings>
<p class="subTitle">Auto Save</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch2" checked />
<label for="switch2"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
<p class="explincation">Not active Setting!!! Have a late night? Enable night mode for an eye saving dark theme acrossed all of your note editor. Stay up just a little later and finish that essay.</p>
</container>
<hr class=tools>
<container class=settings>
<p class="subTitle">Background</p>
<bgSelector>
<div class="background grey"></div>
<div class="background blue"></div>
<div class="background ice"></div>
<div class="background moving"></div>
</bgSelector>
<p class="explincation" id=backgroundExp>Have a late night? Enable night mode for an eye saving dark theme acrossed all of your note editor. Stay up just a little later and finish that essay.</p>
</container>
<hr class=tools>
<p class="subTitleInfo">Introduction</p>
<i class="fa fa-chevron-right arrow" aria-hidden="true"></i>
<hr class=tools>
<p class="subTitleInfo">Help Page</p>
<i class="fa fa-chevron-right arrow" aria-hidden="true"></i>
<hr class=tools>
<p class="subTitleInfo">Polar Summit Account</p>
<i class="fa fa-chevron-right arrow" aria-hidden="true"></i>
<hr class=tools>
</div>
<div class="right settings">
<container class=settings>
<p class="subTitle">Standard Text Option</p>
<switch style="margin-top: 0%;">
<input onclick="updateSettings();" type="checkbox" id="switch3"/>
<label for="switch3"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
<p class="explincation" style="margin-top: -3% !important;">You can still use the <i class=cmd>⌘ + b</i> to get bold, <i class=cmd>⌘ + u</i> to get underlined, and <i class=cmd>⌘ + i</i> to get italics. It just removes these items from your tool bar, to make it even sleaker.</p>
</container>
<hr class=tools>
<container class=settings>
<p class="title">Quotes</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch4" />
<label for="switch4"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
</container>
<hr class=tools>
<container class=settings>
<p class="title">Code Box</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch5" />
<label for="switch5"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
</container>
<hr class=tools>
<container class=settings>
<p class="title">List and Bullets</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch6"/>
<label for="switch6"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
</container>
<hr class=tools>
<container class=settings>
<p class="title">Sub & Super Script </p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch7" />
<label for="switch7"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
</container>
<hr class=tools>
<container class=settings>
<p class="title">Image</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch8"/>
<label for="switch8"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
</container>
<hr class=tools>
<container class=settings>
<p class="title">Link</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch9"/>
<label for="switch9"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
</container>
<hr class=tools>
<container class=settings>
<p class="title">Clear Format</p>
<switch>
<input onclick="updateSettings();" type="checkbox" id="switch10" />
<label for="switch10"></label>
<i class="fa fa-check" aria-hidden="true" ></i>
<i class="fa fa-times" aria-hidden="true" ></i>
</switch>
</container>
<hr class=tools>
<p class="explincation">Disableing these items above will just remove it from the tool bar. But, those formats will not be removed from your notes.</p>
</div>
</div>
</div>
<div id=bodySystem class="blurOverlay">
<!--<div class=header>
<input name="" class=headerBtn type="button" onclick="updateExpandPosition()"> Expand</input>
</div>-->
<script type="text/javascript">
// Updates the message at the bottom of the side bar
function changeBottomMessage() {
document.getElementById("bottomMessage1").style.display = 'block';
}
// open means full screen
var expanded = true;
// Turns on the blur
function blurOverlay(boolean) {
if (boolean == true) {
document.getElementById('bodySystem').className ='blurOverlay';
} else {
document.getElementById('bodySystem').className ='bodySystemClass';
}
}
// Runs Commands From Main.js
require('electron').ipcRenderer.on('function', (event, functionCmd) => {
eval(functionCmd);
})
// Closes setting Menu
function settingMenuClose() {
document.getElementById("settingPageID").style.display = 'none';
setTimeout(function(){
location.reload();
blurOverlay(false);
}, 50);
}
// Opens Setting Menu
function settingMenuOpen() {
blurOverlay(true);
setToggleBtn();
//document.getElementById('settingPageID').classList.remove = 'hide';
setTimeout(function(){
document.getElementById("settingPageID").style.display = 'block';
}, 50);
}
// Opens Page to make new Note
function newNote(open) {
if (open == false) {
blurOverlay(false);
document.getElementById("newNotePageId").style.display = 'none';
} else {
blurOverlay(true);
document.getElementById("newNotePageId").style.display = 'block';
document.getElementById("newNoteName").focus();
}
}
// Open info about page
function metaTagsMenu(open) {
if (open == false) {
blurOverlay(false);
document.getElementById("metaDateNoteId").style.display = 'none';
} else {
blurOverlay(true);
document.getElementById("metaDateNoteId").style.display = 'block';
//document.getElementById("metaDateNote").focus();
}
}
// Closes any open page
function escAnyMenu() {
settingMenuClose();
newNote(false);
}
// Inversts the expandtion for key commands only
function updateExpandPosition(){
if ( expanded == false) {
expand();
} else {
unexpand();
}
console.log(expanded);
}
// Open the side bar
function expand() {
expanded = false;
quill.enable(false);
document.getElementById('img').className ='miniEditor';
// document.getElementById('img').className ='miniEditor:hover';
document.getElementById('sideBar').classList.remove ='hideSideBarCSS';
document.getElementById('sideBar').className ='showSideBarCSS';
//img.onclick = unexpandCheck;
openListNotes();
console.log(expanded);
}
// IS FOR OPEN AND CLOSING THE SIDE BAR
function unexpand() {
quill.enable(true);
document.getElementById("editor-container").blur();
expanded = true;
document.getElementById('sideBar').classList.remove ='showSideBarCSS';
document.getElementById('sideBar').className ='hideSideBarCSS';
document.getElementById('img').className ='classname2';
//document.getElementById('img').classList.remove ='classname2';
// document.getElementById('editor-container').className = 'hoverOpacity;';
document.getElementById('img').classList.remove ='miniEditor';
console.log(expanded);
}
// Adds the notes to the side bar of the program
function openListNotes() {
document.getElementById('NotesInsert').innerHTML = "";
var transaction = db.transaction(["notes"]);
var objectStore = transaction.objectStore("notes");
var request = objectStore.get("list");
request.onsuccess = function(event) {
console.log(request.result.editedLast);
console.log(request.result.editedLast.length);
for ( var i = 0; i <= (request.result.editedLast.length + 1); i++) {
gatherInfo(i, function(i) {
// console.log(i.title);
// console.log(i);
checkData(i, function(i) {
insertData(i);
});
});
}
};
}
//
function gatherInfo(i,callback) {
var transaction2 = db.transaction(["notes"]);
var objectStore2 = transaction2.objectStore("notes");
var requestNote = objectStore2.get(i);
requestNote.onsuccess = function(event) {
callback(requestNote.result);
};
}
// Check for corupted data
function checkData(i, callback) {
console.log(i);
if (i && i.title) {
console.log(true);
callback(i)
} else {
console.log(false);
callback(i)
return false;
}
}
// Creates the HTML for the Side Bar
function insertData (i) {
console.log("Inserting");
var current = document.getElementById('NotesInsert').innerHTML;
var inject = "<div class=content onclick=openNote(" + i.id + ")><div class=titleNote>" + i.title + "</div><hr class=spacer><div class=textNote>" + i.shortHand + "</div></div>";
document.getElementById('NotesInsert').innerHTML = inject + current;
//console.log(i);
}
// Inverts the expantion of the side bar
function invertExpand() {
if (expanded == false) {
unexpand();
} else {
expand();
}
}
// Checks if the side bar is open
function unexpandCheck() {
if (expanded == true) {
unexpand();
}
}
// Makes sure the side bar is closes
function expandWhenNot() {
console.log("hello");
if (expanded == false) {
unexpand();
} else {
console.log("cant");
}
}
</script>
<div class=settingsArea onclick="settingMenuOpen()">
<i class="fa fa-cog settingBtn" onclick="settingMenuOpen()" style="color: #fff" aria-hidden="true"></i>
</div>
<div class=sideBar id=sideBar>
<div id=padding>
<div class=titleSection>
<div id=closeBtn>
<i class="fa fa-times hoverBlue" onclick="unexpand()" aria-hidden="true" ></i>
</div>
<div id=title style="display: block">Note Books</div>
<div id=title style="display: none">Settings</div>
<div id=title style="display: none">Web Clips</div>
<hr id=title>
</div>
<div class=container id=notes>
<div class=content id=addCard onclick=newNote()>
<i class="fa fa-plus addBtnPlusCircle" aria-hidden="true"></i>
<div class=addBtnText>Add New Note</div>
</div>
<div id=NotesInsert>
<!-- Insert Current Notes Here -->
</div>
<div id=messageBox>
<!--<div class=ending id=bottomMessage1 style="display: none;">Whip up something new. Like a [Insert Random Thing here].<br><i class="fa fa-flask footerMessage" aria-hidden="true"></i></div>
<div class=ending id=bottomMessage2 style="display: none;">Don't get weighed down, make something awesome!<br><i class="fa fa-anchor footerMessage" aria-hidden="true"></i></div>
<div class=ending id=bottomMessage3 style="display: none;">Whip up something new. Like a [Insert Random Thing here].<br><i class="fa fa-flask footerMessage" aria-hidden="true"></i></div>-->
</div>
</div>
</div>
</div>
<div class=browserWindow id=img>
<div id=editor2 class=editor >
<div id="toolbar">
</div>
<div class=writeArea>
<div id="editor-container" onclick="expandWhenNot();"></div>
<div class=bottom>
<p id=time class=leftTime>Document Note Saved<p>
<div class=right onclick="metaTagsMenu(true)">
<!-- <div id=text-O-count>
<p id=wordCount>words: 0 characters: 0</p>
</div> -->
</div>
</div>
</div>
</div>
</div>
<script>
// Disables Style Sheet
//document.styleSheets[0].disabled = true;
// You can also require other files to run in this process
require('./renderer.js')
</script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.js'></script>
<script src='http://cdn.quilljs.com/1.3.4/quill.js'></script>
<!--- Message At Bottom --->
<script src='assets/javascript/bottomMessage.js'></script>
<script>changeBottomMessage();</script>
<!--- Code extention for Text Editor --->
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
<!--- Electron Config --->
<script src='assets/javascript/electron.js'></script>
<!--- Text Editor Image Drag and Drop --->
<script src='assets/javascript/imageResize.min.js'></script>
<!--- Text Editor Image Drag and Drop --->
<script src='assets/javascript/imageDrop.min.js'></script>
<!--- Save Database --->
<script src='assets/javascript/saveAndRestore.js'></script>
<!--- Note List --->
<script src='assets/javascript/noteList.js'></script>
<!--- Note List --->
<script src='assets/javascript/settings.js'></script>
<!--- Text Editor --->
<script src='assets/javascript/textEditor.js'></script>
<script>blurOverlay(true);</script>
<body onload="openLastNote(500);">
<script>
function startUpForFirstTime() {
databaseLength("notes", function(length) {
if(length) {
console.log(true);
} else {
console.log("startup");
}
});
}
//editor-container.onclick = expandWhenNot;
// var minEditor = document.querySelector('.miniEditor');
// minEditor.addEventListener('click', function (event) {
// expandWhenNot();
// });
//var customButton = document.querySelector('#custom-button');
// customButton.addEventListener('click', function() {
// console.log('Clicked!');
// expand();
//});
</script>
</div>
</body>
</html>