]> source.dussan.org Git - nextcloud-server.git/commitdiff
removed description. changed target to _blank. removed sorting. updated layout.
authorMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Sat, 8 Oct 2011 11:54:45 +0000 (13:54 +0200)
committerMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Sat, 8 Oct 2011 11:54:45 +0000 (13:54 +0200)
apps/bookmarks/addBm.php
apps/bookmarks/ajax/addBookmark.php
apps/bookmarks/ajax/editBookmark.php
apps/bookmarks/ajax/updateList.php
apps/bookmarks/appinfo/database.xml
apps/bookmarks/bookmarksHelper.php
apps/bookmarks/css/bookmarks.css
apps/bookmarks/js/addBm.js
apps/bookmarks/js/bookmarks.js
apps/bookmarks/templates/addBm.php
apps/bookmarks/templates/list.php

index a2a39134eab5ca0e6e59b8f157efbb74dcf126de..a7cdcee8faae1e8fbb56ca7d284ab6c93cc11b53 100644 (file)
@@ -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();
index 0dc83d9014d223295f49b7630d5139ced6590a88..0a7cdfc9be32642d80591152edf417e19d86594d 100644 (file)
@@ -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);
index b427a175e5f5bf3ba97e18b072c95416e11e5368..e205f69bf5a641c56f06a3903e190b218a103c4a 100644 (file)
@@ -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);
 
index 8e9bda0bc201d7d0b0b4fb27656b7278b68c24f0..f2c81256bb63c751871ad91a3dd3ff78b1d52346 100644 (file)
@@ -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 \' \'
index c30db8bd0c8ec8f461aa43d4e97145c0fce59f11..fca38ad84b2d5c5e2d82098cd54360635765e225 100644 (file)
                                <notnull>true</notnull>
                                <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>
index d674e595a80f26b76d52fdf216a0911c85b34525..f66d98a8ccbc4dcbdf2384aee54be55afaeb442e 100644 (file)
@@ -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
index 0fc6a2ad6083d68c09b1aaa47f259e685a7b4837..233d4a02944f667951ae602b97bd7bed2a652796 100644 (file)
        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 {
        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 {
        color: green;
 }
 
-.bookmark_tags {
+.bookmark_tag {
        color: #ff3333;
 }
 
-.clear {
-       clear:both;
-}
-
 .loading_meta {
        display: none;
        margin-left: 5px;
index 7c914f2338af8274e740cd666e6e4ada96603c11..6e13b59bb2e6e686900011bc6893ef2e67550b6d 100644 (file)
@@ -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';
                }
index 8c0b74b6c67591422e058e310dc73d0f0b9cfb36..51646e5382bf8075e862706cf0473bcf38559f6a 100644 (file)
@@ -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>'
index 36f04e135b67f58d53f4102a5128bfc20a2c716a..c285c3579c565e82d459130c0b035df498b32017 100644 (file)
@@ -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>
index 052531f4011cab30947dc1c22a1b2f344109ce80..ccfe74f008f5f1bca0366598a0aa9917ef19b2d1 100644 (file)
@@ -8,28 +8,18 @@
  */
 ?>
 <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">
        <input type="hidden" id="bookmark_add_id" value="0" />
        <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