mirror of
https://github.com/imapsync/imapsync.git
synced 2025-08-02 15:11:49 +02:00
2.178
This commit is contained in:
parent
f98c9946e5
commit
2f815205a9
72 changed files with 4567 additions and 1469 deletions
|
@ -65,9 +65,13 @@
|
|||
<li> MailStore: <a href="https://www.mailstore.com/en/products/mailstore-home/">https://www.mailstore.com/en/products/mailstore-home/</a></li>
|
||||
<li> mnIMAPSync: <a href="https://github.com/manusa/mnIMAPSync">https://github.com/manusa/mnIMAPSync</a></li>
|
||||
<li> imap-upload: <a href="http://imap-upload.sourceforge.net/">http://imap-upload.sourceforge.net/</a>
|
||||
(A tool for uploading a local mbox file to IMAP4 server)</li>
|
||||
(A tool to upload a local mbox file to IMAP4 server)</li>
|
||||
<li> imapbackup: <a href="https://github.com/rcarmo/imapbackup">https://github.com/rcarmo/imapbackup</a>
|
||||
(A Python script for incremental backups of IMAP mailboxes)</li>
|
||||
(A Python script to incremental backups of IMAP mailboxes)</li>
|
||||
|
||||
<li> imap-backup: <a href="https://github.com/joeyates/imap-backup">https://github.com/joeyates/imap-backup</a>
|
||||
(A Ruby script to backup GMail (or other IMAP) accounts to disk)</li>
|
||||
|
||||
|
||||
<li> BitRecover email-backup <b>99 USD, 299 USD</b> <a href="https://www.bitrecover.com/email-backup/">https://www.bitrecover.com/email-backup/</a>.</li>
|
||||
|
||||
|
@ -182,7 +186,7 @@ alt="Viewable With Any Browser" />
|
|||
<!--#config timefmt="%D" -->
|
||||
<!--#config timefmt="%A %B %d, %Y" -->
|
||||
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b>
|
||||
($Id: external.shtml,v 1.58 2021/06/30 20:34:23 gilles Exp gilles $)<br/>
|
||||
($Id: external.shtml,v 1.59 2022/01/08 19:54:26 gilles Exp gilles $)<br/>
|
||||
<a href="#TOP">Top of the page</a>
|
||||
</p>
|
||||
|
||||
|
|
BIN
S/images/5c019d917bba312af7553b49_MacStadium-developerlogo.png
Normal file
BIN
S/images/5c019d917bba312af7553b49_MacStadium-developerlogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
70
S/news.shtml
70
S/news.shtml
|
@ -85,6 +85,72 @@ If you are very interrested in those projects, don't hesitate to solicit me!
|
|||
</ul>
|
||||
-->
|
||||
|
||||
|
||||
<ul>
|
||||
<li><b>2.178</b></li>
|
||||
<li><b>General</b>: </li>
|
||||
|
||||
<li><b>Dependencies removed</b>: None </li>
|
||||
<li><b>Dependencies added</b>: Perl module Compress::Zlib</li>
|
||||
|
||||
<li><b>Enhancement</b>: Added final statistic line: "CPU time and %cpu : 13.27 sec 8.3 %cpu 2.1 %allcpus</li>
|
||||
<li><b>Enhancement</b>: Removed the hard limit --maxsize 35_651_584 set by --gmail2 since CAPABILITY is used and good.</li>
|
||||
<li><b>Enhancement</b>: Does not checknoabletosearch if --justfolders</li>
|
||||
<li><b>Enhancement</b>: When creating a folder, check if it is selectable and consider ok if it is selectable.</li>
|
||||
<li><b>Enhancement</b>: Options --gmail1 --gmail2 together sets --useheader X-Gmail-Received --useheader Message-Id</li>
|
||||
<li><b>Enhancement</b>: Added compression in the imap connexions.
|
||||
Compression is off by default no matter the capability announced.
|
||||
Use --compress1 and --compress2 to turn compression on.</li>
|
||||
<li><b>Enhancement</b>: Added --keepalive1 and --keepalive2 options.
|
||||
Some firewalls and network gears like to timeout connections prematurely if the connection sits idle.
|
||||
This option enables SO_KEEPALIVE on the host1 socket.
|
||||
--keepalive1 is on by default since imapsync release 2.169
|
||||
Use --nokeepalive1 to disable it. Same thing for --keepalive2 but for --host2. See <a href="https://metacpan.org/pod/Mail::IMAPClient#Keepalive">https://metacpan.org/pod/Mail::IMAPClient#Keepalive</a></li>
|
||||
|
||||
<li><b>Enhancement</b>: </li>
|
||||
<li><b>Enhancement</b>: </li>
|
||||
|
||||
<li><b>Usability</b>: Removed --fast option. It didn't do anything anyway, it was a fake option.</li>
|
||||
<li><b>Usability</b>: Added advice inline advice on errors
|
||||
<ul>
|
||||
<li>ERR_OVERQUOTA. "The destination mailbox is 100% full, get free space on it and then resume the sync."</li>
|
||||
<li>ERR_TRANSFER_EXCEEDED. "The maximum transfer size for a single sync is reached ( over 3 GB ). Relaunch the sync to sync more."</li>
|
||||
<li>ERR_APPEND_SIZE. "The destination server refuses too big messages. Use --truncmess option. Read https://imapsync.lamiral.info/FAQ.d/FAQ.Messages_Too_Big.txt" </li>
|
||||
<li>ERR_CONNECTION_FAILURE_HOST1. "Check that host1 on port1 is the right IMAP server to be contacted for your mailbox."</li>
|
||||
<li>ERR_CONNECTION_FAILURE_HOST2. "Check that host2 on port2 is the right IMAP server to be contacted for your mailbox."</li>
|
||||
<li>ERR_AUTHENTICATION_FAILURE_USER1. "Check the credentials for user1."</li>
|
||||
<li>ERR_AUTHENTICATION_FAILURE_USER2. "Check the credentials for user2."</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><b>Usability</b>: Bytes sizes human readable are now presented in KB MB GB TB PB (1000 base) instead of KiB MiB GiB TiB PiB (1024 base)</li>
|
||||
<li><b>Usability</b>: Added README help for --truncmess</li>
|
||||
<li><b>Usability</b>: </li>
|
||||
<li><b>Usability</b>: </li>
|
||||
<li><b>Usability</b>: </li>
|
||||
<li><b>Usability</b>: </li>
|
||||
|
||||
|
||||
<li><b>CGI context</b>: Experimental loaddelay forced to 0 (no delay at all). So far a huge load is rarely a problem.</li>
|
||||
<li><b>CGI context</b>: Bugfix. Abort didn't set charset=UTF-8; same thing for heavy load 503 Service Unavailable</li>
|
||||
|
||||
|
||||
<li><b>Bug fix</b>: Made reconnect mechanism works with --oauthdirect1 --oauthdirect2 --oauthaccesstoken1 --oauthaccesstoken2</li>
|
||||
<li><b>Bug fix</b>: Upped the maximum number a pid can be. From 99999 to 2^22.
|
||||
See <a href="https://unix.stackexchange.com/questions/16883/what-is-the-maximum-value-of-the-process-id">what-is-the-maximum-value-of-the-process-id</a> </li>
|
||||
<li><b>Bug fix</b>: Load average on Mac was sometimes buggy. locale float 3,14 instead of 3.14</li>
|
||||
<li><b>Bug fix</b>: errors_incr() exited with CATCH_ALL</li>
|
||||
<li><b>Bug fix</b>: Memory consumption on Mac was not relevant. Use RSS instead of VSZ, on Mac only. Linux stays with VSZ.</li>
|
||||
<li><b>Bug fix</b>: </li>
|
||||
<li><b>Bug fix</b>: </li>
|
||||
|
||||
|
||||
<li><b>Docker context</b>: Current working directory changed from /var/tmp to /var/tmp/uid_$EFFECTIVE_USER_ID</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><b>2.140</b></li>
|
||||
<li><b>General</b>: New release numbering from 1.999 directly to 2.100; I want to avoid 1.1000 and sorting issues in directory listing.</li>
|
||||
|
@ -157,8 +223,6 @@ Exit value 112 (EXIT_WITH_ERRORS_MAX) is now replaced by the most common error e
|
|||
|
||||
<li><b>Refactoring</b>: Continuing to deglobalize the global variables.</li>
|
||||
<li><b>Refactoring</b>: 1734 unit tests.</li>
|
||||
<li><b>Refactoring</b>: </li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -954,7 +1018,7 @@ by ignoring PERMANENTFLAGS (Exchange tests)</li>
|
|||
<!--#config timefmt="%D" -->
|
||||
<!--#config timefmt="%A %B %d, %Y" -->
|
||||
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b>
|
||||
($Id: news.shtml,v 1.78 2021/07/05 20:22:15 gilles Exp gilles $)<br />
|
||||
($Id: news.shtml,v 1.83 2022/01/13 18:36:12 gilles Exp gilles $)<br />
|
||||
<a href="#TOP">Top of the page</a>
|
||||
</p>
|
||||
</body></html>
|
||||
|
|
29
S/quiz/README.txt
Normal file
29
S/quiz/README.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
LICENSE
|
||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
Copyright by Code Boxx
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
MORE
|
||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
Please visit https://code-boxx.com/ for more!
|
45
S/quiz/comment_to_toh.txt
Executable file
45
S/quiz/comment_to_toh.txt
Executable file
|
@ -0,0 +1,45 @@
|
|||
Hi Toh!
|
||||
|
||||
First, I thank you very much for posting and sharing this good piece
|
||||
of code!
|
||||
|
||||
I like it because, it's simple, it's embedable, no dependency, pure
|
||||
javascript.
|
||||
|
||||
I found your code search for a simple quiz code. I consider quizzes as
|
||||
a fun learning learning experience on something.
|
||||
|
||||
Some things I'd like to improve on it:
|
||||
|
||||
ux/reload) The user has to reload the page to restart the quiz and
|
||||
it's not evident. How about making the last button a possibility
|
||||
to redo the quiz from start and make a better score?
|
||||
|
||||
ux/where I am) The user doesn't know how many questions there are in
|
||||
the quiz, where he is along the quiz, how good he is. Knowing where we
|
||||
are in a serie makes it easier to reach the end. This one is easy to
|
||||
add, as I could do it.
|
||||
|
||||
css functional) The quiz.css is not so cosmetic: if you comment it in the
|
||||
html, then the quiz functionally doesn't work the same; we have to
|
||||
click twice on a button to go to the next question, and the second
|
||||
click has to be outside the round of the radio button, on the label.
|
||||
I don't know how to fix that but it's not important anyway, the css is
|
||||
needed for cosmetics.
|
||||
|
||||
css cosmetic) this quiz code is to be embedded in a page then I suggest
|
||||
that the cosmetics are inheritated.
|
||||
I'm also adept of minimal css, the less to achieve a goal, the better.
|
||||
|
||||
dev testing) I don't know how do you test it while coding and
|
||||
modifying it. A manual loop browser_reload_run_editor?
|
||||
|
||||
dev jslint) I paste it to jslint (https://www.jslint.com/)
|
||||
and it didn't pass the lint test.
|
||||
|
||||
dev data load) How about putting all the Q/R in a dedicated text file
|
||||
to maintain a single quiz.js and quiz.css and have multiple quizzes
|
||||
using the same functional code?
|
||||
|
||||
|
||||
|
46
S/quiz/quiz.css
Normal file
46
S/quiz/quiz.css
Normal file
|
@ -0,0 +1,46 @@
|
|||
/* (A) WRAPPER */
|
||||
#quizWrap {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* (B) QUESTION */
|
||||
#quizQn {
|
||||
padding: 20px;
|
||||
background: #4c93ba;
|
||||
color: #fff;
|
||||
font-size: 24px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* (C) ANSWERS */
|
||||
#quizAns {
|
||||
margin: 10px 0;
|
||||
display: grid;
|
||||
grid-template-columns: auto auto;
|
||||
grid-gap: 10px;
|
||||
}
|
||||
#quizAns input[type=radio] { display: none; }
|
||||
#quizAns label {
|
||||
background: #fafafa;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
#quizAns label.correct {
|
||||
background: #d8ffc4;
|
||||
border: 1px solid #60a03f;
|
||||
}
|
||||
#quizAns label.wrong {
|
||||
background: #ffe8e8;
|
||||
border: 1px solid #c78181;
|
||||
}
|
||||
|
||||
/* (D) BODY... DOES NOT QUITE MATTER */
|
||||
html, body {
|
||||
background: #74b6db;
|
||||
font-family: arial, sans-serif;
|
||||
}
|
16
S/quiz/quiz.html
Normal file
16
S/quiz/quiz.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
Simple Javascript Quiz Demo
|
||||
</title>
|
||||
|
||||
<!-- (A) LOAD QUIZ CSS + JS -->
|
||||
<link href="quiz.css" rel="stylesheet">
|
||||
<script src="quiz.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- (B) QUIZ CONTAINER -->
|
||||
<div id="quizWrap"></div>
|
||||
</body>
|
||||
</html>
|
136
S/quiz/quiz.js
Normal file
136
S/quiz/quiz.js
Normal file
|
@ -0,0 +1,136 @@
|
|||
var quiz = {
|
||||
// (A) PROPERTIES
|
||||
// (A1) QUESTIONS & ANSWERS
|
||||
// Q = QUESTION, O = OPTIONS, A = CORRECT ANSWER
|
||||
data: [
|
||||
{
|
||||
q : "What is the standard distance between the target and archer in Olympics?",
|
||||
o : [
|
||||
"50 meters",
|
||||
"70 meters",
|
||||
"100 meters",
|
||||
"120 meters"
|
||||
],
|
||||
a : 1 // arrays start with 0, so answer is 70 meters
|
||||
},
|
||||
{
|
||||
q : "Which is the highest number on a standard roulette wheel?",
|
||||
o : [
|
||||
"22",
|
||||
"24",
|
||||
"32",
|
||||
"36"
|
||||
],
|
||||
a : 3
|
||||
},
|
||||
{
|
||||
q : "How much wood could a woodchuck chuck if a woodchuck would chuck wood?",
|
||||
o : [
|
||||
"400 pounds",
|
||||
"550 pounds",
|
||||
"700 pounds",
|
||||
"750 pounds"
|
||||
],
|
||||
a : 2
|
||||
},
|
||||
{
|
||||
q : "Which is the seventh planet from the sun?",
|
||||
o : [
|
||||
"Uranus",
|
||||
"Earth",
|
||||
"Pluto",
|
||||
"Mars"
|
||||
],
|
||||
a : 0
|
||||
},
|
||||
{
|
||||
q : "Which is the largest ocean on Earth?",
|
||||
o : [
|
||||
"Atlantic Ocean",
|
||||
"Indian Ocean",
|
||||
"Arctic Ocean",
|
||||
"Pacific Ocean"
|
||||
],
|
||||
a : 3
|
||||
}
|
||||
],
|
||||
|
||||
// (A2) HTML ELEMENTS
|
||||
hWrap: null, // HTML quiz container
|
||||
hQn: null, // HTML question wrapper
|
||||
hAns: null, // HTML answers wrapper
|
||||
|
||||
// (A3) GAME FLAGS
|
||||
now: 0, // current question
|
||||
score: 0, // current score
|
||||
|
||||
// (B) INIT QUIZ HTML
|
||||
init: function(){
|
||||
// (B1) WRAPPER
|
||||
quiz.hWrap = document.getElementById("quizWrap");
|
||||
|
||||
// (B2) QUESTIONS SECTION
|
||||
quiz.hQn = document.createElement("div");
|
||||
quiz.hQn.id = "quizQn";
|
||||
quiz.hWrap.appendChild(quiz.hQn);
|
||||
|
||||
// (B3) ANSWERS SECTION
|
||||
quiz.hAns = document.createElement("div");
|
||||
quiz.hAns.id = "quizAns";
|
||||
quiz.hWrap.appendChild(quiz.hAns);
|
||||
|
||||
// (B4) GO!
|
||||
quiz.draw();
|
||||
},
|
||||
|
||||
// (C) DRAW QUESTION
|
||||
draw: function(){
|
||||
// (C1) QUESTION
|
||||
quiz.hQn.innerHTML = quiz.data[quiz.now].q;
|
||||
|
||||
// (C2) OPTIONS
|
||||
quiz.hAns.innerHTML = "";
|
||||
for (let i in quiz.data[quiz.now].o) {
|
||||
let radio = document.createElement("input");
|
||||
radio.type = "radio";
|
||||
radio.name = "quiz";
|
||||
radio.id = "quizo" + i;
|
||||
quiz.hAns.appendChild(radio);
|
||||
let label = document.createElement("label");
|
||||
label.innerHTML = quiz.data[quiz.now].o[i];
|
||||
label.setAttribute("for", "quizo" + i);
|
||||
label.dataset.idx = i;
|
||||
label.addEventListener("click", quiz.select);
|
||||
quiz.hAns.appendChild(label);
|
||||
}
|
||||
},
|
||||
|
||||
// (D) OPTION SELECTED
|
||||
select: function(){
|
||||
// (D1) DETACH ALL ONCLICK
|
||||
let all = quiz.hAns.getElementsByTagName("label");
|
||||
for (let label of all) {
|
||||
label.removeEventListener("click", quiz.select);
|
||||
}
|
||||
|
||||
// (D2) CHECK IF CORRECT
|
||||
let correct = this.dataset.idx == quiz.data[quiz.now].a;
|
||||
if (correct) {
|
||||
quiz.score++;
|
||||
this.classList.add("correct");
|
||||
} else {
|
||||
this.classList.add("wrong");
|
||||
}
|
||||
|
||||
// (D3) NEXT QUESTION OR END GAME
|
||||
quiz.now++;
|
||||
setTimeout(function(){
|
||||
if (quiz.now < quiz.data.length) { quiz.draw(); }
|
||||
else {
|
||||
quiz.hQn.innerHTML = `You have answered ${quiz.score} of ${quiz.data.length} correctly.`;
|
||||
quiz.hAns.innerHTML = "";
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
window.addEventListener("load", quiz.init);
|
83
S/quiz/quiz_imapsync.css
Executable file
83
S/quiz/quiz_imapsync.css
Executable file
|
@ -0,0 +1,83 @@
|
|||
|
||||
/* Taken from https://code-boxx.com/simple-javascript-quiz */
|
||||
|
||||
/* (A) WRAPPER */
|
||||
#quizWrap {
|
||||
border-style: solid;
|
||||
border-collapse: collapse;
|
||||
background: #e0e0e0;
|
||||
}
|
||||
|
||||
#quizNumber,#quizScore{
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
border-width: thin;
|
||||
border-style: solid;
|
||||
border-left-style: none;
|
||||
border-right-style: none;
|
||||
}
|
||||
|
||||
#quizScore{
|
||||
border-bottom-style: none;
|
||||
}
|
||||
|
||||
#quizRestart {
|
||||
margin: auto;
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
border-style: solid;
|
||||
border-width: thin;
|
||||
background: #d8ffc4;
|
||||
width: 100px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#quizQn {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* (C) ANSWERS */
|
||||
#quizAns {
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
border-width: thin;
|
||||
display: grid;
|
||||
grid-template-columns: auto auto;
|
||||
grid-gap: 10px;
|
||||
justify-content: space-evenly;
|
||||
align-content: space-evenly;
|
||||
}
|
||||
|
||||
#quizAns input[type=radio] { display: none; }
|
||||
|
||||
#quizAns label {
|
||||
/* background: #cccccc;
|
||||
border: 1px solid #eee;
|
||||
font-size: 20px; */
|
||||
cursor: pointer;
|
||||
background: #ffffff;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
border-style: solid;
|
||||
border-width: thin;
|
||||
margin-top: 5px;
|
||||
margin-left: 25px;
|
||||
margin-right: 25px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#quizAns label.correct {
|
||||
background: #d8ffc4;
|
||||
border: 1px solid #60a03f;
|
||||
}
|
||||
|
||||
#quizAns label.wrong {
|
||||
background: #ffe8e8;
|
||||
border: 1px solid #c78181;
|
||||
}
|
||||
|
20
S/quiz/quiz_imapsync.html
Executable file
20
S/quiz/quiz_imapsync.html
Executable file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<!-- Taken from https://code-boxx.com/simple-javascript-quiz -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
Imapsync Quiz
|
||||
</title>
|
||||
|
||||
<!-- (A) LOAD QUIZ CSS + JS -->
|
||||
<link href="quiz_imapsync.css" rel="stylesheet">
|
||||
<script src="quiz_imapsync.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- (B) QUIZ CONTAINER -->
|
||||
<div id="quizWrap"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
245
S/quiz/quiz_imapsync.js
Executable file
245
S/quiz/quiz_imapsync.js
Executable file
|
@ -0,0 +1,245 @@
|
|||
|
||||
// Taken from https://code-boxx.com/simple-javascript-quiz
|
||||
|
||||
var quiz = {
|
||||
// (A) PROPERTIES
|
||||
// (A1) QUESTIONS & ANSWERS
|
||||
// Q = QUESTION, O = OPTIONS, A = CORRECT ANSWER
|
||||
|
||||
data: [
|
||||
{
|
||||
a : 1,
|
||||
o : [
|
||||
"Facebook",
|
||||
"POP, IMAP, HTTP",
|
||||
"SMTP, ICQ",
|
||||
"Twitter",
|
||||
"FTP, GOPHER",
|
||||
"Instagram"
|
||||
],
|
||||
q : "What are the main protocols usually used to access a mailbox?"
|
||||
},
|
||||
{
|
||||
a : 2,
|
||||
o : [
|
||||
"I'M A Passager",
|
||||
"Instant Mailbox Access Possibility",
|
||||
"Internet Message Access Protocol",
|
||||
"In My Ambiguous Posture",
|
||||
"In My Ambience Place",
|
||||
"Izorc Muggle Ark Prout"
|
||||
],
|
||||
q : "What means the acronym IMAP?"
|
||||
},
|
||||
{
|
||||
a : 2,
|
||||
o : [
|
||||
"No parameter is needed",
|
||||
"Harry Potter's magic wang",
|
||||
"1) The IMAP server name + 2) the user login + 3) the password",
|
||||
"1) the user login + 2) the password"
|
||||
],
|
||||
q : "What are the parameters needed to access an IMAP mailbox?"
|
||||
},
|
||||
{
|
||||
a : 4,
|
||||
o : [
|
||||
"0",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"6",
|
||||
"8"
|
||||
],
|
||||
q : "How many parameters are mandatory to synchronize two IMAP mailboxes with imapsync?"
|
||||
},
|
||||
{
|
||||
a : 0,
|
||||
o : [
|
||||
"No",
|
||||
"Yes"
|
||||
],
|
||||
q : "Can Imapsync synchronize POP accounts?"
|
||||
},
|
||||
{
|
||||
a : 1,
|
||||
o : [
|
||||
"No",
|
||||
"Yes"
|
||||
],
|
||||
q : "Can Imapsync synchronize Gmail accounts?"
|
||||
},
|
||||
{
|
||||
a : 1,
|
||||
o : [
|
||||
"No",
|
||||
"Yes"
|
||||
],
|
||||
q : "Can Imapsync synchronize Office365 accounts?"
|
||||
},
|
||||
{
|
||||
a : 0,
|
||||
o : [
|
||||
"No",
|
||||
"Yes"
|
||||
],
|
||||
q : "Can Imapsync synchronize Contacts, Calendars, Chats, or Notes?"
|
||||
},
|
||||
{
|
||||
a : 0,
|
||||
o : [
|
||||
"NO LIMIT",
|
||||
"GPL",
|
||||
"WTFPL",
|
||||
"MIT",
|
||||
"CC0",
|
||||
"Proprietary"
|
||||
],
|
||||
q : "What is the Imapsync License name?"
|
||||
},
|
||||
{
|
||||
a : 0,
|
||||
o : [
|
||||
"No limits to do anything with this work and this license.",
|
||||
"All permissions restricted.",
|
||||
"Use it for good or evil.",
|
||||
"Too long to fit here."
|
||||
],
|
||||
q : "What is the Imapsync License main text?"
|
||||
},
|
||||
{
|
||||
a : 0,
|
||||
o : [
|
||||
"Yes, sometimes with delay, he's a human",
|
||||
"No, never, email is dead",
|
||||
"Yes, immediately and 24h/24, he's a robot",
|
||||
"What is email?"
|
||||
],
|
||||
q : "Does the imapsync author Gilles LAMIRAL reply to every email?"
|
||||
}
|
||||
],
|
||||
dataDev: [
|
||||
{
|
||||
a : 1,
|
||||
o : [
|
||||
"Facebook",
|
||||
"POP, IMAP, HTTP",
|
||||
"SMTP, ICQ",
|
||||
"Twitter",
|
||||
"FTP, GOPHER",
|
||||
"Instagram"
|
||||
],
|
||||
q : "What are the main protocols usually used to access a mailbox?"
|
||||
}
|
||||
],
|
||||
|
||||
// (B) INIT QUIZ HTML
|
||||
init: function(){
|
||||
// (B1) WRAPPER
|
||||
quiz.hWrap = null;
|
||||
quiz.hScore = null;
|
||||
quiz.hRestart = null;
|
||||
quiz.hQn = null;
|
||||
quiz.hAns = null;
|
||||
quiz.now = 0;
|
||||
quiz.score = 0;
|
||||
|
||||
quiz.hWrap = document.getElementById("quizWrap");
|
||||
quiz.hWrap.innerHTML = "";
|
||||
|
||||
// NUMBER SECTION
|
||||
quiz.hNumber = document.createElement("div");
|
||||
quiz.hNumber.id = "quizNumber";
|
||||
quiz.hWrap.appendChild(quiz.hNumber);
|
||||
|
||||
// (B2) QUESTIONS SECTION
|
||||
quiz.hQn = document.createElement("div");
|
||||
quiz.hQn.id = "quizQn";
|
||||
quiz.hWrap.appendChild(quiz.hQn);
|
||||
|
||||
// (B3) ANSWERS SECTION
|
||||
quiz.hAns = document.createElement("div");
|
||||
quiz.hAns.id = "quizAns";
|
||||
quiz.hWrap.appendChild(quiz.hAns);
|
||||
|
||||
// SCORE SECTION
|
||||
quiz.hScore = document.createElement("div");
|
||||
quiz.hScore.id = "quizScore";
|
||||
quiz.hWrap.appendChild(quiz.hScore);
|
||||
|
||||
// RESTART SECTION
|
||||
quiz.hRestart = document.createElement("div");
|
||||
quiz.hRestart.id = "quizRestart";
|
||||
quiz.hWrap.appendChild(quiz.hRestart);
|
||||
quiz.hRestart.innerHTML = "Restart Quiz";
|
||||
document.getElementById("quizRestart").addEventListener("click", quiz.restart);
|
||||
// (B4) GO!
|
||||
quiz.draw();
|
||||
},
|
||||
|
||||
// (C) DRAW QUESTION
|
||||
draw: function(){
|
||||
// SCORE
|
||||
var QnNumber = `${quiz.now + 1}/${quiz.data.length}`;
|
||||
var ScoreNb = `${quiz.score}/${quiz.now}`;
|
||||
|
||||
quiz.hNumber.innerHTML = `Question ${QnNumber}`;
|
||||
quiz.hScore.innerHTML = `Score ${ScoreNb}`;
|
||||
|
||||
// (C1) QUESTION
|
||||
quiz.hQn.innerHTML = quiz.data[quiz.now].q;
|
||||
|
||||
// (C2) OPTIONS
|
||||
quiz.hAns.innerHTML = "";
|
||||
for (let i in quiz.data[quiz.now].o) {
|
||||
let radio = document.createElement("input");
|
||||
radio.type = "radio";
|
||||
radio.name = "quiz";
|
||||
radio.id = "quizo" + i;
|
||||
quiz.hAns.appendChild(radio);
|
||||
let label = document.createElement("label");
|
||||
label.innerHTML = quiz.data[quiz.now].o[i];
|
||||
label.setAttribute("for", "quizo" + i);
|
||||
label.dataset.idx = i;
|
||||
label.addEventListener("click", quiz.select);
|
||||
quiz.hAns.appendChild(label);
|
||||
}
|
||||
},
|
||||
|
||||
// (D) OPTION SELECTED
|
||||
select: function(){
|
||||
// (D1) DETACH ALL ONCLICK
|
||||
let all = quiz.hAns.getElementsByTagName("label");
|
||||
for (let label of all) {
|
||||
label.removeEventListener("click", quiz.select);
|
||||
}
|
||||
|
||||
// (D2) CHECK IF CORRECT
|
||||
let correct = this.dataset.idx == quiz.data[quiz.now].a;
|
||||
if (correct) {
|
||||
quiz.score++;
|
||||
this.classList.add("correct");
|
||||
} else {
|
||||
this.classList.add("wrong");
|
||||
}
|
||||
|
||||
// (D3) NEXT QUESTION OR END GAME
|
||||
quiz.now++;
|
||||
setTimeout(function(){
|
||||
if (quiz.now < quiz.data.length) { quiz.draw(); }
|
||||
else {
|
||||
// quiz.hNumber.innerHTML = "";
|
||||
ScoreNb = `${quiz.score}/${quiz.now}`;
|
||||
quiz.hScore.innerHTML = `Score ${ScoreNb}`;
|
||||
quiz.hQn.innerHTML = "Finished!";
|
||||
quiz.hAns.innerHTML = "";
|
||||
}
|
||||
}, 800);
|
||||
},
|
||||
|
||||
restart:function(){
|
||||
quiz.init() ;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("load", quiz.init);
|
|
@ -42,6 +42,15 @@ I'm not sure I deserve such great quotes for my work on Imapsync, anyway here th
|
|||
</p>
|
||||
<!--#include file="S/tw-mention.html" -->
|
||||
|
||||
<blockquote class="twitter-tweet">
|
||||
<p lang="en" dir="ltr">
|
||||
imapsync is simply the best and most usable tool ever developed. Works perfect!
|
||||
Thank you <a href="https://twitter.com/imapsync?ref_src=twsrc%5Etfw">@imapsync</a></p>— bkcrri (@bkcrri)
|
||||
<a href="https://twitter.com/bkcrri/status/1456392869808328706?ref_src=twsrc%5Etfw">November 4, 2021</a>
|
||||
</blockquote>
|
||||
<hr>
|
||||
|
||||
|
||||
<blockquote class="twitter-tweet">
|
||||
<p lang="en" dir="ltr">What’s your favorite IMAP migration/sync tool? I made the best experiences with
|
||||
<a href="https://twitter.com/imapsync?ref_src=twsrc%5Etfw">@imapsync</a>.
|
||||
|
@ -157,7 +166,7 @@ alt="Viewable With Any Browser" >
|
|||
<!--#config timefmt="%D" -->
|
||||
<!--#config timefmt="%A %B %d, %Y" -->
|
||||
<b>This document was last modified on <!--#echo var="LAST_MODIFIED" --></b>
|
||||
($Id: testimonial.shtml,v 1.8 2019/11/15 11:35:16 gilles Exp gilles $)<br>
|
||||
($Id: testimonial.shtml,v 1.9 2021/11/05 12:04:12 gilles Exp gilles $)<br>
|
||||
<a href="#TOP">Top of the page</a>
|
||||
</p>
|
||||
</footer>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue