1
0
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:
Brice Maron 2012-07-31 20:48:11 +00:00
parent 2328cc1ec8
commit 566055f4e6
2 changed files with 19 additions and 2 deletions

View File

@ -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">' +
@ -347,3 +361,4 @@ function deleteTag(event){
}
});
}

View File

@ -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';?>