mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 11:36:20 +05:30
Add pager in gallery
Load 40 images for each pager.
This commit is contained in:
parent
a749ef2d73
commit
675cf51259
8 changed files with 125 additions and 71 deletions
|
|
@ -76,7 +76,7 @@ if ($type == 'is_frontpage') {
|
|||
}
|
||||
}
|
||||
|
||||
$images = get_gallery();
|
||||
$images = image_gallery(null, 1, 40);
|
||||
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
|
||||
|
|
@ -184,18 +184,12 @@ $images = get_gallery();
|
|||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php if (!empty($images)) :?>
|
||||
<div class="form-group">
|
||||
<div class="row-fluid cover-container">
|
||||
<?php foreach ($images as $img):?>
|
||||
<div class="cover-item">
|
||||
<img class="img-thumbnail the-img" src="<?php echo site_url() . $img['dirname'] . '/' . $img['basename']?>">
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<div class="row-fluid img-container" id="gallery-1">
|
||||
<?php echo $images;?>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<?php endif;?>
|
||||
<div class="form-group">
|
||||
<label for="insertImageDialogURL">URL</label>
|
||||
<input type="text" class="form-control" id="insertImageDialogURL" size="48" placeholder="<?php echo i18n('Enter_image_URL');?>" />
|
||||
|
|
@ -215,10 +209,24 @@ $images = get_gallery();
|
|||
</div>
|
||||
</div>
|
||||
<!-- Declare the base path. Important -->
|
||||
<script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script>
|
||||
<script type="text/javascript">var base_path = '<?php echo site_url() ?>'; var initial_image = '<?php echo $images;?>';</script>
|
||||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script>
|
||||
<script>
|
||||
$('.the-img').click(function(e) {
|
||||
$('#insertImageDialogURL').val($(e.target).attr('src'));
|
||||
function loadImages(page) {
|
||||
$.ajax({
|
||||
url: '<?php echo site_url();?>admin/gallery',
|
||||
type: 'POST',
|
||||
data: { page: page },
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
$('#gallery-1').html(response.images);
|
||||
$('#gallery-2').html(response.images);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.img-container').on("click", ".the-img", function(e) {
|
||||
$('#insertMediaDialogURL').val($(e.target).attr('src'));
|
||||
$('#insertImageDialogURL').val($(e.target).attr('src'));
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue