wasm-rdp/webrdp/assets/ui.js

141 lines
3.6 KiB
JavaScript

$("#clipboardbtn").attr("open1", 0);
$("#clipboardbtn").click(
function (e) {
e.stopPropagation();
if (($("#clipboardbtn")).attr("open1") == 0) {
clipboard_open();
} else {
clipboard_close();
}
}
);
$(".clipboardback").click(function () {
clipboard_close();
})
$(".clipboard").click(function () {
event.stopPropagation();
})
function clipboard_open() {
$("#clipboardbtn").attr("open1", 1);
$("#clipboardbtn").html(">")
$(".clipboard").toggleClass("clipboard-open");
$(".clipboardback").toggleClass("clipboardback-open");
$(".clipboardback").css("pointer-events", "auto");
}
function clipboard_close() {
$("#clipboardbtn").attr("open1", 0);
$("#clipboardbtn").html("«")
$(".clipboard").toggleClass("clipboard-open");
$(".clipboardback").toggleClass("clipboardback-open");
$(".clipboardback").css("pointer-events", "none");
}
function setClipBoard(s) {
$("#clipboardtxt").val(s);
}
function getClipBoard() {
return $("#clipboardtxt").val();
}
$("#filesharebtn").attr("open1", 0);
$("#filesharebtn").click(
function (e) {
e.stopPropagation();
if (($("#filesharebtn")).attr("open1") == 0) {
fileshare_open();
} else {
fileshare_close();
}
}
);
$(".fileshareback").click(function () {
fileshare_close();
})
$(".fileshare").click(function () {
event.stopPropagation();
})
function fileshare_open() {
$("#filesharebtn").attr("open1", 1);
$("#filesharebtn").html("<")
$(".fileshare").toggleClass("fileshare-open");
$(".fileshareback").toggleClass("fileshareback-open");
$(".fileshareback").css("pointer-events", "auto");
}
function fileshare_close() {
$("#filesharebtn").attr("open1", 0);
$("#filesharebtn").html("»")
$(".fileshare").toggleClass("fileshare-open");
$(".fileshareback").toggleClass("fileshareback-open");
$(".fileshareback").css("pointer-events", "none");
}
// canvas 防止触屏滑动事件
$("#canvas").on("touchmove", function (e) {
e.preventDefault();
});
jconfirm.defaults = {
title: '提示',
titleClass: '',
type: 'default',
typeAnimated: true,
draggable: true,
dragWindowGap: 15,
dragWindowBorder: true,
animateFromElement: true,
smoothContent: true,
content: '你确定要继续吗?',
buttons: {},
defaultButtons: {
ok: {
text: '确定',
action: function () {}
},
close: {
text: '关闭',
action: function () {}
},
},
contentLoaded: function (data, status, xhr) {
},
icon: '',
lazyOpen: false,
bgOpacity: null,
theme: 'light',
animation: 'scale',
closeAnimation: 'scale',
animationSpeed: 400,
animationBounce: 1,
rtl: false,
container: 'body',
containerFluid: false,
backgroundDismiss: false,
backgroundDismissAnimation: 'shake',
autoClose: false,
closeIcon: null,
closeIconClass: false,
watchInterval: 100,
columnClass: 'col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1',
boxWidth: '50%',
scrollToPreviousElement: true,
scrollToPreviousElementAnimate: true,
useBootstrap: true,
offsetTop: 40,
offsetBottom: 40,
bootstrapClasses: {
container: 'container',
containerFluid: 'container-fluid',
row: 'row',
},
onContentReady: function () { },
onOpenBefore: function () { },
onOpen: function () { },
onClose: function () { },
onDestroy: function () { },
onAction: function () { }
};