aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-02-19 20:18:27 -0500
committerAlessandro Cosentino <cosenal@gmail.com>2012-02-19 20:18:27 -0500
commit490c9db15da89797eea5c3e30fc9a0790bd60b32 (patch)
treeb431679301f76d46d8fbe387475e48591490c46b
parent9d2379742b92b223dd2cc171e6a155533cabc889 (diff)
downloadnextcloud-server-490c9db15da89797eea5c3e30fc9a0790bd60b32.tar.gz
nextcloud-server-490c9db15da89797eea5c3e30fc9a0790bd60b32.zip
Added bookmarklet for browser. Inspired by Google Bookmarks
-rw-r--r--apps/bookmarks/addBm.php3
-rw-r--r--apps/bookmarks/css/bookmarks.css15
-rw-r--r--apps/bookmarks/templates/list.php6
3 files changed, 21 insertions, 3 deletions
diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php
index 62ad5821dbf..f56022c42c2 100644
--- a/apps/bookmarks/addBm.php
+++ b/apps/bookmarks/addBm.php
@@ -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();
diff --git a/apps/bookmarks/css/bookmarks.css b/apps/bookmarks/css/bookmarks.css
index 48f0bede110..8dfdc8a07b9 100644
--- a/apps/bookmarks/css/bookmarks.css
+++ b/apps/bookmarks/css/bookmarks.css
@@ -83,4 +83,17 @@
.loading_meta {
display: none;
margin-left: 5px;
-} \ No newline at end of file
+}
+
+#footer {
+ color: #999;
+ font-size: medium;
+ text-align: center;
+ position: absolute;
+ bottom: 10px;
+ left: 0px;
+ width: 100%;
+ height: 20px;
+ visibility: visible;
+ display: block
+}
diff --git a/apps/bookmarks/templates/list.php b/apps/bookmarks/templates/list.php
index ccfe74f008f..d44a0ecbcdb 100644
--- a/apps/bookmarks/templates/list.php
+++ b/apps/bookmarks/templates/list.php
@@ -22,4 +22,8 @@
</div>
<div class="bookmarks_list">
<?php echo $l->t('You have no bookmarks'); ?>
-</div> \ No newline at end of file
+</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>