Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit f1ba193

Browse files
author
h17263
committed
bugfixes and release
1 parent de21177 commit f1ba193

File tree

6 files changed

+271
-67
lines changed

6 files changed

+271
-67
lines changed

DECSV_project/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,9 @@ autoUpdater.on('update-downloaded', function (info){//ev, relNot, relNam, relDat
629629
message: "New version "+ver+" is ready to be installed",
630630
detail: "Would you like to close the application and update?\r\n\r\nVersion: " + ver + "\r\nRelease date: " + new Date(relDat) +"\r\n"+relNote,
631631
buttons: ["yes", "no"]
632-
};
632+
};
633633

634-
dialog.showMessageBox(options, function (index) {
634+
dialog.showMessageBox(mainWindow, options, function (index) {
635635
if (index === 0) {
636636
app.showExitPrompt = false;
637637
autoUpdater.quitAndInstall();
@@ -857,7 +857,7 @@ function transformSrc2Temp(proj_name, event) {
857857
}
858858
secChtml = secChtml + '</div>';
859859
logger.debug("created question lines for C section");
860-
console.log(secChtml);
860+
//console.log(secChtml);
861861
// REMEMBER TO TURN \" and \' into regular " and ' when showing the data!!!!!!
862862
temp_store.set("a", elemtextA);
863863
temp_store.set("b", elemtextB);

DECSV_project/assets/html/sections/login.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,27 @@
44
<div class="w3-panel">
55

66
<h1 id="login-register-title"></h1>
7-
8-
<div id="loginchoices_1" class="">
7+
<!-- NEED TO SET MAXIMUM FIELD LENGTHS!!!!!!! -->
8+
<div id="loginchoices" class="">
99
<label class="w3-text-blue"><b>Username</b></label>
1010
<input id="login-username" style="max-width: 300px;" class="w3-input w3-border" type="text" maxlength="20">
11-
</div>
12-
13-
<div id="registerchoices_1" class="">
14-
<label class="w3-text-blue"><b>Username</b></label>
15-
<input id="register-username" style="max-width: 300px;" class="w3-input w3-border" type="text" maxlength="20">
16-
<label class="w3-text-blue"><b>Email</b></label>
17-
<input id="register-email" style="max-width: 300px;" class="w3-input w3-border" type="email" maxlength="255">
18-
<label class="w3-text-blue"><b>Real name</b></label>
19-
<input id="register-realname" style="max-width: 300px;" class="w3-input w3-border" type="text" maxlength="255">
20-
</div>
21-
22-
<div id="loginchoices_2" class="">
2311
<label class="w3-text-blue"><b>Password</b></label>
2412
<input id="login-pass" style="max-width: 300px;" class="w3-input w3-border" type="password" maxlength="20">
2513
</div>
26-
<div id="registerchoices_2" class="">
14+
15+
<div id="registerchoices" class="">
16+
<label class="w3-text-blue"><b>Username</b></label>
17+
<input id="register-username" style="max-width: 300px;" class="w3-input w3-border" type="text" maxlength="20">
18+
<label class="w3-text-blue"><b>Email</b></label>
19+
<input id="register-email" style="max-width: 300px;" class="w3-input w3-border" type="email" maxlength="255">
20+
<label class="w3-text-blue"><b>Real name</b></label>
21+
<input id="register-realname" style="max-width: 300px;" class="w3-input w3-border" type="text" maxlength="255">
22+
<label class="w3-text-blue"><b>Password</b></label>
23+
<input id="register-pass" style="max-width: 300px;" class="w3-input w3-border" type="password" maxlength="20">
2724
<label class="w3-text-blue"><b>Retype password</b></label>
2825
<input id="register-retype-pass" style="max-width: 300px;" class="w3-input w3-border" type="password" maxlength="20">
2926
</div>
27+
3028
<div id="forgot_password_choices" class="">
3129
<label class="w3-text-blue"><b>Please enter email used with account</b></label>
3230
<input id="forgot-email" style="max-width: 300px;" class="w3-input w3-border" type="email" maxlength="255">

DECSV_project/assets/js/init.js

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ document.getElementById("check-app-updates-button").onclick = function () {
193193
else if (arg[0] === 4) {
194194
// downloading...
195195
var progressObj = arg[1];
196-
var download_data = "Downloading "+progressObj.transferred + "/" + progressObj.total + " at " + (progressObj.bytesPerSecond / 1000) + " kbps";
196+
var download_data = "Downloading " + (Math.round((progressObj.transferred / 1000000) * 100) / 100) + "MB/" + (Math.round((progressObj.total / 1000000) * 100) / 100) + "MB at " + (Math.round((progressObj.bytesPerSecond / 1000) * 100) / 100) + " kBps";
197197
var download_percent = progressObj.percent;
198198

199199
if (arg[1] = 100) {
@@ -245,21 +245,23 @@ document.getElementById("addfilebutton").onclick = function () {
245245
addFilesPrompt(proj_name);
246246
}
247247

248-
document.getElementById("projinfobutton").onclick = function () {
248+
document.getElementById("projinfobutton").onclick = function () {//
249249
logger.debug("projinfo button");
250-
$("#proj-info-files-ul").empty();
251-
$("#proj-info-files-ul").html($("#proj-files-ul").html());
252-
$("#proj-info-files-ul li").removeAttr("onclick");
253-
$("#proj-info-files-ul li").removeAttr("style");
254-
$("#proj-info-files-ul li").removeAttr("data-temp");
255-
$("#proj-info-files-ul li").removeAttr("data-done");
256-
$("#proj-info-files-ul li").removeAttr("onmouseover");
257-
$("#proj-info-files-ul li").removeAttr("onmouseout");
258-
var value = $("#footer-nav-btn4").val();
250+
251+
var value = $("#footer-nav-btn3").val();
259252
if (value === "information"){
260253
// do NOTHING
261254
}
262255
else {
256+
$("#proj-info-files-ul").empty();
257+
$("#proj-info-files-ul").html($("#proj-files-ul").html());
258+
$("#proj-info-files-ul li").removeAttr("onclick");
259+
$("#proj-info-files-ul li").removeAttr("style");
260+
$("#proj-info-files-ul li").removeAttr("data-temp");
261+
$("#proj-info-files-ul li").removeAttr("data-done");
262+
$("#proj-info-files-ul li").removeAttr("onmouseover");
263+
$("#proj-info-files-ul li").removeAttr("onmouseout");
264+
263265
var docpath = remote.app.getPath('documents');
264266
var proj_base = path.join(docpath, 'SLIPPS DECSV\\Projects\\' + window.currentProject + '\\');
265267
var options = {
@@ -326,7 +328,7 @@ document.getElementById("projinfobutton").onclick = function () {
326328
toggleViewMode(10);
327329
}
328330

329-
document.getElementById("projstartbutton").onclick = function () {
331+
document.getElementById("projstartbutton").onclick = function () {//
330332
logger.debug("projectstart button");
331333
toggleViewMode(1);
332334
toggleViewMode(9);
@@ -420,8 +422,13 @@ document.getElementById("back-to-start-button").onclick = function () {
420422

421423
document.getElementById("loginbutton").onclick = function () {
422424
logger.debug("login button");
423-
toggleViewMode(5);
424-
toggleViewMode(10);
425+
if (($('#footer-nav-btn3').val() === "login") || ($('#footer-nav-btn3').val() === "register") || ($('#footer-nav-btn3').val() === "forgotPW")){
426+
// do nothing. already in login.
427+
}
428+
else {
429+
toggleViewMode(5);
430+
toggleViewMode(10);
431+
}
425432
}
426433

427434

@@ -532,11 +539,12 @@ tionStart == "number")
532539

533540
/* Index div footer */
534541

535-
document.getElementById("footer-nav-btn1").onclick = function () {
542+
document.getElementById("footer-nav-btn1").onclick = function () {//
536543
var value = $(this).val();
537544
logger.debug("btn1: " + value);
538545
if (value === "preview"){
539-
$(this).text("Previous file");
546+
//$(this).text("Previous file");
547+
logger.debug("Moving to previous file");
540548
}
541549
//preview move to previous file
542550
}
@@ -545,7 +553,7 @@ document.getElementById("footer-nav-btn2").onclick = function () {
545553
logger.debug("btn2: " +value);
546554
}
547555

548-
document.getElementById("footer-nav-btn3").onclick = function () {
556+
document.getElementById("footer-nav-btn3").onclick = function () {//
549557
var value = $(this).val();
550558
logger.debug("btn3: " + value);
551559
//create project createProjAsync();
@@ -577,9 +585,18 @@ document.getElementById("footer-nav-btn3").onclick = function () {
577585
}
578586
else if (value === "login") {
579587
//login
588+
logger.debug("Now we would try to log in...");
589+
logger.debug("Username: " + $("#login-username").val());
590+
logger.debug("Password: " + $("#login-pass").val());
580591
}
581592
else if (value === "register") {
582593
//register
594+
logger.debug("Now we would try to register...");
595+
logger.debug("Username: " + $("#register-username").val());
596+
logger.debug("Email: " + $("#register-email").val());
597+
logger.debug("Real name: " + $("#register-realname").val());
598+
logger.debug("Password: " + $("#register-pass").val());
599+
logger.debug("Retype Password: " + $("#register-retype-pass").val());
583600
}
584601
else if (value === "settings") {
585602
var options = {
@@ -595,6 +612,7 @@ document.getElementById("footer-nav-btn3").onclick = function () {
595612
saveSettings();
596613
}
597614
else {
615+
//
598616
}
599617
});
600618
//save settings
@@ -607,6 +625,8 @@ s }
607625
}
608626
else if (value === "forgotPW") {
609627
//
628+
logger.debug("Now we would try to ask for password change...");
629+
logger.debug("Email: " + $("#forgot-email").val());
610630
}
611631
}
612632
document.getElementById("footer-nav-btn4").onclick = function () {
@@ -647,7 +667,7 @@ document.getElementById("footer-nav-btn4").onclick = function () {
647667
updateSettingsUI();
648668
// revert changes in settings
649669
}
650-
else if (value === "forgotPW") {
670+
else if (value === "forgotPW") {
651671

652672
toggleViewMode(5);
653673
toggleViewMode(10);
@@ -656,7 +676,7 @@ document.getElementById("footer-nav-btn4").onclick = function () {
656676
}
657677

658678
document.getElementById("footer-nav-btn5").onclick = function () {
659-
var value = $(this).val();
679+
var value = $(this).val();
660680
logger.debug("btn5: " + value);
661681

662682
if (value === "preview") {
@@ -683,12 +703,13 @@ document.getElementById("footer-nav-btn5").onclick = function () {
683703
}
684704

685705
}
686-
document.getElementById("footer-nav-btn6").onclick = function () {
706+
document.getElementById("footer-nav-btn6").onclick = function () {//
687707
var value = $(this).val();
688708
logger.debug("btn6: " + value);
689709

690710
if (value === "preview") {
691-
// Move to next file
711+
logger.debug("Moving to next file");
712+
// Move to next file QWERTY
692713
}
693714
else if (value === "login") {
694715
toggleViewMode(14);
@@ -1905,7 +1926,7 @@ function toggleViewMode(mode) {
19051926
}
19061927
else {
19071928
$("#proj-files-ul").removeClass("element-disabled");
1908-
$("#file-chosen-kw-ul").addClass("element-disabled");
1929+
$("#file-chosen-kw-ul").removeClass("element-disabled");
19091930
}
19101931

19111932
$("#start-div").removeClass("is-shown");
@@ -2029,10 +2050,8 @@ function toggleViewMode(mode) {
20292050
$("#information-div").removeClass("is-shown");
20302051
$("#create-proj-div").removeClass("is-shown");
20312052

2032-
$("#loginchoices_1").removeClass("no-display");
2033-
$("#loginchoices_2").removeClass("no-display");
2034-
$("#registerchoices_1").addClass("no-display");
2035-
$("#registerchoices_2").addClass("no-display");
2053+
$("#loginchoices").removeClass("no-display");
2054+
$("#registerchoices").addClass("no-display");
20362055

20372056
$("#login-username").val("");
20382057
$("#login-pass").val("");
@@ -2057,15 +2076,13 @@ function toggleViewMode(mode) {
20572076
$("#information-div").removeClass("is-shown");
20582077
$("#create-proj-div").removeClass("is-shown");
20592078

2060-
$("#loginchoices_1").addClass("no-display");
2061-
$("#loginchoices_2").removeClass("no-display");
2062-
$("#registerchoices_1").removeClass("no-display");
2063-
$("#registerchoices_2").removeClass("no-display");
2079+
$("#loginchoices").addClass("no-display");
2080+
$("#registerchoices").removeClass("no-display");
20642081

20652082
$("#register-username").val("");
20662083
$("#register-email").val("");
20672084
$("#register-realname").val("");
2068-
$("#login-pass").val("");
2085+
$("#register-pass").val("");
20692086
$("#register-retype-pass").val("");
20702087
$("#login-register-title").text("Register");
20712088

@@ -2159,10 +2176,8 @@ function toggleViewMode(mode) {
21592176
$("#information-div").removeClass("is-shown");
21602177
$("#create-proj-div").removeClass("is-shown");
21612178

2162-
$("#loginchoices_1").addClass("no-display");
2163-
$("#loginchoices_2").addClass("no-display");
2164-
$("#registerchoices_1").addClass("no-display");
2165-
$("#registerchoices_2").addClass("no-display");
2179+
$("#loginchoices").addClass("no-display");
2180+
$("#registerchoices").addClass("no-display");
21662181

21672182
$("#forgot_password_choices").removeClass("no-display");
21682183
$("#forgot-email").val("");
@@ -2454,6 +2469,9 @@ function paintEmAll(word, mode) {
24542469
// SETTING UP SELECTING WORDS
24552470
function setupCensorSelect() {
24562471
logger.debug("setupCensorSelect");
2472+
$("#edit-A-edit-text .word").off("click");
2473+
$("#edit-B-edit-text .word").off("click");
2474+
$("#edit-C-edit-text .word").off("click");
24572475

24582476
$("#edit-A-edit-text .word").on("click", function () {
24592477
//console.log($("#secBcontent").text());

DECSV_project/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "decsv",
33
"productName": "DECSV",
4-
"version": "1.4.1",
4+
"version": "1.4.2",
55
"description": "SLIPPS survey results review and edit application.",
66
"main": "app.js",
77
"scripts": {

0 commit comments

Comments
 (0)