Re-use choose_media for selecting category icons.
Also, save some JS performance by generating the button in Smarty, not in JS. References #110 #85
This commit is contained in:
parent
7b5ef26e7e
commit
a3cb5e253c
@ -132,6 +132,7 @@
|
||||
<div class="form_field">
|
||||
<label for="category_icon">{$CONST.CATEGORY} {$CONST.IMAGE}</label>
|
||||
<input id="category_icon" name="serendipity[cat][icon]" type="text" value="{$this_cat.category_icon|default:""|escape}">
|
||||
<button id="insert_image" type="button" name="insImage" title="{$CONST.MEDIA_LIBRARY}"><span class="icon-picture"></span><span class="visuallyhidden"> {$CONST.MEDIA_LIBRARY}</span></button>
|
||||
</div>
|
||||
|
||||
<figure id="preview">
|
||||
|
@ -1135,14 +1135,8 @@ $(function() {
|
||||
});
|
||||
|
||||
// Category icon preview
|
||||
// NOTE: This is just to replace the old functionality; ideally, this should
|
||||
// have a working no-js fallback
|
||||
if($('#category_icon').length > 0) {
|
||||
$('<button id="insert_image" type="button" name="insImage" title="{$CONST.MEDIA_LIBRARY}"><span class="icon-picture"></span><span class="visuallyhidden"> {$CONST.MEDIA_LIBRARY}</span></button>').insertAfter('#category_icon');
|
||||
}
|
||||
|
||||
$('#insert_image').click(function(e) {
|
||||
serendipity.openPopup('serendipity_admin.php?serendipity[adminModule]=media&serendipity[noBanner]=true&serendipity[noSidebar]=true&serendipity[noFooter]=true&serendipity[showMediaToolbar]=false&serendipity[htmltarget]=category_icon&serendipity[filename_only]=true');
|
||||
serendipity.choose_media('category_icon');
|
||||
});
|
||||
|
||||
$('#category_icon').change(function() {
|
||||
|
@ -2140,6 +2140,8 @@ label .perm_name,
|
||||
.no-js .toggle_comment_full,
|
||||
.no-js #add_upload,
|
||||
.no-js .choose_media,
|
||||
.no-js #insert_image,
|
||||
.no-js #category_preview #preview,
|
||||
.no-js .media_show_info,
|
||||
.no-js .media_rename,
|
||||
.no-js .template_show_info,
|
||||
|
Loading…
x
Reference in New Issue
Block a user