mirror of
https://github.com/danpros/htmly.git
synced 2026-04-23 14:06:23 +05:30
parent
a2d5355dcd
commit
73cab6df0d
2 changed files with 98 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ if ($type != 'is_post' && $type != 'is_image' && $type != 'is_video' && $type !=
|
|||
|
||||
$desc = get_category_info(null);
|
||||
|
||||
$tags = tag_cloud(true);
|
||||
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
|
||||
|
|
@ -20,6 +22,53 @@ $desc = get_category_info(null);
|
|||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script>
|
||||
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
|
||||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script>
|
||||
<script>
|
||||
$( function() {
|
||||
var availableTags = [
|
||||
<?php foreach ($tags as $tag => $count):?>
|
||||
"<?php echo tag_i18n($tag) ?>",
|
||||
<?php endforeach;?>
|
||||
];
|
||||
function split( val ) {
|
||||
return val.split( /,\s*/ );
|
||||
}
|
||||
function extractLast( term ) {
|
||||
return split( term ).pop();
|
||||
}
|
||||
|
||||
$( "#pTag" )
|
||||
// don't navigate away from the field on tab when selecting an item
|
||||
.on( "keydown", function( event ) {
|
||||
if ( event.keyCode === $.ui.keyCode.TAB &&
|
||||
$( this ).autocomplete( "instance" ).menu.active ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
})
|
||||
.autocomplete({
|
||||
minLength: 0,
|
||||
source: function( request, response ) {
|
||||
// delegate back to autocomplete, but extract the last term
|
||||
response( $.ui.autocomplete.filter(
|
||||
availableTags, extractLast( request.term ) ) );
|
||||
},
|
||||
focus: function() {
|
||||
// prevent value inserted on focus
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
// remove the current input
|
||||
terms.pop();
|
||||
// add the selected item
|
||||
terms.push( ui.item.value );
|
||||
// add placeholder to get the comma-and-space at the end
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} );
|
||||
</script>
|
||||
|
||||
<?php if (isset($error)) { ?>
|
||||
<div class="error-message"><?php echo $error ?></div>
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ if (config('permalink.type') == 'post') {
|
|||
$delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination;
|
||||
}
|
||||
|
||||
$tags = tag_cloud(true);
|
||||
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
|
||||
<script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script>
|
||||
|
|
@ -64,6 +66,53 @@ if (config('permalink.type') == 'post') {
|
|||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script>
|
||||
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
|
||||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script>
|
||||
<script>
|
||||
$( function() {
|
||||
var availableTags = [
|
||||
<?php foreach ($tags as $tag => $count):?>
|
||||
"<?php echo tag_i18n($tag) ?>",
|
||||
<?php endforeach;?>
|
||||
];
|
||||
function split( val ) {
|
||||
return val.split( /,\s*/ );
|
||||
}
|
||||
function extractLast( term ) {
|
||||
return split( term ).pop();
|
||||
}
|
||||
|
||||
$( "#pTag" )
|
||||
// don't navigate away from the field on tab when selecting an item
|
||||
.on( "keydown", function( event ) {
|
||||
if ( event.keyCode === $.ui.keyCode.TAB &&
|
||||
$( this ).autocomplete( "instance" ).menu.active ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
})
|
||||
.autocomplete({
|
||||
minLength: 0,
|
||||
source: function( request, response ) {
|
||||
// delegate back to autocomplete, but extract the last term
|
||||
response( $.ui.autocomplete.filter(
|
||||
availableTags, extractLast( request.term ) ) );
|
||||
},
|
||||
focus: function() {
|
||||
// prevent value inserted on focus
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
// remove the current input
|
||||
terms.pop();
|
||||
// add the selected item
|
||||
terms.push( ui.item.value );
|
||||
// add placeholder to get the comma-and-space at the end
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} );
|
||||
</script>
|
||||
|
||||
<?php if (isset($error)) { ?>
|
||||
<div class="error-message"><?php echo $error ?></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue