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

Merge branch 'master' into navigation

This commit is contained in:
Jan-Christoph Borchardt 2013-01-15 20:36:33 +07:00
commit c1d1ce6cd8
7 changed files with 63 additions and 31 deletions

View File

@ -29,14 +29,13 @@ OCP\JSON::checkAppEnabled('bookmarks');
// If we go the dialog form submit
if(isset($_POST['url'])) {
$title = '';
$title = isset($_POST['title']) ? $_POST['title'] : '';
$tags = isset($_POST['item']['tags']) ? $_POST['item']['tags'] : array();
$pub = isset($_POST['is_public']) ? true : false;
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);
$title = $_POST['title'];
}
else {
if(isset($_POST['from_own'])) {

View File

@ -265,7 +265,7 @@ function updateBookmarksList(bookmark, position) {
var taglist = '';
for ( var i=0, len=tags.length; i<len; ++i ){
if(tags[i] != '')
taglist = taglist + '<a class="bookmark_tag" href="#">' + encodeEntities(tags[i]) + '</a> ';
taglist = taglist + '<a class="bookmark_tag" href="#">' + escapeHTML(tags[i]) + '</a> ';
}
if(!hasProtocol(bookmark.url)) {
bookmark.url = 'http://' + bookmark.url;
@ -312,14 +312,6 @@ function recordClick(event) {
});
}
function encodeEntities(s){
try {
return $('<div/>').text(s).html();
} catch (ex) {
return "";
}
}
function hasProtocol(url) {
var regexp = /(ftp|http|https|sftp)/;
return regexp.test(url);

View File

@ -1,14 +1,7 @@
<?php $TRANSLATIONS = array(
"Bookmarks" => "Отметки",
"Tags" => "Етикети",
"Bookmarks" => "Предпочитани",
"Save" => "Запис",
"Delete" => "Изтриване",
"Cancel" => "Отказ",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "Завлачете това в лентата с отметки на браузъра си и го натискайте, когато искате да отметнете бързо някоя страница:",
"Read later" => "Отмятане",
"Address" => "Адрес",
"Add" => "Добавяне",
"You have no bookmarks" => "Нямате отметки",
"Export" => "Изнасяне",
"Import" => "Внасяне"
"Settings" => "Настройки"
);

33
l10n/bn_BD.php Normal file
View File

@ -0,0 +1,33 @@
<?php $TRANSLATIONS = array(
"Unsupported file type for import" => "আমদানি করার জন্য ফাইলের ফর্ম্যাটটি সঠিক নয়",
"Bookmarks" => "ঠিকাসমূহ",
"Tags" => "ট্যাগ",
"Filter by tag" => "ট্যাগ অনুসারে ছাঁক",
"Edit bookmark" => "ঠিকা সম্পাদনা",
"Are you sure you want to remove this tag from every entry?" => "প্রত্যেক ভুক্তি থেকে এই ট্যাগটি অপসারণ করতে আপনি কি বদ্ধপরিকর?",
"Warning" => "সতর্কবাণী",
"Import completed successfully." => "আমদানি সুসম্পন্ন হয়েছে।",
"Uploading..." => "আপলোড করা হচ্ছে..........",
"Bookm." => "ঠিকা",
"Add a bookmark" => "ঠিকা যোগ করুন",
"Close" => "বন্ধ",
"The title of the page" => "পৃষ্ঠার শিরোনাম",
"The address of the page" => "পৃষ্ঠার ঠিকানা",
"Description of the page" => "পৃষ্ঠার বিবরণ",
"Save" => "সংরক্ষণ কর",
"Delete" => "মুছে ফেল",
"Edit" => "সম্পাদনা",
"Cancel" => "বাতিল",
"Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:" => "দ্রুত কোন ওয়েবপেজ ঠিকাতে সংরক্ষণ করতে চাইলে এটিকে টেনে ব্রাউজারের ঠিকাতে নিয়ে যান এবং তাতে ক্লিক করুনঃ",
"Read later" => "পরে পড়ার জন্য সংরক্ষন কর",
"Address" => "ঠিকানা",
"Add" => "যোগ কর",
"Related Tags" => "সম্পর্কযুক্ত ট্যাগ",
"Settings" => "নিয়ামকসমূহ",
"You have no bookmarks" => "আপনার কোন ঠিক নেই",
"You can also try to import a bookmark file" => "আপনি একটি ঠিকা ফাইল আমদানি করার চেষ্টা করে দেখতে পারেন",
"Bookmarklet" => "অনুঠিকা",
"Export & Import" => "আমদানি এবং রপ্তানি",
"Export" => "রপ্তানি",
"Import" => "আমদানি"
);

View File

@ -1,8 +1,19 @@
<?php $TRANSLATIONS = array(
"Unsupported file type for import" => "Az importálandó fájltípus nem támogatott",
"Bookmarks" => "Könyvjelzők",
"Tags" => "Címkék",
"Filter by tag" => "Rendezés címkék szerint",
"Edit bookmark" => "Könyvjelző szerkesztése",
"Are you sure you want to remove this tag from every entry?" => "Biztos vagy benne, hogy el szeretnéd távolítani ezt a címkét az összes bejegyzésből?",
"Warning" => "Figyelmeztetés",
"Import completed successfully." => "Sikeres importálás.",
"Uploading..." => "Feltöltés...",
"Bookm." => "Könyvj.",
"Add a bookmark" => "Könyvjelző hozzáadása",
"Close" => "Bezár",
"The title of the page" => "Az oldal neve",
"The address of the page" => "Az oldal webcíme",
"Description of the page" => "Az oldal leírása",
"Save" => "Mentés",
"Delete" => "Törlés",
"Edit" => "Szerkesztés",
@ -11,8 +22,12 @@
"Read later" => "Később olvasom",
"Address" => "Cím",
"Add" => "Hozzáad",
"Related Tags" => "Kapcsolódó címkék",
"Settings" => "Beállítások",
"You have no bookmarks" => "Nincsenek könyvjelzőid",
"You can also try to import a bookmark file" => "Akár importálhatsz is egy könyvjelző fájlt",
"Bookmarklet" => "Könyvjelző",
"Export & Import" => "Export és import",
"Export" => "Exportálás",
"Import" => "Import"
);

View File

@ -384,14 +384,14 @@ class OC_Bookmarks_Bookmarks{
$url = 'http://' . $url;
}
$metadata['url'] = $url;
if (!function_exists('curl_init')) {
return $metadata;
}
$page = OC_Util::getUrlContent($url);
if($page) {
if(preg_match( "/<title>(.*)<\/title>/sUi", $page, $match ) !== false)
$metadata['title'] = htmlspecialchars_decode($match[1]);
$metadata['title'] = html_entity_decode($match[1], ENT_NOQUOTES , 'UTF-8');
//Not the best solution but....
$metadata['title'] = str_replace('&trade;', chr(153), $metadata['title']);
$metadata['title'] = str_replace('&dash;', '', $metadata['title']);
$metadata['title'] = str_replace('&ndash;', '', $metadata['title']);
}
return $metadata;
}

View File

@ -7,10 +7,10 @@
</span>&nbsp;
</p>
<p class="bookmark_title">
<a href="<%= encodeEntities(url) %>" target="_blank" class="bookmark_link">
<%= encodeEntities(title == '' ? url : title ) %>
<a href="<%= encodeURI(url) %>" target="_blank" class="bookmark_link">
<%= escapeHTML(title == '' ? encodeURI(url) : title ) %>
</a>
<span class="bookmark_desc"><%= encodeEntities(description)%> </span>
<span class="bookmark_desc"><%= escapeHTML(description)%> </span>
<span class="bookmark_date"><%= formatDate(added_date) %></span>
</p>
<div class="bookmark_edit_btn">
@ -28,11 +28,11 @@
<input type="hidden" name="record_id" value="<%= id %>" />
<p class="bookmark_form_title">
<input type="text" name="title" placeholder="<?php echo $l->t('The title of the page');?>"
value="<%= title %>"/>
value="<%= escapeHTML(title) %>"/>
</p>
<p class="bookmark_form_url">
<input type="text" name="url" placeholder="<?php echo $l->t('The address of the page');?>"
value="<%= encodeEntities(url)%>"/>
value="<%= encodeURI(url)%>"/>
</p>
<div class="bookmark_form_tags"><ul>
<% for ( var i = 0; i < tags.length; i++ ) { %>
@ -41,7 +41,7 @@
</ul></div>
<p class="bookmark_form_desc">
<textarea name="description" placeholder="<?php echo $l->t('Description of the page');?>"
><%= description%></textarea>
><%= escapeHTML(description) %></textarea>
</p>
<p class="bookmark_form_submit"><button class="reset" ><?php echo $l->t('Cancel');?></button>
<input type="submit" value="<?php echo $l->t('Save');?>">