aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMarvin Thomas Rabe <m.rabe@echtzeitraum.de>2011-10-08 13:54:45 +0200
committerMarvin Thomas Rabe <m.rabe@echtzeitraum.de>2011-10-08 13:54:45 +0200
commit6b64aa3faf1e94a2fc2a1e98b35418d35b73ab22 (patch)
treec474c6fe7b5c9755ef062131ae638fc9b8dbeae2 /apps
parentf3f5d775b519c12e56f4c6db8ca8ccf87c68f19d (diff)
downloadnextcloud-server-6b64aa3faf1e94a2fc2a1e98b35418d35b73ab22.tar.gz
nextcloud-server-6b64aa3faf1e94a2fc2a1e98b35418d35b73ab22.zip
removed description. changed target to _blank. removed sorting. updated layout.
Diffstat (limited to 'apps')
-rw-r--r--apps/bookmarks/addBm.php1
-rw-r--r--apps/bookmarks/ajax/addBookmark.php5
-rw-r--r--apps/bookmarks/ajax/editBookmark.php3
-rw-r--r--apps/bookmarks/ajax/updateList.php2
-rw-r--r--apps/bookmarks/appinfo/database.xml7
-rw-r--r--apps/bookmarks/bookmarksHelper.php4
-rw-r--r--apps/bookmarks/css/bookmarks.css60
-rw-r--r--apps/bookmarks/js/addBm.js3
-rw-r--r--apps/bookmarks/js/bookmarks.js46
-rw-r--r--apps/bookmarks/templates/addBm.php1
-rw-r--r--apps/bookmarks/templates/list.php14
11 files changed, 41 insertions, 105 deletions
diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php
index a2a39134eab..a7cdcee8faa 100644
--- a/apps/bookmarks/addBm.php
+++ b/apps/bookmarks/addBm.php
@@ -41,6 +41,5 @@ $metadata = getURLMetadata($url);
$tmpl->assign('URL', htmlentities($metadata['url']));
$tmpl->assign('TITLE', htmlentities($metadata['title']));
-$tmpl->assign('DESCRIPTION', htmlentities($metadata['description']));
$tmpl->printPage();
diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php
index 0dc83d9014d..0a7cdfc9be3 100644
--- a/apps/bookmarks/ajax/addBookmark.php
+++ b/apps/bookmarks/ajax/addBookmark.php
@@ -40,15 +40,14 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
//FIXME: Detect when user adds a known URL
$query = OC_DB::prepare("
INSERT INTO *PREFIX*bookmarks
- (url, title, description, user_id, public, added, lastmodified)
- VALUES (?, ?, ?, ?, 0, $_ut, $_ut)
+ (url, title, user_id, public, added, lastmodified)
+ VALUES (?, ?, ?, 0, $_ut, $_ut)
");
$params=array(
htmlspecialchars_decode($_GET["url"]),
htmlspecialchars_decode($_GET["title"]),
- htmlspecialchars_decode($_GET["description"]),
OC_User::getUser()
);
$query->execute($params);
diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php
index b427a175e5f..e205f69bf5a 100644
--- a/apps/bookmarks/ajax/editBookmark.php
+++ b/apps/bookmarks/ajax/editBookmark.php
@@ -41,14 +41,13 @@ $bookmark_id = (int)$_GET["id"];
$query = OC_DB::prepare("
UPDATE *PREFIX*bookmarks
- SET url = ?, title =?, description = ?, lastmodified = $_ut
+ SET url = ?, title =?, lastmodified = $_ut
WHERE id = $bookmark_id
");
$params=array(
htmlspecialchars_decode($_GET["url"]),
htmlspecialchars_decode($_GET["title"]),
- htmlspecialchars_decode($_GET["description"]),
);
$query->execute($params);
diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php
index 8e9bda0bc20..f2c81256bb6 100644
--- a/apps/bookmarks/ajax/updateList.php
+++ b/apps/bookmarks/ajax/updateList.php
@@ -59,7 +59,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
}
$query = OC_DB::prepare('
- SELECT id, url, title, description,
+ SELECT id, url, title,
CASE WHEN *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id
THEN GROUP_CONCAT( tag ' .$_gc_separator. ' )
ELSE \' \'
diff --git a/apps/bookmarks/appinfo/database.xml b/apps/bookmarks/appinfo/database.xml
index c30db8bd0c8..fca38ad84b2 100644
--- a/apps/bookmarks/appinfo/database.xml
+++ b/apps/bookmarks/appinfo/database.xml
@@ -30,13 +30,6 @@
<length>140</length>
</field>
<field>
- <name>description</name>
- <type>text</type>
- <default></default>
- <notnull>false</notnull>
- <length>255</length>
- </field>
- <field>
<name>user_id</name>
<type>text</type>
<default></default>
diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index d674e595a80..f66d98a8ccb 100644
--- a/apps/bookmarks/bookmarksHelper.php
+++ b/apps/bookmarks/bookmarksHelper.php
@@ -19,10 +19,6 @@ function getURLMetadata($url) {
$metadata['title'] = htmlspecialchars_decode(@$match[1]);
$meta = get_meta_tags($url);
-
- if(array_key_exists('description', $meta)) {
- $metadata['description'] = $meta['description'];
- }
return $metadata;
} \ No newline at end of file
diff --git a/apps/bookmarks/css/bookmarks.css b/apps/bookmarks/css/bookmarks.css
index 0fc6a2ad608..233d4a02944 100644
--- a/apps/bookmarks/css/bookmarks.css
+++ b/apps/bookmarks/css/bookmarks.css
@@ -12,34 +12,13 @@
padding: 0.5ex;
}
-.bookmark_actions {
- font-size: smaller;
- color: #ff44ff;
- padding-left: 4em;
-}
-
-.bookmark_actions span:hover {
- cursor: pointer;
- text-decoration: underline;
-}
-
-.bookmarks_sorting {
- float: left;
- margin-left: 2em;
-}
-
-.bookmarks_sorting li {
- padding: 1ex 1em;
- border: 1px solid gray;
- -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em;
-}
-
-.bookmarks_sorting_active {
- font-weight: bold;
-}
-
.bookmarks_add {
display: none;
+ margin-top: 45px;
+}
+
+.bookmarks_list {
+ margin-top: 45px;
}
.bookmarks_addBml {
@@ -56,15 +35,28 @@
width: 20em;
}
+.bookmark_actions {
+ display: none;
+ font-size: smaller;
+ color: #666;
+ padding-left: 4em;
+}
+
+.bookmark_actions span:hover {
+ cursor: pointer;
+ text-decoration: underline;
+}
+
.bookmark_single {
- margin-left: 2em;
- margin-top: 3ex;
- padding: 0.5ex;
-/* border-bottom: 1px solid black; */
+ padding: 0.5em 1em;
}
.bookmark_single:hover {
- background-color: #ccccff;
+ background-color: #EAEAEA;
+}
+
+.bookmark_single:hover .bookmark_actions {
+ display: block;
}
.bookmark_title {
@@ -77,14 +69,10 @@
color: green;
}
-.bookmark_tags {
+.bookmark_tag {
color: #ff3333;
}
-.clear {
- clear:both;
-}
-
.loading_meta {
display: none;
margin-left: 5px;
diff --git a/apps/bookmarks/js/addBm.js b/apps/bookmarks/js/addBm.js
index 7c914f2338a..6e13b59bb2e 100644
--- a/apps/bookmarks/js/addBm.js
+++ b/apps/bookmarks/js/addBm.js
@@ -5,11 +5,10 @@ $(document).ready(function() {
function addBookmark(event) {
var url = $('#bookmark_add_url').val();
var title = $('#bookmark_add_title').val();
- var description = $('#bookmark_add_description').val();
var tags = $('#bookmark_add_tags').val();
$.ajax({
url: 'ajax/addBookmark.php',
- data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + encodeURI(description) + '&tags=' + encodeURI(tags),
+ data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
success: function(data){
location.href='index.php';
}
diff --git a/apps/bookmarks/js/bookmarks.js b/apps/bookmarks/js/bookmarks.js
index 8c0b74b6c67..51646e5382b 100644
--- a/apps/bookmarks/js/bookmarks.js
+++ b/apps/bookmarks/js/bookmarks.js
@@ -12,9 +12,6 @@ $(document).ready(function() {
$(window).scroll(updateOnBottom);
$('#bookmark_add_url').focusout(getMetadata);
- $('.' + bookmarks_sorting).addClass('bookmarks_sorting_active');
-
- $('.bookmarks_sorting li').click(function(event){changeSorting(this)});
$('.bookmarks_list').empty();
getBookmarks();
@@ -39,6 +36,7 @@ function getBookmarks() {
for(var i in bookmarks.data) {
updateBookmarksList(bookmarks.data[i]);
}
+
$('.bookmark_link').click(recordClick);
$('.bookmark_delete').click(delBookmark);
$('.bookmark_edit').click(showBookmark);
@@ -57,36 +55,21 @@ function getMetadata() {
success: function(pageinfo){
$('#bookmark_add_url').val(pageinfo.data.url);
$('#bookmark_add_title').val(pageinfo.data.title);
- if (pageinfo.data.description !== undefined){
- $('#bookmark_add_description').val(pageinfo.data.description);
- }
$('.loading_meta').css('display','none');
}
});
}
-function changeSorting(sortEl) {
- $('.' + bookmarks_sorting).removeClass('bookmarks_sorting_active');
- bookmarks_sorting = sortEl.className;
- $('.' + bookmarks_sorting).addClass('bookmarks_sorting_active');
-
- $('.bookmarks_list').empty();
- bookmarks_page = 0;
- bookmarks_loading = false;
- getBookmarks();
-}
-
// function addBookmark() {
// Instead of creating editBookmark() function, Converted the one above to
// addOrEditBookmark() to make .js file more compact.
function addOrEditBookmark(event) {
var id = $('#bookmark_add_id').val();
- var url = encodeEntities($('#bookmark_add_url').val())
- var title = encodeEntities($('#bookmark_add_title').val())
- var description = encodeEntities($('#bookmark_add_description').val())
- var tags = encodeEntities($('#bookmark_add_tags').val())
- var taglist = tags.split(' ')
+ var url = encodeEntities($('#bookmark_add_url').val());
+ var title = encodeEntities($('#bookmark_add_title').val());
+ var tags = encodeEntities($('#bookmark_add_tags').val());
+ var taglist = tags.split(' ');
var tagshtml = '';
for ( var i=0, len=taglist.length; i<len; ++i ){
tagshtml += '<a class="bookmark_tag" href="?tag=' + encodeURI(taglist[i]) + '">' + taglist[i] + '</a> ';
@@ -95,16 +78,15 @@ function addOrEditBookmark(event) {
if (id == 0) {
$.ajax({
url: 'ajax/addBookmark.php',
- data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + encodeURI(description) + '&tags=' + encodeURI(tags),
+ data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
success: function(response){
var bookmark_id = response.data;
$('.bookmarks_add').slideToggle();
$('.bookmarks_add').children('p').children('.bookmarks_input').val('');
$('.bookmarks_list').prepend(
'<div class="bookmark_single" data-id="' + bookmark_id + '" >' +
- '<p class="bookmark_title"><a href="' + url + '" target="_new" class="bookmark_link">' + title + '</a></p>' +
+ '<p class="bookmark_title"><a href="' + url + '" target="_blank" class="bookmark_link">' + title + '</a></p>' +
'<p class="bookmark_url">' + url + '</p>' +
- '<p class="bookmark_description">' + description + '</p>' +
'<p class="bookmark_tags">' + tagshtml + '</p>' +
'<p class="bookmark_actions"><span class="bookmark_delete">Delete</span>&nbsp;<span class="bookmark_edit">Edit</span></p>' +
'</div>'
@@ -115,8 +97,7 @@ function addOrEditBookmark(event) {
else {
$.ajax({
url: 'ajax/editBookmark.php',
- data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' +
- encodeURI(description) + '&tags=' + encodeURI(tags),
+ data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags),
success: function(){
$('.bookmarks_add').slideToggle();
$('.bookmarks_add').children('p').children('.bookmarks_input').val('');
@@ -124,7 +105,6 @@ function addOrEditBookmark(event) {
var record = $('.bookmark_single[data-id = "' + id + '"]');
record.children('.bookmark_url:first').text(url);
- record.children('.bookmark_description:first').text(description);
var record_title = record.children('.bookmark_title:first').children('a:first');
record_title.attr('href', url);
@@ -138,7 +118,7 @@ function addOrEditBookmark(event) {
}
function delBookmark(event) {
- var record = $(this).parent().parent()
+ var record = $(this).parent().parent();
$.ajax({
url: 'ajax/delBookmark.php',
data: 'url=' + encodeURI($(this).parent().parent().children('.bookmark_url:first').text()),
@@ -151,7 +131,6 @@ function showBookmark(event) {
$('#bookmark_add_id').val(record.attr('data-id'));
$('#bookmark_add_url').val(record.children('.bookmark_url:first').text());
$('#bookmark_add_title').val(record.children('.bookmark_title:first').text());
- $('#bookmark_add_description').val(record.children('.bookmark_description:first').text());
$('#bookmark_add_tags').val(record.children('.bookmark_tags:first').text());
if ($('.bookmarks_add').css('display') == 'none') {
@@ -163,10 +142,6 @@ function showBookmark(event) {
}
-function editBookmark(event) {
-
-}
-
function updateBookmarksList(bookmark) {
var tags = encodeEntities(bookmark.tags).split(' ');
var taglist = '';
@@ -178,9 +153,8 @@ function updateBookmarksList(bookmark) {
}
$('.bookmarks_list').append(
'<div class="bookmark_single" data-id="' + bookmark.id +'" >' +
- '<p class="bookmark_title"><a href="' + encodeEntities(bookmark.url) + '" target="_new" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a></p>' +
+ '<p class="bookmark_title"><a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a></p>' +
'<p class="bookmark_url">' + encodeEntities(bookmark.url) + '</p>' +
- '<p class="bookmark_description">' + encodeEntities(bookmark.description) + '</p>' +
'<p class="bookmark_tags">' + taglist + '</p>' +
'<p class="bookmark_actions"><span class="bookmark_delete">Delete</span>&nbsp;<span class="bookmark_edit">Edit</span></p>' +
'</div>'
diff --git a/apps/bookmarks/templates/addBm.php b/apps/bookmarks/templates/addBm.php
index 36f04e135b6..c285c3579c5 100644
--- a/apps/bookmarks/templates/addBm.php
+++ b/apps/bookmarks/templates/addBm.php
@@ -1,7 +1,6 @@
<div class="bookmarks_addBm">
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<?php echo $_['URL']; ?>"/></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<?php echo $_['TITLE']; ?>" /></p>
- <p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<?php echo $_['DESCRIPTION']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
diff --git a/apps/bookmarks/templates/list.php b/apps/bookmarks/templates/list.php
index 052531f4011..ccfe74f008f 100644
--- a/apps/bookmarks/templates/list.php
+++ b/apps/bookmarks/templates/list.php
@@ -8,8 +8,7 @@
*/
?>
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" />
-<h2 class="bookmarks_headline"><?php echo isset($_GET["tag"]) ? $l->t('Bookmarks with tag: ') . urldecode($_GET["tag"]) : $l->t('All bookmarks'); ?></h2>
-<div class="bookmarks_menu">
+<div id="controls">
<input type="button" class="bookmarks_addBtn" value="<?php echo $l->t('Add bookmark'); ?>"/>
</div>
<div class="bookmarks_add">
@@ -17,19 +16,10 @@
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" />
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
- <p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" />
- <img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
</div>
-<div class="bookmarks_sorting pager">
- <ul>
- <li class="bookmarks_sorting_recent"><?php echo $l->t('Recent Bookmarks'); ?></li>
- <li class="bookmarks_sorting_clicks"><?php echo $l->t('Most clicks'); ?></li>
- </ul>
-</div>
-<div class="clear"></div>
<div class="bookmarks_list">
<?php echo $l->t('You have no bookmarks'); ?>
-</div>
+</div> \ No newline at end of file