|
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="templateWindow.aspx.vb" Inherits="templateWindow" %>
<!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 Template</title>
<link href="EditorStyle.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function chkFile()
{
var filupload = document.getElementById("<%= templateUpload.ClientID %>").value;
if(filupload == "")
{
alert("Please select a HTML file");
return false;
}
else
{
if(filupload.lastIndexOf(".htm") == -1 && filupload.lastIndexOf(".HTM") == -1 && filupload.lastIndexOf(".html") == -1 && filupload.lastIndexOf(".HTML") == -1)
{
alert("The File you selected is not a HTML File");
return false;
}
}
}
var tempSrc;
function loadTemplate(tmpName)
{
tempSrc = "uploadsDir/templatefiles/" + tmpName;
document.getElementById("tempIFrame").src = tempSrc;
}
function setTemplate()
{
if(tempSrc)
{
var topWind = window.opener;
topWind.editFrame.focus();
var content = tempIFrame.document.body.innerHTML;
var selectedRegion = topWind.editFrame.document.selection.createRange();
selectedRegion.pasteHTML(content);
window.close();
}
else
{
alert("You have not selected any HTML 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 TEMPLATES
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:FileUpload ID="templateUpload" 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 Templates
</td>
<td align="Center" class="txtStyle">
Preview
</td>
</tr>
<tr>
<td align="center">
<div id="listDiv" class="newDivStyle">
<%= listOfTemplates %>
</div>
</td>
<td align="Center">
<div class="newDivStyle">
<iframe id="tempIFrame" frameborder="0" width="150" height="150"></iframe>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<button id="btnOK" class="buttonStyle2" onclick="setTemplate()">
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.