Re-added change filename/target dir for media db uploads

References #136
This commit is contained in:
Matthias Mees
2014-04-30 11:15:40 +02:00
parent 0ef5a689f9
commit b9be5eae5e
2 changed files with 25 additions and 1 deletions
+16 -1
View File
@@ -51,7 +51,7 @@
<div id="downloads"> <div id="downloads">
<div class="clearfix form_field"> <div class="clearfix form_field">
<label for="imageurl">{$CONST.ENTER_MEDIA_URL}</label> <label for="imageurl">{$CONST.ENTER_MEDIA_URL}</label>
<input id="imageurl" class="check_input" name="serendipity[imageurl]" type="text" value=""> <input id="imageurl" name="serendipity[imageurl]" type="text" value="">
</div> </div>
<div class="clearfix form_select"> <div class="clearfix form_select">
@@ -61,6 +61,21 @@
<option value="hotlink">{$CONST.FETCH_METHOD_HOTLINK}</option> <option value="hotlink">{$CONST.FETCH_METHOD_HOTLINK}</option>
</select> </select>
</div> </div>
<div class="form_field clearfix">
<label for="imagefilename" class="uploadform_target_filename_label">{$CONST.SAVE_FILE_AS} <span>{$CONST.PLAIN_ASCII_NAMES}</span></label>
<input id="imagefilename" class="uploadform_target_filename" name="serendipity[target_filename][]" type="text" value="">
</div>
<div class="form_select clearfix">
<label for="imagetargetdirectory" class="uploadform_target_directory_label">{$CONST.STORE_IN_DIRECTORY}</label>
<select id="imagetargetdirectory" class="uploadform_target_directory" name="serendipity[target_directory][]">
<option value="">{$CONST.BASE_DIRECTORY}</option>
{foreach from=$media.folders item="folder"}
<option{if $media.only_path == $folder.relpath} selected{/if} value="{$folder.relpath}">{'&nbsp;'|@str_repeat:($folder.depth*2)} {$folder.name}</option>
{/foreach}
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -1142,6 +1142,15 @@ $(function() {
serendipity.checkInputs(); serendipity.checkInputs();
}); });
// Extra function for media db download
$('#imageurl').change(function() {
sourceval = serendipity.getfilename(document.getElementById('imageurl').value);
if (sourceval.length > 0) {
document.getElementById('imagefilename').value = sourceval;
}
});
// Dashboard bookmarklet hint // Dashboard bookmarklet hint
$('.s9y_bookmarklet').click(function(e) { $('.s9y_bookmarklet').click(function(e) {
e.preventDefault(); e.preventDefault();