|
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="mediaWindow.aspx.vb" Inherits="mediaWindow" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Insert Media</title>
<link href="EditorStyle.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function chkFile()
{
var filupload = document.getElementById("<%= mediaUpload.ClientID %>").value;
if(filupload == "")
{
alert("Please select a file");
return false;
}
else
{
if(filupload.lastIndexOf(".avi") == -1 && filupload.lastIndexOf(".AVI") == -1 && filupload.lastIndexOf(".wmv") == -1 && filupload.lastIndexOf(".WMV") == -1 && filupload.lastIndexOf(".mp3") == -1 && filupload.lastIndexOf(".MP3") == -1)
{
alert("The File you selected is not a MEDIA File");
return false;
}
}
}
var mediaTag;
function loadMedia(mediaName)
{
mediaTag = "<embed autostart='true' pluginspage=http://download.microsoft.com/download/winmediaplayer/nsplugin/6.4/WIN98/EN-US/wmpplugin.exe align=baseline src='uploadsDir/mediafiles/" + mediaName + "' type=application/x-mplayer2 ";
document.getElementById("mediaDiv").innerHTML = mediaTag + "width='150' height='150'></embed>";
}
function setMedia()
{
if(mediaTag)
{
var topWind = window.opener;
topWind.editFrame.focus();
var iWid = document.getElementById("medWidth").value;
var iHei = document.getElementById("medHeight").value;
if(iWid)
mediaTag += " width='"+ iWid + "'";
if(iHei)
mediaTag += " height='"+ iHei + "'";
var selectedRegion = topWind.editFrame.document.selection.createRange();
selectedRegion.pasteHTML(mediaTag + "></embed>");
window.close();
}
else
{
alert("You have not selected any media file");
}
}
</script>
</head>
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0" class='txtStyle'
bgcolor='#fffcd1'>
<form id="form1" runat="server">
<table align="Center" cellpadding="2" cellspacing="2">
<tr>
<td colspan="2" align="center">
INSERT MEDIA
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:FileUpload ID="mediaUpload" runat="server" Width="250px" CssClass="otherstyle" /> <asp:Button
ID="btnUpload" runat="server" CssClass="buttonStyle2" Text="Upload" OnClick="btnUpload_Click" />
</td>
</tr>
<tr>
<td align="center" class="txtStyle">
List of Media
</td>
<td align="Center" class="txtStyle">
Preview
</td>
</tr>
<tr>
<td align="center">
<div id="listDiv" class="newDivStyle">
<%= listOfMedia %>
</div>
</td>
<td align="Center">
<div id="mediaDiv" class="newDivStyle">
</div>
</td>
</tr>
<tr>
<td colspan="2" class="txtStyle">
<table width="20%" cellpadding="2" cellspacing="1">
<tr>
<td align="left">
Width:
</td>
<td align="left">
<input type="text" class="txtStyle" id="medWidth" style="width: 25px" value="150" />
</td>
</tr>
<tr>
<td>
Height:
</td>
<td align="left">
<input type="text" class="txtStyle" id="medHeight" style="width: 25px" value="150" />
</td>
</tr>
</table> </td> </tr>
<tr>
<td colspan="2" align="right">
<button id="btnOK" class="buttonStyle2" onclick="setMedia()">
OK</button>
<button id="btnCancel" class="buttonStyle2" onclick="window.close()">
Cancel</button>
</td>
</tr>
</table>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.