Skip to content

Instantly share code, notes, and snippets.

@esther
Created May 14, 2009 20:31
Show Gist options
  • Save esther/111886 to your computer and use it in GitHub Desktop.
Save esther/111886 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Insert Slide</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<script language="JavaScript">
function insertObject(form) {
var imgtitle="";
var imgsrc="";
var path="";
var title="";
var media="";
var dimensions="";
var contact="";
var contact2="";
var email="";
if (document.slideform.imgsrc.value != ""){
imgsrc=document.slideform.imgsrc.value;
} else { imgsrc = ''; }
if (document.slideform.path.value != ""){
path=document.slideform.path.value;
} else { path = '#'; }
if (document.slideform.title.value != ""){
title=document.slideform.title.value;
} else { title = ''; }
if (document.slideform.media.value != ""){
media=document.slideform.media.value;
} else { media = ''; }
if (document.slideform.dimensions.value != ""){
dimensions=document.slideform.dimensions.value;
} else { dimensions = ''; }
if (document.slideform.email.value != ""){
email=document.slideform.email.value;
} else { email = ''; }
if (document.slideform.contact.value != ""){
contact=document.slideform.contact.value;
} else { contact = ''; }
if (document.slideform.contact2.value != ""){
contact2=document.slideform.contact2.value;
} else { contact2 = ''; }
if (document.slideform.linktext.value != ""){
imgtitle=document.slideform.linktext.value;}
else {imgtitle='LINKTEXT';}
var output='<div class="slide">\n';
output+='<div class="image"><a href="' + path + '"><img src="' + imgsrc + '" title="' + imgtitle + '" /></a></div>\n';
output+='<div class="info"><i>' + title + '</i><br/> ' + media +'<br/> ' + dimensions + '</div>\n';
output+='<div class="contact"><a href="' + path + '">' + imgtitle + '</a>';
if (contact != '') output+= '<br/>' + contact + ' ';
if (contact2 != '') output+= '<br/>' + contact2 + ' ';
if (email) output+= '<br/><a href="mailto:' + email + '">' + email + '</a><br/>';
output+= '</div>\n';
output+= '<div class="next-prev-links"><a href="#"><span class="prev">&laquo; previous</span></a> <a href="#"><span class="next">next &raquo;</span></a></div>\n';
output+='</div><!-- end of slide -->\n\n';
var theDOM = dw.getDocumentDOM(); //get the dom of the current document
var insertloc = theDOM.slides;
//setInsertionPoint(theDOM, insertloc);
theDOM.insertHTML(output, false);
return;
}
</script>
<form action="" method="post" enctype="multipart/form-data" name="slideform">
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Artist Name</td>
<td>
<input type="text" name="linktext">
</td>
</tr>
<tr>
<td>Fullsize Image Filename</td>
<td><input type="file" name="imgsrc" id="imgsrc"></td>
</tr>
<tr>
<tr>
<td>Artist Page Path</td>
<td><input type="file" name="path" id="path"></td>
</tr>
<tr>
<td>Title</td>
<td><input type="text" name="title">
</td>
</tr>
<tr>
<td>Media</td>
<td><input type="text" name="media">
</td>
</tr>
<tr>
<td>Dimensions</td>
<td><input type="text" name="dimensions">
</td>
</tr>
<tr>
<td>Contact Line 1</td>
<td><input type="text" name="contact">
</td>
</tr>
<tr>
<td>Contact Line 2</td>
<td><input type="text" name="contact2">
</td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email">
</td>
</tr>
</table>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment