From e78fc2baa08543bdd6d3b59be6e7d14bb53b5e7e Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 6 Nov 2012 23:52:14 +0000 Subject: [PATCH] Bookmark: Display bmlet if there is not bookmarks yet fix #136 --- css/bookmarks.css | 6 +++--- js/bookmarks.js | 7 +++++-- templates/list.php | 20 ++++++++++++++------ templates/settings.php | 10 +--------- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/css/bookmarks.css b/css/bookmarks.css index 618d419c..c2acb06c 100644 --- a/css/bookmarks.css +++ b/css/bookmarks.css @@ -1,9 +1,9 @@ #content { overflow: auto; height: 100%; } -#firstrun { width: 80%; margin: 5em auto auto auto; text-align: center; font-weight:bold; font-size:1.5em; color:#777; position: relative;} -#firstrun small { display: block; font-weight: normal; font-size: 0.5em; margin-bottom: 1.5em; } +#firstrun, #firstrun_setting{ width: 80%; margin: 5em auto auto auto; text-align: center; font-weight:bold; font-size:1.5em; color:#777; position: relative;} +#firstrun small { display: block; font-weight: normal; font-size: 0.5em; } #firstrun .button { font-size: 0.7em; } #firstrun #selections { font-size:0.8em; font-weight: normal; width: 100%; margin: 2em auto auto auto; clear: both; } - +#firstrun_setting { font-size: 100%; text-decoration: underline} input.disabled, input.disabled:hover { cursor: not-allowed; diff --git a/js/bookmarks.js b/js/bookmarks.js index b7427353..f0713a0f 100644 --- a/js/bookmarks.js +++ b/js/bookmarks.js @@ -9,8 +9,11 @@ $(document).ready(function() { $('#add_url').on('keydown keyup change click', watchUrlField); $('#settingsbtn').on('click keydown', toggleSettings); $('#bm_export').click(exportBm); - - $(window).resize(); + $('#firstrun_setting').click(function(){ + if(! $('#bookmark_settings').hasClass('open')){ + $('#settingsbtn').click(); + } + }); $('.bookmarks_list').scroll(updateOnBottom).empty(); $('#tag_filter input').tagit({ allowSpaces: true, diff --git a/templates/list.php b/templates/list.php index 079d49c1..2aeeab55 100644 --- a/templates/list.php +++ b/templates/list.php @@ -6,6 +6,14 @@ * later. * See the COPYING-README file. */ +function bookmarklet(){ + $l = new OC_l10n('bookmarks'); + $blet = "javascript:(function(){var a=window,b=document,c=encodeURIComponent,e=document.title,d=a.open('"; + $blet .= OCP\Util::linkToAbsolute('bookmarks', 'addBm.php'); + $blet .= "?output=popup&url='+c(b.location)+'&title='+e,'bkmk_popup','left='+((a.screenX||a.screenLeft)+10)+',top='+((a.screenY||a.screenTop)+10)+',height=400px,width=550px,resizable=1,alwaysRaised=1');a.setTimeout(function(){d.focus()},300);})();"; + $help_msg = $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:'); + return ''.$help_msg.'
' . $l->t('Read later') . ''; +} ?>
@@ -39,15 +47,15 @@
-