1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2024-12-01 05:24:11 +01:00

Bookmark: simplify settings and implement hide&show button. ref #51

This commit is contained in:
Brice Maron 2012-11-03 21:46:42 +00:00
parent f81072ec20
commit f50e01a96b
8 changed files with 69 additions and 71 deletions

View File

@ -5,9 +5,7 @@
#firstrun #selections { font-size:0.8em; font-weight: normal; width: 100%; margin: 2em auto auto auto; clear: both; }
#leftcontent {
/* margin: 0; */
padding-top: 1em;
/* top: 3.5em !important; */
}
#rightcontent {
@ -22,7 +20,6 @@
border: 1px solid lightgray;
border-right:0;
border-radius: 0.5em 0em 0em 0.5em;
/* margin-right: 10px; */
padding: 3px;
}
@ -46,8 +43,6 @@
overflow: auto;
position: fixed;
top: 6.5em;
/* margin-left: 15px; */
}
#add_url {
@ -156,11 +151,9 @@
}
.addBm textarea{
min-width:250px;
/* min-height: 70px; */
}
.addBm .close_btn
{
/* background-color: #EEEEEE; */
height: 18px;
margin: -20px 0 0;
padding: 1px;
@ -178,10 +171,6 @@
}
.ui-autocomplete {
/* background: none repeat scroll 0 0 #DEE7F8; */
}
#leftcontent > ul > li, .leftcontent li {
padding: 0.2em;
padding-left:1em;
@ -199,8 +188,6 @@
border-radius: 6px 6px 6px 6px;
color: #555555;
font-weight: normal;
/* padding: 0.2em 18px 0.2em 0.5em; */
float:left;
padding: 0.3em;
position: relative;
@ -236,7 +223,6 @@ li:hover em { display : none; }
#tag_filter ul.tagit li.tagit-choice {
background: none repeat scroll 0 0 #DEE7F8;
padding: 0.2em 18px 0.2em 0.5em;
/* padding:0; */
}
#tag_filter a {
@ -268,8 +254,6 @@ li:hover em { display : none; }
float: left;
height: 240px;
margin: 1em;
/* background: none repeat scroll 0 0 #EEEEEE; */
border-radius: 8px 8px 8px 8px;
box-shadow: 0 0 5px rgba(34, 25, 25, 0.5);
}
@ -349,6 +333,7 @@ li:hover em { display : none; }
width: 20em;
z-index: 2;
}
#leftcontent #bookmark_settings li{
padding: 0;
background-color:transparent;
@ -358,16 +343,43 @@ li:hover em { display : none; }
}
#bookmark_settings .controls {
height: 100%;
height: 2.8em;
width: 100%;
}
#bookmark_settings .controls > li:last-child button {
margin-right: 0.3em;
}
#bookmark_settings button {
#bookmark_settings .controls button {
height: 2.4em;
margin: 0.15em 0 0 0.15em;
padding: 0.2em 0.1em 0;
width: 2.4em;
}
#bookmark_settings.open {
height: 300px;
}
#bm_setting_panel {
background-color: white;
padding: 1em;
height: 100%;
display:none;
}
.open #bm_setting_panel { display:block; }
#bm_setting_panel legend{
margin-top: 0.5em;
}
#bm_import {
opacity: 0;
position: absolute;
}
#import_bookmark .personalblock {
margin-top: 1em;
}
#leftcontent a.bookmarklet {
margin-top: 5px;
padding: 0 5px 2px;
}

View File

@ -29,6 +29,7 @@ OCP\App::checkAppEnabled('bookmarks');
OCP\App::setActiveNavigationEntry( 'bookmarks_index' );
OCP\Util::addscript('bookmarks', 'settings');
OCP\Util::addscript('bookmarks', 'bookmarks');
OCP\Util::addStyle('bookmarks', 'bookmarks');
OCP\Util::addscript('bookmarks', 'addBm');

View File

