📄 mediadialog.js
字号:
// JScript 文件
function SetMouseOverStyle(obj)
{
obj.style.textDecoration = "underline";
obj.style.color = "red";
}
function SetMouseOutStyle(obj)
{
obj.style.textDecoration = "none";
obj.style.color = "black";
}
function TabChange(index)
{
var tabCount = 4;
var defaultClass = "tdButton";
var SelectedClass = "tdSelected";
for (var i = 0; i < tabCount; i++)
{
SetStyleClass("Tab" + i, defaultClass);
DisplayBlock("Tab" + i + "_0","none");
}
SetStyleClass("Tab" + index, SelectedClass);
DisplayBlock("Tab" + index + "_0","block");
if (index == 0)
{
UpdateView();
}
}
function UpdateView()
{
var viewer = document.getElementById("ViewPanel");
var htmlCode = GetMediaCode();
viewer.innerHTML = htmlCode;
}
function SetAttribute(obj,attributeName,value)
{
if (value.trim() != "")
{
obj.setAttribute(attributeName,value);
}
else
{
obj.removeAttribute(attributeName);
}
}
function BrowserServerFile()
{
var url = window.showModalDialog("FileBrowser.aspx?type=1",null,"resizable:yes;status:no;center:yes;dialogWidth:500px;dialogHeight:420px;");
if (url != null)
{
document.getElementById("Url").value = url;
UpdateView();
}
}
function OK()
{
var url = GetFormValue("Url");
if (url.trim() != "")
{
htmlCode = GetMediaCode();
window.returnValue = htmlCode;
window.close();
}
else
{
alert("没有图片可以插入");
}
}
function GetMediaCode()
{
var innerHTML = "";
var url = GetFormValue("Url");
if (url.trim() != "")
{
var width = GetFormValue("Width");
var height = GetFormValue("Height");
var align = GetSelectedValue("Align")
var autoStart = document.getElementById("AutoStart").checked ? 1 : 0;
var autoRewind = document.getElementById("AutoRewind").checked ? 1 : 0;
var showControls = document.getElementById("ShowControls").checked ? 1 : 0;
var showStatusBar = document.getElementById("ShowStatusBar").checked ? 1 : 0;
var enableContextmenu = document.getElementById("EnableContextMenu").checked ? 1 : 0;
var showTracker = document.getElementById("ShowTracker").checked ? 1 : 0;
var showAudioControls = document.getElementById("ShowAudioControls").checked ? 1 : 0;
innerHTML += "<embed src=\"" + url + "\" align=\"" + align + "\" border=\"0\"";
innerHTML += " type=\"application/x-mplayer2\"";
innerHTML += " pluginspage=\"http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin&\"";
if (width.trim() != "")
{
innerHTML += " width=\"" + width + "\"";
}
if (height.trim() != "")
{
innerHTML += " height=\"" + height + "\"";
}
if (align != "")
{
innerHTML += " align=\"" + align + "\"";
}
innerHTML += " showcontrols=\"" + showControls + "\"";
innerHTML += " showpositioncontrols=\"0\"";
innerHTML += " showaudiocontrols=\"" + showAudioControls + "\"";
innerHTML += " showtracker=\"" + showTracker + "\"";
innerHTML += " showdisplay=\"0\"";
innerHTML += " showstatusbar=\"" + showStatusBar + "\"";
innerHTML += " autosize=\"0\"";
innerHTML += " showgotobar=\"0\" showcaptioning=\"0\"";
innerHTML += " autostart=\"" + autoStart + "\"";
innerHTML += " autoRewind=\"" + autoRewind + "\"";
innerHTML += " animationatstart=\"0\" transparentatstart=\"0\" allowscan=\"1\"";
innerHTML += " enablecontextmenu=\"" + enableContextmenu + "\"";
innerHTML += " clicktoplay=\"0\"";
innerHTML += " defaultframe=\"datawindow\" invokeurls=\"0\">";
innerHTML += "</embed>";
}
return innerHTML;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -