|
|
@ -211,20 +211,35 @@ $(function(){
|
|
|
|
|
|
|
|
|
|
|
|
var FF = !(window.mozInnerScreenX == null);
|
|
|
|
var FF = !(window.mozInnerScreenX == null);
|
|
|
|
var websshLineHeight = FF ? 19 : 18
|
|
|
|
var websshLineHeight = FF ? 19 : 18
|
|
|
|
|
|
|
|
function throttle(method, delay, duration){
|
|
|
|
|
|
|
|
var timer = null, begin = new Date();
|
|
|
|
|
|
|
|
return function(){
|
|
|
|
|
|
|
|
var context = this, args = arguments, current = new Date();
|
|
|
|
|
|
|
|
clearTimeout(timer);
|
|
|
|
|
|
|
|
if(current-begin >= duration){
|
|
|
|
|
|
|
|
method.apply(context, args);
|
|
|
|
|
|
|
|
begin = current;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
timer = setTimeout(function(){
|
|
|
|
|
|
|
|
method.apply(context, args);
|
|
|
|
|
|
|
|
}, delay);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
doc.live('mousemove touchmove',function(e){
|
|
|
|
doc.live('mousemove touchmove',function(e){
|
|
|
|
|
|
|
|
|
|
|
|
$(".-brother").show();// 代码行的遮罩显示
|
|
|
|
$(".-brother").show();// 代码行的遮罩显示
|
|
|
|
if(dragging) {
|
|
|
|
if(dragging) {
|
|
|
|
clickX = e.pageX || e.originalEvent.touches[0].pageX;;
|
|
|
|
clickX = e.pageX || e.originalEvent.touches[0].pageX;;
|
|
|
|
if(clickX > leftOffset+0&&clickX<leftOffset+1600) {
|
|
|
|
if(clickX > leftOffset+0&&clickX<leftOffset+1600) {
|
|
|
|
|
|
|
|
console.log('resize')
|
|
|
|
//console.log(1);
|
|
|
|
//console.log(1);
|
|
|
|
lab.css('left', clickX - 7 - leftOffset + 'px');
|
|
|
|
lab.css('left', clickX - 7 - leftOffset + 'px');
|
|
|
|
$("#game_left_contents").width( clickX-leftOffset + 'px');
|
|
|
|
$("#game_left_contents").width( clickX-leftOffset + 'px');
|
|
|
|
nextW2 = clickX-leftOffset;
|
|
|
|
nextW2 = clickX-leftOffset;
|
|
|
|
$("#game_right_contents").width( wrapWidth - nextW2 + 'px');
|
|
|
|
$("#game_right_contents").width( wrapWidth - nextW2 + 'px');
|
|
|
|
//console.log(lab.next().width());
|
|
|
|
//console.log(lab.next().width());
|
|
|
|
refresh_editor_monaco()
|
|
|
|
throttle(refresh_editor_monaco, 100, 200)()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
lab.css('left', '0px');
|
|
|
|
lab.css('left', '0px');
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -246,7 +261,8 @@ $(function(){
|
|
|
|
var w = $("#games_repository_contents").width();
|
|
|
|
var w = $("#games_repository_contents").width();
|
|
|
|
$(".game_webssh").css("min-height", m);
|
|
|
|
$(".game_webssh").css("min-height", m);
|
|
|
|
$(".game_webssh").css("max-height", m);
|
|
|
|
$(".game_webssh").css("max-height", m);
|
|
|
|
refresh_editor_monaco(m)
|
|
|
|
throttle(refresh_editor_monaco, 100, 200)(m)
|
|
|
|
|
|
|
|
// refresh_editor_monaco(m)
|
|
|
|
// 火狐下行高为19
|
|
|
|
// 火狐下行高为19
|
|
|
|
// CodeRepositoryView.js有同样的计算逻辑,用来初始化ssh
|
|
|
|
// CodeRepositoryView.js有同样的计算逻辑,用来初始化ssh
|
|
|
|
var rows = Math.round(m / websshLineHeight);
|
|
|
|
var rows = Math.round(m / websshLineHeight);
|
|
|
@ -1187,6 +1203,8 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
|
|
|
|
dragging = true;
|
|
|
|
dragging = true;
|
|
|
|
dragDom = lab;
|
|
|
|
dragDom = lab;
|
|
|
|
$('#htmlIframe').css('pointer-events', 'none')
|
|
|
|
$('#htmlIframe').css('pointer-events', 'none')
|
|
|
|
|
|
|
|
$('#can-drag').show()
|
|
|
|
|
|
|
|
lab.hide()
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -1206,8 +1224,11 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
doc.live("mouseup", function(e) {
|
|
|
|
doc.live("mouseup", function(e) {
|
|
|
|
|
|
|
|
lab.show()
|
|
|
|
// 在大窗口将下边测试集滚动条拖上去后,将窗口缩小,再拖下来就有这种情况 https://www.trustie.net/issues/16326
|
|
|
|
// 在大窗口将下边测试集滚动条拖上去后,将窗口缩小,再拖下来就有这种情况 https://www.trustie.net/issues/16326
|
|
|
|
if (dragging === true) {
|
|
|
|
if (dragging === true) {
|
|
|
|
|
|
|
|
$('#can-drag').hide()
|
|
|
|
|
|
|
|
|
|
|
|
window.editor_CodeMirror && window.editor_CodeMirror.refresh()
|
|
|
|
window.editor_CodeMirror && window.editor_CodeMirror.refresh()
|
|
|
|
|
|
|
|
|
|
|
|
// 使得iframe可以继续捕获事件
|
|
|
|
// 使得iframe可以继续捕获事件
|
|
|
|