@ -9,13 +9,13 @@ $(document).ready(function() {
$('.centercontent').click(clickSideBar);
$('#view_type input').click(clickSwitchView);
$('#bookmark_add_submit').click(addBookmark);
// $('#bm_import_submit').click(attachSettingEvent);
$('#bm_import').change(attachSettingEvent);
$('#settingsbtn').on('click keydown', function() {
try {
OC.appSettings({appid:'bookmarks', loadJS:true, cache:false});
} catch(e) {
alert(e);
}
$('#bookmark_settings').toggleClass('open');
});
$('#bm_export').click(exportBm);
$(window).resize(function () {
fillWindow($('.bookmarks_list'));

View File

@ -1,12 +1,12 @@
$(document).ready(function() {
$('#bm_import_submit').click(attachSettingEvent);
});
function attachSettingEvent(event) {
event.preventDefault();
fileUpload($(this).closest('form'), $('#upload'));
}
function exportBm(e) {
window.location = $(this).attr('href');
}
function fileUpload(form, result_div) {
var uploadEventHandler = function () {

View File

@ -1,12 +0,0 @@
<?php
/**
* Copyright (c) 2011 Marvin Thomas Rabe <mrabe@marvinrabe.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
OCP\App::checkAppEnabled('bookmarks');
$tmpl = new OCP\Template('bookmarks', 'settings');
$tmpl->printPage();

View File

@ -1,8 +0,0 @@
<?php
function createBookmarklet() {
$l = OC_L10N::get('bookmarks');
echo '<small>' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . '</small><br />'
. '<a class="button bookmarklet" href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,e=document.title,d=a.open(\'' . OCP\Util::linkToAbsolute('bookmarks', 'addBm.php') . '?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);})();">'
. $l->t('Read later') . '</a>';
}

View File

@ -33,14 +33,17 @@
<div id="bookmark_settings">
<ul class="controls">
<li style="float: right">
<button id="settingsbtn" title="<?php echo $l->t('Settings'); ?>">
<img class="svg" src="<?php echo OCP\Util::imagePath('core', 'actions/settings.png'); ?>"
alt="<?php echo $l->t('Settings'); ?>" /></button>
</li>
</ul>
<ul class="controls">
<li style="float: right">
<button id="settingsbtn" title="<?php echo $l->t('Settings'); ?>">
<img class="svg" src="<?php echo OCP\Util::imagePath('core', 'actions/settings.png'); ?>"
alt="<?php echo $l->t('Settings'); ?>" /></button>
</li>
</ul>
<div id="bm_setting_panel">
<?php require 'settings.php';?>
</div>
</div>
</div>
<div id="rightcontent" class="rightcontent">
@ -48,9 +51,9 @@
<div id="firstrun" style="display: none;">
<?php
echo $l->t('You have no bookmarks');
$embedded = true;
$embedded = true;/*
require_once OC_App::getAppPath('bookmarks') .'/templates/bookmarklet.php' ;
createBookmarklet();
createBookmarklet(); */
?>
<div id="appsettings" class="popup bottomleft hidden"></div>
</div>

View File

@ -8,11 +8,16 @@
?>
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('Bookmarklet <br />');?></strong></legend>
<?php
require_once 'bookmarklet.php';
createBookmarklet();
?>
<legend><strong><?php echo $l->t('Bookmarklet');?></strong></legend>
<small>
<?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:');?>
</small><br />
<a class="button bookmarklet"
href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,e=document.title,d=a.open('<?php
echo OCP\Util::linkToAbsolute('bookmarks', 'addBm.php');
?>'?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);})();">
<?php echo $l->t('Read later');?>
</a>
</fieldset>
<form id="import_bookmark" action="<?php echo OCP\Util::linkTo( "bookmarks", "ajax/import.php" );?>"
@ -23,16 +28,13 @@
<p><?php echo $_['error']['hint']; ?></p>
<?php endif; ?>
<legend><strong><?php echo $l->t('Import bookmarks');?></strong></legend>
<p><input type="file" id="bm_import" name="bm_import" style="width:280px;">
<label for="bm_import"> <?php echo $l->t('html bookmarks file');?></label>
</p>
<input type="button" name="bm_import_btn" id="bm_import_submit" value="<?php echo $l->t('Import'); ?>" />
<div id="upload"></div>
<legend><strong><?php echo $l->t('Export & Import');?></strong></legend>
<input type="button" id="bm_export" href="<?php echo OCP\Util::linkTo('bookmarks', 'export.php') ;?>" value="<?php echo $l->t('Export'); ?>" />
<input type="file" id="bm_import" name="bm_import">
<button type="button" name="bm_import_btn" id="bm_import_submit"><?php echo $l->t('Import'); ?></button>
<div id="upload"></div>
<legend><strong><?php echo $l->t('Export bookmarks');?></strong></legend>
<p><a href="<?php echo OCP\Util::linkTo('bookmarks', 'export.php') ;?>"
class="button"><?php echo $l->t('Export'); ?></a></p>
</fieldset>
</form>