]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge remote-tracking branch 'ArthurHoaro/autocomplete' into next
authornodiscc <nodiscc@gmail.com>
Sun, 15 Mar 2015 13:21:59 +0000 (14:21 +0100)
committernodiscc <nodiscc@gmail.com>
Sun, 15 Mar 2015 13:21:59 +0000 (14:21 +0100)
1  2 
COPYING
inc/shaarli.css
index.php

diff --combined COPYING
index 7312abd3763c96c99baf5821b98a4050b14fecc0,720cf643a0001709e9b1c936de6e3d732ed8a708..7e222aafce0ea888f1e76b32247095d06c477f19
+++ b/COPYING
@@@ -18,7 -18,6 +18,7 @@@ Copyright: (c) 2011-2015 Sébastien SAU
             (c) 2011-2015 virtualtam <virtualtam@flibidi.org>
             (c) 2011-2015 qwertygc <champlywood@free.fr>
             (c) 2011-2015 idleman <idleman@idleman.fr>
 +           (c) 2015 Miloš Jovanović <mjovanovic@gmail.com>
  
  
  Files: inc/reset.css
@@@ -47,10 -46,6 +47,6 @@@ Files: images/logo.pn
  License: zlib/libpng
  Copyright: (c) 2011-2014 idleman idleman@idleman.fr
  
- Files: Files: inc/jquery*.js, inc/jquery-ui*.js
- License: MIT License (http://opensource.org/licenses/MIT)
- Copyright: (C) jQuery Foundation and other contributors,https://jquery.com/download/
  Files: inc/blazy*.js
  License: MIT License (http://opensource.org/licenses/MIT)
  Copyright: (C) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy
@@@ -64,6 -59,10 +60,10 @@@ Copyright: 2011-2012, Federico Ulfo <ra
             2011-2012, The Rain Team <hello@raintm.com>
  License: LGPL-3+ (https://www.gnu.org/licenses/lgpl-3.0.txt)
  
+ Files: inc/awesomplete*
+ License: MIT License (http://opensource.org/licenses/MIT)
+ Copyright: (C) 2015 Lea Verou - https://github.com/LeaVerou/awesomplete
  ----------------------------------------------------
  ZLIB/LIBPNG LICENSE
  
diff --combined inc/shaarli.css
index 34c32224180c908ccc8c5d574877c27b531b8a06,53a407c44868f381a3ab1d9b908bf0010ed3b6c4..7bfdc420f601d04ce6f5297946838b3ac4fd7fee
@@@ -17,7 -17,7 +17,7 @@@ input, textarea 
      background: linear-gradient(#dedede, #ffffff);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
      padding: 5px;
 -    border-radius: 5px 5px 5px 5px;
 +    border-radius: 3px 3px 3px 3px;
      border: none;
      color: #000;
  }
@@@ -84,14 -84,21 +84,14 @@@ h1 
  
  .linkeditbuttons {
      position: absolute;
 -    left: -1px;
 +    left: 2px;
      padding: 4px 2px 2px 2px;
 -    background-color: #f0f0f0;
  
      -webkit-border-radius: 0px 6px 6px 0px;
      -moz-border-radius: 0px 6px 6px 0px;
      -o-border-radius: 0px 6px 6px 0px;
      -ms-border-radius: 0px 6px 6px 0px;
      border-radius: 0px 6px 6px 0px;
 -
 -    -webkit-box-shadow: 0px 0px 3px 0px #333333;
 -    -moz-box-shadow: 0px 0px 3px 0px #333333;
 -    -o-box-shadow: 0px 0px 3px 0px #333333;
 -    -ms-box-shadow: 0px 0px 3px 0px #333333;
 -    box-shadow: 0px 0px 3px 0px #333333;
  }
  
  #pageheader #logo {
      cursor: pointer;
  }
  
 +#pageheader #menu {
 +    width: 100%;
 +}
 +
 +#pageheader #menu ul {
 +    margin: auto;
 +    padding: 7px 0px 0px 0px;
 +    float: none;
 +}
 +
 +#pageheader #menu ul li {
 +    list-style: none;
 +    display: inline;
 +    position: relative;
 +    box-sizing: border-box;
 +}
 +
 +#pageheader a {
 +    background-color: #333333;
 +    background: -webkit-gradient(linear, 0 0, 0 bottom, from(#333333), to(#000000));
 +    background: -webkit-linear-gradient(#333333, #000000);
 +    background: -moz-linear-gradient(#333333, #000000);
 +    background: -ms-linear-gradient(#333333, #000000);
 +    background: -o-linear-gradient(#333333, #000000);
 +    background: linear-gradient(#333333, #000000);
 +    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
 +    padding: 5px;
 +    border-radius: 3px 3px 3px 3px;
 +    margin: 10px 3px 3px 3px;
 +    color: #A2DD42;
 +    text-decoration: none;
 +    line-height: 2.5;
 +    white-space: nowrap;
 +}
 +
  #pageheader #linkcount {
      float: right;
      font-style: italic;
      color: #bbb;
      text-align: right;
      padding-right: 5px;
 +    margin: 3px 3px 0px 0px;
  }
  
  #pageheader {
      margin: auto;
  }
  
 -#pageheader a {
 -    background-color: #333333;
 -    background: -webkit-gradient(linear, 0 0, 0 bottom, from(#333333), to(#000000));
 -    background: -webkit-linear-gradient(#333333, #000000);
 -    background: -moz-linear-gradient(#333333, #000000);
 -    background: -ms-linear-gradient(#333333, #000000);
 -    background: -o-linear-gradient(#333333, #000000);
 -    background: linear-gradient(#333333, #000000);
 -    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
 -    padding: 5px;
 -    border-radius: 5px 5px 5px 5px;
 -    margin: 10px 3px 3px 3px;
 -    color: #A2DD42;
 -    float: left;
 -    text-decoration: none;
 -}
 -
  #pageheader .search {
      width: 100%;
      white-space: nowrap;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
      padding: 5px;
      border: none;
 -    border-radius: 5px 5px 5px 5px;
 +    border-radius: 3px 3px 3px 3px;
      margin: 10px 3px 3px 3px;
      color: #cecece;
  }
      padding: 0 5px 0 5px;
      margin: 5px 0 5px 0;
      height: 20px;
 -    border-radius: 5px 5px 5px 5px;
 +    border-radius: 3px 3px 3px 3px;
      cursor: pointer;
  }
  
  .paging_linksperpage {
      float: right;
      padding-right: 5px;
 +    margin: 0px 10px 2px 0px;
  }
  
  .paging_linksperpage form.linksperpage {
  
  #editlinkform {
      height: 100%;
-     color: #ffffff;
      padding: 5px 5px 5px 15px;
      width: 80%;
      clear: left;
  }
  
+ #editlinkform label {
+     color: #ffffff;
+ }
  #editlinkform textarea, #editlinkform .lf_input {
      width: 100%;
  }
@@@ -401,12 -391,12 +404,12 @@@ a.qrcode img 
  }
  
  #linklist li.private {
 -    background: url('../images/private.png') no-repeat 10px center;
 -    padding-left: 60px;
 +    background: url('../images/private.png') no-repeat 4px center;
 +    padding-left: 30px;
  }
  
  #linklist li {
 -    padding-left: 26px;
 +    padding-left: 30px;
  }
  
  .private .linktitle a {
      background: -o-linear-gradient(#F2F2F2, #ffffff);
      background: linear-gradient(#F2F2F2, #ffffff);
      box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
 -    padding: 3px 3px 3px 20px;
 +    padding: 3px 5px 3px 20px;
      height: 20px;
 -    border-radius: 3px 3px 3px 3px;
 +    border-radius: 3px;
      cursor: pointer;
      background-image: url('../images/tag_blue.png');
      background-repeat: no-repeat;
  #footer {
      font-size: 8pt;
      text-align: center;
 -    border-top: 1px solid #ddd;
      color: #888;
      clear: both;
 +    max-width: 30em;
 +    margin: 15px auto 15px auto;
  }
  
  #footer a {
      margin-left: 40px;
  }
  
+ #changetag div {
+     float:left;
+ }
+ #changetag label {
+     padding: 5px;
+ }
+ #changetag li {
+     color: #000;
+ }
  #configform td {
      color: #ccc;
      font-size: 10pt;
  
  .thumbnail {
      float: right;
 -    margin-left: 10px;
 +    margin: 0px 10px 0px 10px;
 +}
 +
 +.thumbnail img {
 +    border-radius: 3px;
 +    box-shadow: 0.5px 0.5px 0.5px 1px #dde4e6;
  }
  
  /* If you want thumbnails on the left:
      text-shadow: 2px 2px 1px #000000;
  }
  
- /* Minimal customisation for jQuery widgets */
- .ui-autocomplete {
-     background-color: #fff;
-     padding-left: 5px;
- }
- .ui-state-hover {
-     background-color: #604dff;
-     color: #fff;
- }
  #linklist li.publicLinkHightLight {
      background: #ffffff;
  }
@@@ -875,6 -859,10 +878,10 @@@ div.dailyNoEntry 
      text-align: right;
  }
  
