mirror of
https://github.com/owncloud/bookmarks.git
synced 2024-11-29 04:24:11 +01:00
manage placeholder for shot provider
This commit is contained in:
parent
2328cc1ec8
commit
566055f4e6
@ -27,6 +27,19 @@ $(document).ready(function() {
|
||||
switchView();
|
||||
});
|
||||
|
||||
|
||||
var formatString = (function() {
|
||||
var replacer = function(context) {
|
||||
return function(s, name) {
|
||||
return context[name];
|
||||
};
|
||||
};
|
||||
|
||||
return function(input, context) {
|
||||
return input.replace(/\{(\w+)\}/g, replacer(context));
|
||||
};
|
||||
})();
|
||||
|
||||
function clickSideBar() {
|
||||
$.post(OC.filePath('bookmarks', 'ajax', 'changescreen.php'), {sidebar: $('#leftcontent').is(':visible')});
|
||||
toggleSideBar();
|
||||
@ -217,9 +230,10 @@ function updateBookmarksList(bookmark) {
|
||||
if(bookmark.title == '') bookmark.title = bookmark.url;
|
||||
|
||||
if(bookmark_view == 'image') { //View in images
|
||||
service_url = formatString(shot_provider, {url: encodeEntities(bookmark.url), title: bookmark.title, width: 200});
|
||||
$('.bookmarks_list').append(
|
||||
'<div class="bookmark_single" data-id="' + bookmark.id +'" >' +
|
||||
'<p class="shot"><img src="'+ "http://screenshots.bookmarkly.com/thumb?url="+encodeEntities(bookmark.url) +'"></p>'+
|
||||
'<p class="shot"><img src="'+ service_url +'"></p>'+
|
||||
'<p class="bookmark_actions">' +
|
||||
'<span class="bookmark_edit">' +
|
||||
'<img class="svg" src="'+OC.imagePath('core', 'actions/rename')+'" title="Edit">' +
|
||||
@ -346,4 +360,5 @@ function deleteTag(event){
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,8 @@
|
||||
var fullTags = <?php echo $_['tags'];?>;
|
||||
var init_view = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'bookmarks', 'currentview', 'list');?>';
|
||||
var init_sidebar = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'bookmarks', 'sidebar', 'true');?>';
|
||||
var shot_provider = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'bookmarks', 'shot_provider', 'http://screenshots.bookmarkly.com/thumb?url={url}');?>';
|
||||
//http://api.thumbalizr.com/?width={width}&url={url}
|
||||
</script>
|
||||
<div id="edit_dialog" style="display:none;">
|
||||
<?php include 'addBm.php';?>
|
||||
|
Loading…
Reference in New Issue
Block a user