Added bookmarklet for browser. Inspired by Google Bookmarks

This commit is contained in:
Alessandro Cosentino 2012-02-19 20:18:27 -05:00
parent 9d2379742b
commit 490c9db15d
3 changed files with 21 additions and 3 deletions

View File

@ -40,6 +40,7 @@ $url = isset($_GET['url']) ? urldecode($_GET['url']) : '';
$metadata = getURLMetadata($url);
$tmpl->assign('URL', htmlentities($metadata['url'],ENT_COMPAT,'utf-8'));
$tmpl->assign('TITLE', htmlentities($metadata['title'],ENT_COMPAT,'utf-8'));
$title = isset($metadata['title']) ? $metadata['title'] : (isset($_GET['title']) ? $_GET['title'] : '');
$tmpl->assign('TITLE', htmlentities($title,ENT_COMPAT,'utf-8'));
$tmpl->printPage();

View File

@ -84,3 +84,16 @@
display: none;
margin-left: 5px;
}
#footer {
color: #999;
font-size: medium;
text-align: center;
position: absolute;
bottom: 10px;
left: 0px;
width: 100%;
height: 20px;
visibility: visible;
display: block
}

View File

@ -23,3 +23,7 @@
<div class="bookmarks_list">
<?php echo $l->t('You have no bookmarks'); ?>
</div>
<div id="footer">
Bookmark pages more easily. Drag this bookmarklet to the Bookmarks bar of your browser:
<a style='background-color:#dddddd;border:1px groove #999; padding:5px;padding-top:0px;padding-bottom:2px; text-decoration:none; margin-top:5px' href='javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open("<?php echo OC_Helper::linkToAbsolute('bookmarks', 'addBm.php') ?>?output=popup&url="+c(b.location)+"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=510px,width=550px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})();'>ownCloud bookmark</a>
</div>