// smtp palvelimet....
// 7.4.2015 added ending state
// 8.4.2015 changed SMTP_server to sähköposti_palvelin for clarity that it is not 'just' SMTP server
// 30.8.2018 Teksit lyhemmiksi, jotta mahtuu pienempään näyttöön
// TODO: optio jolla valitaan näytetäänkö TCP yhteydenmuodostus/lopetus
var text = "";
var protokollaTila = -1;
var hosts = {
"h1": "Minä",
"h2": "MyEmailServer",
"h3": "KaveriEmailServer",
"h4": "Kaveri"
};
var synArray = new Array("Avataanko yhteys?", "Avataan yhteys, ok?", "OK!");
var finArray = new Array("Suljetaanpa yhteys", "Suljetaan yhteys", "Okei!", "Ookoo!");
var mailArray = new Array("SMTP kommunikaatio", "POP3 tai IMAP kommunikaatio", "Sähköposti email-clientilla");
var webmailArray = new Array("HTTP kommunikaatio", "Sähköposti selaimella");
$(document).ready(function() {
alusta();
piirra();
$('a').click(function(event) {
var tila = this.id;
switch (tila) {
case "mailclient":
switch (protokollaTila) {
case -1:
text = "title: Sähköpostin välitys - Mail client";
$('#webmail').fadeOut(500);
$('#mailclient').fadeOut(500);
$('#mailclient').fadeIn(500, function() {
$('#mailclient').html('Seuraava viesti');
});
text = text.concat("\nNote right of " + hosts.h1 + ": Lähetät sähköpostin");
protokollaTila += 1;
break;
case 0:
piirra_nuoli("h1", "h2", mailArray[0]);
protokollaTila += 1;
break;
case 1:
piirra_nuoli("h2", "h3", mailArray[0]);
protokollaTila += 1;
break;
case 2:
text = text.concat("\nNote left of " + hosts.h4 + ": Avaa sähköpostiohjelman");
protokollaTila += 1;
break;
case 3:
piirra_nuoli("h4", "h3", mailArray[1]);
protokollaTila += 1;
break;
case 4:
piirra_nuoli("h3", "h4",...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.