danpros 4 years ago
parent
commit
73cab6df0d
2 changed files with 98 additions and 0 deletions
  1. +49
    -0
      system/admin/views/add-content.html.php
  2. +49
    -0
      system/admin/views/edit-content.html.php

+ 49
- 0
system/admin/views/add-content.html.php View File

@ -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>


+ 49
- 0
system/admin/views/edit-content.html.php View File

@ -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…
Cancel
Save