📄 post.js
字号:
{
var obj = document.getElementById("customLayer");
if ( obj != null )
{
var selectText = "<select size='5' Multiple='yes' id='customInputValueSelect' style='width:200px' onchange='DMFPostx.getValues(document.getElementById(\"customInputValue\"),this)'>";
for ( var i in Teams.data )
{
selectText += "<option value='" + i + "'>" + Teams.get(i) + "</option>";
}
selectText += "</select><input type='hidden' id='customInputValue' value=''>";
obj.innerHTML = text + ":" + selectText;
}
}
this.ViewGroups = function ( text )
{
var obj = document.getElementById("customLayer");
if ( obj != null )
{
var selectText = "<select size='5' Multiple='yes' id='customInputValueSelect' style='width:200px' onchange='DMFPostx.getValues(document.getElementById(\"customInputValue\"),this)'>";
for ( var i in Groups.data )
{
selectText += "<option value='" + i + "'>" + Groups.get(i) + "</option>";
}
selectText += "</select><input type='hidden' id='customInputValue' value=''>";
obj.innerHTML = text + ":" + selectText;
}
}
this.ViewInteger = function ( text )
{
var obj = document.getElementById("customLayer");
if ( obj != null ) obj.innerHTML = text + ":<input type='text' id='customInputValue' class='textinput' style='width:100px'/>";
}
this.ShowAdvBox = function(title,text,values,reObj,returnProc)
{
if ( Teams == null || Groups == null )
{
return;
}
var obj = document.getElementById("InputLayer");
var inputs = "";
inputs += "<div class='message-title' style='text-align:center'>" + title[0] + ":<select id='customSelectValue' style='width:200px' onchange='if(this.value==3){DMFPostx.ViewTeams(\"" + title[1] + "\");return;}else {if(this.value==4){DMFPostx.ViewGroups(\"" + title[1] + "\");return;}}DMFPostx.ViewInteger(\"" + title[1] + "\");'/>";
for ( var i = 1;i <= text.length ;i ++ )
{
inputs += "<option value=\"" + values[i-1] + "\">" + text[i-1] + "</option>";
}
inputs += "</select></div>";
inputs += "<div class='message-title' style='text-align:center'><div id='customLayer'>" + title[1] + ":<input type='text' id='customInputValue' class='textinput' style='width:100px'/></div></div>";
if ( title[2] != null ) inputs += "<div class='message-content'>" + title[2] + "</div>";
obj.innerHTML = inputs + "<div class='message-null'><input type='button' onclick='" + returnProc + "' value='确定' class='flatbutton'/> <input type='button' onclick='DMFPostx.HiddenInput()' value='取消' class='flatbutton'/></div>";
var p = this.getXY(reObj);
var nowtop = p.y + reObj.height;
var nowleft = p.x;
obj.style.top = nowtop + "px";
obj.style.left = nowleft + "px";
obj.style.display = "block";
}
this.ShowFontSelect = function( reObj,command )
{
var obj = document.getElementById("InputLayer");
if ( obj == null ) return;
var inputs = "";
var inputnames = "";
var text = new Array(
"默认","宋体","黑体","隶书","幼圆","细明体",
"Arial","Courier New","Fixedsys","MS Sans Serif","Tahoma","Time New Roman","Verdana",
"仿宋_GB2312","楷体_GB2312"
);
inputs += "<div class='message-title' style=\"text-align:center\">选择字体:<select id='customSelectValue' style='width:150px'/>";
for ( var i = 1;i <= text.length ;i ++ )
{
inputs += "<option value=\"" + text[i-1] + "\" style=\"font-family:" + text[i-1] + ";font-size:11pt\">" + text[i-1] + "</option>";
}
inputs += "</select></div>";
obj.innerHTML = inputs + "<div class='message-null'><input type='button' onclick='DMFEditor.EditObject.contentWindow.document.execCommand(\"" + command + "\", false, $(\"customSelectValue\").value);DMFPostx.HiddenInput() ' value='确定' class='flatbutton'/> <input type='button' onclick='DMFPostx.HiddenInput()' value='取消' class='flatbutton'/></div>";
var p = this.getXY(reObj);
var nowtop = p.y + reObj.height;
var nowleft = p.x;
obj.style.top = nowtop + "px";
obj.style.left = nowleft + "px";
obj.style.display = "block";
}
this.ShowSelect = function( title,text,reObj,returnProc )
{
var obj = document.getElementById("InputLayer");
if ( obj == null ) return;
var inputs = "";
var inputnames = "";
inputs += "<div class='message-title' style=\"text-align:center\">" + title + ":<select id='customSelectValue' style='width:200px'/>";
for ( var i = 1;i <= text.length ;i ++ )
{
inputs += "<option value=\"" + text[i-1] + "\">" + text[i-1] + "</option>";
}
inputs += "</select></div>";
obj.innerHTML = inputs + "<div class='message-null'><input type='button' onclick='" + returnProc + "' value='确定' class='flatbutton'/> <input type='button' onclick='DMFPostx.HiddenInput()' value='取消' class='flatbutton'/></div>";
var p = this.getXY(reObj);
var nowtop = p.y + reObj.height;
var nowleft = p.x;
obj.style.top = nowtop + "px";
obj.style.left = nowleft + "px";
obj.style.display = "block";
}
this.ShowInput = function( text,reObj,inputCount,returnProc )
{
var obj = document.getElementById("InputLayer");
if ( obj == null ) return;
var inputs = "";
var inputnames = "";
for ( i = 1;i <= inputCount ;i ++ )
{
inputs += "<div class='message-title' style=\"text-align:center\">" + text[i-1] + ":<input type='text' id='InputValue" + i + "' class='textinput' style='width:200px'/></div>";
}
obj.innerHTML = inputs + "<div class='message-null'><input type='button' onclick='" + returnProc + "' value='确定' class='flatbutton'/> <input type='button' onclick='DMFPostx.HiddenInput()' value='取消' class='flatbutton'/></div>";
var p = this.getXY(reObj);
var nowtop = p.y + reObj.height;
var nowleft = p.x;
obj.style.top = nowtop + "px";
obj.style.left = nowleft + "px";
obj.style.display = "block";
}
this.ShowPollInput = function ( returnProc,reObj )
{
var obj = document.getElementById("InputLayer");
if ( obj == null ) return;
var inputs = "<div class='message-title'>投票项目设定:<input type='checkbox' id='canMutiSelect' value='1'> 允许多选?<input type='button' onclick='DMFPostx.AddPollItem()' value='增加选项' class='flatbutton'/> <input type='button' onclick='DMFPostx.ClearPollItem()' value='清空选项' class='flatbutton'/></div>";
inputs += "<div id='PollItems'></div>";
obj.innerHTML = inputs + "<div class='message-null'><input type='button' onclick='" + returnProc + "' value='确定' class='flatbutton'/> <input type='button' onclick='DMFPostx.HiddenInput()' value='取消' class='flatbutton'/></div>";
var p = this.getXY(reObj);
var nowtop = p.y + 20;
var nowleft = p.x;
obj.style.width = "450px";
obj.style.top = nowtop + "px";
obj.style.left = nowleft + "px";
obj.style.display = "block";
if ( this.PollItemLength == 0 ) this.LoadPollItemFromFront();
if ( this.PollItemLength > 0 ) this.CreatePollItem();
}
this.BuildPolls = function ()
{
var countObj = document.getElementById("pollCountView");
var valuesObj = document.getElementById("pollValues");
var mutiObj = document.getElementById("canMutiSelect");
if ( countObj == null || valuesObj == null ) return;
this.cachePollItems();
var count = this.PollItemLength;
var inputs = "";
var mutiselect = 1;
if ( mutiObj != null && mutiObj.checked ) mutiselect = 2;
countObj.innerHTML = count;
inputs += "<input type='hidden' id='Poll' name='Poll' value='" + mutiselect + "'/>";
inputs += "<input type='hidden' id='PollCount' name='PollCount' value='" + count + "'/>";
for ( var i = 1; i <= count; i ++ )
{
inputs += "<input type='hidden' id='PollItem" + i + "' name='PollItem" + i + "' value='" + this.PollItems.get(i) + "'/>";
inputs += "<input type='hidden' id='PollIIDtem" + i + "' name='PollIDItem" + i + "' value='" + this.PollIDs.get(i) + "'/>";
}
valuesObj.innerHTML = inputs;
this.HiddenInput();
}
this.cachePollItems = function ( )
{
this.PollItems.Clear();
for ( var i = 1; i <= this.PollItemLength; i ++ )
{
var obj = document.getElementById("PollItem" + i);
var idobj = document.getElementById("PollIDItem" + i);
if ( obj != null )
{
this.PollItems.Append(i,obj.value);
if ( idobj != null )
{
this.PollIDs.Append(i,idobj.value);
}else
{
this.PollIDs.Append(i,0);
}
}
}
}
this.CreatePollItem = function()
{
var obj = document.getElementById("PollItems");
var mobj = document.getElementById("Poll");
var mutiObj = document.getElementById("canMutiSelect");
if ( mobj != null && mutiObj != null )
{
mutiObj.checked = (mobj.value == 2);
}
if ( obj == null ) return;
var inputs = "";
var count = this.PollItemLength;
for ( var i = 1; i <= count; i ++ )
{
inputs += "<div class='message-title'>选项[" + this.FixZero(i) + "]:<input type='text' id='PollItem" + i + "' value='" + this.PollItems.get(i) + "' class='textinput' style='width:300px'/> <input type='hidden' id='PollIDItem" + i + "' value='" + this.PollIDs.get(i) + "'/> <img src='./image/remove.gif' alt='移除此选项' onclick='DMFPostx.RemovePollItem(" + i + ")' style='cursor:pointer'/></div>";
}
obj.innerHTML = inputs;
this.PollItemLength = count;
}
this.LoadPollItemFromFront = function ( )
{
var obj = document.getElementById("pollValues");
if ( obj == null ) return;
//this.PollItems.Clear();
for ( var i = 1; i <= 100; i ++ )
{
var obj = document.getElementById("PollItem" + i);
var idobj = document.getElementById("PollIDItem" + i);
if ( obj != null && idobj != null )
{
this.PollItems.Append(i,obj.value);
this.PollIDs.Append(i,idobj.value);
this.PollItemLength += 1;
}else
{
this.PollItemLength = i - 1;
break;
}
}
}
this.AddPollItem = function ()
{
var obj = document.getElementById("PollItems");
if ( obj == null ) return;
this.PollItemLength += 1;
var inputs = "<div class='message-title'>选项[" + this.FixZero(this.PollItemLength) + "]:<input type='text' id='PollItem" + this.PollItemLength + "' class='textinput' maxlength='50' style='width:300px'/> <input type='hidden' id='PollIDItem" + this.PollItemLength + "' value='0'/> <img src='./image/remove.gif' alt='移除此选项' onclick='DMFPostx.RemovePollItem(" + this.PollItemLength + ")' style='cursor:pointer'/></div>";
obj.innerHTML += inputs;
}
this.RemovePollItem = function ( itemIndex )
{
this.cachePollItems();
this.PollItems.Remove(itemIndex);
this.PollItemLength -= 1;
this.CreatePollItem();
}
this.ClearPollItem = function ( )
{
this.PollItems.Clear();
this.PollItemLength = 0;
this.CreatePollItem();
}
this.HiddenInput = function()
{
var obj = document.getElementById("InputLayer");
obj.style.width = "300px";
obj.style.display = "none";
}
this.showColor = function (color) {
document.getElementById("selectedColor").style.backgroundColor = color;
document.getElementById("selectedColorBox").value = color;
}
function renderColorMap( act ) {
var html = "";
var inputColor = "";
html += '<br><table border="0" cellspacing="1" cellpadding="0" align="center">'
+ '<tr>';
for (var i=0; i<colors.length; i++) {
html += '<td bgcolor="' + colors[i] + '" style="padding:0px">'
+ '<a href="javascript:' + act + ';" onfocus="DMFPostx.showColor(\'' + colors[i] + '\');" onmouseover="DMFPostx.showColor(\'' + colors[i] + '\');">'
+ '<img border="0" src="image/blank.gif" width="10" height="10" title="' + colors[i] + '" alt="' + colors[i] + '" /></a></td>';
if ((i+1) % 18 == 0)
html += '</tr><tr>';
}
html += '<tr><td colspan="18">'
+ '<table width="100%" border="0" cellspacing="0" cellpadding="0">'
+ '<tr><td align="left">'
+ '<img id="selectedColor" style="background-color:black" border="0" src="image/blank.gif" width="80" height="16" />'
+ '</td><td align="right" style="padding:0px">'
+ '<input id="selectedColorBox" name="selectedColorBox" type="hidden" value="' + inputColor + '" /><input type="button" value="取消" onclick="DMFPostx.HiddenInput()" class="flatbutton"/>'
+ '</td></tr>'
+ '</table>'
+ '</td></tr>'
+ '</table><br>';
return html;
}
}
var DMFPostx = new class_post();
DMFPostx.getXY = DMFx.getXY;
DMFPostx.FixZero = DMFx.FixZero;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -