diff --git a/3rdparty/css/jquery.tagit.css b/3rdparty/css/jquery.tagit.css new file mode 100644 index 00000000..1e7e0239 --- /dev/null +++ b/3rdparty/css/jquery.tagit.css @@ -0,0 +1,110 @@ +ul.tagit { + padding: 1px 5px; + overflow: auto; + margin-left: inherit; /* usually we don't want the regular ul margins. */ + margin-right: inherit; +} +ul.tagit li { + display: block; + float: left; + margin: 2px 5px 2px 0; +} +ul.tagit li.tagit-choice { + padding: .2em 18px .2em .5em; + position: relative; + line-height: inherit; +} +ul.tagit li.tagit-new { + padding: .25em 4px .25em 0; +} + +ul.tagit li.tagit-choice a.tagit-label { + cursor: pointer; + text-decoration: none; +} +ul.tagit li.tagit-choice .close { + cursor: pointer; + position: absolute; + right: .1em; + top: 50%; + margin-top: -8px; +} + +/* used for some custom themes that don't need image icons */ +ul.tagit li.tagit-choice .close .text-icon { + display: none; +} + +ul.tagit li.tagit-choice input { + display: block; + float: left; + margin: 2px 5px 2px 0; +} +ul.tagit input[type="text"] { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + + border: none; + margin: 0; + padding: 0; + width: inherit; + background-color: inherit; + outline: none; +} + + +/***** ZENDESK ***/ + +/* Optional scoped theme for tag-it which mimics the zendesk widget. */ + + +ul.tagit { + border-style: solid; + border-width: 1px; + border-color: #C6C6C6; + background: inherit; +} +ul.tagit li.tagit-choice { + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-border-radius: 6px; + border: 1px solid #CAD8F3; + + background: none; + background-color: #DEE7F8; + + color: #555; + font-weight: normal; +} +ul.tagit li.tagit-choice a.close { + text-decoration: none; +} +ul.tagit li.tagit-choice .close { + right: .4em; +} +ul.tagit li.tagit-choice .ui-icon { + display: none; +} +ul.tagit li.tagit-choice .close .text-icon { + display: inline; + font-family: arial, sans-serif; + font-size: 16px; + line-height: 16px; + color: #777; +} +ul.tagit li.tagit-choice:hover, ul.tagit li.tagit-choice.remove { + background-color: #bbcef1; + border-color: #6d95e0; +} +ul.tagit li.tagit-choice a.tagLabel:hover, +ul.tagit li.tagit-choice a.close .text-icon:hover { + color: #222; +} +ul.tagit input[type="text"] { + color: #333333; + background: none; +} + + + diff --git a/3rdparty/js/js_tpl.js b/3rdparty/js/js_tpl.js new file mode 100644 index 00000000..7e987fee --- /dev/null +++ b/3rdparty/js/js_tpl.js @@ -0,0 +1,36 @@ + +// Simple JavaScript Templating +// John Resig - http://ejohn.org/ - MIT Licensed +(function(){ + var cache = {}; + + this.tmpl = function tmpl(str, data){ + // Figure out if we're getting a template, or if we need to + // load the template - and be sure to cache the result. + var fn = !/\W/.test(str) ? + cache[str] = cache[str] || + tmpl(document.getElementById(str).innerHTML) : + + // Generate a reusable function that will serve as a template + // generator (and which will be cached). + new Function("obj", + "var p=[],print=function(){p.push.apply(p,arguments);};" + + + // Introduce the data as local variables using with(){} + "with(obj){p.push('" + + + // Convert the template into pure JavaScript + str + .replace(/[\r\t\n]/g, " ") + .split("<%").join("\t") + .replace(/((^|%>)[^\t]*)'/g, "$1\r") + .replace(/\t=(.*?)%>/g, "',$1,'") + .split("\t").join("');") + .split("%>").join("p.push('") + .split("\r").join("\\'") + + "');}return p.join('');"); + + // Provide some basic currying to the user + return data ? fn( data ) : fn; + }; +})(); diff --git a/3rdparty/js/tag-it.js b/3rdparty/js/tag-it.js new file mode 100644 index 00000000..7331ac28 --- /dev/null +++ b/3rdparty/js/tag-it.js @@ -0,0 +1,376 @@ +/* +* jQuery UI Tag-it! +* +* @version v2.0 (06/2011) +* +* Copyright 2011, Levy Carneiro Jr. +* Released under the MIT license. +* http://aehlke.github.com/tag-it/LICENSE +* +* Homepage: +* http://aehlke.github.com/tag-it/ +* +* Authors: +* Levy Carneiro Jr. +* Martin Rehfeld +* Tobias Schmidt +* Skylar Challand +* Alex Ehlke +* +* Maintainer: +* Alex Ehlke - Twitter: @aehlke +* +* Dependencies: +* jQuery v1.4+ +* jQuery UI v1.8+ +*/ +(function($) { + + $.widget('ui.tagit', { + options: { + itemName : 'item', + fieldName : 'tags', + availableTags : [], + tagSource : null, + removeConfirmation: false, + caseSensitive : true, + + // When enabled, quotes are not neccesary + // for inputting multi-word tags. + allowSpaces: false, + + // The below options are for using a single field instead of several + // for our form values. + // + // When enabled, will use a single hidden field for the form, + // rather than one per tag. It will delimit tags in the field + // with singleFieldDelimiter. + // + // The easiest way to use singleField is to just instantiate tag-it + // on an INPUT element, in which case singleField is automatically + // set to true, and singleFieldNode is set to that element. This + // way, you don't need to fiddle with these options. + singleField: false, + + singleFieldDelimiter: ',', + + // Set this to an input DOM node to use an existing form field. + // Any text in it will be erased on init. But it will be + // populated with the text of tags as they are created, + // delimited by singleFieldDelimiter. + // + // If this is not set, we create an input node for it, + // with the name given in settings.fieldName, + // ignoring settings.itemName. + singleFieldNode: null, + + // Optionally set a tabindex attribute on the input that gets + // created for tag-it. + tabIndex: null, + + + // Event callbacks. + onTagAdded : null, + onTagRemoved: null, + onTagClicked: null + }, + + + _create: function() { + // for handling static scoping inside callbacks + var that = this; + + // There are 2 kinds of DOM nodes this widget can be instantiated on: + // 1. UL, OL, or some element containing either of these. + // 2. INPUT, in which case 'singleField' is overridden to true, + // a UL is created and the INPUT is hidden. + if (this.element.is('input')) { + this.tagList = $('').insertAfter(this.element); + this.options.singleField = true; + this.options.singleFieldNode = this.element; + this.element.css('display', 'none'); + } else { + this.tagList = this.element.find('ul, ol').andSelf().last(); + } + + this._tagInput = $('').addClass('ui-widget-content'); + if (this.options.tabIndex) { + this._tagInput.attr('tabindex', this.options.tabIndex); + } + + this.options.tagSource = this.options.tagSource || function(search, showChoices) { + var filter = search.term.toLowerCase(); + var choices = $.grep(that.options.availableTags, function(element) { + // Only match autocomplete options that begin with the search term. + // (Case insensitive.) + return (element.toLowerCase().indexOf(filter) === 0); + }); + showChoices(that._subtractArray(choices, that.assignedTags())); + }; + + this.tagList + .addClass('tagit') + .addClass('ui-widget ui-widget-content ui-corner-all') + // Create the input field. + .append($('
  • ').append(this._tagInput)) + .click(function(e) { + var target = $(e.target); + if (target.hasClass('tagit-label')) { + that._trigger('onTagClicked', e, target.closest('.tagit-choice')); + } else { + // Sets the focus() to the input field, if the user + // clicks anywhere inside the UL. This is needed + // because the input field needs to be of a small size. + that._tagInput.focus(); + } + }); + + // Add existing tags from the list, if any. + this.tagList.children('li').each(function() { + if (!$(this).hasClass('tagit-new')) { + that.createTag($(this).html(), $(this).attr('class')); + $(this).remove(); + } + }); + + // Single field support. + if (this.options.singleField) { + if (this.options.singleFieldNode) { + // Add existing tags from the input field. + var node = $(this.options.singleFieldNode); + var tags = node.val().split(this.options.singleFieldDelimiter); + node.val(''); + $.each(tags, function(index, tag) { + that.createTag(tag); + }); + } else { + // Create our single field input after our list. + this.options.singleFieldNode = this.tagList.after(''); + } + } + + // Events. + this._tagInput + .keydown(function(event) { + // Backspace is not detected within a keypress, so it must use keydown. + if (event.which == $.ui.keyCode.BACKSPACE && that._tagInput.val() === '') { + var tag = that._lastTag(); + if (!that.options.removeConfirmation || tag.hasClass('remove')) { + // When backspace is pressed, the last tag is deleted. + that.removeTag(tag); + } else if (that.options.removeConfirmation) { + tag.addClass('remove ui-state-highlight'); + } + } else if (that.options.removeConfirmation) { + that._lastTag().removeClass('remove ui-state-highlight'); + } + + // Comma/Space/Enter are all valid delimiters for new tags, + // except when there is an open quote or if setting allowSpaces = true. + // Tab will also create a tag, unless the tag input is empty, in which case it isn't caught. + if ( + event.which == $.ui.keyCode.COMMA || + event.which == $.ui.keyCode.ENTER || + ( + event.which == $.ui.keyCode.TAB && + that._tagInput.val() !== '' + ) || + ( + event.which == $.ui.keyCode.SPACE && + that.options.allowSpaces !== true && + ( + $.trim(that._tagInput.val()).replace( /^s*/, '' ).charAt(0) != '"' || + ( + $.trim(that._tagInput.val()).charAt(0) == '"' && + $.trim(that._tagInput.val()).charAt($.trim(that._tagInput.val()).length - 1) == '"' && + $.trim(that._tagInput.val()).length - 1 !== 0 + ) + ) + ) + ) { + event.preventDefault(); + that.createTag(that._cleanedInput()); + + // The autocomplete doesn't close automatically when TAB is pressed. + // So let's ensure that it closes. + that._tagInput.autocomplete('close'); + } + }).blur(function(e){ + //If autocomplete is enabled and suggestion was clicked, don't add it + if (that.options.tagSource && that._tagInput.data('autocomplete-open')) { + that._cleanedInput(); + } else { + that.createTag(that._cleanedInput()); + } + }); + + + // Autocomplete. + if (this.options.availableTags || this.options.tagSource) { + this._tagInput.autocomplete({ + source: this.options.tagSource, + open: function(){that._tagInput.data('autocomplete-open', true)}, + close: function(){that._tagInput.data('autocomplete-open', false)}, + select: function(event, ui) { + that.createTag(ui.item.value); + // Preventing the tag input to be updated with the chosen value. + return false; + } + }); + } + }, + + _cleanedInput: function() { + // Returns the contents of the tag input, cleaned and ready to be passed to createTag + return $.trim(this._tagInput.val().replace(/^"(.*)"$/, '$1')); + }, + + _lastTag: function() { + return this.tagList.children('.tagit-choice:last'); + }, + + assignedTags: function() { + // Returns an array of tag string values + var that = this; + var tags = []; + if (this.options.singleField) { + tags = $(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter); + if (tags[0] === '') { + tags = []; + } + } else { + this.tagList.children('.tagit-choice').each(function() { + tags.push(that.tagLabel(this)); + }); + } + return tags; + }, + + _updateSingleTagsField: function(tags) { + // Takes a list of tag string values, updates this.options.singleFieldNode.val to the tags delimited by this.options.singleFieldDelimiter + $(this.options.singleFieldNode).val(tags.join(this.options.singleFieldDelimiter)); + }, + + _subtractArray: function(a1, a2) { + var result = []; + for (var i = 0; i < a1.length; i++) { + if ($.inArray(a1[i], a2) == -1) { + result.push(a1[i]); + } + } + return result; + }, + + tagLabel: function(tag) { + // Returns the tag's string label. + if (this.options.singleField) { + return $(tag).children('.tagit-label').text(); + } else { + return $(tag).children('input').val(); + } + }, + + _isNew: function(value) { + var that = this; + var isNew = true; + this.tagList.children('.tagit-choice').each(function(i) { + if (that._formatStr(value) == that._formatStr(that.tagLabel(this))) { + isNew = false; + return; + } + }); + return isNew; + }, + + _formatStr: function(str) { + if (this.options.caseSensitive) { + return str; + } + return $.trim(str.toLowerCase()); + }, + + createTag: function(value, additionalClass) { + that = this; + // Automatically trims the value of leading and trailing whitespace. + value = $.trim(value); + + if (!this._isNew(value) || value === '') { + return false; + } + + var label = $(this.options.onTagClicked ? '' : '').text(value); + + // Create tag. + var tag = $('
  • ') + .addClass('tagit-choice ui-widget-content ui-state-default ui-corner-all') + .addClass(additionalClass) + .append(label); + + // Button for removing the tag. + var removeTagIcon = $('') + .addClass('ui-icon ui-icon-close'); + var removeTag = $('\xd7') // \xd7 is an X + .addClass('close') + .append(removeTagIcon) + .click(function(e) { + // Removes a tag when the little 'x' is clicked. + that.removeTag(tag); + }); + tag.append(removeTag); + + // Unless options.singleField is set, each tag has a hidden input field inline. + if (this.options.singleField) { + var tags = this.assignedTags(); + tags.push(value); + this._updateSingleTagsField(tags); + } else { + var escapedValue = label.html(); + tag.append(''); + } + + this._trigger('onTagAdded', null, tag); + + // Cleaning the input. + this._tagInput.val(''); + + // insert tag + this._tagInput.parent().before(tag); + }, + + removeTag: function(tag, animate) { + if (typeof animate === 'undefined') { animate = true; } + + tag = $(tag); + + this._trigger('onTagRemoved', null, tag); + + if (this.options.singleField) { + var tags = this.assignedTags(); + var removedTagLabel = this.tagLabel(tag); + tags = $.grep(tags, function(el){ + return el != removedTagLabel; + }); + this._updateSingleTagsField(tags); + } + // Animate the removal. + if (animate) { + tag.fadeOut('fast').hide('blind', {direction: 'horizontal'}, 'fast', function(){ + tag.remove(); + }).dequeue(); + } else { + tag.remove(); + } + this._trigger('onTagFinishRemoved', null, tag); + }, + + removeAll: function() { + // Removes all tags. Takes an optional `animate` argument. + var that = this; + this.tagList.children('.tagit-choice').each(function(index, tag) { + that.removeTag(tag, false); + }); + } + + }); + +})(jQuery); \ No newline at end of file diff --git a/addBm.php b/addBm.php index 336e2d40..f56ebb4f 100644 --- a/addBm.php +++ b/addBm.php @@ -28,6 +28,44 @@ OCP\User::checkLoggedIn(); OCP\App::checkAppEnabled('bookmarks'); require_once 'bookmarksHelper.php'; -addBookmark($_GET['url'], '', 'Read-Later'); -include 'templates/addBm.php'; +// Prep screen if we come from the bookmarklet +$url =''; +if(isset($_GET['url'])) { + $url = $_GET['url']; +} +if(!isset($_GET['title']) || trim($_GET['title']) == '') { + $datas = getURLMetadata($url); + $title = isset($datas['title']) ? $datas['title'] : ''; +} +else{ + $title = $_GET['title']; +} + + +OCP\Util::addscript('bookmarks/3rdparty', 'tag-it'); +OCP\Util::addscript('bookmarks', 'addBm'); +OCP\Util::addStyle('bookmarks', 'bookmarks'); +OCP\Util::addStyle('bookmarks/3rdparty', 'jquery.tagit'); + + + +$bm = array('title'=> $title, + 'url'=> $url, + 'tags'=> array(), + 'desc'=>'', + 'is_public'=>0, +); + +//Find All Tags +$qtags = OC_Bookmarks_Bookmarks::findTags(); +$tags = array(); +foreach($qtags as $tag) { + $tags[] = $tag['tag']; +} + +$tmpl = new OCP\Template( 'bookmarks', 'addBm', 'base' ); +$tmpl->assign('requesttoken', OC_Util::callRegister()); +$tmpl->assign('bookmark', $bm); +$tmpl->assign('tags', json_encode($tags), false); +$tmpl->printPage(); diff --git a/ajax/changescreen.php b/ajax/changescreen.php new file mode 100644 index 00000000..116b9822 --- /dev/null +++ b/ajax/changescreen.php @@ -0,0 +1,29 @@ +'unexspected parameter: ' . $view)); + exit; + } + OCP\Config::setUserValue(OCP\USER::getUser(), 'bookmarks', 'currentview', $view); + OCP\JSON::success(); +}elseif(isset($_POST['sidebar'])) { + $view = $_POST['sidebar']; + switch($view){ + case 'true': + case 'false'; + break; + default: + OCP\JSON::error(array('message'=>'unexspected parameter: ' . $view)); + exit; + } + OCP\Config::setUserValue(OCP\USER::getUser(), 'bookmarks', 'sidebar', $view); + OCP\JSON::success(); +} diff --git a/ajax/delTag.php b/ajax/delTag.php new file mode 100644 index 00000000..f8a9cdfb --- /dev/null +++ b/ajax/delTag.php @@ -0,0 +1,36 @@ +. +* +*/ + +// Check if we are a user +OCP\JSON::checkLoggedIn(); +OCP\JSON::callCheck(); +OCP\JSON::checkAppEnabled('bookmarks'); + +if(isset($_POST['old_name'])) { + OC_Bookmarks_Bookmarks::deleteTag($_POST['old_name']); + OCP\JSON::success(); + exit(); +} + +OC_JSON::error(); +exit(); diff --git a/ajax/editBookmark.php b/ajax/editBookmark.php index b03261c9..3ac60707 100644 --- a/ajax/editBookmark.php +++ b/ajax/editBookmark.php @@ -27,64 +27,20 @@ OCP\JSON::callCheck(); OCP\JSON::checkAppEnabled('bookmarks'); -$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" ); -if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) { - $_ut = "strftime('%s','now')"; -} elseif($CONFIG_DBTYPE == 'pgsql') { - $_ut = 'date_part(\'epoch\',now())::integer'; -} elseif($CONFIG_DBTYPE == 'oci') { - $_ut = '(oracletime - to_date(\'19700101\',\'YYYYMMDD\')) * 86400'; -} else { - $_ut = "UNIX_TIMESTAMP()"; -} +// If we go the dialog form submit +if(isset($_POST['url'])) { + $tags = isset($_POST['item']['tags']) ? $_POST['item']['tags'] : array(); + $pub = isset($_POST['is_public']) ? true : false; -$bookmark_id = (int)$_POST["id"]; -$user_id = OCP\USER::getUser(); - -//TODO check using CURRENT_TIMESTAMP? prepare already does magic when using now() -$query = OCP\DB::prepare(' - UPDATE `*PREFIX*bookmarks` - SET `url` = ?, `title` = ?, `lastmodified` = '.$_ut.' - WHERE `id` = ? - AND `user_id` = ? - '); - -$params=array( - htmlspecialchars_decode($_POST["url"]), - htmlspecialchars_decode($_POST["title"]), - $bookmark_id, - $user_id, - ); - -$result = $query->execute($params); - -# Abort the operation if bookmark couldn't be set (probably because the user is not allowed to edit this bookmark) -if ($result->numRows() == 0) exit(); - -# Remove old tags and insert new ones. -$query = OCP\DB::prepare(' - DELETE FROM `*PREFIX*bookmarks_tags` - WHERE `bookmark_id` = ? - '); - -$params=array( - $bookmark_id - ); - -$query->execute($params); - -$query = OCP\DB::prepare(' - INSERT INTO `*PREFIX*bookmarks_tags` - (`bookmark_id`, `tag`) - VALUES (?, ?) - '); - -$tags = explode(' ', urldecode($_POST["tags"])); -foreach ($tags as $tag) { - if(empty($tag)) { - //avoid saving blankspaces - continue; + if(isset($_POST['record_id']) && is_numeric($_POST['record_id']) ) { //EDIT + $bm = $_POST['record_id']; + OC_Bookmarks_Bookmarks::editBookmark($bm, $_POST['url'], $_POST['title'], $tags, $_POST['description'], $pub); } - $params = array($bookmark_id, trim($tag)); - $query->execute($params); + else { + $bm = OC_Bookmarks_Bookmarks::addBookmark($_POST['url'], $_POST['title'], $tags, $_POST['description'], $pub); + } + OCP\JSON::success(array('id'=>$bm)); + exit(); } +OC_JSON::error(); +exit(); diff --git a/ajax/getInfos.php b/ajax/getInfos.php new file mode 100644 index 00000000..54355e8f --- /dev/null +++ b/ajax/getInfos.php @@ -0,0 +1,39 @@ +. +* +*/ + +// Check if we are a user +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); + +require_once OC_App::getAppPath('bookmarks').'/bookmarksHelper.php'; + +$req_type=isset($_GET['type']) ? $_GET['type'] : ''; + +if($req_type == 'url_info' && $_GET['url']) { + $datas = getURLMetadata($_GET['url']); + $title = isset($datas['title']) ? $datas['title'] : ''; + OCP\JSON::success(array('title' => $title)); + exit(); +} + +OC_JSON::error(); +exit(); diff --git a/ajax/renameTag.php b/ajax/renameTag.php new file mode 100644 index 00000000..e25e6c30 --- /dev/null +++ b/ajax/renameTag.php @@ -0,0 +1,40 @@ +. +* +*/ + +//no apps or filesystem +$RUNTIME_NOSETUPFS=true; + + + +// Check if we are a user +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); + +if(isset($_POST['old_name']) && isset($_POST['new_name']) && $_POST['new_name'] != '') { + OC_Bookmarks_Bookmarks::renameTag($_POST['old_name'], $_POST['new_name']); + OCP\JSON::success(); + exit(); +} + +OC_JSON::error(); +exit(); diff --git a/ajax/updateList.php b/ajax/updateList.php index cf9a2cf9..5ddd9869 100644 --- a/ajax/updateList.php +++ b/ajax/updateList.php @@ -25,21 +25,28 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('bookmarks'); +require_once OC_App::getAppPath('bookmarks').'/bookmarksHelper.php'; +$req_type= isset($_GET['type']) ? $_GET['type'] : 'bookmark'; -//Filter for tag? -$filterTag = isset($_POST['tag']) ? htmlspecialchars_decode($_POST['tag']) : false; +if($req_type == 'rel_tags') { + $tags = analyzeTagRequest(isset($_GET['tag']) ? $_GET['tag'] : ''); + $qtags = OC_Bookmarks_Bookmarks::findTags($tags); + OCP\JSON::success(array('data' => $qtags)); -$offset = isset($_POST['page']) ? intval($_POST['page']) * 10 : 0; - -$sort = isset($_POST['sort']) ? ($_POST['sort']) : 'bookmarks_sorting_recent'; -if($sort == 'bookmarks_sorting_clicks') { - $sqlSortColumn = 'clickcount'; -} else { - $sqlSortColumn = 'id'; } +else { // type == bookmark + $filterTag = analyzeTagRequest(isset($_GET['tag']) ? $_GET['tag'] : ''); + $offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0; -$bookmarks = OC_Bookmarks_Bookmarks::findBookmarks($offset, $sqlSortColumn, $filterTag, true); + $sort = isset($_GET['sort']) ? ($_GET['sort']) : 'bookmarks_sorting_recent'; + if($sort == 'bookmarks_sorting_clicks') { + $sqlSortColumn = 'clickcount'; + } else { + $sqlSortColumn = 'id'; + } + $bookmarks = OC_Bookmarks_Bookmarks::findBookmarks($offset, $sqlSortColumn, $filterTag, true); + OCP\JSON::success(array('data' => $bookmarks)); -OCP\JSON::success(array('data' => $bookmarks)); +} diff --git a/appinfo/app.php b/appinfo/app.php index f4bca9df..1b4e1ddf 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -11,9 +11,13 @@ OC::$CLASSPATH['OC_Bookmarks_Bookmarks'] = 'apps/bookmarks/lib/bookmarks.php'; OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php'; $l = new OC_l10n('bookmarks'); -OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks'))); +OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', + 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), + 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), + 'name' => $l->t('Bookmarks') +)); OCP\App::registerPersonal('bookmarks', 'settings'); -OCP\Util::addscript('bookmarks','bookmarksearch'); +OCP\Util::addscript('bookmarks', 'bookmarksearch'); OC_Search::registerProvider('OC_Search_Provider_Bookmarks'); diff --git a/appinfo/database.xml b/appinfo/database.xml index d28857b0..6e45d5e1 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -36,6 +36,13 @@ true 64 + + description + text + + true + 4096 + public integer diff --git a/appinfo/info.xml b/appinfo/info.xml index 93510815..88b7c1c1 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -6,6 +6,6 @@ AGPL Arthur Schiwon, Marvin Thomas Rabe - 4 + 4.9 true diff --git a/appinfo/migrate.php b/appinfo/migrate.php index f8a037b3..2abc8272 100644 --- a/appinfo/migrate.php +++ b/appinfo/migrate.php @@ -21,8 +21,7 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{ $ids2 = $this->content->copyRows( $options ); // If both returned some ids then they worked - if( is_array( $ids ) && is_array( $ids2 ) ) - { + if( is_array( $ids ) && is_array( $ids2 ) ) { return true; } else { return false; @@ -39,9 +38,14 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{ $results = $query->execute( array( $this->olduid ) ); $idmap = array(); while( $row = $results->fetchRow() ) { - // Import each bookmark, saving its id into the map - $query = OCP\DB::prepare( "INSERT INTO `*PREFIX*bookmarks`(`url`, `title`, `user_id`, `public`, `added`, `lastmodified`) VALUES (?, ?, ?, ?, ?, ?)" ); - $query->execute( array( $row['url'], $row['title'], $this->uid, $row['public'], $row['added'], $row['lastmodified'] ) ); + // Import each bookmark, saving its id into the map + $sql = "INSERT INTO `*PREFIX*bookmarks` + (`url`, `title`, `user_id`, `public`, `added`, `lastmodified`) VALUES (?, ?, ?, ?, ?, ?)" ; + $query = OCP\DB::prepare($sql); + $query->execute(array( + $row['url'], $row['title'], $this->uid, $row['public'], + $row['added'], $row['lastmodified'] + ) ); // Map the id $idmap[$row['id']] = OCP\DB::insertid(); } @@ -51,12 +55,13 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{ $results = $query->execute( array( $oldid ) ); while( $row = $results->fetchRow() ) { // Import the tags for this bookmark, using the new bookmark id - $query = OCP\DB::prepare( "INSERT INTO `*PREFIX*bookmarks_tags`(`bookmark_id`, `tag`) VALUES (?, ?)" ); + $sql = "INSERT INTO `*PREFIX*bookmarks_tags`(`bookmark_id`, `tag`) VALUES (?, ?)"; + $query = OCP\DB::prepare($sql); $query->execute( array( $newid, $row['tag'] ) ); } } // All done! - break; + break; } return true; diff --git a/appinfo/version b/appinfo/version index 2f453618..1d71ef97 100644 --- a/appinfo/version +++ b/appinfo/version @@ -1 +1 @@ -0.2 \ No newline at end of file +0.3 \ No newline at end of file diff --git a/bookmarksHelper.php b/bookmarksHelper.php index 0c302a33..5ffb5087 100644 --- a/bookmarksHelper.php +++ b/bookmarksHelper.php @@ -13,6 +13,7 @@ function curl_exec_follow(/*resource*/ $ch, /*int*/ &$maxredirect = null) { $newurl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); $rch = curl_copy_handle($ch); + curl_setopt($ch, CURLOPT_USERAGENT, "Owncloud Bookmark Crawl"); curl_setopt($rch, CURLOPT_HEADER, true); curl_setopt($rch, CURLOPT_NOBODY, true); curl_setopt($rch, CURLOPT_FORBID_REUSE, false); @@ -35,7 +36,10 @@ function curl_exec_follow(/*resource*/ $ch, /*int*/ &$maxredirect = null) { curl_close($rch); if (!$mr) { if ($maxredirect === null) { - trigger_error('Too many redirects. When following redirects, libcurl hit the maximum amount.', E_USER_WARNING); + OCP\Util::writeLog( + 'bookmark', + 'Too many redirects. When following redirects, libcurl hit the maximum amount on bookmark', + OCP\Util::ERROR); } else { $maxredirect = 0; } @@ -53,7 +57,7 @@ function getURLMetadata($url) { //if not (allowed) protocol is given, assume http if(preg_match($protocols, $url) == 0) { $url = 'http://' . $url; - } + } $metadata['url'] = $url; if (!function_exists('curl_init')) { @@ -65,66 +69,17 @@ function getURLMetadata($url) { $page = curl_exec_follow($ch); curl_close($ch); - @preg_match( "/(.*)<\/title>/si", $page, $match ); - $metadata['title'] = htmlspecialchars_decode(@$match[1]); - + @preg_match( "/<title>(.*)<\/title>/sUi", $page, $match ); + $metadata['title'] = htmlspecialchars_decode(@$match[1]); return $metadata; } -function addBookmark($url, $title, $tags='') { - $CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" ); - if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) { - $_ut = "strftime('%s','now')"; - } elseif($CONFIG_DBTYPE == 'pgsql') { - $_ut = 'date_part(\'epoch\',now())::integer'; - } else { - $_ut = "UNIX_TIMESTAMP()"; - } - - //FIXME: Detect when user adds a known URL - $query = OCP\DB::prepare(" - INSERT INTO `*PREFIX*bookmarks` - (`url`, `title`, `user_id`, `public`, `added`, `lastmodified`) - VALUES (?, ?, ?, 0, $_ut, $_ut) - "); - - if(empty($title)) { - $metadata = getURLMetadata($url); - if(isset($metadata['title'])) // Check for problems fetching the title - $title = $metadata['title']; - } - - if(empty($title)) { - $l = OC_L10N::get('bookmarks'); - $title = $l->t('unnamed'); - } - - $params=array( - htmlspecialchars_decode($url), - htmlspecialchars_decode($title), - OCP\USER::getUser() - ); - $query->execute($params); - - $b_id = OCP\DB::insertid('*PREFIX*bookmarks'); - - if($b_id !== false) { - $query = OCP\DB::prepare(" - INSERT INTO `*PREFIX*bookmarks_tags` - (`bookmark_id`, `tag`) - VALUES (?, ?) - "); - - $tags = explode(' ', urldecode($tags)); - foreach ($tags as $tag) { - if(empty($tag)) { - //avoid saving blankspaces - continue; - } - $params = array($b_id, trim($tag)); - $query->execute($params); - } - - return $b_id; +function analyzeTagRequest($line) { + $tags = explode(',', $line); + $filterTag = array(); + foreach($tags as $tag){ + if(trim($tag) != '') + $filterTag[] = trim($tag); } + return $filterTag; } diff --git a/css/bookmarks.css b/css/bookmarks.css index a67afcd4..7fe274ae 100644 --- a/css/bookmarks.css +++ b/css/bookmarks.css @@ -4,6 +4,32 @@ #firstrun .button { font-size: 0.7em; } #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 { + padding-top: 5px; + top: 3.5em !important; +} +.centercontent { + margin-bottom: 1em; + text-align: right; +} +.centercontent span { + border: 1px solid lightgray; + border-right:0; + border-radius: 0.5em 0em 0em 0.5em; +/* margin-right: 10px; */ + padding: 3px; +} + +.centercontent .right_img { + display:none; +} + .bookmarks_headline { font-size: large; font-weight: bold; @@ -20,8 +46,13 @@ overflow: auto; position: fixed; top: 6.5em; +/* margin-left: 15px; */ + } +#add_url { + width: 25em; +} .bookmarks_addBml { text-decoration: underline; } @@ -61,10 +92,13 @@ display: block; } -.bookmark_title { font-weight: bold; display: inline-block; margin-right: 0.8em; } -.bookmark_url { display: none; color: #999; } -.bookmark_single:hover .bookmark_url { display: inline; } -.bookmark_tags { +.bookmark_title { + font-weight: bold; + display: inline-block; + margin-right: 0.8em; +} + +.bm_view_list .bookmark_tags { position: absolute; top: 0.5em; right: 6em; @@ -85,3 +119,218 @@ display: none; margin-left: 5px; } + +.addBm { + background: none repeat scroll 0 0 #F8F8F8; + border-radius: 0.5em 0.5em 0.5em 0.5em; + color: #555555; + margin: 1em; + padding: 0.5em 1em; + text-shadow: 0 1px 0 #FFFFFF; + width: 500px; + +} +.bm_desc { + width:90%; +} +.addBm h1 { + font-weight: bold; + border-bottom: 1px solid #BABABA; + +} + + +.addBm fieldset > ul > li { + margin-top: 1em; +} +.addBm label { + display:block; + width:100%; +} +.addBm .is_public_label { + display: inline; + +} +.addBm fieldset input[type="text"], .addBm textarea { + width:100%; +} +.addBm textarea{ + min-width:250px; +/* min-height: 70px; */ +} +.addBm .close_btn +{ +/* background-color: #EEEEEE; */ + height: 18px; + margin: -20px 0 0; + padding: 1px; + float:right; + width: 19px; +} +.addBm .submit { + float: right; +} + +.addBm ul.tagit { background:white; } + +.addBm input.ui-autocomplete-input, #tag_filter input.ui-autocomplete-input, .bookmark_form_tags input.ui-autocomplete-input{ + box-shadow:none; + +} + +.ui-autocomplete { +/* background: none repeat scroll 0 0 #DEE7F8; */ +} + +#leftcontent > ul > li, .leftcontent li { + padding: 0.2em; + padding-left:1em; +} +#leftcontent > label { + margin-top: 1em; + margin-bottom: 0.7em; + display: block; + padding-left: 1em; +} + +#leftcontent .tag_list > li .tag , #leftcontent .share_list > li .tag{ + background: none repeat scroll 0 0 #DEE7F8; + border: 1px solid #CAD8F3; + 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; +} + +ul.tagit li.tagit-new { + padding-left: 0em; +} + +.tag_list em , .share_list em{ + float:right; + display:block; +} +.tags_actions { + display:none; + margin-left: 0.5em; + float:right; +} +li:hover .tags_actions { + display:block; +} +li:hover em { display : none; } +#tag_filter li, #tag_filter li:hover{ + background: none repeat scroll 0 0 #F8F8F8; + +} +#tag_filter .tagit { + margin: 0.3em; +} +#tag_filter ul.tagit > li.tagit-new { + padding:0; +} +#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 { + display: inline; + float: none; + margin: 0; + padding: 0; +} +#tag_filter ul.tagit li.tagit-choice .close{ + margin-top: -8px; + cursor: pointer; + margin-top: -8px; + position: absolute; + right: 0.1em; + top: 50%; +} + +#view_type { + display:none; /* @TODO: Remove when image view is ready*/ + position: absolute; + right: 33.5em; + top: 0; +} + +/***** Lis View *****/ + +.bm_view_img .bookmark_single{ + width: 240px; + 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); +} + +.bm_view_img .bookmark_single .shot{ + text-align:center; +} +.bm_view_img .bookmark_single .shot img{ + border: 1px solid black; + width: 228px; + height: 160px +} + +.bookmark_desc{ + height: 1.5em; + padding-left:1em; + white-space:nowrap; + text-overflow:ellipsis; + overflow:hidden; + display:block; +} +.bookmark_date, .bookmark_submit { + font-size:small; + position: absolute; + right: 6em; + color:gray; +/* margin-top:2.5em; */ + margin-right: 0.2em; +} + +/* +.bm_view_img .bookmark_single:hover .bookmark_url{ + display:block; +} +.bm_view_img .bookmark_single .bookmark_url{ + display:block; +} +*/ +.bookmark_single:hover .bookmark_url { display: inline; } +.bookmark_single:hover .bookmark_url a[href]{ color:gray; } + +.bookmark_url { display: none; } +.bookmark_form_title input, .bookmark_form_url input, .bookmark_form_desc textarea { + width: 80%; +} + +.bookmark_single_form { + padding-top: 1em; + border-bottom: 1px solid #DDD; + padding-left: 2em; +} + +.bookmark_single_form .tagit{ + width: 80%; + box-shadow: 0 1px 1px #FFFFFF, 0 1px 0 #BBBBBB inset; + margin: 3px; +} +.bm_view_img .bookmark_actions { + bottom: 0.7em; + display: block; + position: absolute; + right: 1em; + top: auto; +} \ No newline at end of file diff --git a/export.php b/export.php new file mode 100644 index 00000000..ed9d5b21 --- /dev/null +++ b/export.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright (c) 2012 Brice Maron < brice __At__ bmaron dot net > + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +// Check if we are a user +OCP\User::checkLoggedIn(); +OCP\App::checkAppEnabled('bookmarks'); + + +$file = <<<EOT +<!DOCTYPE NETSCAPE-Bookmark-file-1> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> +<!-- This is an automatically generated file. +It will be read and overwritten. +Do Not Edit! --> +<TITLE>Bookmarks +

    Bookmarks

    +

    +EOT; + +$bookmarks = OC_Bookmarks_Bookmarks::findBookmarks(0, 'id', array(), true, -1); +foreach($bookmarks as $bm) { + $file .= '

    '; + $file .= htmlspecialchars($bm['title'], ENT_QUOTES, 'UTF-8').''; + if($bm['description']) + $file .= '
    '.htmlspecialchars($bm['description'], ENT_QUOTES, 'UTF-8'); +} + +header("Cache-Control: private"); +header("Content-Type: application/stream"); +header("Content-Length: ".$fileSize); +header("Content-Disposition: attachment; filename=oc-bookmarks.html"); + +echo $file; +exit; \ No newline at end of file diff --git a/img/triangle-e.png b/img/triangle-e.png new file mode 100644 index 00000000..ca24e7a5 Binary files /dev/null and b/img/triangle-e.png differ diff --git a/img/triangle-e.svg b/img/triangle-e.svg new file mode 100644 index 00000000..835d8923 --- /dev/null +++ b/img/triangle-e.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/img/triangle-w.png b/img/triangle-w.png new file mode 100644 index 00000000..568e7e35 Binary files /dev/null and b/img/triangle-w.png differ diff --git a/img/triangle-w.svg b/img/triangle-w.svg new file mode 100644 index 00000000..aac0be84 --- /dev/null +++ b/img/triangle-w.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/index.php b/index.php index a4ce0229..5da06b7d 100644 --- a/index.php +++ b/index.php @@ -29,9 +29,32 @@ OCP\App::checkAppEnabled('bookmarks'); OCP\App::setActiveNavigationEntry( 'bookmarks_index' ); -OCP\Util::addscript('bookmarks','bookmarks'); +OCP\Util::addscript('bookmarks', 'bookmarks'); OCP\Util::addStyle('bookmarks', 'bookmarks'); +OCP\Util::addscript('bookmarks', 'addBm'); + + +OCP\Util::addscript('bookmarks/3rdparty', 'tag-it'); +OCP\Util::addscript('bookmarks/3rdparty', 'js_tpl'); +OCP\Util::addStyle('bookmarks/3rdparty', 'jquery.tagit'); +$qtags = OC_Bookmarks_Bookmarks::findTags(); + +$tags = array(); +foreach($qtags as $tag) { + $tags[] = $tag['tag']; +} + +$bm = array('title'=> '', + 'url'=> '', + 'tags'=> array(), + 'desc'=>'', + 'is_public'=>0, +); $tmpl = new OCP\Template( 'bookmarks', 'list', 'user' ); +$tmpl->assign('bookmark', $bm); + +$tmpl->assign('req_tag', isset($_GET['tag']) ? $_GET['tag'] : ''); +$tmpl->assign('tags', json_encode($tags), false); $tmpl->printPage(); diff --git a/js/addBm.js b/js/addBm.js index 625ac842..615593ce 100644 --- a/js/addBm.js +++ b/js/addBm.js @@ -1,16 +1,77 @@ -$(document).ready(function() { - $('#bookmark_add_submit').click(addBookmark); -}); - -function addBookmark(event) { - var url = $('#bookmark_add_url').val(); - var tags = $('#bookmark_add_tags').val(); - $.ajax({ - type: 'POST', - url: 'ajax/addBookmark.php', - data: 'url=' + encodeURI(url) + '&tags=' + encodeURI(tags), - success: function(data){ - window.close(); +(function($){ + $.bookmark_dialog = function(el, options){ + // To avoid scope issues, use 'base' instead of 'this' + // to reference this class from internal events and functions. + var base = this; + + // Access to jQuery and DOM versions of element + base.$el = $(el); + base.el = el; + + // Add a reverse reference to the DOM object + base.$el.data('bookmark_dialog', base); + + base.form_submit = function search_form_submit(event) + { + event.preventDefault(); + $.ajax({ + type: 'POST', + url: $(this).attr('action'), + data: $(this).serialize(), + success: function(data){ + if(data.status == 'success'){ + base.options['on_success'](data); + } else { // On failure + + } + } + }); + return false; + } + base.setTitle = function (str) { + base.$el.find('.title').val(str); } - }); -} \ No newline at end of file + + base.init = function(){ + base.options = $.extend({},$.bookmark_dialog.defaultOptions, options); + base.$el.find('form').bind('submit.addBmform',base.form_submit); + // Init Tagging thing + base.$el.find('.tags').tagit({ + allowSpaces: true, + availableTags: fullTags, + placeholderText: t('bookmark', 'Tags') + }); + + if(base.options['record']) { //Fill the form if it's an edit + record = base.options['record']; + base.$el.find('.record_id').val(record.id); + base.$el.find('.title').val(record.title); + base.$el.find('.url_input').val(record.url); + base.$el.find('.desc').val(record.description); + tagit_elem = base.$el.find('.tags'); + if(record.tags) { + for(var i=0;i' + tags[i] + ' '; + taglist = taglist + '' + encodeEntities(tags[i]) + ' '; } if(!hasProtocol(bookmark.url)) { bookmark.url = 'http://' + bookmark.url; } - if(bookmark.title == '') bookmark.title = bookmark.url; - $('.bookmarks_list').append( - '
    ' + - '

    ' + - '' + - '' + - '' + - '' + - '' + - ' ' + - '

    ' + - '

    '+ - '' + encodeEntities(bookmark.title) + '' + - '

    ' + - '

    ' + encodeEntities(bookmark.url) + '

    ' + - '
    ' - ); - if(taglist != '') { - $('div[data-id="'+ bookmark.id +'"]').append('

    ' + taglist + '

    '); + + if(bookmark.added) { + bookmark.added_date.setTime(parseInt(bookmark.added)*1000); } + + if(bookmark_view == 'image') { //View in images + service_url = formatString(shot_provider, {url: encodeEntities(bookmark.url), title: bookmark.title, width: 200}); + bookmark['service_url'] = service_url; + html = tmpl("img_item_tmpl", bookmark); + $('.bookmarks_list').append(html); + $('div[data-id="'+ bookmark.id +'"]').data('record', bookmark); + if(taglist != '') { + $('div[data-id="'+ bookmark.id +'"]').append('

    ' + taglist + '

    '); + } + $('div[data-id="'+ bookmark.id +'"] a.bookmark_tag').bind('click', addFilterTag); + } + else { + html = tmpl("item_tmpl", bookmark); + if(position == "prepend") { + $('.bookmarks_list').prepend(html); + } else { + $('.bookmarks_list').append(html); + } + line = $('div[data-id="'+ bookmark.id +'"]'); + line.data('record', bookmark); + if(taglist != '') { + line.append('

    ' + taglist + '

    '); + } + line.find('a.bookmark_tag').bind('click', addFilterTag); + line.find('.bookmark_link').click(recordClick); + line.find('.bookmark_delete').click(delBookmark); + line.find('.bookmark_edit').click(editBookmark); + } + } function updateOnBottom() { @@ -199,3 +340,62 @@ function hasProtocol(url) { var regexp = /(ftp|http|https|sftp)/; return regexp.test(url); } + +function renameTag(event) { + if($('input[name="tag_new_name"]').length) return; // Do nothing if a tag is currenlty edited + tag_el = $(this).closest('li'); + tag_el.append('
    '); + var form = tag_el.find('form'); + tag_el.find('.tags_actions').hide(); + tag_name = tag_el.find('.tag').hide().text(); + tag_el.find('input').val(tag_name).focus().bind('blur',function() { + form.trigger('submit'); + }); + form.bind('submit',submitTagName); +} + +function submitTagName(event) { + event.preventDefault(); + tag_el = $(this).closest('li') + new_tag_name = tag_el.find('input').val(); + old_tag_name = tag_el.find('.tag').show().text(); + tag_el.find('.tag_edit').show(); + tag_el.find('.tags_actions').show(); + tag_el.find('input').unbind('blur'); + tag_el.find('form').unbind('submit').remove(); + + if(new_tag_name != old_tag_name && new_tag_name != '') { + //submit + $.ajax({ + type: 'POST', + url: OC.filePath('bookmarks', 'ajax', 'renameTag.php'), + data: { old_name: old_tag_name, new_name: new_tag_name}, + success: function(bookmarks){ + if (bookmarks.status =='success') { + filterTagsChanged(); + } + } + }); + } +} + +function deleteTag(event){ + tag_el = $(this).closest('li'); + var old_tag_name = tag_el.find('.tag').show().text(); + OC.dialogs.confirm(t('bookmarks', 'Are you sure you want to remove this tag from every entry?'), + t('bookmarks', 'Warning'), function(answer) { + if(answer) { + $.ajax({ + type: 'POST', + url: OC.filePath('bookmarks', 'ajax', 'delTag.php'), + data: { old_name: old_tag_name}, + success: function(bookmarks){ + if (bookmarks.status =='success') { + filterTagsChanged(); + } + } + }); + } + }); +} + diff --git a/l10n/bg_BG.php b/l10n/bg_BG.php index 04d731b1..0606ab79 100644 --- a/l10n/bg_BG.php +++ b/l10n/bg_BG.php @@ -1,12 +1,9 @@ "Отметки", -"unnamed" => "неозаглавено", +"Tags" => "Етикети", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Завлачете това в лентата с отметки на браузъра си и го натискайте, когато искате да отметнете бързо някоя страница:", "Read later" => "Отмятане", "Address" => "Адрес", -"Title" => "Заглавие", -"Tags" => "Етикети", -"Save bookmark" => "Запис на отметката", "You have no bookmarks" => "Нямате отметки", "Bookmarklet
    " => "Бутон за отметки
    " ); diff --git a/l10n/ca.php b/l10n/ca.php index f6cd2105..30f55fcf 100644 --- a/l10n/ca.php +++ b/l10n/ca.php @@ -1,13 +1,33 @@ "Adreces d'interès", -"unnamed" => "sense nom", +"Tags" => "Etiquetes", +"Edit bookmark" => "Edita l'adreça d'interès", +"Are you sure you want to remove this tag from every entry?" => "Segur que voleu eliminar aquesta etiqueta de cada entrada?", +"Warning" => "Avís", "Bookm." => "Marcador", +"Add a bookmark" => "Afegeix una adreça d'interès", +"Close" => "Tanca", +"The title of the page" => "El títol de la pàgina", +"The address of the page" => "L'adreça de la pàgina", +"Description of the page" => "Descripció de la pàgina", +"Save" => "Desa", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Arrossegueu-ho al navegador i feu-hi un clic quan volgueu marcar ràpidament una adreça d'interès:", "Read later" => "Llegeix més tard", "Address" => "Adreça", -"Title" => "Títol", -"Tags" => "Etiquetes", -"Save bookmark" => "Desa l'adreça d'interès", +"Add bookmark" => "Afegeix una adreça d'interès", +"List" => "Llista", +"Image" => "Imatge", +"Hide" => "Amaga", +"Show" => "Mostra", +"Related Tags" => "Etiquetes relacionades", "You have no bookmarks" => "No teniu adreces d'interès", -"Bookmarklet
    " => "Bookmarklet
    " +"Edit" => "Edita", +"Delete" => "Esborra", +"Cancel" => "Cancel·la", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Importa les adreces d'interès", +"Bookmark html file" => "Adreça d'interès en fitxer html", +"Import" => "Importa", +"Export bookmarks" => "Exporta adreces d'interès", +"Export" => "Exporta" ); diff --git a/l10n/cs_CZ.php b/l10n/cs_CZ.php index d026c0ad..1084b900 100644 --- a/l10n/cs_CZ.php +++ b/l10n/cs_CZ.php @@ -1,13 +1,33 @@ "Záložky", -"unnamed" => "nepojmenováno", +"Tags" => "Značky", +"Edit bookmark" => "Upravit záložku", +"Are you sure you want to remove this tag from every entry?" => "Opravdu jste si jisti, že si přejete odstranit tuto značku z každého záznamu?", +"Warning" => "Varování", "Bookm." => "Zál.", +"Add a bookmark" => "Přidat záložku", +"Close" => "Zavřít", +"The title of the page" => "Název stránky", +"The address of the page" => "Adresa stránky", +"Description of the page" => "Popis stránky", +"Save" => "Uložit", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Přetáhněte do Vašeho prohlížeče a klikněte, pokud si přejete rychle uložit stránku do záložek:", "Read later" => "Přečíst později", "Address" => "Adresa", -"Title" => "Název", -"Tags" => "Značky", -"Save bookmark" => "Uložit záložku", +"Add bookmark" => "Přidat záložku", +"List" => "Seznam", +"Image" => "Obrázek", +"Hide" => "Skrýt", +"Show" => "Zobrazit", +"Related Tags" => "Podobné značky", "You have no bookmarks" => "Nemáte žádné záložky", -"Bookmarklet
    " => "Záložky
    " +"Edit" => "Upravit", +"Delete" => "Smazat", +"Cancel" => "Zrušit", +"Bookmarklet
    " => "Záložky
    ", +"Import bookmarks" => "Importovat záložky", +"Bookmark html file" => "Html soubor záložek", +"Import" => "Importovat", +"Export bookmarks" => "Exportovat záložky", +"Export" => "Exportovat" ); diff --git a/l10n/da.php b/l10n/da.php index f2c2a63d..574c5566 100644 --- a/l10n/da.php +++ b/l10n/da.php @@ -1,13 +1,33 @@ "Bogmærker", -"unnamed" => "uden navn", +"Tags" => "Mærker", +"Edit bookmark" => "Rediger bogmærker", +"Are you sure you want to remove this tag from every entry?" => "Er du sikker på at du vil fjerne dette flag fra alle poster?", +"Warning" => "Advarsel", "Bookm." => "Bogm.", +"Add a bookmark" => "Tilføj bogmærke", +"Close" => "Luk", +"The title of the page" => "Sidens titel", +"The address of the page" => "Sidens adresse", +"Description of the page" => "Sidens beskrivelse", +"Save" => "Gem", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Træk denne til dine browserbogmærker pg klik på den, når du ønsker at lynoprette et bogmærke til hjemmesiden:", "Read later" => "Læs senere", "Address" => "Adresser", -"Title" => "Titel", -"Tags" => "Mærker", -"Save bookmark" => "Gem bogmærke", +"Add bookmark" => "Tilføj bogmærke", +"List" => "Liste", +"Image" => "Billede", +"Hide" => "Gem", +"Show" => "Vis", +"Related Tags" => "Relaterede Tags", "You have no bookmarks" => "Du har ingen bogmærker", -"Bookmarklet
    " => "Bookmarklet
    " +"Edit" => "Rediger", +"Delete" => "Slet", +"Cancel" => "Annuller", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Importer bogmærker", +"Bookmark html file" => "Bogmærke html fil", +"Import" => "Importer", +"Export bookmarks" => "Exporter bogmærker", +"Export" => "Exporter" ); diff --git a/l10n/de.php b/l10n/de.php index f208031c..723c0298 100644 --- a/l10n/de.php +++ b/l10n/de.php @@ -1,13 +1,33 @@ "Lesezeichen", -"unnamed" => "unbenannt", +"Tags" => "Tags", +"Edit bookmark" => "Lesezeichen bearbeiten", +"Are you sure you want to remove this tag from every entry?" => "Soll dieses Schlagwort wirklich von allen Einträgen entfernt werden?", +"Warning" => "Warnung", "Bookm." => "Lesez.", -"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Ziehen Sie dies zu Ihren Browser-Lesezeichen und klicken Sie darauf, wenn Sie eine Website schnell den Lesezeichen hinzufügen wollen.", +"Add a bookmark" => "Ein Lesezeichen hinzufügen", +"Close" => "Schließen", +"The title of the page" => "Der Titel der Seite", +"The address of the page" => "Die Adresse der Seite", +"Description of the page" => "Die Beschreibung der Seite", +"Save" => "Speichern", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Ziehe dies zu Deinen Browser-Lesezeichen und klicke darauf, wenn Du eine Website schnell den Lesezeichen hinzufügen willst.", "Read later" => "Später lesen", "Address" => "Adresse", -"Title" => "Titel", -"Tags" => "Tags", -"Save bookmark" => "Lesezeichen speichern", -"You have no bookmarks" => "Sie haben keine Lesezeichen", -"Bookmarklet
    " => "Bookmarklet
    " +"Add bookmark" => "Lesezeichen hinzufügen", +"List" => "Liste", +"Image" => "Bild", +"Hide" => "Ausblenden", +"Show" => "Anzeigen", +"Related Tags" => "Verwandte Schlagworte", +"You have no bookmarks" => "Du hast keine Lesezeichen", +"Edit" => "Bearbeiten", +"Delete" => "Löschen", +"Cancel" => "Abbrechen", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Lesezeichen importieren", +"Bookmark html file" => "HTML-Lesezeichen-Datei", +"Import" => "Importieren", +"Export bookmarks" => "Lesezeichen exportieren", +"Export" => "Exportieren" ); diff --git a/l10n/de_DE.php b/l10n/de_DE.php new file mode 100644 index 00000000..6fb794ac --- /dev/null +++ b/l10n/de_DE.php @@ -0,0 +1,33 @@ + "Lesezeichen", +"Tags" => "Tags", +"Edit bookmark" => "Lesezeichen bearbeiten", +"Are you sure you want to remove this tag from every entry?" => "Soll dieses Schlagwort wirklich von allen Einträgen entfernt werden?", +"Warning" => "Warnung", +"Bookm." => "Lesez.", +"Add a bookmark" => "Ein Lesezeichen hinzufügen", +"Close" => "Schließen", +"The title of the page" => "Der Titel der Seite", +"The address of the page" => "Die Adresse der Seite", +"Description of the page" => "Die Beschreibung der Seite", +"Save" => "Speichern", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Ziehen Sie dies zu Ihren Browser-Lesezeichen und klicken Sie darauf, wenn Sie eine Website schnell den Lesezeichen hinzufügen wollen.", +"Read later" => "Später lesen", +"Address" => "Adresse", +"Add bookmark" => "Lesezeichen hinzufügen", +"List" => "Liste", +"Image" => "Bild", +"Hide" => "Ausblenden", +"Show" => "Anzeigen", +"Related Tags" => "Verwandte Schlagworte", +"You have no bookmarks" => "Sie haben keine Lesezeichen", +"Edit" => "Bearbeiten", +"Delete" => "Löschen", +"Cancel" => "Abbrechen", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Lesezeichen importieren", +"Bookmark html file" => "HTML-Lesezeichen-Datei", +"Import" => "Importieren", +"Export bookmarks" => "Lesezeichen exportieren", +"Export" => "Exportieren" +); diff --git a/l10n/el.php b/l10n/el.php index f282a1bb..a1daa98f 100644 --- a/l10n/el.php +++ b/l10n/el.php @@ -1,12 +1,33 @@ "Σελιδοδείκτες", -"unnamed" => "ανώνυμο", +"Tags" => "Ετικέτες", +"Edit bookmark" => "Επεξεργασία σελιδοδείκτη", +"Are you sure you want to remove this tag from every entry?" => "Είστε σίγουρος για την αφαίρεση αυτής της ετικέτας από κάθε καταχώρηση;", +"Warning" => "Προειδοποίηση", +"Bookm." => "Σελιδοδεικτ.", +"Add a bookmark" => "Προσθήκη σελιδοδείκτη", +"Close" => "Κλείσιμο", +"The title of the page" => "Τίτλος της σελίδας", +"The address of the page" => "Διεύθυνση της σελίδας", +"Description of the page" => "Περιγραφή της σελίδας", +"Save" => "Αποθήκευση", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Σύρετε αυτό στους σελιδοδείκτες του περιηγητή σας και κάντε κλικ επάνω του, όταν θέλετε να προσθέσετε σύντομα μια ιστοσελίδα ως σελιδοδείκτη:", "Read later" => "Ανάγνωση αργότερα", "Address" => "Διεύθυνση", -"Title" => "Τίτλος", -"Tags" => "Ετικέτες", -"Save bookmark" => "Αποθήκευση σελιδοδείκτη", +"Add bookmark" => "Προσθήκη σελιδοδείκτη", +"List" => "Λίστα", +"Image" => "Εικόνα", +"Hide" => "Απόκρυψη", +"Show" => "Εμφάνιση", +"Related Tags" => "Σχετικές ετικέτες", "You have no bookmarks" => "Δεν έχετε σελιδοδείκτες", -"Bookmarklet
    " => "Εφαρμογίδιο Σελιδοδεικτών
    " +"Edit" => "Επεξεργασία", +"Delete" => "Διαγραφή", +"Cancel" => "Ακύρωση", +"Bookmarklet
    " => "Εφαρμογίδιο Σελιδοδεικτών
    ", +"Import bookmarks" => "Εισαγωγή σελιδοδεικτών", +"Bookmark html file" => "HTML αρχείο σελιδοδείκτη", +"Import" => "Εισαγωγή", +"Export bookmarks" => "Εξαγωγή σελιδοδεικτών", +"Export" => "Εξαγωγή" ); diff --git a/l10n/eo.php b/l10n/eo.php index 12cd7a00..08f9510f 100644 --- a/l10n/eo.php +++ b/l10n/eo.php @@ -1,12 +1,33 @@ "Legosignoj", -"unnamed" => "nenomita", +"Tags" => "Etikedoj", +"Edit bookmark" => "Redakti legosignon", +"Are you sure you want to remove this tag from every entry?" => "Ĉu vi vere volas forigi ĉi tiun etikedon el ĉiu ero?", +"Warning" => "Averto", +"Bookm." => "Legos.", +"Add a bookmark" => "Aldoni legosignon", +"Close" => "Fermi", +"The title of the page" => "Titolo de la paĝo", +"The address of the page" => "Adreso de la paĝo", +"Description of the page" => "Priskribo de la paĝo", +"Save" => "Konservi", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Ŝovu tion ĉi al la legosignoj de via TTT-legilo kaj klaku ĝin, se vi volas rapide legosignigi TTT-paĝon:", "Read later" => "Legi poste", "Address" => "Adreso", -"Title" => "Titolo", -"Tags" => "Etikedoj", -"Save bookmark" => "Konservi legosignon", +"Add bookmark" => "Aldoni legosignon", +"List" => "Listo", +"Image" => "Bildo", +"Hide" => "Malmontri", +"Show" => "Montri", +"Related Tags" => "Rilataj etikedoj", "You have no bookmarks" => "Vi havas neniun legosignon", -"Bookmarklet
    " => "Kodosigno
    " +"Edit" => "Redakti", +"Delete" => "Forigi", +"Cancel" => "Nuligi", +"Bookmarklet
    " => "Kodosigno
    ", +"Import bookmarks" => "Enporti legosignojn", +"Bookmark html file" => "Legosignigi HTML-dosieron", +"Import" => "Enporti", +"Export bookmarks" => "Elporti legosignojn", +"Export" => "Elporti" ); diff --git a/l10n/es.php b/l10n/es.php index 071b0dda..748fa270 100644 --- a/l10n/es.php +++ b/l10n/es.php @@ -1,12 +1,33 @@ "Marcadores", -"unnamed" => "sin nombre", +"Tags" => "Etiquetas", +"Edit bookmark" => "Editar marcador", +"Are you sure you want to remove this tag from every entry?" => "Esta seguro que desea remover este tag de todas las entradas?", +"Warning" => "Preacucion", +"Bookm." => "Marc.", +"Add a bookmark" => "Agregar a marcadores", +"Close" => "cerrrar", +"The title of the page" => "Titulo de la pagina", +"The address of the page" => "Direccion de la pagina", +"Description of the page" => "Descripcion de la pagina", +"Save" => "Guardar", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Arrastra desde aquí a los marcadores de tu navegador, y haz clic cuando quieras marcar una página web rápidamente:", "Read later" => "Leer después", "Address" => "Dirección", -"Title" => "Título", -"Tags" => "Etiquetas", -"Save bookmark" => "Guardar marcador", +"Add bookmark" => "Agregar Marcador", +"List" => "Lista", +"Image" => "Imagen", +"Hide" => "Ocultar", +"Show" => "Mostrar", +"Related Tags" => "Tags relacionados", "You have no bookmarks" => "No tienes marcadores", -"Bookmarklet
    " => "Bookmarklet
    " +"Edit" => "Editar", +"Delete" => "Eliminar", +"Cancel" => "Cancelar", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Importar marcadores", +"Bookmark html file" => "Marcadores en archivo HTML", +"Import" => "Importart", +"Export bookmarks" => "Exportar marcadores", +"Export" => "Exportar" ); diff --git a/l10n/es_AR.php b/l10n/es_AR.php new file mode 100644 index 00000000..e96ed90c --- /dev/null +++ b/l10n/es_AR.php @@ -0,0 +1,33 @@ + "Marcadores", +"Tags" => "Etiquetas", +"Edit bookmark" => "Editar marcadores", +"Are you sure you want to remove this tag from every entry?" => "¿Estás seguro de que querés borrar esta etiqueta de todos los elementos?", +"Warning" => "Atención", +"Bookm." => "Marc.", +"Add a bookmark" => "Agregar un marcador", +"Close" => "Cerrar", +"The title of the page" => "El título de la página", +"The address of the page" => "La dirección de la página", +"Description of the page" => "Descripción de la página", +"Save" => "Guardar", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Arrastrá desde aquí a los marcadores de tu navegador, y hacé click cuando quieras marcar una página web:", +"Read later" => "Leer después", +"Edit" => "Editar", +"Delete" => "Borrar", +"Cancel" => "Cancelar", +"Address" => "Dirección", +"Add bookmark" => "Agregar marcador", +"List" => "Lista", +"Image" => "Imagen", +"Hide" => "Ocultar", +"Show" => "Mostrar", +"Related Tags" => "Etiquetas relacionadas", +"You have no bookmarks" => "No tenés marcadores", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Importar marcadores", +"Bookmark html file" => "Agregar a marcadores archivo html", +"Import" => "Importar", +"Export bookmarks" => "Exportar marcadores", +"Export" => "Exportar" +); diff --git a/l10n/et_EE.php b/l10n/et_EE.php index 8e36a09d..5675292d 100644 --- a/l10n/et_EE.php +++ b/l10n/et_EE.php @@ -1,13 +1,33 @@ "Järjehoidjad", -"unnamed" => "nimetu", +"Tags" => "Sildid", +"Edit bookmark" => "Muuda järjehoidjat", +"Are you sure you want to remove this tag from every entry?" => "Oled sa kindel, et sa soovid kõigilt sissekannetelt seda silti eemaldada?", +"Warning" => "Hoiatus", "Bookm." => "Järjeh.", +"Add a bookmark" => "Lisa järjehoidja", +"Close" => "Sulge", +"The title of the page" => "Lehe pealkiri", +"The address of the page" => "Lehe aadress", +"Description of the page" => "Lehe kirjeldus", +"Save" => "Salvesta", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Lohista see oma veebilehitseja järjehoidjatesse ja kliki sellele, kui sa soovid veebilehte kiirelt lisada:", "Read later" => "Loe hiljem", "Address" => "Aadress", -"Title" => "Pealkiri", -"Tags" => "Sildid", -"Save bookmark" => "Salvesta järjehoidja", +"Add bookmark" => "Lisa järjehoidja", +"List" => "Nimekiri", +"Image" => "Pilt", +"Hide" => "Peida", +"Show" => "Näita", +"Related Tags" => "Seotud sildid", "You have no bookmarks" => "Sul pole järjehoidjaid", -"Bookmarklet
    " => "Järjehoidja vidin
    " +"Edit" => "Muuda", +"Delete" => "Kustuta", +"Cancel" => "Loobu", +"Bookmarklet
    " => "Järjehoidja vidin
    ", +"Import bookmarks" => "Impordi järjehoidjaid", +"Bookmark html file" => "Järjehoidjate HTML-fail", +"Import" => "Impordi", +"Export bookmarks" => "Ekspordi järjehoidjaid", +"Export" => "Ekspordi" ); diff --git a/l10n/eu.php b/l10n/eu.php index 5f2d685d..a3ae700e 100644 --- a/l10n/eu.php +++ b/l10n/eu.php @@ -1,12 +1,33 @@ "Laster-markak", -"unnamed" => "izengabekoa", +"Tags" => "Etiketak", +"Edit bookmark" => "Editatu laster-marka", +"Are you sure you want to remove this tag from every entry?" => "Ziur zaude etiketa hau sarrera guztietatik ezabatu nahi duzula?", +"Warning" => "Abisua", +"Bookm." => "Lasterm.", +"Add a bookmark" => "Gehitu laster-marka", +"Close" => "Itxi", +"The title of the page" => "Orriaren izenburua", +"The address of the page" => "Orriaren helbidea", +"Description of the page" => "Orriaren deskribapena", +"Save" => "Gorde", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Web orri bat laster-marketara azkar gehitzeko, arrastratu hau zure arakatzailearen laster-marketara eta klikatu bertan:", "Read later" => "Irakurri geroago", "Address" => "Helbidea", -"Title" => "Izenburua", -"Tags" => "Etiketak", -"Save bookmark" => "Gorde laster-marka", +"Add bookmark" => "Gehitu laster-marka", +"List" => "Zerrenda", +"Image" => "Irudia", +"Hide" => "Ezkutatu", +"Show" => "Bistaratu", +"Related Tags" => "Erlazionatutako etiketak", "You have no bookmarks" => "Ez duzu laster-markarik", -"Bookmarklet
    " => "Bookmarklet
    " +"Edit" => "Editatu", +"Delete" => "Ezabatu", +"Cancel" => "Ezeztatu", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Inportatu laster-markak", +"Bookmark html file" => "Egin html fitxategi baten laster marka", +"Import" => "Inportatu", +"Export bookmarks" => "Exportatu laster-markak", +"Export" => "Exportatu" ); diff --git a/l10n/fa.php b/l10n/fa.php index 64eaeb15..27fdc169 100644 --- a/l10n/fa.php +++ b/l10n/fa.php @@ -1,11 +1,8 @@ "نشانک‌ها", -"unnamed" => "بدون‌نام", +"Tags" => "برچسب‌ها", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "هنگامی که می‌خواهید کی صفحه‌ی اینترنتی را بسرعت نشان کنید، این را به نشانه‌های مرورگر خود بکشید و روی آن کلیک کنید.", "Read later" => "بعد خوانده‌شود", "Address" => "آدرس", -"Title" => "عنوان", -"Tags" => "برچسب‌ها", -"Save bookmark" => "ذخیره نشانک", "You have no bookmarks" => "شما هیچ نشانکی ندارید" ); diff --git a/l10n/fi_FI.php b/l10n/fi_FI.php index dbf1084d..1b09a13e 100644 --- a/l10n/fi_FI.php +++ b/l10n/fi_FI.php @@ -1,13 +1,32 @@ "Kirjanmerkit", -"unnamed" => "nimetön", +"Tags" => "Tunnisteet", +"Edit bookmark" => "Muokkaa kirjanmerkkejä", +"Are you sure you want to remove this tag from every entry?" => "Haluatko varmasti poistaa tämän tunnisteen jokaiselta kohteelta?", +"Warning" => "Varoitus", "Bookm." => "Kirjanm.", +"Add a bookmark" => "Lisää kirjanmerkki", +"Close" => "Sulje", +"The title of the page" => "Sivun otsikko", +"The address of the page" => "Sivun osoite", +"Description of the page" => "Sivun kuvaus", +"Save" => "Tallenna", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Vedä tämä selaimesi kirjanmerkkipalkkiin ja napsauta sitä, kun haluat lisätä kirjanmerkin nopeasti:", "Read later" => "Lue myöhemmin", "Address" => "Osoite", -"Title" => "Otsikko", -"Tags" => "Tunnisteet", -"Save bookmark" => "Tallenna kirjanmerkki", +"Add bookmark" => "Lisää kirjanmerkki", +"List" => "Lista", +"Image" => "Kuva", +"Hide" => "Piilota", +"Show" => "Näytä", +"Related Tags" => "Vastaavanlaiset tunnisteet", "You have no bookmarks" => "Sinulla ei ole kirjanmerkkejä", -"Bookmarklet
    " => "Kirjanmerkitsin
    " +"Edit" => "Muokkaa", +"Delete" => "Poista", +"Cancel" => "Peru", +"Bookmarklet
    " => "Kirjanmerkitsin
    ", +"Import bookmarks" => "Tuo kirjanmerkkejä", +"Import" => "Tuo", +"Export bookmarks" => "Vie kirjanmerkkejä", +"Export" => "Vie" ); diff --git a/l10n/fr.php b/l10n/fr.php index 8f10dddd..af3fd168 100644 --- a/l10n/fr.php +++ b/l10n/fr.php @@ -1,13 +1,33 @@ "Favoris", -"unnamed" => "sans titre", +"Tags" => "Étiquettes", +"Edit bookmark" => "Modifier le favori", +"Are you sure you want to remove this tag from every entry?" => "Êtes-vous certain de vouloir retirer cette étiquette de chaque entrée ?", +"Warning" => "Attention", "Bookm." => "Fav.", +"Add a bookmark" => "Ajouter un favori", +"Close" => "Fermer", +"The title of the page" => "Le titre de la page", +"The address of the page" => "L'adresse de la page", +"Description of the page" => "Description de la page", +"Save" => "Sauvegarder", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Glissez ceci dans les favoris de votre navigateur, et cliquer dessus lorsque vous souhaitez ajouter la page en cours à vos marques-pages :", "Read later" => "Lire plus tard", "Address" => "Adresse", -"Title" => "Titre", -"Tags" => "Étiquettes", -"Save bookmark" => "Sauvegarder le favori", +"Add bookmark" => "Ajouter le favori", +"List" => "Lister", +"Image" => "Image", +"Hide" => "Masquer", +"Show" => "Afficher", +"Related Tags" => "Étiquettes similaires", "You have no bookmarks" => "Vous n'avez aucun favori", -"Bookmarklet
    " => "Gestionnaire de favoris
    " +"Edit" => "Modifier", +"Delete" => "Supprimer", +"Cancel" => "Annuler", +"Bookmarklet
    " => "Gestionnaire de favoris
    ", +"Import bookmarks" => "Importer des favoris", +"Bookmark html file" => "Mettre en favoris un fichier HTML", +"Import" => "Importer", +"Export bookmarks" => "Exporter les favoris", +"Export" => "Exporter" ); diff --git a/l10n/gl.php b/l10n/gl.php new file mode 100644 index 00000000..8dfe8538 --- /dev/null +++ b/l10n/gl.php @@ -0,0 +1,10 @@ + "Marcadores", +"Tags" => "Etiquetas", +"Bookm." => "Marcad.", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Arrastre esto aos marcadores do seu navegador e pulse nel cando queira marcar unha páxina con rapidez:", +"Read later" => "Ler máis tarde", +"Address" => "Enderezo", +"You have no bookmarks" => "Non ten marcadores", +"Bookmarklet
    " => "Bookmarklet
    " +); diff --git a/l10n/he.php b/l10n/he.php index 6d242dba..acf54838 100644 --- a/l10n/he.php +++ b/l10n/he.php @@ -1,11 +1,8 @@ "סימניות", -"unnamed" => "ללא שם", +"Tags" => "תגיות", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "ניתן לגרור את הקישור הזה אל סרגל הסימניות בדפדפן שלך וללחוץ עליו כאשר מעוניינים ליצור סימניה לאתר במהירות.", "Read later" => "קריאה מאוחרת", "Address" => "כתובת", -"Title" => "כותרת", -"Tags" => "תגיות", -"Save bookmark" => "שמירת סימניה", "You have no bookmarks" => "אין ברשותך סימניות" ); diff --git a/l10n/hu_HU.php b/l10n/hu_HU.php index ea5f0e69..a2207969 100644 --- a/l10n/hu_HU.php +++ b/l10n/hu_HU.php @@ -1,12 +1,9 @@ "Könyvjelzők", -"unnamed" => "névtelen", +"Tags" => "Címkék", "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!", "Read later" => "Később olvasom", "Address" => "Cím", -"Title" => "Felirat", -"Tags" => "Címkék", -"Save bookmark" => "Könyvjelző mentése", "You have no bookmarks" => "Nincsenek könyvjelzőid", "Bookmarklet
    " => "Könyvjelzőalkalmazás
    " ); diff --git a/l10n/id.php b/l10n/id.php new file mode 100644 index 00000000..3b5c5968 --- /dev/null +++ b/l10n/id.php @@ -0,0 +1,19 @@ + "label", +"Warning" => "peringatan", +"Close" => "tutup", +"The title of the page" => "judul laman", +"Save" => "simpan", +"Read later" => "baca nanti", +"Address" => "alamat", +"List" => "daftar", +"Image" => "gambar", +"Hide" => "sembunyikan", +"Show" => "tampilkan", +"Related Tags" => "label terkait", +"Edit" => "ubah", +"Delete" => "hapus", +"Cancel" => "batal", +"Import" => "mengimpor", +"Export" => "mengekspor" +); diff --git a/l10n/it.php b/l10n/it.php index 18be146b..b4f41015 100644 --- a/l10n/it.php +++ b/l10n/it.php @@ -1,13 +1,33 @@ "Segnalibri", -"unnamed" => "senza nome", +"Tags" => "Tag", +"Edit bookmark" => "Modifica segnalibro", +"Are you sure you want to remove this tag from every entry?" => "Sei sicuro di voler rimuovere questo tag da ogni voce?", +"Warning" => "Avviso", "Bookm." => "Segnal.", +"Add a bookmark" => "Aggiungi un segnalibro", +"Close" => "Chiudi", +"The title of the page" => "Il titolo della pagina", +"The address of the page" => "L'indirizzo della pagina", +"Description of the page" => "Descrizione della pagina", +"Save" => "Salva", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Quando vuoi creare rapidamente un segnalibro, trascinalo sui segnalibri del browser e fai clic su di esso:", "Read later" => "Leggi dopo", "Address" => "Indirizzo", -"Title" => "Titolo", -"Tags" => "Tag", -"Save bookmark" => "Salva segnalibro", +"Add bookmark" => "Aggiungi segnalibro", +"List" => "Elenco", +"Image" => "Immagine", +"Hide" => "Nascondi", +"Show" => "Mostra", +"Related Tags" => "Tag correlati", "You have no bookmarks" => "Non hai segnalibri", -"Bookmarklet
    " => "Bookmarklet
    " +"Edit" => "Modifica", +"Delete" => "Elimina", +"Cancel" => "Annulla", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Importa segnalibri", +"Bookmark html file" => "File html di segnalibri", +"Import" => "Importa", +"Export bookmarks" => "Esporta segnalibri", +"Export" => "Esporta" ); diff --git a/l10n/ja_JP.php b/l10n/ja_JP.php index 95480786..3fc870b4 100644 --- a/l10n/ja_JP.php +++ b/l10n/ja_JP.php @@ -1,13 +1,33 @@ "ブックマーク", -"unnamed" => "無名タイトル", +"Tags" => "タグ", +"Edit bookmark" => "ブックマークを編集", +"Are you sure you want to remove this tag from every entry?" => "すべてのエントリからこのタグを削除してもよろしいですか?", +"Warning" => "警告", "Bookm." => "ブックマーク", +"Add a bookmark" => "ブックマークを追加", +"Close" => "閉じる", +"The title of the page" => "ページのタイトル", +"The address of the page" => "ページのアドレス", +"Description of the page" => "ページの説明", +"Save" => "保存", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Webページをすぐにブックマークしたい場合は、これをブラウザのブックマークにドラッグし、クリックしてください:", "Read later" => "後で確認", "Address" => "アドレス", -"Title" => "タイトル", -"Tags" => "タグ", -"Save bookmark" => "ブックマークを保存", +"Add bookmark" => "ブックマークを追加", +"List" => "一覧", +"Image" => "画像", +"Hide" => "非表示", +"Show" => "表示", +"Related Tags" => "関連タグ", "You have no bookmarks" => "ブックマークがありません", -"Bookmarklet
    " => "ブックマークレット
    " +"Edit" => "編集", +"Delete" => "削除", +"Cancel" => "キャンセル", +"Bookmarklet
    " => "ブックマークレット
    ", +"Import bookmarks" => "ブックマークをインポート", +"Bookmark html file" => "ブックマークのHTMLファイル", +"Import" => "インポート", +"Export bookmarks" => "ブックマークをエクスポート", +"Export" => "エクスポート" ); diff --git a/l10n/ka_GE.php b/l10n/ka_GE.php new file mode 100644 index 00000000..1e9bfdbe --- /dev/null +++ b/l10n/ka_GE.php @@ -0,0 +1,33 @@ + "ბუქმარკები", +"Tags" => "ტაგები", +"Edit bookmark" => "ბუქმარკების რედაქტირება", +"Are you sure you want to remove this tag from every entry?" => "დარწმუნებული ხართ რომ აღნიშნული ტაგის წაშლა გინდათ ყველა ჩანაწერიდა?", +"Warning" => "გაფრთხილება", +"Bookm." => "Bookm.", +"Add a bookmark" => "ბუქმარქში დამატება", +"Close" => "დახურვა", +"The title of the page" => "გვერდის სათაური", +"The address of the page" => "გვერდის მისამართი", +"Description of the page" => "გვერდის დახასიათება", +"Save" => "შენახვა", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "გადაათრიეთ ეს თქვენს ბუქმარკებში თუ გინდათ რომ საითი სწრაფად დაბუქმარკდეს", +"Read later" => "წაიკითხე მოგვიანებით", +"Edit" => "რედაქტირება", +"Delete" => "წაშლა", +"Cancel" => "უარყოფა", +"Address" => "მისამართი", +"Add bookmark" => "ბუქმარქის დამატება", +"List" => "სია", +"Image" => "სურათი", +"Hide" => "დამალვა", +"Show" => "გამოჩენა", +"Related Tags" => "Related Tags", +"You have no bookmarks" => "თქვენ არ გაქვთ ბუქმარკები", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "ბუქმარქების იმპორტი", +"Bookmark html file" => "ბუქმარქ html ფაილი", +"Import" => "იმპორტი", +"Export bookmarks" => "ბუქმარქების ექსპორტი", +"Export" => "ექსპორტი" +); diff --git a/l10n/ku_IQ.php b/l10n/ku_IQ.php new file mode 100644 index 00000000..b175a032 --- /dev/null +++ b/l10n/ku_IQ.php @@ -0,0 +1,10 @@ + "دڵخوازه‌کان", +"Tags" => "تاگه‌کان", +"Bookm." => "نیشانکردن", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "رابکێشه‌ ئه‌مه بۆ دڵخوازه‌کان له‌ وێبگه‌ڕه‌که‌ت وه‌ کرته‌ بکه‌ لێی، کاتێك ده‌ته‌وێت ماڵپه‌ڕێك دڵخواز بکه‌ی به‌خێرای:", +"Read later" => "دووای بیخوێنه‌وه", +"Address" => "ناونیشان", +"You have no bookmarks" => "تۆ دڵخوازت نیه", +"Bookmarklet
    " => "دڵخوازکرا
    " +); diff --git a/l10n/nb_NO.php b/l10n/nb_NO.php index f0efeaca..5670ade5 100644 --- a/l10n/nb_NO.php +++ b/l10n/nb_NO.php @@ -1,12 +1,9 @@ "Bokmerker", -"unnamed" => "uten navn", +"Tags" => "Etikett", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Dra denne over din nettlesers bokmerker og klikk den, hvis du ønsker å hurtig legge til bokmerke for en nettside", "Read later" => "Les senere", "Address" => "Adresse", -"Title" => "Tittel", -"Tags" => "Etikett", -"Save bookmark" => "Lagre bokmerke", "You have no bookmarks" => "Du har ingen bokmerker", "Bookmarklet
    " => "Bokmerke
    " ); diff --git a/l10n/nl.php b/l10n/nl.php index 33f25353..52448747 100644 --- a/l10n/nl.php +++ b/l10n/nl.php @@ -1,13 +1,33 @@ "Bladwijzers", -"unnamed" => "geen naam", -"Bookm." => "Bladw.", -"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Sleep dit naar uw browser bladwijzers en klik erop, wanneer u een webpagina snel wilt voorzien van een bladwijzer:", -"Read later" => "Lees later", -"Address" => "Adres", -"Title" => "Titel", "Tags" => "Tags", -"Save bookmark" => "Bewaar bladwijzer", +"Edit bookmark" => "Bewerk bladwijzer", +"Are you sure you want to remove this tag from every entry?" => "Bent u zeker dat u deze tag van elk item wilt verwijderen.", +"Warning" => "Waarschuwing", +"Bookm." => "Bladw.", +"Add a bookmark" => "Voeg een bladwijzer toe", +"Close" => "Sluit", +"The title of the page" => "De pagina titel", +"The address of the page" => "Het pagina adres", +"Description of the page" => "Pagina beschrijving", +"Save" => "Bewaar", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Sleep dit naar uw browser bladwijzer menu en klik erop, wanneer u een webpagina snel wilt voorzien van een bladwijzer:", +"Read later" => "Lees later", +"Edit" => "Bewerk", +"Delete" => "Verwijder", +"Cancel" => "Annuleer", +"Address" => "Adres", +"Add bookmark" => "Bladwijzer toevoegen", +"List" => "Lijst", +"Image" => "Afbeelding", +"Hide" => "Verbergen", +"Show" => "Tonen", +"Related Tags" => "Aanverwante tags", "You have no bookmarks" => "U heeft geen bladwijzers", -"Bookmarklet
    " => "Bookmarklet
    " +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Importeer bladwijzers", +"Bookmark html file" => "Bladwijzer html bestand", +"Import" => "Importeer", +"Export bookmarks" => "Exporteer bladwijzers", +"Export" => "Exporteer" ); diff --git a/l10n/pl.php b/l10n/pl.php index f5d28130..3e763bab 100644 --- a/l10n/pl.php +++ b/l10n/pl.php @@ -1,13 +1,33 @@ "Zakładki", -"unnamed" => "bez nazwy", +"Tags" => "Tagi", +"Edit bookmark" => "Edytuj zakładkę", +"Are you sure you want to remove this tag from every entry?" => "Czy na pewno chcesz usunąć ten tag na każdym wejściu?", +"Warning" => "Ostrzeżenie", "Bookm." => "Zakładka", +"Add a bookmark" => "Dodaj zakładkę", +"Close" => "Zamknij", +"The title of the page" => "Tytuł strony", +"The address of the page" => "Adres strony", +"Description of the page" => "Opis strony", +"Save" => "Zapisz", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Przeciągnij to do ulubionych przeglądarki i kliknij go, gdy użytkownik chce szybko dodać zakładkę strony sieci Web:", "Read later" => "Czytaj później", "Address" => "Adres", -"Title" => "Tytuł", -"Tags" => "Tagi", -"Save bookmark" => "Zapisz zakładkę", +"Add bookmark" => "Dodaj zakładkę", +"List" => "Lista", +"Image" => "Obraz", +"Hide" => "Schowaj", +"Show" => "Pokaż", +"Related Tags" => "Powiązane Tagi", "You have no bookmarks" => "Nie masz żadnych zakładek", -"Bookmarklet
    " => "Skryptozakładka
    " +"Edit" => "Edytuj", +"Delete" => "Usuń", +"Cancel" => "Anuluj", +"Bookmarklet
    " => "Skryptozakładka
    ", +"Import bookmarks" => "Importuj zakładki", +"Bookmark html file" => "Plik HTML zakładek", +"Import" => "Import", +"Export bookmarks" => "Eksportuj zakładki", +"Export" => "Export" ); diff --git a/l10n/pt_BR.php b/l10n/pt_BR.php new file mode 100644 index 00000000..48af8708 --- /dev/null +++ b/l10n/pt_BR.php @@ -0,0 +1,33 @@ + "Marcadores", +"Tags" => "Tags", +"Edit bookmark" => "Editar bookmark", +"Are you sure you want to remove this tag from every entry?" => "Tem certeza que deseja remover esta tag de todas as entradas?", +"Warning" => "Aviso", +"Bookm." => "Marc.", +"Add a bookmark" => "Adicionar um bookmark", +"Close" => "Fechar", +"The title of the page" => "O título da página", +"The address of the page" => "O endereço da página", +"Description of the page" => "Descrição da página", +"Save" => "Salvar", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Arraste isso para os favoritos do seu navegador web e clique nele quando você quiser marcar/favoritar uma página rapidamente:", +"Read later" => "Ler depois", +"Address" => "Endereço", +"Add bookmark" => "Adicionar bookmark", +"List" => "Listar", +"Image" => "Imagem", +"Hide" => "Ocultar", +"Show" => "Exibir", +"Related Tags" => "Tags relacionadas", +"You have no bookmarks" => "Você não tem marcadores", +"Edit" => "Editar", +"Delete" => "Excluir", +"Cancel" => "Cancelar", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Importar bookmarks", +"Bookmark html file" => "Arquivo HTML de bookmark", +"Import" => "Importar", +"Export bookmarks" => "Exportar bookmarks", +"Export" => "Exportar" +); diff --git a/l10n/pt_PT.php b/l10n/pt_PT.php new file mode 100644 index 00000000..29229c91 --- /dev/null +++ b/l10n/pt_PT.php @@ -0,0 +1,33 @@ + "Marcadores", +"Tags" => "Etiquetas", +"Edit bookmark" => "Editar marcador", +"Are you sure you want to remove this tag from every entry?" => "Tem a certeza de que quer remover esta etiqueta de cada registo?", +"Warning" => "Aviso", +"Bookm." => "Marc.", +"Add a bookmark" => "Acrescentar um marcador", +"Close" => "Fechar", +"The title of the page" => "O titulo da página", +"The address of the page" => "O endereço da página", +"Description of the page" => "Descrição da página", +"Save" => "Guardar", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Arraste isto para o seu navegador, e click nele quando quiser guardar a página rapidamente com um marcador.", +"Read later" => "Ler mais tarde", +"Address" => "Endereço", +"Add bookmark" => "Acrescentar marcador", +"List" => "Lista", +"Image" => "Imagem", +"Hide" => "Esconder", +"Show" => "Mostrar", +"Related Tags" => "Etiquetas relacionadas", +"You have no bookmarks" => "Não tem marcadores", +"Edit" => "Editar", +"Delete" => "Apagar", +"Cancel" => "Cancelar", +"Bookmarklet
    " => "Marcador", +"Import bookmarks" => "Importar marcadores", +"Bookmark html file" => "Ficheiro html de marcadores", +"Import" => "Importar", +"Export bookmarks" => "Exportar marcadores", +"Export" => "Exportar" +); diff --git a/l10n/ro.php b/l10n/ro.php new file mode 100644 index 00000000..02a8022f --- /dev/null +++ b/l10n/ro.php @@ -0,0 +1,10 @@ + "Semne de carte", +"Tags" => "Cuvinte cheie", +"Bookm." => "Bookm.", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Trage acest semn în semnele de carte din navigatorul tău web când dorești să salvezi rapid un semn către o pagină web:", +"Read later" => "Citește mai târziu", +"Address" => "Adresă", +"You have no bookmarks" => "Nu ai nici un semn de carte", +"Bookmarklet
    " => "Bookmarklet
    " +); diff --git a/l10n/ru.php b/l10n/ru.php index 06a7a2b8..4cafda86 100644 --- a/l10n/ru.php +++ b/l10n/ru.php @@ -1,13 +1,33 @@ "Закладки", -"unnamed" => "без имени", +"Tags" => "Метки", +"Edit bookmark" => "Редактировать закладку", +"Are you sure you want to remove this tag from every entry?" => "Вы уверены, что хотите удалить этот тег из каждой записи?", +"Warning" => "Предупреждение", "Bookm." => "Закл.", +"Add a bookmark" => "Добавить закладку", +"Close" => "Закрыть", +"The title of the page" => "Заголовок страницы", +"The address of the page" => "Адрес страницы", +"Description of the page" => "Описание страницы", +"Save" => "Сохранить", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Перетащите эту кнопку в закладки вашего браузера и нажимайте на неё для быстрого добавления страницы в закладки:", "Read later" => "Прочитать позже", +"Edit" => "Редактировать", +"Delete" => "Удалить", +"Cancel" => "Отменить", "Address" => "Адрес", -"Title" => "Заголовок", -"Tags" => "Метки", -"Save bookmark" => "Сохранить закладки", +"Add bookmark" => "Добавить закладку", +"List" => "Список", +"Image" => "Изображение", +"Hide" => "Спрятать", +"Show" => "Показать", +"Related Tags" => "Связанные теги", "You have no bookmarks" => "У вас нет закладок", -"Bookmarklet
    " => "Быстрые закладки
    " +"Bookmarklet
    " => "Быстрые закладки
    ", +"Import bookmarks" => "Импортировать закладки", +"Bookmark html file" => "Добавить html-файл в закладки", +"Import" => "Импорт", +"Export bookmarks" => "Экспортировать закладки", +"Export" => "Экспорт" ); diff --git a/l10n/ru_RU.php b/l10n/ru_RU.php new file mode 100644 index 00000000..0dc5633b --- /dev/null +++ b/l10n/ru_RU.php @@ -0,0 +1,33 @@ + "Закладки", +"Tags" => "Теги", +"Edit bookmark" => "Редактировать закладку", +"Are you sure you want to remove this tag from every entry?" => "Вы уверены, что хотите удалить этот тег из каждой записи?", +"Warning" => "Предупреждение", +"Bookm." => "Bookm.", +"Add a bookmark" => "Добавить закладку", +"Close" => "Закрыть", +"The title of the page" => "Заголовок страницы", +"The address of the page" => "Адрес страницы", +"Description of the page" => "Описание страницы", +"Save" => "Сохранить", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Перетащите это в закладки Вашего браузера и кликните на него, когда захотите быстро добавить страницу в закладки:", +"Read later" => "Прочитать позже", +"Address" => "Адрес", +"Add bookmark" => "Добавить закладку", +"List" => "Список", +"Image" => "Изображение", +"Hide" => "Скрыть", +"Show" => "Показать", +"Related Tags" => "Связанные теги", +"You have no bookmarks" => "У Вас нет закладок", +"Edit" => "Редактировать", +"Delete" => "Удалить", +"Cancel" => "Отмена", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "Импорт закладок", +"Bookmark html file" => "Добавить html-файл в закладки ", +"Import" => "Импортировать", +"Export bookmarks" => "Экспорт закладок", +"Export" => "Экспортировать" +); diff --git a/l10n/si_LK.php b/l10n/si_LK.php new file mode 100644 index 00000000..31656589 --- /dev/null +++ b/l10n/si_LK.php @@ -0,0 +1,33 @@ + "පිටු සළකුනු", +"Tags" => "ටැග", +"Edit bookmark" => "පිටු සළකුනු සකසන්න", +"Are you sure you want to remove this tag from every entry?" => "මෙම ටැගය සියළු ඇතුලත් කිරීමකින් ඉවත් කරන බව ඔබට සහතිකද", +"Warning" => "අනතුරු ඇඟවිම", +"Bookm." => "පිටුසන", +"Add a bookmark" => "පිටු සළකුනක් එක් කරන්න", +"Close" => "වසන්න", +"The title of the page" => "පිටුවේ මාතෘකාව", +"The address of the page" => "පිටුවේ ලිපිනය", +"Description of the page" => "පිටුවේ විස්තර", +"Save" => "සුරකින්න", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "මෙම වෙබ් පිටුව ඉක්මනින් පිටු සළකුනක් ලෙස සටහන් කිරීමට, එය බ්‍රවුසරයේ පිටු සළකුනු මතට ඇද ක්ලික් කරන්න:", +"Read later" => "පසුව කියවීමට", +"Edit" => "සකසන්න", +"Delete" => "මකන්න", +"Cancel" => "එපා", +"Address" => "ලිපිනය", +"Add bookmark" => "පිටුසන එකතුකරන්න", +"List" => "ලයිස්තුව", +"Image" => "පින්තූරය", +"Hide" => "සඟවන්න", +"Show" => "පෙන්වන්න", +"Related Tags" => "අදාළ ටැගයන්", +"You have no bookmarks" => "පිටු සළකුනු නොමැත", +"Bookmarklet
    " => "පිටුසන
    ", +"Import bookmarks" => "පිටුසනයන් ආයාත කරන්න", +"Bookmark html file" => "html ගොනුව පිටුසන් කරන්න", +"Import" => "ආයාත කරන්න", +"Export bookmarks" => "පිටුසනයන් නිර්යාත කරන්න", +"Export" => "නිර්යාත කරන්න" +); diff --git a/l10n/sk_SK.php b/l10n/sk_SK.php new file mode 100644 index 00000000..a391fd1f --- /dev/null +++ b/l10n/sk_SK.php @@ -0,0 +1,33 @@ + "Záložky", +"Tags" => "Značky", +"Edit bookmark" => "Upraviť záložku", +"Are you sure you want to remove this tag from every entry?" => "Naozaj ste si istý, že chcete odstrániť túto značku z každého záznamu?", +"Warning" => "Varovanie", +"Bookm." => "Zál.", +"Add a bookmark" => "Pridať záložku", +"Close" => "Zavrieť", +"The title of the page" => "Názov stránky", +"The address of the page" => "Adresa stránky", +"Description of the page" => "Popis stránky", +"Save" => "Uložiť", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Presuňte toto do vášho prehliadača a kliknite ak chcete aktuálnu stránku uložiť do záložiek.", +"Read later" => "Prečítať neskôr", +"Edit" => "Upraviť", +"Delete" => "Zmazať", +"Cancel" => "Zrušiť", +"Address" => "Adresa", +"Add bookmark" => "Pridať záložku", +"List" => "Zoznam", +"Image" => "Obrázok", +"Hide" => "Skyť", +"Show" => "Zobraziť", +"Related Tags" => "Podobné značky", +"You have no bookmarks" => "Nemáte záložky", +"Bookmarklet
    " => "Záložky
    ", +"Import bookmarks" => "Importovať záložky", +"Bookmark html file" => "Html súbor záložiek", +"Import" => "Import", +"Export bookmarks" => "Export záložiek", +"Export" => "Export" +); diff --git a/l10n/sl.php b/l10n/sl.php index 05b939db..f9bf825b 100644 --- a/l10n/sl.php +++ b/l10n/sl.php @@ -1,13 +1,33 @@ "Zaznamki", -"unnamed" => "neimenovano", +"Tags" => "Oznake", +"Edit bookmark" => "Uredi zaznamke", +"Are you sure you want to remove this tag from every entry?" => "Ali res želite odstraniti te oznake iz vsakega vnosa?", +"Warning" => "Opozorilo", "Bookm." => "Zaznam.", +"Add a bookmark" => "Dodaj zaznamek", +"Close" => "Zapri", +"The title of the page" => "Naziv strani", +"The address of the page" => "Naslov strani", +"Description of the page" => "Opis strani", +"Save" => "Shrani", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Povlecite gumb med svoje zaznamke in kliknite nanj, ko želite obiskano spletno stran hitro dodati med svoje zaznamke:", "Read later" => "Preberi kasneje", +"Edit" => "Uredi", +"Delete" => "Izbriši", +"Cancel" => "Prekliči", "Address" => "Naslov", -"Title" => "Ime", -"Tags" => "Oznake", -"Save bookmark" => "Shrani zaznamek", +"Add bookmark" => "Dodaj zaznamek", +"List" => "znam", +"Image" => "Slika", +"Hide" => "Skrij", +"Show" => "Pokaži", +"Related Tags" => "Sorodne oznake", "You have no bookmarks" => "Nimate zaznamkov", -"Bookmarklet
    " => "Vstavek za zaznamke
    " +"Bookmarklet
    " => "Vstavek za zaznamke
    ", +"Import bookmarks" => "Uvozi zaznamke", +"Bookmark html file" => "Datoteka zaznamkov HTML", +"Import" => "Uvozi", +"Export bookmarks" => "Izvozi zaznamke", +"Export" => "Izvozi" ); diff --git a/l10n/sv.php b/l10n/sv.php index 3ea7e9b1..e6d19ebb 100644 --- a/l10n/sv.php +++ b/l10n/sv.php @@ -1,13 +1,33 @@ "Bokmärken", -"unnamed" => "namnlös", +"Tags" => "Taggar", +"Edit bookmark" => "Redigera bokmärke", +"Are you sure you want to remove this tag from every entry?" => "Är du säker på att du vill ta bort denna tagg från varje post?", +"Warning" => "Varning", "Bookm." => "Bokm.", +"Add a bookmark" => "Lägg till ett bokmärke", +"Close" => "Stäng", +"The title of the page" => "Titel på sidan", +"The address of the page" => "Adress till sidan", +"Description of the page" => "Beskrivning av sidan", +"Save" => "Spara", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Dra till din webbläsares bokmärken och klicka på det när du vill bokmärka en webbsida snabbt:", "Read later" => "Läs senare", "Address" => "Adress", -"Title" => "Titel", -"Tags" => "Taggar", -"Save bookmark" => "Spara bokmärke", +"Add bookmark" => "Lägg till bokmärke", +"List" => "Lista", +"Image" => "Bild", +"Hide" => "Göm", +"Show" => "Visa", +"Related Tags" => "Relaterade taggar", "You have no bookmarks" => "Du har inga bokmärken", -"Bookmarklet
    " => "Skriptbokmärke
    " +"Edit" => "Redigera", +"Delete" => "Radera", +"Cancel" => "Avbryt", +"Bookmarklet
    " => "Skriptbokmärke
    ", +"Import bookmarks" => "Importera bokmärken", +"Bookmark html file" => "Bokmärkets html-fil", +"Import" => "Importera", +"Export bookmarks" => "Exportera bokmärken", +"Export" => "Exportera" ); diff --git a/l10n/th_TH.php b/l10n/th_TH.php index 2720de44..87b26f5f 100644 --- a/l10n/th_TH.php +++ b/l10n/th_TH.php @@ -1,13 +1,33 @@ "รายการโปรด", -"unnamed" => "ยังไม่มีชื่อ", +"Tags" => "ป้ายกำกับ", +"Edit bookmark" => "แก้ไขรายการโปรด", +"Are you sure you want to remove this tag from every entry?" => "คุณแน่ใจแล้วหรือว่าต้องการลบป้ายกำกับนี้ออกจากทุกๆรายการ", +"Warning" => "คำเตือน", "Bookm." => "รายการโปรด", +"Add a bookmark" => "เพิ่มรายการโปรด", +"Close" => "ปิด", +"The title of the page" => "ชื่อของหน้า", +"The address of the page" => "ที่อยู่ของหน้า", +"Description of the page" => "คำอธิบายเกี่ยวกับหน้า", +"Save" => "บันทึก", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "ลากสิ่งนี้ไปไว้ที่รายการโปรดในโปรแกรมบราวเซอร์ของคุณ แล้วคลิกที่นั่น, เมื่อคุณต้องการเก็บหน้าเว็บเพจเข้าไปไว้ในรายการโปรดอย่างรวดเร็ว", "Read later" => "อ่านภายหลัง", "Address" => "ที่อยู่", -"Title" => "ชื่อ", -"Tags" => "ป้ายกำกับ", -"Save bookmark" => "บันทึกรายการโปรด", +"Add bookmark" => "เพิ่มรายการโปรด", +"List" => "รายการ", +"Image" => "รูปภาพ", +"Hide" => "ซ๋อน", +"Show" => "แสดง", +"Related Tags" => "ป้ายกำกับอื่นๆที่เกี่ยวข้อง", "You have no bookmarks" => "คุณยังไม่มีรายการโปรด", -"Bookmarklet
    " => "Bookmarklet
    " +"Edit" => "แก้ไข", +"Delete" => "ลบ", +"Cancel" => "ยกเลิก", +"Bookmarklet
    " => "Bookmarklet
    ", +"Import bookmarks" => "นำเข้ารายการโปรด", +"Bookmark html file" => "ไฟล์รายการโปรดในรูปแบบ html", +"Import" => "นำเข้า", +"Export bookmarks" => "ส่งออกรายการโปรด", +"Export" => "ส่งออก" ); diff --git a/l10n/tr.php b/l10n/tr.php new file mode 100644 index 00000000..8c159bf4 --- /dev/null +++ b/l10n/tr.php @@ -0,0 +1,13 @@ + "Etiketler", +"Close" => "Kapat", +"Save" => "Kaydet", +"Read later" => "Sonra oku", +"Edit" => "Düzenle", +"Delete" => "Sil", +"Cancel" => "İptal", +"Address" => "Adres", +"List" => "Liste", +"Hide" => "Gizle", +"Show" => "Göster" +); diff --git a/l10n/uk.php b/l10n/uk.php index 6f6cb7aa..9d1dd9b9 100644 --- a/l10n/uk.php +++ b/l10n/uk.php @@ -1,9 +1,7 @@ "Закладки", +"Tags" => "Теги", "Read later" => "Прочитати пізніше", "Address" => "Адреса", -"Title" => "Назва", -"Tags" => "Теги", -"Save bookmark" => "Зберегти закладку", "You have no bookmarks" => "У вас нема закладок" ); diff --git a/l10n/vi.php b/l10n/vi.php index c0c4de73..b176f162 100644 --- a/l10n/vi.php +++ b/l10n/vi.php @@ -1,12 +1,9 @@ "Đánh dấu", -"unnamed" => "Không tên", +"Tags" => "Tags", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Kéo vào bookmark trình duyệt của bạn và nhấp vào nó, khi bạn muốn đánh dấu một trang web một cách nhanh chóng:", "Read later" => "Đọc sau", "Address" => "Địa chỉ", -"Title" => "Tiêu đề", -"Tags" => "Tags", -"Save bookmark" => "Lưu đánh dấu", "You have no bookmarks" => "Bạn chưa có đánh dấu nào", "Bookmarklet
    " => "Bookmarklet
    " ); diff --git a/l10n/zh_CN.GB2312.php b/l10n/zh_CN.GB2312.php new file mode 100644 index 00000000..d87f2dd1 --- /dev/null +++ b/l10n/zh_CN.GB2312.php @@ -0,0 +1,33 @@ + "书签", +"Tags" => "标签", +"Edit bookmark" => "编辑书签", +"Are you sure you want to remove this tag from every entry?" => "您确定要从所有条目中移除此标签吗?", +"Warning" => "警告", +"Bookm." => "订阅它们。", +"Add a bookmark" => "添加书签", +"Close" => "关闭", +"The title of the page" => "页面标题", +"The address of the page" => "页面地址", +"Description of the page" => "页面描述", +"Save" => "保存", +"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "拖动此物到您的浏览器书签栏,在您想要快速订阅某网页时点击:", +"Read later" => "稍后阅读", +"Address" => "网址", +"Add bookmark" => "添加书签", +"List" => "列表", +"Image" => "图片", +"Hide" => "隐藏", +"Show" => "显示", +"Related Tags" => "相关标签", +"You have no bookmarks" => "您没有书签", +"Edit" => "编辑", +"Delete" => "删除", +"Cancel" => "取消", +"Bookmarklet
    " => "小书签
    ", +"Import bookmarks" => "导入书签", +"Bookmark html file" => "书签 html 文件", +"Import" => "导入", +"Export bookmarks" => "导出书签", +"Export" => "导出" +); diff --git a/l10n/zh_CN.php b/l10n/zh_CN.php index 0510738c..b24113a8 100644 --- a/l10n/zh_CN.php +++ b/l10n/zh_CN.php @@ -1,12 +1,33 @@ "书签", -"unnamed" => "未命名", +"Tags" => "标签", +"Edit bookmark" => "编辑书签", +"Are you sure you want to remove this tag from every entry?" => "确定要从所有条目中移除此标签?", +"Warning" => "警告", +"Bookm." => "书签", +"Add a bookmark" => "新增一个书签", +"Close" => "关闭", +"The title of the page" => "页面名称", +"The address of the page" => "页面地址", +"Description of the page" => "页面描述", +"Save" => "保存", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "拖曳此处到您的浏览器书签处,点击可以将网页快速添加到书签中。", "Read later" => "稍后阅读", +"Edit" => "编辑", +"Delete" => "删除", +"Cancel" => "取消", "Address" => "地址", -"Title" => "标题", -"Tags" => "标签", -"Save bookmark" => "保存书签", +"Add bookmark" => "新增书签", +"List" => "列表", +"Image" => "图像", +"Hide" => "隐藏", +"Show" => "显示", +"Related Tags" => "相关标签", "You have no bookmarks" => "您暂无书签", -"Bookmarklet
    " => "书签应用" +"Bookmarklet
    " => "书签应用", +"Import bookmarks" => "导入书签", +"Bookmark html file" => "书签HTML文件", +"Import" => "导入", +"Export bookmarks" => "导出书签", +"Export" => "导出" ); diff --git a/l10n/zh_TW.php b/l10n/zh_TW.php index e6b8b702..ee1dfded 100644 --- a/l10n/zh_TW.php +++ b/l10n/zh_TW.php @@ -1,12 +1,9 @@ "書籤", -"unnamed" => "未命名", +"Tags" => "標籤", "Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "將此拖曳至您的瀏覽器書籤並點擊, 當你想要將網頁快速地加入書籤:", "Read later" => "稍後閱讀", "Address" => "網址", -"Title" => "標題", -"Tags" => "標籤", -"Save bookmark" => "儲存書籤", "You have no bookmarks" => "你沒有書籤", "Bookmarklet
    " => "書籤小工具" ); diff --git a/lib/bookmarks.php b/lib/bookmarks.php index 094abe11..fc2f2311 100644 --- a/lib/bookmarks.php +++ b/lib/bookmarks.php @@ -25,91 +25,85 @@ */ class OC_Bookmarks_Bookmarks{ + /** + * @brief Finds all tags for bookmarks + * @param filterTags array of tag to look for if empty then every tag + * @param offset result offset + * @param limit number of item to return + */ + public static function findTags($filterTags = array(), $offset = 0, $limit = 10){ + $params = array_merge($filterTags, $filterTags); + array_unshift($params, OCP\USER::getUser()); + $not_in = ''; + if(!empty($filterTags) ) { + $exist_clause = " AND exists (select 1 from *PREFIX*bookmarks_tags + t2 where t2.bookmark_id = t.bookmark_id and tag = ?) "; + + $not_in = ' AND tag not in ('. implode(',', array_fill(0, count($filterTags), '?') ) .')'. + str_repeat($exist_clause, count($filterTags)); + } + $sql = 'SELECT tag, count(*) as nbr from *PREFIX*bookmarks_tags t '. + ' WHERE EXISTS( SELECT 1 from *PREFIX*bookmarks bm where t.bookmark_id = bm.id and user_id = ?) '. + $not_in. + ' group by tag Order by nbr DESC '; + + $query = OCP\DB::prepare($sql, $limit, $offset); + $tags = $query->execute($params)->fetchAll(); + return $tags; + } + /** * @brief Finds all bookmarks, matching the filter * @param offset result offset * @param sqlSortColumn sort result with this column - * @param filter can be: empty -> no filter, a string -> filter this, a string array -> filter for all strings - * @param filterTagOnly if true, filter affacts only tags, else filter affects url, title and tags + * @param filters can be: empty -> no filter, a string -> filter this, a string array -> filter for all strings + * @param filterTagOnly if true, filter affects only tags, else filter affects url, title and tags + * @param limit number of item to return (default 10) if -1 or false then all item are returned * @return void */ - public static function findBookmarks($offset, $sqlSortColumn, $filter, $filterTagOnly) { - //OCP\Util::writeLog('bookmarks', 'findBookmarks ' .$offset. ' '.$sqlSortColumn.' '. $filter.' '. $filterTagOnly ,OCP\Util::DEBUG); + public static function findBookmarks($offset, $sqlSortColumn, $filters, $filterTagOnly, $limit = 10) { $CONFIG_DBTYPE = OCP\Config::getSystemValue( 'dbtype', 'sqlite' ); - + if(is_string($filters)) $filters = array($filters); + $params=array(OCP\USER::getUser()); - - if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) { - $_gc_separator = ', \' \''; - } else { - $_gc_separator = 'SEPARATOR \' \''; + + if($CONFIG_DBTYPE == 'pgsql') { + $group_fct = 'array_agg(tag)'; } + else { + $group_fct = 'GROUP_CONCAT(tag)'; + } + $sql = "SELECT *, (select $group_fct from *PREFIX*bookmarks_tags where bookmark_id = b.id) as tags + FROM *PREFIX*bookmarks b + WHERE user_id = ? "; - if($filter) { - if($CONFIG_DBTYPE == 'pgsql' ) - $tagString = 'array_to_string(array_agg(tag), \' \')'; - else - $tagString = 'tags'; - - $sqlFilterTag = 'HAVING '; - if(is_array($filter)) { - $first = true; - $filterstring = ''; - foreach ($filter as $singleFilter) { - $filterstring = $filterstring . ($first?'':' AND ') . $tagString.' LIKE ? '; - $params[] = '%'.$singleFilter.'%'; - $first=false; - } - $sqlFilterTag = $sqlFilterTag . $filterstring; - } else{ - $sqlFilterTag = $sqlFilterTag .$tagString.' LIKE ? '; - $params[] = '%'.$filter.'%'; + if($filterTagOnly) { + $exist_clause = " AND exists (select id from *PREFIX*bookmarks_tags + t2 where t2.bookmark_id = b.id and tag = ?) "; + $sql .= str_repeat($exist_clause, count($filters)); + $params = array_merge($params, $filters); + } else { + if($CONFIG_DBTYPE == 'mysql') { //Dirty hack to allow usage of alias in where + $sql .= ' having true '; } - } else { - $sqlFilterTag = ''; + foreach($filters as $filter) { + $sql .= ' AND lower(url || title || description || tags ) like ? '; + $params[] = '%' . strtolower($filter) . '%'; + } + } + $sql .= " ORDER BY ".$sqlSortColumn." DESC "; + if($limit == -1 || $limit === false) { + $limit = null; + $offset = null; } - if($CONFIG_DBTYPE == 'pgsql' ) { - $query = OCP\DB::prepare(' - SELECT `id`, `url`, `title`, '.($filterTagOnly?'':'`url` || `title` ||').' array_to_string(array_agg(`tag`), \' \') as `tags` - FROM `*PREFIX*bookmarks` - LEFT JOIN `*PREFIX*bookmarks_tags` ON `*PREFIX*bookmarks`.`id` = `*PREFIX*bookmarks_tags`.`bookmark_id` - WHERE - `*PREFIX*bookmarks`.`user_id` = ? - GROUP BY `id`, `url`, `title` - '.$sqlFilterTag.' - ORDER BY `*PREFIX*bookmarks`.`'.$sqlSortColumn.'` DESC', - 10,$offset); - } else { - if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) - $concatFunction = '(url || title || '; - else - $concatFunction = 'Concat(Concat( url, title), '; - - $query = OCP\DB::prepare(' - SELECT `id`, `url`, `title`, ' - .($filterTagOnly?'':$concatFunction). - 'CASE WHEN `*PREFIX*bookmarks`.`id` = `*PREFIX*bookmarks_tags`.`bookmark_id` - THEN GROUP_CONCAT( `tag` ' .$_gc_separator. ' ) - ELSE \' \' - END ' - .($filterTagOnly?'':')').' - AS `tags` - FROM `*PREFIX*bookmarks` - LEFT JOIN `*PREFIX*bookmarks_tags` ON 1=1 - WHERE (`*PREFIX*bookmarks`.`id` = `*PREFIX*bookmarks_tags`.`bookmark_id` - OR `*PREFIX*bookmarks`.`id` NOT IN ( - SELECT `*PREFIX*bookmarks_tags`.`bookmark_id` FROM `*PREFIX*bookmarks_tags` - ) - ) - AND `*PREFIX*bookmarks`.`user_id` = ? - GROUP BY `url` - '.$sqlFilterTag.' - ORDER BY `*PREFIX*bookmarks`.`'.$sqlSortColumn.'` DESC', - 10, $offset); + $query = OCP\DB::prepare($sql, $limit, $offset); + $results = $query->execute($params)->fetchAll(); + $bookmarks = array(); + foreach($results as $result){ + $result['tags'] = explode(',', $result['tags']); + $bookmarks[] = $result; } - - $bookmarks = $query->execute($params)->fetchAll(); return $bookmarks; } @@ -144,4 +138,241 @@ class OC_Bookmarks_Bookmarks{ $result = $query->execute(); return true; } + + public static function renameTag($old, $new) + { + $user_id = OCP\USER::getUser(); + $CONFIG_DBTYPE = OCP\Config::getSystemValue( 'dbtype', 'sqlite' ); + + + if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) { + // Update tags to the new label unless it already exists a tag like this + $query = OCP\DB::prepare(" + UPDATE OR REPLACE *PREFIX*bookmarks_tags + SET tag = ? + WHERE tag = ? + AND exists( select b.id from *PREFIX*bookmarks b where b.user_id = ? and bookmark_id = b.id) + "); + + $params=array( + $new, + $old, + $user_id, + ); + + $result = $query->execute($params); + } else { + + // Remove potentialy duplicated tags + $query = OCP\DB::prepare(" + DELETE FROM *PREFIX*bookmarks_tags as tgs where tgs.tag = ? + AND exists( select id from *PREFIX*bookmarks where user_id = ? and tgs.bookmark_id = id) + AND exists( select t.tag from *PREFIX*bookmarks_tags t where t.tag=? and tgs.bookmark_id = tbookmark_id"); + + $params=array( + $new, + $user_id, + ); + + $result = $query->execute($params); + + + // Update tags to the new label unless it already exists a tag like this + $query = OCP\DB::prepare(" + UPDATE *PREFIX*bookmarks_tags + SET tag = ? + WHERE tag = ? + AND exists( select b.id from *PREFIX*bookmarks b where b.user_id = ? and bookmark_id = b.id) + "); + + $params=array( + $new, + $old, + $user_id, + $old, + ); + + $result = $query->execute($params); + } + + + return true; + } + + public static function deleteTag($old) + { + $user_id = OCP\USER::getUser(); + + // Update the record + $query = OCP\DB::prepare(" + DELETE FROM *PREFIX*bookmarks_tags + WHERE tag = ? + AND exists( select id from *PREFIX*bookmarks where user_id = ? and bookmark_id = id) + "); + + $params=array( + $old, + $user_id, + ); + + $result = $query->execute($params); + return $result; + } + + /** + * get a string corresponding to the current time depending + * of the OC database system + * @return string + */ + protected static function getNowValue() { + $CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" ); + if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ) { + $_ut = "strftime('%s','now')"; + } elseif($CONFIG_DBTYPE == 'pgsql') { + $_ut = 'date_part(\'epoch\',now())::integer'; + } else { + $_ut = "UNIX_TIMESTAMP()"; + } + return $_ut; + } + + /** + * Edit a bookmark + * @param int $id The id of the bookmark to edit + * @param string $url + * @param string $title Name of the bookmark + * @param array $tags Simple array of tags to qualify the bookmark (different tags are taken from values) + * @param string $description A longer description about the bookmark + * @param boolean $is_public True if the bookmark is publishable to not registered users + * @return null + */ + public static function editBookmark($id, $url, $title, $tags = array(), $description='', $is_public=false) { + + $is_public = $is_public ? 1 : 0; + $user_id = OCP\USER::getUser(); + + // Update the record + $query = OCP\DB::prepare(" + UPDATE *PREFIX*bookmarks SET + url = ?, title = ?, public = ?, description = ?, + lastmodified = ".self::getNowValue() ." + WHERE id = ? + AND user_id = ? + "); + + $params=array( + htmlspecialchars_decode($url), + htmlspecialchars_decode($title), + $is_public, + htmlspecialchars_decode($description), + $id, + $user_id, + ); + + $result = $query->execute($params); + + // Abort the operation if bookmark couldn't be set + // (probably because the user is not allowed to edit this bookmark) + if ($result->numRows() == 0) exit(); + + + // Remove old tags + $sql = "DELETE from *PREFIX*bookmarks_tags WHERE bookmark_id = ?"; + $query = OCP\DB::prepare($sql); + $query->execute(array($id)); + + // Add New Tags + self::addTags($id, $tags); + } + + /** + * Add a bookmark + * @param string $url + * @param string $title Name of the bookmark + * @param array $tags Simple array of tags to qualify the bookmark (different tags are taken from values) + * @param string $description A longer description about the bookmark + * @param boolean $is_public True if the bookmark is publishable to not registered users + * @return int The id of the bookmark created + */ + public static function addBookmark($url, $title, $tags=array(), $description='', $is_public=false) { + + $is_public = $is_public ? 1 : 0; + //FIXME: Detect and do smth when user adds a known URL + $_ut = self::getNowValue(); + + $query = OCP\DB::prepare(" + INSERT INTO *PREFIX*bookmarks + (url, title, user_id, public, added, lastmodified, description) + VALUES (?, ?, ?, ?, $_ut, $_ut, ?) + "); + + $params=array( + htmlspecialchars_decode($url), + htmlspecialchars_decode($title), + OCP\USER::getUser(), + $is_public, + $description, + ); + $query->execute($params); + + $b_id = OCP\DB::insertid('*PREFIX*bookmarks'); + + if($b_id !== false) { + self::addTags($b_id, $tags); + return $b_id; + } + } + + /** + * Add a set of tags for a bookmark + * @param int $bookmark_id The bookmark reference + * @param array $tags Set of tags to add to the bookmark + * @return null + **/ + private static function addTags($bookmark_id, $tags) { + $query = OCP\DB::prepare(" + INSERT INTO *PREFIX*bookmarks_tags + (bookmark_id, tag) + VALUES (?, ?)"); + + foreach ($tags as $tag) { + if(empty($tag)) { + //avoid saving blankspaces + continue; + } + $params = array($bookmark_id, trim($tag)); + $query->execute($params); + } + } + + /** + * Simple function to search for bookmark. call findBookmarks + * @param array $search_words Set of words to look for in bookmars fields + * @return array An Array of bookmarks + **/ + public static function searchBookmarks($search_words) { + return self::findBookmarks(0, 'id', $search_words, false); + } + + public static function importFile($file){ + libxml_use_internal_errors(true); + $dom = new domDocument(); + + $dom->loadHTMLFile($file); + $links = $dom->getElementsByTagName('a'); + + OCP\DB::beginTransaction(); + foreach($links as $link) { + $title = $link->nodeValue; + $ref = $link->getAttribute("href"); + $tag_str = ''; + if($link->hasAttribute("tags")) + $tag_str = $link->getAttribute("tags"); + $tags = explode(',', $tag_str); + + self::addBookmark($ref, $title, $tags); + } + OCP\DB::commit(); + return array(); + } } diff --git a/lib/search.php b/lib/search.php index 28227119..a1e30409 100644 --- a/lib/search.php +++ b/lib/search.php @@ -24,23 +24,18 @@ class OC_Search_Provider_Bookmarks extends OC_Search_Provider{ function search($query) { $l=OC_L10N::get('bookmarks'); $results=array(); - - $offset = 0; - $sqlSortColumn = 'id'; - - $searchquery=array(); + + $search_words=array(); if(substr_count($query, ' ') > 0) { - $searchquery = explode(' ', $query); + $search_words = explode(' ', $query); }else{ - $searchquery = $query; + $search_words = $query; } -// OCP\Util::writeLog('bookmarks', 'search ' .$query ,OCP\Util::DEBUG); - $bookmarks = OC_Bookmarks_Bookmarks::findBookmarks($offset, $sqlSortColumn, $searchquery, false); -// OCP\Util::writeLog('bookmarks', 'found ' .count($bookmarks) ,OCP\Util::DEBUG); - //$l = new OC_l10n('bookmarks'); //resulttype can't be localized, javascript relies on that type + $bookmarks = OC_Bookmarks_Bookmarks::searchBookmarks($search_words); + $l = new OC_l10n('bookmarks'); //resulttype can't be localized, javascript relies on that type foreach($bookmarks as $bookmark) { - $results[]=new OC_Search_Result($bookmark['title'],'', $bookmark['url'],(string) $l->t('Bookm.')); + $results[]=new OC_Search_Result($bookmark['title'], '', $bookmark['url'], (string) $l->t('Bookm.')); } return $results; diff --git a/settings.php b/settings.php index 6db36176..626bbc9e 100644 --- a/settings.php +++ b/settings.php @@ -6,6 +6,27 @@ * See the COPYING-README file. */ -$tmpl = new OCP\Template( 'bookmarks', 'settings'); +OCP\App::checkAppEnabled('bookmarks'); -return $tmpl->fetchPage(); +if (isset($_POST['bm_import'])) { + $error = array(); + + $file = $_FILES['bm_import']['tmp_name']; + if($_FILES['bm_import']['type'] =='text/html') { + $error = OC_Bookmarks_Bookmarks::importFile($file); + + } else { + $error[]= array('error' => 'Unsupported file type for import', + 'hint' => ''); + } + + $tmpl = new OCP\Template('bookmarks', 'settings'); + // Any problems? + if(count($error)) { + $tmpl->assign('error', $error); + } + return $tmpl->fetchPage(); +} else { + $tmpl = new OCP\Template( 'bookmarks', 'settings'); + return $tmpl->fetchPage(); +} diff --git a/templates/addBm.php b/templates/addBm.php index 357e0a18..171b81c8 100644 --- a/templates/addBm.php +++ b/templates/addBm.php @@ -1,11 +1,52 @@ - - - - - Read later - ownCloud - - -

    Saved!

    - Close the window - - \ No newline at end of file +
    + + +

    t('Add a bookmark');?>

    + + +
    +
      +
    • + +
    • + +
    • + +
    • + +
    • +
        + +
      • + +
      +
    • + +
    • + +
    • + +
    • + " /> + + +
    • + +
    + +
    +
    \ No newline at end of file diff --git a/templates/bookmarklet.php b/templates/bookmarklet.php index f54a5124..cc6b1d31 100644 --- a/templates/bookmarklet.php +++ b/templates/bookmarklet.php @@ -3,6 +3,6 @@ function createBookmarklet() { $l = OC_L10N::get('bookmarks'); echo '' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . '' - . '' + . '' . $l->t('Read later') . ''; } diff --git a/templates/js_tpl.php b/templates/js_tpl.php new file mode 100644 index 00000000..55d211f2 --- /dev/null +++ b/templates/js_tpl.php @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/templates/list.php b/templates/list.php index 1e42ef64..c3946c9d 100644 --- a/templates/list.php +++ b/templates/list.php @@ -7,20 +7,51 @@ * See the COPYING-README file. */ ?> - +
    - - - - - + + + +
    + + +
    -
    +
    +
    + t('Hide')?> << + t('Show')?> >> +
    + +

    + +

    + + +
      +
    +
    -