+ .white {
+     color: white;
+ }
  /* For lazy images loading in picture wall.
     Using http://www.appelsiini.net/projects/lazyload
  */
        display: none;
      }
  
 -    #pageheader a {
 +    #pageheader #menu ul {
 +        text-align: center;
 +    }
 +
 +    #pageheader #menu a {
        padding: 5px;
 -      border-radius: 5px 5px 5px 5px;
 +      border-radius: 3px 3px 3px 3px;
        margin: 3px;
      }
  
      .searchform, .tagfilter {
        display: block !important;
 -      margin: 0px !important;
 +      margin: 0px 3px 7px 0px !important;
        padding: 0px !important;
 -      width: 100% !important;
 +      width: 97% !important;
      }
  
      .searchform input, .tagfilter input {
        padding: 3px 5px 3px 5px;
        background-color: #666;
        color: #fff;
 -      border-radius: 5px 5px 5px 5px;
 +      border-radius: 3px 3px 3px 3px;
      }
  
      .thumbnail {
diff --combined index.php
index 066058e617d651e01297abb2515b3573cd06fc50,83a54f86d08d590c060d2fdc865f00ef40447167..a82c4409ff8709c65965eacf40ce1aa1e296fcd8
+++ b/index.php
@@@ -1491,6 -1491,7 +1491,7 @@@ function renderPage(
              $PAGE = new pageBuilder;
              $PAGE->assign('linkcount',count($LINKSDB));
              $PAGE->assign('token',getToken());
+             $PAGE->assign('tags', $LINKSDB->allTags());
              $PAGE->renderPage('changetag');
              exit;
          }
          $tags = trim(preg_replace('/\s\s+/',' ', $_POST['lf_tags'])); // Remove multiple spaces.
          $linkdate=$_POST['lf_linkdate'];
          $url = trim($_POST['lf_url']);
 -        if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?'))
 +        if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?') && !startsWith($url,'javascript:'))
              $url = 'http://'.$url;
          $link = array('title'=>trim($_POST['lf_title']),'url'=>$url,'description'=>trim($_POST['lf_description']),'private'=>(isset($_POST['lf_private']) ? 1 : 0),
                        'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags));
          $PAGE->assign('link_is_new',false);
          $PAGE->assign('token',getToken()); // XSRF protection.
          $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
+         $PAGE->assign('tags', $LINKSDB->allTags());
          $PAGE->renderPage('editlink');
          exit;
      }
          $PAGE->assign('link_is_new',$link_is_new);
          $PAGE->assign('token',getToken()); // XSRF protection.
          $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
+         $PAGE->assign('tags', $LINKSDB->allTags());
          $PAGE->renderPage('editlink');
          exit;
      }
@@@ -2309,45 -2312,6 +2312,6 @@@ if (!function_exists('json_encode')) 
      }
  }
  
- // Webservices (for use with jQuery/jQueryUI)
- // e.g. index.php?ws=tags&term=minecr
- function processWS()
- {
-     if (empty($_GET['ws']) || empty($_GET['term'])) return;
-     $term = $_GET['term'];
-     $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
-     header('Content-Type: application/json; charset=utf-8');
-     // Search in tags (case insensitive, cumulative search)
-     if ($_GET['ws']=='tags')
-     {
-         $tags=explode(' ',str_replace(',',' ',$term)); $last = array_pop($tags); // Get the last term ("a b c d" ==> "a b c", "d")
-         $addtags=''; if ($tags) $addtags=implode(' ',$tags).' '; // We will pre-pend previous tags
-         $suggested=array();
-         /* To speed up things, we store list of tags in session */
-         if (empty($_SESSION['tags'])) $_SESSION['tags'] = $LINKSDB->allTags();
-         foreach($_SESSION['tags'] as $key=>$value)
-         {
-             if (startsWith($key,$last,$case=false) && !in_array($key,$tags)) $suggested[$addtags.$key.' ']=0;
-         }
-         echo json_encode(array_keys($suggested));
-         exit;
-     }
-     // Search a single tag (case sensitive, single tag search)
-     if ($_GET['ws']=='singletag')
-     {
-         /* To speed up things, we store list of tags in session */
-         if (empty($_SESSION['tags'])) $_SESSION['tags'] = $LINKSDB->allTags();
-         foreach($_SESSION['tags'] as $key=>$value)
-         {
-             if (startsWith($key,$term,$case=true)) $suggested[$key]=0;
-         }
-         echo json_encode(array_keys($suggested));
-         exit;
-     }
- }
  // Re-write configuration file according to globals.
  // Requires some $GLOBALS to be set (login,hash,salt,title).
  // If the config file cannot be saved, an error message is displayed and the user is redirected to "Tools" menu.
@@@ -2604,7 -2568,6 +2568,6 @@@ if (isset($_SERVER["QUERY_STRING"]) && 
  if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=atom')) { showATOM(); exit; }
  if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=dailyrss')) { showDailyRSS(); exit; }
  if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=daily')) { showDaily(); exit; }
- if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'ws=')) { processWS(); exit; } // Webservices (for jQuery/jQueryUI)
  if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE'];
  renderPage();
  ?>