index.js
2.8 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
$(function (){
function Show_Hidden1(obj) {
if(obj.style.display=="block")
{
obj.style.display='none';
}
else
{
obj.style.display='block';
}
}
draw.initCanvas();
// 绑定绘画板工具
$(".pencil").on("click", function () {
draw.draw_graph('pencil', this);
});
$(".rescind").on("click", function () {
client.sendGotoPrev();
});
$(".handwriting").on("click", function () {
draw.draw_graph('handwriting', this);
});
$(".rubber").on("click", function () {
draw.draw_graph('rubber', this);
});
$(".drawLine").on("click", function () {
draw.draw_graph('line', this);
});
$(".square").on("click", function () {
draw.draw_graph('square', this);
});
$(".circle").on("click", function () {
draw.draw_graph('circle', this);
});
$(".clearContext").on("click", function () {
client.sendDeleteAllAnnotation();
// draw.clearContext('1');
});
// 初始化铅笔工具
$(".draw_controller li:first").click();
// 选择线条大小
$(".line_size button").click(function () {
$(".line_size button").removeClass('current');
$(this).addClass('current');
size = $(this).data("value");
$("#line_size").hide();
});
//表情
var face=document.getElementById("face");
var faceList=document.getElementById("facelist");
face.onclick=function()
{
console.log("click事件---------------------");
Show_Hidden1(faceList);
return false;
}
//表情功能实现
var step = 0, count = 4;
var $inner = $("#inner-slide"),
$tip = $("#tiplist"),
$tipList = $tip.children("li");
function changeTip() {
var temp = step;
temp >= count ? temp = 0 : null;
$tipList.each(function (index, item) {
index === temp ? $(this).addClass("bg") : $(this).removeClass("bg");
});
}
$tipList.bind("click", function () {
step = $(this).index();
if (document.documentElement.clientWidth > 1366) {
$inner.stop().animate({left: -step * 360}, 500);
} else if (document.documentElement.clientWidth <= 1366 && document.documentElement.clientWidth > 1280) {
$inner.stop().animate({left: -step * 256}, 500);
} else if (document.documentElement.clientWidth <= 1280) {
$inner.stop().animate({left: -step * 238}, 500);
}
changeTip();
});
$(".inner-slide").on("click", "li", function (e) {
$("#txt_message").val($("#txt_message").val() + "[img:" + $(this).find("img").attr("data-type") + "]");
faceList.style.display="none";
});
});