1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-01-19 15:52:10 +01:00

merge master into navigation

This commit is contained in:
Jan-Christoph Borchardt 2013-02-02 10:50:10 +01:00
commit 3d4cdd4b7f
12 changed files with 120 additions and 32 deletions

View File

@ -10,13 +10,10 @@ input.disabled, input.disabled:hover, input.disabled:focus {
background-color: #ddd;
color: gray;
}
#leftcontent {
top: 4em !important;
}
#rightcontent {
padding-top: 5px;
top: 1em !important;
}
.bookmarks_headline {
@ -36,8 +33,11 @@ input.disabled, input.disabled:hover, input.disabled:focus {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding-top: 3em;
width: 100%;
/* width: 100%; */
height: 100%;
position: fixed;
left: 32.5em;
right:0;
}
#add_form {
@ -292,6 +292,30 @@ li:hover em { display : none; }
.bookmark_single:hover .bookmark_url a[href]{ color:gray; }
.bookmark_url { display: none; }
.bookmark_form_title {
float: left;
width:25%;
}
.bookmark_form_url {
float:left;
width:25%;
}
.bookmark_form_tags {
width:30%;
float:left;
}
.bookmark_form_desc {
width:50%;
}
.bookmark_form_desc textarea {
margin-top:-3.4em;
}
.bookmark_form_title input, .bookmark_form_url input, .bookmark_form_desc textarea {
width: 80%;
}
@ -319,6 +343,7 @@ li:hover em { display : none; }
width: 80%;
box-shadow: 0 1px 1px #FFFFFF, 0 1px 0 #BBBBBB inset;
margin: 3px;
height:6.4em;
}
.bm_view_img .bookmark_actions {
bottom: 0.7em;

30
js/full_tags.php Normal file
View File

@ -0,0 +1,30 @@
<?php
/**
* Copyright (c) 2013 Lukas Reschke <lukas@statuscode.ch>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
// Set the content type to Javascript
header("Content-type: text/javascript");
// Disallow caching
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
$qtags = OC_Bookmarks_Bookmarks::findTags(array(), 0, 400);
$tags = array();
foreach($qtags as $tag) {
$tags[] = $tag['tag'];
}
?>
var fullTags = <?php echo json_encode($tags);?>;
$(document).ready(function() {
$('body').bookmark_dialog({
'on_success': function(){
self.close();
}
});
});

View File

@ -2,6 +2,7 @@
"Bookmarks" => "Предпочитани",
"Save" => "Запис",
"Delete" => "Изтриване",
"Edit" => "Промяна",
"Add" => "Добавяне",
"Settings" => "Настройки"
);

View File

@ -2,11 +2,11 @@
"Unsupported file type for import" => "Az importálandó fájltípus nem támogatott",
"Bookmarks" => "Könyvjelzők",
"Tags" => "Címkék",
"Filter by tag" => "Rendezés címkék szerint",
"Filter by tag" => "Szűrés címkék szerint",
"Edit bookmark" => "Könyvjelző szerkesztése",
"Are you sure you want to remove this tag from every entry?" => "Biztos vagy benne, hogy el szeretnéd távolítani ezt a címkét az összes bejegyzésből?",
"Are you sure you want to remove this tag from every entry?" => "Biztos benne, hogy ezt a címkét el szeretné távolítani az összes bejegyzésből?",
"Warning" => "Figyelmeztetés",
"Import completed successfully." => "Sikeres importálás.",
"Import completed successfully." => "Az importálás sikeresen befejeződött.",
"Uploading..." => "Feltöltés...",
"Bookm." => "Könyvj.",
"Add a bookmark" => "Könyvjelző hozzáadása",
@ -18,16 +18,16 @@
"Delete" => "Törlés",
"Edit" => "Szerkesztés",
"Cancel" => "Mégsem",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Húzd át ezt a böngésződben a Könyvjelzők sávba! Klikkelj rá bármikor, amikor szeretnéd az aktuális weboldal címét ide elmenteni!",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Húzza át ezt a gombot a böngészőprogram \"Könyvjelzők\" sávjába! Ha ezután rákattint, akkor az aktuális weboldal címét ide fogja menteni.",
"Read later" => "Később olvasom",
"Address" => "Cím",
"Add" => "Hozzáad",
"Related Tags" => "Kapcsolódó címkék",
"Settings" => "Beállítások",
"You have no bookmarks" => "Nincsenek könyvjelzőid",
"You can also try to import a bookmark file" => "Akár importálhatsz is egy könyvjelző fájlt",
"You have no bookmarks" => "Nincsenek könyvjelzői",
"You can also try to import a bookmark file" => "Könyvjelzőket tartalmazó állomány is importálható",
"Bookmarklet" => "Könyvjelző",
"Export & Import" => "Export és import",
"Export" => "Exportálás",
"Import" => "Import"
"Import" => "Importálás"
);

View File

@ -1,4 +1,5 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Bookmarks",
"Warning" => "Warnung",
"Close" => "Zoumaachen",
"Save" => "Späicheren",

View File

@ -1,4 +1,9 @@
<?php $TRANSLATIONS = array(
"Save" => "Saglabāt",
"Delete" => "Izdzēst",
"Settings" => "Iestatījumi"
"Edit" => "Rediģēt",
"Cancel" => "Atcelt",
"Settings" => "Iestatījumi",
"Export" => "Eksportēt",
"Import" => "Importēt"
);

View File

@ -1,9 +1,19 @@
<?php $TRANSLATIONS = array(
"Unsupported file type for import" => "Tipul de fișier nu este suportat pentru importări",
"Bookmarks" => "Semne de carte",
"Tags" => "Cuvinte cheie",
"Filter by tag" => "Filtrare după marcaj",
"Edit bookmark" => "Editează semnele de carte",
"Are you sure you want to remove this tag from every entry?" => "Ești sigur că vrei să ștergi acest marcaj din fiecare înscriere",
"Warning" => "Atenție",
"Import completed successfully." => "Importarea a fost completată cu succes",
"Uploading..." => "Încărcăm...",
"Bookm." => "Bookm.",
"Add a bookmark" => "Adaugă semn de carte",
"Close" => "Închide",
"The title of the page" => "Titlul paginii",
"The address of the page" => "Adresa paginii",
"Description of the page" => "Descrierea paginii",
"Save" => "Salvează",
"Delete" => "Șterge",
"Edit" => "Editează",
@ -12,8 +22,12 @@
"Read later" => "Citește mai târziu",
"Address" => "Adresă",
"Add" => "Adaugă",
"Related Tags" => "Marcaje asemănătoare",
"Settings" => "Setări",
"You have no bookmarks" => "Nu ai nici un semn de carte",
"You can also try to import a bookmark file" => "Dvs. de asemenea puteți să încercați importarea unui fișier cu semne de carte",
"Bookmarklet" => "marcator",
"Export & Import" => "Exportează & Importează",
"Export" => "Exportă",
"Import" => "Importă"
);

View File

@ -1,13 +1,18 @@
<?php $TRANSLATIONS = array(
"Unsupported file type for import" => "不支援這種檔案類型的匯入",
"Bookmarks" => "書籤",
"Tags" => "標籤",
"Filter by tag" => "依標籤篩選",
"Edit bookmark" => "編輯書籤",
"Are you sure you want to remove this tag from every entry?" => "您確定要從每個項目中移除這個標籤嗎?",
"Warning" => "警告",
"Import completed successfully." => "匯入成功完成。",
"Uploading..." => "上傳中...",
"Bookm." => "書籤",
"Add a bookmark" => "新增書籤",
"Close" => "關閉",
"The title of the page" => "頁面標題",
"The address of the page" => "頁面的位址",
"Description of the page" => "頁面說明",
"Save" => "儲存",
"Delete" => "刪除",
@ -21,6 +26,7 @@
"Settings" => "設定",
"You have no bookmarks" => "你沒有書籤",
"You can also try to import a bookmark file" => "您也可以匯入書籤檔",
"Bookmarklet" => "Bookmarklet",
"Export & Import" => "匯出與匯入",
"Export" => "匯出",
"Import" => "匯入"

View File

@ -316,14 +316,27 @@ class OC_Bookmarks_Bookmarks{
$_ut = self::getNowValue();
// Change lastmodified date if the record if already exists
$sql = "SELECT id from *PREFIX*bookmarks WHERE url = ? and user_id = ?";
$sql = "SELECT * from *PREFIX*bookmarks WHERE url = ? and user_id = ?";
$query = OCP\DB::prepare($sql, 1);
$result = $query->execute(array($enc_url, OCP\USER::getUser()));
if(count($result) != 0) {
$row = $result->fetchRow();
$sql = "UPDATE *PREFIX*bookmarks SET lastmodified = $_ut WHERE url = ? and user_id = ?";
$params = array();
$title_str = '';
if(trim($title) != '') { // Do we replace the old title
$title_str = ' , title = ?';
$params[] = $title;
}
$desc_str = '';
if(trim($title) != '') { // Do we replace the old description
$desc_str = ' , description = ?';
$params[] = $description;
}
$sql = "UPDATE *PREFIX*bookmarks SET lastmodified = $_ut $title_str $desc_str WHERE url = ? and user_id = ?";
$params[] = $enc_url;
$params[] = OCP\USER::getUser();
$query = OCP\DB::prepare($sql);
$query->execute(array($enc_url, OCP\USER::getUser()));
$query->execute($params);
return $row['id'];
}

View File

@ -1,13 +1,7 @@
<form class="addBm" method="post" action="<?php echo OCP\Util::linkTo('bookmarks', 'ajax/editBookmark.php');?>">
<?php if(!isset($embedded) || !$embedded):?>
<script type="text/javascript">
var fullTags = <?php echo $_['tags'];?>;
$(document).ready(function() {
$('body').bookmark_dialog({
'on_success': function(){ self.close(); }
});
});
</script>
<script type="text/javascript" src="<?php echo OC_Helper::linkTo('bookmarks/js', 'full_tags.php');?>"></script>
<h1><?php echo $l->t('Add a bookmark');?></h1>
<div class="close_btn">
<a href="javascript:self.close()" class="ui-icon ui-icon-closethick">

View File

@ -59,9 +59,8 @@ function bookmarklet(){
</div>
<div class="bookmarks_list"></div>
</div>
<script>
var fullTags = <?php echo $_['tags'];?>;
</script>
<script type="text/javascript" src="<?php echo OC_Helper::linkTo('bookmarks/js', 'full_tags.php');?>"></script>
<script type="text/html" id="edit_dialog_tmpl">
<?php require 'addBm.php';?>

View File

@ -1,7 +1,7 @@
<?php
OC_App::loadApp('bookmarks');
class Test_LibBookmarks_Bookmarks extends UnitTestCase {
class Test_LibBookmarks_Bookmarks extends PHPUnit_Framework_TestCase {
function testAddBM() {
$this->assertCount(0, OC_Bookmarks_Bookmarks::findBookmarks(0, 'id', array(), true, -1));
@ -12,11 +12,11 @@ class Test_LibBookmarks_Bookmarks extends UnitTestCase {
function testFindTags() {
// $uid=uniqid();
$this->assertEqual(OC_Bookmarks_Bookmarks::findTags(), array());
$this->assertEquals(OC_Bookmarks_Bookmarks::findTags(), array());
OC_Bookmarks_Bookmarks::addBookmark(
'http://owncloud.org', 'Owncloud project', array('oc', 'cloud'), 'An Awesome project');
$this->assertEqual(array(0=>array('tag' => 'cloud', 'nbr'=>1), 1=>array('tag' => 'oc', 'nbr'=>1)),
$this->assertEquals(array(0=>array('tag' => 'cloud', 'nbr'=>1), 1=>array('tag' => 'oc', 'nbr'=>1)),
OC_Bookmarks_Bookmarks::findTags());
}