代码拉取完成,页面将自动刷新
同步操作将从 starRTC/starrtc-web 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
var MyMsgWindow = function(id, _inputMsgCallBack)
{
this.id = id;
this.userName = "unnamed";
this.inputMsgCallBack = _inputMsgCallBack;
this.showSpeed = 0;
this.showCallback = null;
this.hideSpeed = 0;
this.hideCallBack = null;
this.parentObj = $("#"+id);
this.exitButton = $("<div style=\"width:25px;height:25px;position:absolute;left:10px;top:10px;background-image: url(images/exitMsgWindow.jpg);background-size: cover;cursor:pointer;z-index:1;\"></div>");
this.msgContent = $("<div style=\"width:100%;height:90%;overflow:auto;position:relative;background-color:#ffffff\" ></div>");
this.msgInputWrapper = $("<div style=\"width:100%;height:10%;\" ></div>");
this.msgInput = $("<input type=\"text\" style=\"width: 100%;height: 100%;background: whitesmoke;padding: 0;border-width: 0;text-align: left\" placeholder=\"点击这里 输入消息\" />");
var that = this;
this.msgInput.bind("keydown", function(evt){
if(evt.keyCode==13)
{
if(evt.target.value != "")
{
that.displayMessage(that.userName ,evt.target.value, true);
if(that.inputMsgCallBack != null)
{
that.inputMsgCallBack(evt.target.value);
}
evt.target.value = "";
}
}
});
this.exitButton.bind("click", function(evt){
that.hide();
});
this.msgInputWrapper.append(this.msgInput);
this.parentObj.append(this.exitButton);
this.parentObj.append(this.msgContent);
this.parentObj.append(this.msgInputWrapper);
MyMsgWindow.prototype.displayMessage = function(displayname, msg, flag)
{
var name = flag?(":" + displayname):(displayname + ":");
var floatDir = flag?"right":"left";
var bgColor = flag?"#088cb7":"red";
var msg = $("<div style='width:100%;font-size:10px;clear:both;'><div style='text-align:right;float:" + floatDir + ";padding:5px;margin:5px auto 5px auto;'>" + name + "</div><div class = 'msgBubble' style='max-width:60%;float:" + floatDir + ";background:" + bgColor + ";'>" + msg + "</div></div>");
this.msgContent.append(msg);
this.msgContent.scrollTop( this.msgContent[0].scrollHeight );
}
MyMsgWindow.prototype.setShowHideCallBack = function(showSpeed, showCallback, hideSpeed, hideCallBack)
{
this.showSpeed = showSpeed;
this.showCallback = showCallback;
this.hideSpeed = hideSpeed;
this.hideCallBack = hideCallBack;
}
MyMsgWindow.prototype.show = function()
{
this.parentObj.slideDown(this.showSpeed, this.showCallback);
}
MyMsgWindow.prototype.hide = function()
{
this.parentObj.slideUp(this.hideSpeed, this.hideCallBack);
}
return this;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。