var commentPhotoURL = "";
var currentFilename = "";
$(document).ready(function(){
$("#comment-photo-dialog").dialog({
modal : true,
resizable : false,
draggable : true,
closeOnEscape : true,
autoOpen : false,
width : 250,
height : 200,
position : ["center","top"],
title : "Attach a Photo"
});
$("#comment-photo").uploadify({
"uploader" : "/templates/nate/js/uploadify.swf",
"script" : "/scripts/gallery_upload.php",
"scriptData" : {mediaAdminTags : "nate-comment-photo", mediaTitle : "Comment Photo - " + document.title},
"cancelImg" : "/images/cancel_upload.png",
"folder" : "/tmp",
"queueID" : "commentPhotoQueue",
"auto" : true,
"multi" : false,
"width" : 70,
"height" : 21,
"buttonImg" : "/images/browse_btn.png",
"fileDesc" : "Comment Photo",
"fileExt" : "*.jpg;*.jpeg;*.gif;*.bmp;*.png;*.tiff",
"onCancel" : function(){ },
"onSelect" : function(event,ID,fileObj){ currentFilename = fileObj.name; },
"onComplete" : function(event, queueID, fileObj, response, data){
var ret = eval("(" + response + ")");
if(ret.mediaId > 0 && ret.mediaUrl != ""){
commentPhotoURL = ret.mediaUrl;
$("#attached-item-filename").html("
Filename: ");
}else{
alert("There was an error uploading the related media");
}
$("#comment-submit-btn").attr("disabled", false);
$("#comment-photo-dialog").dialog("close");
}
});
$(".remove-comment-photo-file").live("click", function(e){
e.preventDefault();
$("#attached-item-filename").html("");
commentPhotoURL = "";
});
});
var commentVideoID = "";
var currentFilename = "";
$(document).ready(function(){
$("#comment-video-dialog").dialog({
modal : true,
resizable : false,
draggable : true,
closeOnEscape : true,
autoOpen : false,
width : 300,
height : 250,
title : "Attach a Video"
});
$("#comment-video").uploadify({
"uploader" : "/templates/nate/js/uploadify.swf",
"script" : "/scripts/gallery_upload.php",
"scriptData" : {mediaAdminTags : "nate-comment-video", mediaTitle : "Comment Video - " + document.title},
"cancelImg" : "/images/cancel_upload.png",
"folder" : "/tmp",
"queueID" : "commentVideoQueue",
"auto" : true,
"multi" : false,
"width" : 70,
"height" : 21,
"buttonImg" : "/images/browse_btn.png",
"fileDesc" : "Comment Video",
"fileExt" : "*.flv;*.wmv;*.asf;*.avi;*.mov;*.3gp;*.mpg;*.mpeg;*.mp4",
"onCancel" : function(){ },
"onSelect" : function(event,ID,fileObj){ currentFilename = fileObj.name; },
"onComplete" : function(event, queueID, fileObj, response, data){
var ret = eval("(" + response + ")");
if(ret.mediaId > 0){
commentVideoID = ret.mediaId;
$("#attached-item-filename").html("
Filename: ");
}else{
alert("There was an error uploading the related media");
}
$("#comment-finish-text").html("Your video has been uploaded. Until it has been processed you will see a placeholder image.
OK");
$("#comment-finish-text").fadeIn();
$("#comment-submit-btn").attr("disabled", false);
setTimeout(function(){ $("#comment-video-dialog").dialog("close"); }, 5000);
}
});
$(".remove-comment-video-file").live("click", function(e){
e.preventDefault();
$("#attached-item-filename").html("");
commentVideoURL = "";
});
});
function closeMe(){
$('#comment-video-dialog').dialog('close');
$("#comment-finish-text").hide();
}
Attach A Photo To Your Comment
Photos must be in JPEG, PNG, or GIF format (no progressive JPGs or animated GIFs), 100 MB limit
Do not upload copyrighted materials without the original author's permission!