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:
parent
f81072ec20
commit
f50e01a96b
@ -5,9 +5,7 @@
|
|||||||
#firstrun #selections { font-size:0.8em; font-weight: normal; width: 100%; margin: 2em auto auto auto; clear: both; }
|
#firstrun #selections { font-size:0.8em; font-weight: normal; width: 100%; margin: 2em auto auto auto; clear: both; }
|
||||||
|
|
||||||
#leftcontent {
|
#leftcontent {
|
||||||
/* margin: 0; */
|
|
||||||
padding-top: 1em;
|
padding-top: 1em;
|
||||||
/* top: 3.5em !important; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#rightcontent {
|
#rightcontent {
|
||||||
@ -22,7 +20,6 @@
|
|||||||
border: 1px solid lightgray;
|
border: 1px solid lightgray;
|
||||||
border-right:0;
|
border-right:0;
|
||||||
border-radius: 0.5em 0em 0em 0.5em;
|
border-radius: 0.5em 0em 0em 0.5em;
|
||||||
/* margin-right: 10px; */
|
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,8 +43,6 @@
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 6.5em;
|
top: 6.5em;
|
||||||
/* margin-left: 15px; */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#add_url {
|
#add_url {
|
||||||
@ -156,11 +151,9 @@
|
|||||||
}
|
}
|
||||||
.addBm textarea{
|
.addBm textarea{
|
||||||
min-width:250px;
|
min-width:250px;
|
||||||
/* min-height: 70px; */
|
|
||||||
}
|
}
|
||||||
.addBm .close_btn
|
.addBm .close_btn
|
||||||
{
|
{
|
||||||
/* background-color: #EEEEEE; */
|
|
||||||
height: 18px;
|
height: 18px;
|
||||||
margin: -20px 0 0;
|
margin: -20px 0 0;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
@ -178,10 +171,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-autocomplete {
|
|
||||||
/* background: none repeat scroll 0 0 #DEE7F8; */
|
|
||||||
}
|
|
||||||
|
|
||||||
#leftcontent > ul > li, .leftcontent li {
|
#leftcontent > ul > li, .leftcontent li {
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
padding-left:1em;
|
padding-left:1em;
|
||||||
@ -199,8 +188,6 @@
|
|||||||
border-radius: 6px 6px 6px 6px;
|
border-radius: 6px 6px 6px 6px;
|
||||||
color: #555555;
|
color: #555555;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
||||||
/* padding: 0.2em 18px 0.2em 0.5em; */
|
|
||||||
float:left;
|
float:left;
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -236,7 +223,6 @@ li:hover em { display : none; }
|
|||||||
#tag_filter ul.tagit li.tagit-choice {
|
#tag_filter ul.tagit li.tagit-choice {
|
||||||
background: none repeat scroll 0 0 #DEE7F8;
|
background: none repeat scroll 0 0 #DEE7F8;
|
||||||
padding: 0.2em 18px 0.2em 0.5em;
|
padding: 0.2em 18px 0.2em 0.5em;
|
||||||
/* padding:0; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#tag_filter a {
|
#tag_filter a {
|
||||||
@ -268,8 +254,6 @@ li:hover em { display : none; }
|
|||||||
float: left;
|
float: left;
|
||||||
height: 240px;
|
height: 240px;
|
||||||
margin: 1em;
|
margin: 1em;
|
||||||
|
|
||||||
/* background: none repeat scroll 0 0 #EEEEEE; */
|
|
||||||
border-radius: 8px 8px 8px 8px;
|
border-radius: 8px 8px 8px 8px;
|
||||||
box-shadow: 0 0 5px rgba(34, 25, 25, 0.5);
|
box-shadow: 0 0 5px rgba(34, 25, 25, 0.5);
|
||||||
}
|
}
|
||||||
@ -349,6 +333,7 @@ li:hover em { display : none; }
|
|||||||
width: 20em;
|
width: 20em;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#leftcontent #bookmark_settings li{
|
#leftcontent #bookmark_settings li{
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background-color:transparent;
|
background-color:transparent;
|
||||||
@ -358,16 +343,43 @@ li:hover em { display : none; }
|
|||||||
}
|
}
|
||||||
|
|
||||||
#bookmark_settings .controls {
|
#bookmark_settings .controls {
|
||||||
height: 100%;
|
height: 2.8em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#bookmark_settings .controls > li:last-child button {
|
#bookmark_settings .controls > li:last-child button {
|
||||||
margin-right: 0.3em;
|
margin-right: 0.3em;
|
||||||
}
|
}
|
||||||
#bookmark_settings button {
|
#bookmark_settings .controls button {
|
||||||
height: 2.4em;
|
height: 2.4em;
|
||||||
margin: 0.15em 0 0 0.15em;
|
margin: 0.15em 0 0 0.15em;
|
||||||
padding: 0.2em 0.1em 0;
|
padding: 0.2em 0.1em 0;
|
||||||
width: 2.4em;
|
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;
|
||||||
|
}
|
@ -29,6 +29,7 @@ OCP\App::checkAppEnabled('bookmarks');
|
|||||||
|
|
||||||
OCP\App::setActiveNavigationEntry( 'bookmarks_index' );
|
OCP\App::setActiveNavigationEntry( 'bookmarks_index' );
|
||||||
|
|
||||||
|
OCP\Util::addscript('bookmarks', 'settings');
|
||||||
OCP\Util::addscript('bookmarks', 'bookmarks');
|
OCP\Util::addscript('bookmarks', 'bookmarks');
|
||||||
OCP\Util::addStyle('bookmarks', 'bookmarks');
|
OCP\Util::addStyle('bookmarks', 'bookmarks');
|
||||||
OCP\Util::addscript('bookmarks', 'addBm');
|
OCP\Util::addscript('bookmarks', 'addBm');
|
||||||
|
@ -9,13 +9,13 @@ $(document).ready(function() {
|
|||||||
$('.centercontent').click(clickSideBar);
|
$('.centercontent').click(clickSideBar);
|
||||||
$('#view_type input').click(clickSwitchView);
|
$('#view_type input').click(clickSwitchView);
|
||||||
$('#bookmark_add_submit').click(addBookmark);
|
$('#bookmark_add_submit').click(addBookmark);
|
||||||
|
|
||||||
|
// $('#bm_import_submit').click(attachSettingEvent);
|
||||||
|
$('#bm_import').change(attachSettingEvent);
|
||||||
$('#settingsbtn').on('click keydown', function() {
|
$('#settingsbtn').on('click keydown', function() {
|
||||||
try {
|
$('#bookmark_settings').toggleClass('open');
|
||||||
OC.appSettings({appid:'bookmarks', loadJS:true, cache:false});
|
|
||||||
} catch(e) {
|
|
||||||
alert(e);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
$('#bm_export').click(exportBm);
|
||||||
|
|
||||||
$(window).resize(function () {
|
$(window).resize(function () {
|
||||||
fillWindow($('.bookmarks_list'));
|
fillWindow($('.bookmarks_list'));
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
$(document).ready(function() {
|
|
||||||
$('#bm_import_submit').click(attachSettingEvent);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function attachSettingEvent(event) {
|
function attachSettingEvent(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
fileUpload($(this).closest('form'), $('#upload'));
|
fileUpload($(this).closest('form'), $('#upload'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exportBm(e) {
|
||||||
|
window.location = $(this).attr('href');
|
||||||
|
}
|
||||||
|
|
||||||
function fileUpload(form, result_div) {
|
function fileUpload(form, result_div) {
|
||||||
|
|
||||||
var uploadEventHandler = function () {
|
var uploadEventHandler = function () {
|
||||||
|
12
settings.php
12
settings.php
@ -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();
|
|
@ -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>';
|
|
||||||
}
|
|
@ -40,6 +40,9 @@
|
|||||||
alt="<?php echo $l->t('Settings'); ?>" /></button>
|
alt="<?php echo $l->t('Settings'); ?>" /></button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<div id="bm_setting_panel">
|
||||||
|
<?php require 'settings.php';?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -48,9 +51,9 @@
|
|||||||
<div id="firstrun" style="display: none;">
|
<div id="firstrun" style="display: none;">
|
||||||
<?php
|
<?php
|
||||||
echo $l->t('You have no bookmarks');
|
echo $l->t('You have no bookmarks');
|
||||||
$embedded = true;
|
$embedded = true;/*
|
||||||
require_once OC_App::getAppPath('bookmarks') .'/templates/bookmarklet.php' ;
|
require_once OC_App::getAppPath('bookmarks') .'/templates/bookmarklet.php' ;
|
||||||
createBookmarklet();
|
createBookmarklet(); */
|
||||||
?>
|
?>
|
||||||
<div id="appsettings" class="popup bottomleft hidden"></div>
|
<div id="appsettings" class="popup bottomleft hidden"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,11 +8,16 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<fieldset class="personalblock">
|
<fieldset class="personalblock">
|
||||||
<legend><strong><?php echo $l->t('Bookmarklet <br />');?></strong></legend>
|
<legend><strong><?php echo $l->t('Bookmarklet');?></strong></legend>
|
||||||
<?php
|
<small>
|
||||||
require_once 'bookmarklet.php';
|
<?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:');?>
|
||||||
createBookmarklet();
|
</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>
|
</fieldset>
|
||||||
|
|
||||||
<form id="import_bookmark" action="<?php echo OCP\Util::linkTo( "bookmarks", "ajax/import.php" );?>"
|
<form id="import_bookmark" action="<?php echo OCP\Util::linkTo( "bookmarks", "ajax/import.php" );?>"
|
||||||
@ -23,16 +28,13 @@
|
|||||||
<p><?php echo $_['error']['hint']; ?></p>
|
<p><?php echo $_['error']['hint']; ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<legend><strong><?php echo $l->t('Import bookmarks');?></strong></legend>
|
<legend><strong><?php echo $l->t('Export & Import');?></strong></legend>
|
||||||
<p><input type="file" id="bm_import" name="bm_import" style="width:280px;">
|
<input type="button" id="bm_export" href="<?php echo OCP\Util::linkTo('bookmarks', 'export.php') ;?>" value="<?php echo $l->t('Export'); ?>" />
|
||||||
<label for="bm_import"> <?php echo $l->t('html bookmarks file');?></label>
|
<input type="file" id="bm_import" name="bm_import">
|
||||||
</p>
|
<button type="button" name="bm_import_btn" id="bm_import_submit"><?php echo $l->t('Import'); ?></button>
|
||||||
<input type="button" name="bm_import_btn" id="bm_import_submit" value="<?php echo $l->t('Import'); ?>" />
|
|
||||||
<div id="upload"></div>
|
<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>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user