|
@@ -1,5 +1,5 @@
|
|
//蒙版
|
|
//蒙版
|
|
-var canvas_bak = document.getElementById("box");
|
|
|
|
|
|
+var canvas_bak = document.getElementById('box');
|
|
|
|
|
|
var winHeight = window.screen.height - window.innerHeight;
|
|
var winHeight = window.screen.height - window.innerHeight;
|
|
var vowidth = window.screen.width;
|
|
var vowidth = window.screen.width;
|
|
@@ -8,9 +8,9 @@ var numse = window.screen.height;
|
|
|
|
|
|
// 计算title top 头部 连接断开,是否准备重连?
|
|
// 计算title top 头部 连接断开,是否准备重连?
|
|
if (numse <= 70) {
|
|
if (numse <= 70) {
|
|
- var voheight = window.screen.height - winHeight - 34 - 20
|
|
|
|
|
|
+ var voheight = window.screen.height - winHeight - 34 - 20;
|
|
} else {
|
|
} else {
|
|
- var voheight = window.screen.height - topwinHeightDraw - 20
|
|
|
|
|
|
+ var voheight = window.screen.height - topwinHeightDraw - 20;
|
|
}
|
|
}
|
|
|
|
|
|
// 画笔大小
|
|
// 画笔大小
|
|
@@ -24,7 +24,8 @@ var videoWidth, videoHeight;
|
|
var isControl = true; // 是否是观看模式
|
|
var isControl = true; // 是否是观看模式
|
|
var isAuth = parameters['authPhone']; // 是否是获取的云手机
|
|
var isAuth = parameters['authPhone']; // 是否是获取的云手机
|
|
|
|
|
|
-var wsss, errorTime = 0;
|
|
|
|
|
|
+var wsss,
|
|
|
|
+ errorTime = 0;
|
|
var first = true;
|
|
var first = true;
|
|
function throttle(fn, delay) {
|
|
function throttle(fn, delay) {
|
|
var flag = true;
|
|
var flag = true;
|
|
@@ -40,20 +41,20 @@ function throttle(fn, delay) {
|
|
}
|
|
}
|
|
|
|
|
|
function doConnectDirectives() {
|
|
function doConnectDirectives() {
|
|
- videoWidth = Number(resolvingPower) ? Number(resolvingPower) : 720
|
|
|
|
- videoHeight = videoWidth === 720 ? 1280 : 1920
|
|
|
|
|
|
+ videoWidth = Number(resolvingPower) ? Number(resolvingPower) : 720;
|
|
|
|
+ videoHeight = videoWidth === 720 ? 1280 : 1920;
|
|
wsss = new WebSocket(cUrl);
|
|
wsss = new WebSocket(cUrl);
|
|
wsss.binaryType = 'arraybuffer';
|
|
wsss.binaryType = 'arraybuffer';
|
|
|
|
|
|
wsss.onopen = function () {
|
|
wsss.onopen = function () {
|
|
// 进入发起询问
|
|
// 进入发起询问
|
|
var pings2 = {
|
|
var pings2 = {
|
|
- "type": "forwardMsg",
|
|
|
|
- "data": {
|
|
|
|
- "code": "3000",
|
|
|
|
- "desc": "询问是否有在控制" // 可选
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ type: 'forwardMsg',
|
|
|
|
+ data: {
|
|
|
|
+ code: '3000',
|
|
|
|
+ desc: '询问是否有在控制', // 可选
|
|
|
|
+ },
|
|
|
|
+ };
|
|
wsss.send(JSON.stringify(pings2));
|
|
wsss.send(JSON.stringify(pings2));
|
|
};
|
|
};
|
|
wsss.onerror = function (evt) {
|
|
wsss.onerror = function (evt) {
|
|
@@ -64,47 +65,67 @@ function doConnectDirectives() {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
wsss.onmessage = function (res) {
|
|
wsss.onmessage = function (res) {
|
|
- console.log('res', res)
|
|
|
|
- var result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data
|
|
|
|
- console.log('result.type', result.type)
|
|
|
|
|
|
+ console.log('res', res);
|
|
|
|
+ var result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
|
|
|
|
+ console.log('result.type', result.type);
|
|
if (result.type === 'cutting') {
|
|
if (result.type === 'cutting') {
|
|
if (result.data.status === 0) {
|
|
if (result.data.status === 0) {
|
|
- $.toast('复制成功', "text");
|
|
|
|
|
|
+ $.toast('复制成功', 'text');
|
|
} else {
|
|
} else {
|
|
- $.toast(result.msg, "text");
|
|
|
|
|
|
+ $.toast(result.msg, 'text');
|
|
}
|
|
}
|
|
- return
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- if (result.type === 'forwardMsg' && isAuth !== 'none') {
|
|
|
|
- if (result.data.code === 4000 || result.data.code === 3000) {
|
|
|
|
- if (isAuth === 'huo') {
|
|
|
|
- $.confirm("授权方已收回控制权,您进入观看屏幕模式", function () {
|
|
|
|
- //点击确认后的回调函数
|
|
|
|
- isControl = false;
|
|
|
|
- }, function () {
|
|
|
|
- isControl = false;
|
|
|
|
- //点击取消后的回调函数
|
|
|
|
- quit();
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- $.confirm("当前云手机正在授控,是否请求获取云手机控制权?", function () {
|
|
|
|
- //点击确认后的回调函数
|
|
|
|
- var ping = {
|
|
|
|
- "type": "forwardMsg",
|
|
|
|
- "data": {
|
|
|
|
- "code": "5000",
|
|
|
|
- "desc": "控制权限收回" // 可选
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- wsss.send(JSON.stringify(ping));
|
|
|
|
- isControl = true;
|
|
|
|
- }, function () {
|
|
|
|
- //点击取消后的回调函数
|
|
|
|
- isControl = false;
|
|
|
|
- });
|
|
|
|
|
|
+ if (result.type === 'forwardMsg') {
|
|
|
|
+ if (isAuth !== 'none') {
|
|
|
|
+ if (result.data.code === 4000 || result.data.code === 3000) {
|
|
|
|
+ if (isAuth === 'huo') {
|
|
|
|
+ $.confirm(
|
|
|
|
+ '授权方已收回控制权,您进入观看屏幕模式',
|
|
|
|
+ function () {
|
|
|
|
+ //点击确认后的回调函数
|
|
|
|
+ isControl = false;
|
|
|
|
+ },
|
|
|
|
+ function () {
|
|
|
|
+ isControl = false;
|
|
|
|
+ //点击取消后的回调函数
|
|
|
|
+ quit();
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ $.confirm(
|
|
|
|
+ '当前云手机正在授控,是否请求获取云手机控制权?',
|
|
|
|
+ function () {
|
|
|
|
+ //点击确认后的回调函数
|
|
|
|
+ var ping = {
|
|
|
|
+ type: 'forwardMsg',
|
|
|
|
+ data: {
|
|
|
|
+ code: '5000',
|
|
|
|
+ desc: '控制权限收回', // 可选
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ wsss.send(JSON.stringify(ping));
|
|
|
|
+ isControl = true;
|
|
|
|
+ },
|
|
|
|
+ function () {
|
|
|
|
+ //点击取消后的回调函数
|
|
|
|
+ isControl = false;
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
+ if (result.data.code === 'phoneSizeChange') {
|
|
|
|
+ console.log(result.data);
|
|
|
|
+ window.currentPhoneSize = {
|
|
|
|
+ width: result.data.width,
|
|
|
|
+ height: result.data.height,
|
|
|
|
+ };
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- return
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if (result.type === 'payInitiateEvent') {
|
|
if (result.type === 'payInitiateEvent') {
|
|
var url = window.location.href;
|
|
var url = window.location.href;
|
|
@@ -121,93 +142,114 @@ function doConnectDirectives() {
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
contentType: 'application/json;charset=UTF-8',
|
|
contentType: 'application/json;charset=UTF-8',
|
|
success: function (res) {
|
|
success: function (res) {
|
|
- if(result.data.payType === 1) { // 微信
|
|
|
|
- if (window.__wxjs_environment === 'miniprogram') { // 小程序
|
|
|
|
|
|
+ if (result.data.payType === 1) {
|
|
|
|
+ // 微信
|
|
|
|
+ if (window.__wxjs_environment === 'miniprogram') {
|
|
|
|
+ // 小程序
|
|
// copyUrl(result.data.payUrl);
|
|
// copyUrl(result.data.payUrl);
|
|
} else {
|
|
} else {
|
|
- window.location.href = result.data.payUrl
|
|
|
|
|
|
+ window.location.href = result.data.payUrl;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- window.location.href = result.data.payUrl
|
|
|
|
|
|
+ window.location.href = result.data.payUrl;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
});
|
|
- return
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
}
|
|
}
|
|
-$('body').on("click", function () {
|
|
|
|
|
|
+$('body').on('click', function () {
|
|
draw_graph('pencil');
|
|
draw_graph('pencil');
|
|
-})
|
|
|
|
|
|
+});
|
|
//剪切板
|
|
//剪切板
|
|
-$(".upload").on("click", function () {
|
|
|
|
- var texts = $(this).attr("data-text")
|
|
|
|
- if (texts == "uploads") {
|
|
|
|
- $(".mainbox").css({
|
|
|
|
- "display": "block"
|
|
|
|
- })
|
|
|
|
- $(".sbox").css({
|
|
|
|
- "display": "none"
|
|
|
|
- })
|
|
|
|
|
|
+$('.upload').on('click', function () {
|
|
|
|
+ var texts = $(this).attr('data-text');
|
|
|
|
+ if (texts == 'uploads') {
|
|
|
|
+ $('.mainbox').css({
|
|
|
|
+ display: 'block',
|
|
|
|
+ });
|
|
|
|
+ $('.sbox').css({
|
|
|
|
+ display: 'none',
|
|
|
|
+ });
|
|
}
|
|
}
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
//home 控制home
|
|
//home 控制home
|
|
-$(".botmat1img").on("click", function () {
|
|
|
|
- var codes = $(this).attr("data-text")
|
|
|
|
- if (codes == "home" && isControl) {
|
|
|
|
|
|
+$('.botmat1img').on('click', function () {
|
|
|
|
+ var codes = $(this).attr('data-text');
|
|
|
|
+ if (codes == 'home' && isControl) {
|
|
wsss.send(ExexuteKeyBoard(3));
|
|
wsss.send(ExexuteKeyBoard(3));
|
|
- } else if (codes == "return" && isControl) {
|
|
|
|
|
|
+ } else if (codes == 'return' && isControl) {
|
|
wsss.send(ExexuteKeyBoard(4));
|
|
wsss.send(ExexuteKeyBoard(4));
|
|
- } else if (codes == "gengduo" && isControl) {
|
|
|
|
|
|
+ } else if (codes == 'gengduo' && isControl) {
|
|
wsss.send(ExexuteKeyBoard(187));
|
|
wsss.send(ExexuteKeyBoard(187));
|
|
}
|
|
}
|
|
-
|
|
|
|
-})
|
|
|
|
|
|
+});
|
|
// 高清控制
|
|
// 高清控制
|
|
-$(".PictureQuality").on("click", function () {
|
|
|
|
|
|
+$('.PictureQuality').on('click', function () {
|
|
if (!isControl) {
|
|
if (!isControl) {
|
|
- return
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- $(this).addClass("avit").siblings().removeClass('avit')
|
|
|
|
- var id = $(this).attr("data-id")
|
|
|
|
|
|
+ $(this).addClass('avit').siblings().removeClass('avit');
|
|
|
|
+ var id = $(this).attr('data-id');
|
|
var buffer = makeSharpness(Number(id));
|
|
var buffer = makeSharpness(Number(id));
|
|
ws.send(buffer);
|
|
ws.send(buffer);
|
|
-})
|
|
|
|
|
|
+});
|
|
//画图形
|
|
//画图形
|
|
var draw_graph = function (graphType, obj) {
|
|
var draw_graph = function (graphType, obj) {
|
|
//把蒙版放于画板上面
|
|
//把蒙版放于画板上面
|
|
- $("#container").css("z-index", 30);
|
|
|
|
- $("#dedit").css("z-index", 20);
|
|
|
|
|
|
+ $('#container').css('z-index', 30);
|
|
|
|
+ $('#dedit').css('z-index', 20);
|
|
var canDraw = false;
|
|
var canDraw = false;
|
|
//鼠标按下获取 开始xy开始画图
|
|
//鼠标按下获取 开始xy开始画图
|
|
var ongoingTouches = [];
|
|
var ongoingTouches = [];
|
|
var touchstart = function (e) {
|
|
var touchstart = function (e) {
|
|
if (!isControl) {
|
|
if (!isControl) {
|
|
- return
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
$('.control-right-img').attr({
|
|
$('.control-right-img').attr({
|
|
- "data-id": "2"
|
|
|
|
- })
|
|
|
|
- $(".leftmains").css({
|
|
|
|
- "right": "-4rem"
|
|
|
|
- })
|
|
|
|
|
|
+ 'data-id': '2',
|
|
|
|
+ });
|
|
|
|
+ $('.leftmains').css({
|
|
|
|
+ right: '-4rem',
|
|
|
|
+ });
|
|
var touchfor = e.originalEvent.changedTouches; //for 的手指数组
|
|
var touchfor = e.originalEvent.changedTouches; //for 的手指数组
|
|
//是否横屏
|
|
//是否横屏
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
- var acrossHeightY = videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
|
|
|
+ var acrossHeightY =
|
|
|
|
+ videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
var idx = ongoingTouches.findIndex(function (ele) {
|
|
var idx = ongoingTouches.findIndex(function (ele) {
|
|
- return ele.identifier === touchfor[i].identifier
|
|
|
|
- })
|
|
|
|
|
|
+ return ele.identifier === touchfor[i].identifier;
|
|
|
|
+ });
|
|
if (idx < 0) {
|
|
if (idx < 0) {
|
|
ongoingTouches.push(touchfor[i]);
|
|
ongoingTouches.push(touchfor[i]);
|
|
}
|
|
}
|
|
- var ping = resolving == 0 ?
|
|
|
|
- { "data": { "action": 0, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
|
|
|
|
- { "data": { "action": 0, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
|
|
|
|
|
|
+ var ping =
|
|
|
|
+ resolving == 0
|
|
|
|
+ ? {
|
|
|
|
+ data: {
|
|
|
|
+ action: 0,
|
|
|
|
+ count: ongoingTouches.length,
|
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
|
+ x: acrossWidthX.toFixed(2),
|
|
|
|
+ y: acrossHeightY.toFixed(2),
|
|
|
|
+ },
|
|
|
|
+ type: 'event',
|
|
|
|
+ }
|
|
|
|
+ : {
|
|
|
|
+ data: {
|
|
|
|
+ action: 0,
|
|
|
|
+ count: ongoingTouches.length,
|
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
|
+ x: verticalWidthX.toFixed(2),
|
|
|
|
+ y: verticalHeightY.toFixed(2),
|
|
|
|
+ },
|
|
|
|
+ type: 'event',
|
|
|
|
+ };
|
|
wsss.send(JSON.stringify(ping));
|
|
wsss.send(JSON.stringify(ping));
|
|
}
|
|
}
|
|
canDraw = true;
|
|
canDraw = true;
|
|
@@ -216,24 +258,44 @@ var draw_graph = function (graphType, obj) {
|
|
//鼠标离开 把蒙版canvas的图片生成到canvas中
|
|
//鼠标离开 把蒙版canvas的图片生成到canvas中
|
|
var touchend = function (e) {
|
|
var touchend = function (e) {
|
|
if (!isControl) {
|
|
if (!isControl) {
|
|
- return
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
var touchfor = e.originalEvent.changedTouches; //for 的手指数组
|
|
var touchfor = e.originalEvent.changedTouches; //for 的手指数组
|
|
//是否横屏
|
|
//是否横屏
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
- var acrossHeightY = videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
|
|
|
+ var acrossHeightY =
|
|
|
|
+ videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
- var ping = resolving == 0 ?
|
|
|
|
- { "data": { "action": 1, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
|
|
|
|
- { "data": { "action": 1, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
|
|
|
|
|
|
+ var ping =
|
|
|
|
+ resolving == 0
|
|
|
|
+ ? {
|
|
|
|
+ data: {
|
|
|
|
+ action: 1,
|
|
|
|
+ count: ongoingTouches.length,
|
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
|
+ x: acrossWidthX.toFixed(2),
|
|
|
|
+ y: acrossHeightY.toFixed(2),
|
|
|
|
+ },
|
|
|
|
+ type: 'event',
|
|
|
|
+ }
|
|
|
|
+ : {
|
|
|
|
+ data: {
|
|
|
|
+ action: 1,
|
|
|
|
+ count: ongoingTouches.length,
|
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
|
+ x: verticalWidthX.toFixed(2),
|
|
|
|
+ y: verticalHeightY.toFixed(2),
|
|
|
|
+ },
|
|
|
|
+ type: 'event',
|
|
|
|
+ };
|
|
wsss.send(JSON.stringify(ping));
|
|
wsss.send(JSON.stringify(ping));
|
|
ongoingTouches.forEach(function (item, index) {
|
|
ongoingTouches.forEach(function (item, index) {
|
|
if (item.identifier === touchfor[i].identifier) {
|
|
if (item.identifier === touchfor[i].identifier) {
|
|
- ongoingTouches.splice(index, 1)
|
|
|
|
|
|
+ ongoingTouches.splice(index, 1);
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
canDraw = false;
|
|
canDraw = false;
|
|
};
|
|
};
|
|
@@ -241,22 +303,42 @@ var draw_graph = function (graphType, obj) {
|
|
//清空层 云手机超出屏幕的开关
|
|
//清空层 云手机超出屏幕的开关
|
|
var clearContext = function () {
|
|
var clearContext = function () {
|
|
canDraw = false;
|
|
canDraw = false;
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
// 鼠标移动
|
|
// 鼠标移动
|
|
var touchmove = function (e) {
|
|
var touchmove = function (e) {
|
|
if (!isControl) {
|
|
if (!isControl) {
|
|
- return
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
var touchfor = e.originalEvent.targetTouches; //for 的手指数组
|
|
var touchfor = e.originalEvent.targetTouches; //for 的手指数组
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
- var acrossHeightY = videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
|
|
|
+ var acrossHeightY =
|
|
|
|
+ videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
- var ping = resolving == 0 ?
|
|
|
|
- { "data": { "action": 2, "count": touchfor.length, "pointerId": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
|
|
|
|
- { "data": { "action": 2, "count": touchfor.length, "pointerId": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
|
|
|
|
|
|
+ var ping =
|
|
|
|
+ resolving == 0
|
|
|
|
+ ? {
|
|
|
|
+ data: {
|
|
|
|
+ action: 2,
|
|
|
|
+ count: touchfor.length,
|
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
|
+ x: acrossWidthX.toFixed(2),
|
|
|
|
+ y: acrossHeightY.toFixed(2),
|
|
|
|
+ },
|
|
|
|
+ type: 'event',
|
|
|
|
+ }
|
|
|
|
+ : {
|
|
|
|
+ data: {
|
|
|
|
+ action: 2,
|
|
|
|
+ count: touchfor.length,
|
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
|
+ x: verticalWidthX.toFixed(2),
|
|
|
|
+ y: verticalHeightY.toFixed(2),
|
|
|
|
+ },
|
|
|
|
+ type: 'event',
|
|
|
|
+ };
|
|
wsss.send(JSON.stringify(ping));
|
|
wsss.send(JSON.stringify(ping));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -266,24 +348,24 @@ var draw_graph = function (graphType, obj) {
|
|
if (graphType != 'handwriting') {
|
|
if (graphType != 'handwriting') {
|
|
clearContext();
|
|
clearContext();
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
$(canvas_bak).unbind();
|
|
$(canvas_bak).unbind();
|
|
$(canvas_bak).bind('touchstart', touchstart);
|
|
$(canvas_bak).bind('touchstart', touchstart);
|
|
$(canvas_bak).bind('touchmove', touchmove);
|
|
$(canvas_bak).bind('touchmove', touchmove);
|
|
$(canvas_bak).bind('touchend', touchend);
|
|
$(canvas_bak).bind('touchend', touchend);
|
|
$(canvas_bak).bind('mouseout', mouseout);
|
|
$(canvas_bak).bind('mouseout', mouseout);
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
// 获取url中"?"符后的字串
|
|
// 获取url中"?"符后的字串
|
|
function GetRequest() {
|
|
function GetRequest() {
|
|
var url = location.search;
|
|
var url = location.search;
|
|
var obj = new Object();
|
|
var obj = new Object();
|
|
- if (url.indexOf("?") != -1) {
|
|
|
|
|
|
+ if (url.indexOf('?') != -1) {
|
|
var str = url.substr(1);
|
|
var str = url.substr(1);
|
|
- strs = str.split("&");
|
|
|
|
|
|
+ strs = str.split('&');
|
|
for (var i = 0; i < strs.length; i++) {
|
|
for (var i = 0; i < strs.length; i++) {
|
|
- obj[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
|
|
|
|
|
|
+ obj[strs[i].split('=')[0]] = strs[i].split('=')[1];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return obj;
|
|
return obj;
|