77 lines
2.2 KiB
HTML
Executable File
77 lines
2.2 KiB
HTML
Executable File
|
|
|
|
<div id="mp3_upload">
|
|
<label for="description">MP3</label>
|
|
<br /><input type="file" name="mp3" id="mp3" enctype="multipart/form-data"/>
|
|
<div style="font-size:11px; color:#666; margin-top:5px;">
|
|
Supports MP3. <strong>Max size is 10 MB.</strong>
|
|
</div>
|
|
<div style="font-size:11px; color:#666; margin-top:5px;">
|
|
<a href="#" class="linkFrm">Use a URL instead</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="mp3_url">
|
|
<label for="description">MP3 URL</label>
|
|
<br /><input class="input-text" type="text" name="url" id="url" value="{editUrl}" style="width:400px"/>
|
|
<div style="font-size:11px; color:#666; margin-top:5px;">
|
|
<a href="#" class="linkFrm">Use a upload form instead</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="description" style="display:block;">Caption <span class="option">(optional)</span></label>
|
|
<textarea rows="12" cols="84" name="description" id="description">{editBody}</textarea>
|
|
</div>
|
|
|
|
<input type="hidden" name="title" id="title" value="" />
|
|
<input type="hidden" name="MAX_FILE_SIZE" value="10485760" />
|
|
<input type="hidden" name="type" id="type" value="{type}" />
|
|
<input type="hidden" name="date" id="date" value="{date}" />
|
|
<input type="hidden" name="id_user" id="id_user" value="{id_user}" />
|
|
|
|
|
|
|
|
|
|
<script>
|
|
$('#mp3_url').css('display','none');
|
|
$("#autosave").validate({
|
|
rules: {
|
|
mp3: {
|
|
required: function() {
|
|
return ($('#mp3_upload').css('display')!= 'none') ? true : false;
|
|
},
|
|
accept: "(mp3)"
|
|
},
|
|
url: {
|
|
required: function() {
|
|
return ($('#mp3_url').css('display')!= 'none') ? true : false;
|
|
},
|
|
url: true
|
|
}
|
|
},
|
|
errorElement: "span",
|
|
errorClass: "validate_span",
|
|
errorPlacement: function(label, element) {
|
|
label.prependTo(element.prev())
|
|
}
|
|
});
|
|
|
|
$("#mp3_upload a.linkFrm").click( function() {
|
|
$('#mp3_upload').css('display','none');
|
|
$('#mp3_url').css('display','block');
|
|
$('#mp3').val('');
|
|
return false;
|
|
}
|
|
);
|
|
|
|
$("#mp3_url a.linkFrm").click( function() {
|
|
$('#mp3_url').css('display','none');
|
|
$('#mp3_upload').css('display','block');
|
|
$('#url').val('');
|
|
return false;
|
|
}
|
|
);
|
|
|
|
</script>
|