forked from mkaminsky11/codeyourcloud
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
79 lines (69 loc) · 2.38 KB
/
Copy pathindex.js
File metadata and controls
79 lines (69 loc) · 2.38 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
$(window).resize(function() {
var width = $("#screen").width();
$("#svg2").css("width", width + "px");
var mid = Math.floor(width / 2);
$("#svg2").css("margin-left", "calc(50% - "+mid+"px)");
});
var width = $("#screen").width();
$("#svg2").css("width", (width - 1) + "px");
var mid = Math.floor(width / 2);
$("#svg2").css("margin-left", "calc(50% - "+mid+"px)");
$("#logos").fitText();
var ok = true;
/*********
COMMENTS
*********/
var connection = new WebSocket('wss://codeyourcloud.com:8080');
connection.onopen = function () {
console.log("open");
};
connection.onmessage = function (message) {
console.log(json);
try {
var json = JSON.parse(message.data);
if(json.type === "ok"){
}
}
catch(e){}
}
function comment(){
var name = strip(document.getElementById("comment_name").value);
var mail = strip(document.getElementById("comment_mail").value);
var text = strip(document.getElementById("comment_comment").value);
var agree = $("#agree-checkbox").prop("checked");
var info = {
name: name,
email: mail,
comment: text,
accept: agree
};
//connection.send(JSON.stringify({type: "comment", sender: name, email: mail, comment: text, agree: agree}));
$.ajax("https://codeyourcloud.com/comment",{
method: "POST",
data: info,
success: function(data, textStatus, jqXHR){
console.log(data);
},
error: function(jqXHR, textStatus, errorThrown){
throw errorThrown;
}
});
document.getElementById("comment_name").value = "";
document.getElementById("comment_mail").value = "";
document.getElementById("comment_comment").value = "";
}
function resetForm(){
document.getElementById("comment_name").value = "";
document.getElementById("comment_mail").value = "";
document.getElementById("comment_comment").value = "";
}
function strip(string){
var ret = string.split("(").join("").split(")").join("");
ret = ret.split("{").join("").split("}").join("");
ret = ret.split("+").join("").split("-").join("");
ret = ret.split(";").join("").split("<").join("").split(">").join("");
return ret;
}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-47415821-1', 'codeyourcloud.com');
ga('send', 'pageview');