Subversion Repository Public Repository

Nextrek

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
if (!window["$CT"]){window["$CT"] = new Object();}
if (window.jQuery){/* jQuery already loaded */} else {loadJQuery();}
function loadJQuery(){ var script = document.createElement("script"); script.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"); script.setAttribute("type", "text/javascript"); document.getElementsByTagName("head")[0].appendChild(script);}

$CT.create = function (){
	
	$(".ChatTrek").remove();
	
	var classHidden = "chat-hidden";
	if ($CT.config.hintInitiallyVisible){
		classHidden = "";
	}
	var hintElem = $("<div class='ChatTrek "+classHidden+" hintElem hintVertical-"+$CT.config.hintVerticalPosition+" hintHorizontal-"+$CT.config.hintHorizontalPosition+" hintOrientation-"+$CT.config.hintOrientation+"'></div>");
	$("body").append(hintElem);
	var hintInner = $("<div class='hintInner'></div>");
	hintElem.append(hintInner);
	hintInner.append("<p class='title'>"+$CT.config.hintTitle+"</p>");
	hintInner.append("<p class='text'>"+$CT.config.hintSubTitle+"</p>");
	hintInner.click(function(){
		$CT.openChat();
	})
}

$CT.setOptions = function(options){
	for (elem in options){
		if ($CT.config[elem]){
			$CT.config[elem] = options[elem];
		}
	}
}

$CT.show = function (){
	$(".ChatTrek").fadeIn(300);
}

$CT.hide = function (){
	$(".ChatTrek").fadeOut(300);
}

$CT.openChat = function(){
	alert("apri chat");
}

Commits for Nextrek/socketIO/public/testPage/lib/ChatTrek.js

Diff revisions: vs.
Revision Author Commited Message
1118 MOliva picture MOliva Mon 29 Oct, 2018 19:15:25 +0000