mirror of
https://github.com/danpros/htmly.git
synced 2026-04-20 12:36:23 +05:30
Fix autosave
This commit is contained in:
parent
3fc2b04edf
commit
668168c3fe
2 changed files with 10 additions and 6 deletions
|
|
@ -121,7 +121,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var base_path = '<?php echo site_url() ?>';
|
var base_path = '<?php echo site_url() ?>';
|
||||||
var initial_image = '<?php echo $images;?>';
|
var initial_image = '<?php echo $images;?>';
|
||||||
var parent_page = '<?php echo $parent;?>';
|
var parent_page = '<?php echo isset($parent) ? $parent : '';?>';
|
||||||
var oldfile = '';
|
var oldfile = '';
|
||||||
var addEdit = 'add';
|
var addEdit = 'add';
|
||||||
var saveInterval = 60000;
|
var saveInterval = 60000;
|
||||||
|
|
@ -162,5 +162,7 @@ $('.img-container').on("click", ".the-img", function(e) {
|
||||||
document.getElementById('hideButton').addEventListener('click', toggleDivs);
|
document.getElementById('hideButton').addEventListener('click', toggleDivs);
|
||||||
</script>
|
</script>
|
||||||
<?php if (config('autosave.enable') == 'true' ):?>
|
<?php if (config('autosave.enable') == 'true' ):?>
|
||||||
|
<?php if ($type == 'is_page' || $type == 'is_subpage') :?>
|
||||||
<script src="<?php echo site_url();?>system/resources/js/save_draft.js"></script>
|
<script src="<?php echo site_url();?>system/resources/js/save_draft.js"></script>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
<?php endif;?>
|
||||||
|
|
|
||||||
|
|
@ -154,10 +154,10 @@ $images = image_gallery(null, 1, 40);
|
||||||
<?php $dd = find_subpage($oldmd); ?>
|
<?php $dd = find_subpage($oldmd); ?>
|
||||||
<?php $dr = find_draft_subpage($oldmd);?>
|
<?php $dr = find_draft_subpage($oldmd);?>
|
||||||
<?php if (stripos($dir . '/', '/draft/') !== false) { ?>
|
<?php if (stripos($dir . '/', '/draft/') !== false) { ?>
|
||||||
<input type="submit" name="publishdraft" class="btn btn-primary submit" value="<?php echo i18n('Publish_draft');?>"/> <input type="submit" name="updatedraft" class="btn btn-primary draft" value="<?php echo i18n('Update_draft');?>"/> <?php if (empty($dd) && empty($dr) && $type != 'is_page'):?><a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?>
|
<input type="submit" name="publishdraft" class="btn btn-primary submit" value="<?php echo i18n('Publish_draft');?>"/> <input type="submit" name="updatedraft" class="btn btn-primary draft" value="<?php echo i18n('Update_draft');?>"/> <?php if (empty($dd) && empty($dr)):?><a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?>
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<input type="submit" name="submit" class="btn btn-primary submit" value="<?php echo i18n('Save');?>"/> <?php if (empty($dd) && empty($dr) && $type != 'is_page'):?><input type="submit" name="revertpage" class="btn btn-primary revert" value="<?php echo i18n('Revert_to_draft');?>"/> <a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?>
|
<input type="submit" name="submit" class="btn btn-primary submit" value="<?php echo i18n('Save');?>"/> <?php if (empty($dd) && empty($dr)):?><input type="submit" name="revertpage" class="btn btn-primary revert" value="<?php echo i18n('Revert_to_draft');?>"/> <a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a><?php endif;?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -269,8 +269,8 @@ $images = image_gallery(null, 1, 40);
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var base_path = '<?php echo site_url() ?>';
|
var base_path = '<?php echo site_url() ?>';
|
||||||
var initial_image = '<?php echo $images;?>';
|
var initial_image = '<?php echo $images;?>';
|
||||||
var parent_page = '<?php echo $parent;?>';
|
var parent_page = '<?php echo isset($parent) ? $parent : '';?>';
|
||||||
var oldfile = '<?php echo $url;?>';
|
var oldfile = '<?php echo isset($url) ? $url : '';?>';
|
||||||
var addEdit = 'edit';
|
var addEdit = 'edit';
|
||||||
var saveInterval = 60000;
|
var saveInterval = 60000;
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -312,8 +312,10 @@ $('.img-container').on("click", ".the-img", function(e) {
|
||||||
}
|
}
|
||||||
document.getElementById('hideButton').addEventListener('click', toggleDivs);
|
document.getElementById('hideButton').addEventListener('click', toggleDivs);
|
||||||
</script>
|
</script>
|
||||||
<?php if (config('autosave.enable') == 'true' ):?>
|
<?php if (config('autosave.enable') == 'true'):?>
|
||||||
|
<?php if ($type !== 'is_category' || $type !== 'is_profile') :?>
|
||||||
<?php if (stripos($dir . '/', '/draft/') !== false): ?>
|
<?php if (stripos($dir . '/', '/draft/') !== false): ?>
|
||||||
<script src="<?php echo site_url();?>system/resources/js/save_draft.js"></script>
|
<script src="<?php echo site_url();?>system/resources/js/save_draft.js"></script>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
<?php endif;?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue