]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #99 from pikzen/license-version
authornodiscc <nodiscc@gmail.com>
Mon, 26 Jan 2015 12:41:06 +0000 (13:41 +0100)
committernodiscc <nodiscc@gmail.com>
Mon, 26 Jan 2015 12:41:06 +0000 (13:41 +0100)
Versioned JS files & centralized licenses

17 files changed:
inc/shaarli.css
index.php
tpl/changepassword.html
tpl/changetag.html
tpl/configure.html
tpl/daily.html
tpl/editlink.html
tpl/export.html
tpl/import.html
tpl/includes.html
tpl/install.html
tpl/linklist.html
tpl/linklist.paging.html
tpl/page.footer.html
tpl/picwall.html
tpl/tagcloud.html
tpl/tools.html

index e7396ccb3240ff0dc369dc67b029bf96f524e990..325515ef500dace98b3a89b94c98f19a6cfd0b38 100644 (file)
@@ -291,34 +291,34 @@ h1 {
     color: #fff;
 }
 
-#paging_privatelinks {
+.paging_privatelinks {
     float: left;
 }
 
-#paging_linksperpage {
+.paging_linksperpage {
     float: right;
     padding-right: 5px;
 }
 
-#paging_linksperpage form.linksperpage {
+.paging_linksperpage form.linksperpage {
     display: inline;
 }
 
-#paging_linksperpage form.linksperpage input {
+.paging_linksperpage form.linksperpage input {
     height: 15px;
 }
 
-#paging_current {
+.paging_current {
     display: inline;
     color: #fff;
     padding: 0 20 0 20;
 }
 
-#paging_older {
+.paging_older {
     margin-right: 15px;
 }
 
-#paging_newer {
+.paging_newer {
     margin-left: 15px;
 }
 
@@ -562,7 +562,6 @@ a.qrcode img {
 }
 
 #cloudtag a {
-    font-weight:bold;
     color: black;
     text-decoration: none;
 }
@@ -813,6 +812,10 @@ div.dailyEntryTitle {
     font-weight: bold;
 }
 
+div.dailyEntryLinkdate {
+    font-size: 8pt;
+}
+
 div.dailyEntryThumbnail {
     width: 100%;
     text-align: center;
@@ -844,6 +847,10 @@ div.dailyNoEntry {
     clear: both;
 }
 
+.right {
+    text-align: right;
+}
+
 /* For lazy images loading in picture wall.
    Using http://www.appelsiini.net/projects/lazyload
 */
@@ -851,6 +858,12 @@ div.dailyNoEntry {
     display: none;
 }
 
+#configuration_table td {
+    border: none;
+    padding: 10px;
+    vertical-align: top;
+}
+
 @media print {
     html {
        border: none;
@@ -959,17 +972,17 @@ div.dailyNoEntry {
        left: 0px;
     }
 
-    #paging_privatelinks {
+    .paging_privatelinks {
        float: none;
     }
 
-    #paging_linksperpage {
+    .paging_linksperpage {
        float: none;
        margin-bottom: 10px;
        font-size: smaller;
     }
 
-    #paging_older, #paging_newer, #paging_linksperpage a {
+    #paging_older, #paging_newer, .paging_linksperpage a {
        border: 1px solid black;
        padding: 3px 5px 3px 5px;
        background-color: #666;
@@ -1030,3 +1043,7 @@ div.dailyNoEntry {
 .highlight {
     background-color: #FFFF33;
 }
+
+.center {
+    text-align: center;
+}
index 38958a79f199b1104acadf81fd7f4573df00c553..4729324001723c795534d67afb5a5d5b9448e8ad 100644 (file)
--- a/index.php
+++ b/index.php
@@ -89,7 +89,7 @@ header("Cache-Control: post-check=0, pre-check=0", false);
 header("Pragma: no-cache");
 
 // Directories creations (Note that your web host may require different rights than 705.)
-if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory ('.realpath(dirname(__FILE__)).').</pre>');
+if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory.</pre>');
 
 // Handling of old config file which do not have the new parameters.
 if (empty($GLOBALS['title'])) $GLOBALS['title']='Shared links on '.htmlspecialchars(indexUrl());
@@ -118,7 +118,7 @@ function checkphpversion()
     if (version_compare(PHP_VERSION, '5.1.0') < 0)
     {
         header('Content-Type: text/plain; charset=utf-8');
-        echo 'Your server supports PHP '.PHP_VERSION.'. Shaarli requires at least php 5.1.0, and thus cannot run. Sorry.';
+        echo 'Your PHP version is obsolete! Shaarli requires at least php 5.1.0, and thus cannot run. Sorry. Your PHP version has known security vulnerabilities and should be updated as soon as possible.';
         exit;
     }
 }
@@ -430,7 +430,7 @@ if (isset($_POST['login']))
         ban_loginFailed();
         $redir = '';
         if (isset($_GET['post'])) { $redir = '&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['description'])?'&description='.urlencode($_GET['description']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):''); }
-        echo '<script language="JavaScript">alert("Wrong login/password.");document.location=\'?do=login'.$redir.'\';</script>'; // Redirect to login screen.
+        echo '<script>alert("Wrong login/password.");document.location=\'?do=login'.$redir.'\';</script>'; // Redirect to login screen.
         exit;
     }
 }
@@ -794,14 +794,16 @@ class linkdb implements Iterator, Countable, ArrayAccess
     {
         // FIXME: explode(' ',$searchterms) and perform a AND search.
         // FIXME: accept double-quotes to search for a string "as is"?
+        // Using mb_convert_case($val, MB_CASE_LOWER, 'UTF-8') allows us to perform searches on
+        // Unicode text. See https://github.com/shaarli/Shaarli/issues/75 for examples.
         $filtered=array();
-        $s = strtolower($searchterms);
+        $s = mb_convert_case($searchterms, MB_CASE_LOWER, 'UTF-8');
         foreach($this->links as $l)
         {
-            $found=   (strpos(strtolower($l['title']),$s)!==false)
-                   || (strpos(strtolower($l['description']),$s)!==false)
-                   || (strpos(strtolower($l['url']),$s)!==false)
-                   || (strpos(strtolower($l['tags']),$s)!==false);
+            $found=   (strpos(mb_convert_case($l['title'],       MB_CASE_LOWER, 'UTF-8'),$s) !== false)
+                   || (strpos(mb_convert_case($l['description'], MB_CASE_LOWER, 'UTF-8'),$s) !== false)
+                   || (strpos(mb_convert_case($l['url'],         MB_CASE_LOWER, 'UTF-8'),$s) !== false)
+                   || (strpos(mb_convert_case($l['tags'],        MB_CASE_LOWER, 'UTF-8'),$s) !== false);
             if ($found) $filtered[$l['linkdate']] = $l;
         }
         krsort($filtered);
@@ -813,12 +815,14 @@ class linkdb implements Iterator, Countable, ArrayAccess
     // e.g. print_r($mydb->filterTags('linux programming'));
     public function filterTags($tags,$casesensitive=false)
     {
-        $t = str_replace(',',' ',($casesensitive?$tags:strtolower($tags)));
+        // Same as above, we use UTF-8 conversion to handle various graphemes (i.e. cyrillic, or greek)
+        // TODO: is $casesensitive ever true ?
+        $t = str_replace(',',' ',($casesensitive?$tags:mb_convert_case($tags, MB_CASE_LOWER, 'UTF-8')));
         $searchtags=explode(' ',$t);
         $filtered=array();
         foreach($this->links as $l)
         {
-            $linktags = explode(' ',($casesensitive?$l['tags']:strtolower($l['tags'])));
+            $linktags = explode(' ',($casesensitive?$l['tags']:mb_convert_case($l['tags'], MB_CASE_LOWER, 'UTF-8')));
             if (count(array_intersect($linktags,$searchtags)) == count($searchtags))
                 $filtered[$l['linkdate']] = $l;
         }
@@ -1147,6 +1151,7 @@ function showDaily()
         $linksToDisplay[$key]['taglist']=$taglist;
         $linksToDisplay[$key]['formatedDescription']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
         $linksToDisplay[$key]['thumbnail'] = thumbnail($link['url']);
+        $linksToDisplay[$key]['localdate'] = linkdate2locale($link['linkdate']);
     }
 
     /* We need to spread the articles on 3 columns.
@@ -1173,10 +1178,7 @@ function showDaily()
     $PAGE = new pageBuilder;
     $PAGE->assign('linksToDisplay',$linksToDisplay);
     $PAGE->assign('linkcount',count($LINKSDB));
-    $PAGE->assign('col1',$columns[0]);
-    $PAGE->assign('col1',$columns[0]);
-    $PAGE->assign('col2',$columns[1]);
-    $PAGE->assign('col3',$columns[2]);
+    $PAGE->assign('cols', $columns);
     $PAGE->assign('day',utf8_encode(strftime('%A %d, %B %Y',linkdate2timestamp($day.'_000000'))));
     $PAGE->assign('previousday',$previousday);
     $PAGE->assign('nextday',$nextday);
@@ -1251,8 +1253,9 @@ function renderPage()
         ksort($tags);
         $tagList=array();
         foreach($tags as $key=>$value)
+       // Tag font size scaling: default 15 and 30 logarithm bases affect scaling, 22 and 6 are arbitrary font sizes for max and min sizes.
         {
-            $tagList[$key] = array('count'=>$value,'size'=>max(40*$value/$maxcount,8));
+            $tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6);
         }
         $PAGE = new pageBuilder;
         $PAGE->assign('linkcount',count($LINKSDB));
@@ -1385,12 +1388,12 @@ function renderPage()
 
             // Make sure old password is correct.
             $oldhash = sha1($_POST['oldpassword'].$GLOBALS['login'].$GLOBALS['salt']);
-            if ($oldhash!=$GLOBALS['hash']) { echo '<script language="JavaScript">alert("The old password is not correct.");document.location=\'?do=changepasswd\';</script>'; exit; }
+            if ($oldhash!=$GLOBALS['hash']) { echo '<script>alert("The old password is not correct.");document.location=\'?do=changepasswd\';</script>'; exit; }
             // Save new password
             $GLOBALS['salt'] = sha1(uniqid('',true).'_'.mt_rand()); // Salt renders rainbow-tables attacks useless.
             $GLOBALS['hash'] = sha1($_POST['setpassword'].$GLOBALS['login'].$GLOBALS['salt']);
             writeConfig();
-            echo '<script language="JavaScript">alert("Your password has been changed.");document.location=\'?do=tools\';</script>';
+            echo '<script>alert("Your password has been changed.");document.location=\'?do=tools\';</script>';
             exit;
         }
         else // show the change password form.
@@ -1421,7 +1424,7 @@ function renderPage()
             $GLOBALS['disablejquery']=!empty($_POST['disablejquery']);
             $GLOBALS['privateLinkByDefault']=!empty($_POST['privateLinkByDefault']);
             writeConfig();
-            echo '<script language="JavaScript">alert("Configuration was saved.");document.location=\'?do=tools\';</script>';
+            echo '<script>alert("Configuration was saved.");document.location=\'?do=tools\';</script>';
             exit;
         }
         else // Show the configuration form.
@@ -1465,7 +1468,7 @@ function renderPage()
                 $LINKSDB[$key]=$value;
             }
             $LINKSDB->savedb(); // Save to disk.
-            echo '<script language="JavaScript">alert("Tag was removed from '.count($linksToAlter).' links.");document.location=\'?\';</script>';
+            echo '<script>alert("Tag was removed from '.count($linksToAlter).' links.");document.location=\'?\';</script>';
             exit;
         }
 
@@ -1482,7 +1485,7 @@ function renderPage()
                 $LINKSDB[$key]=$value;
             }
             $LINKSDB->savedb(); // Save to disk.
-            echo '<script language="JavaScript">alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>';
+            echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>';
             exit;
         }
     }
@@ -1513,7 +1516,7 @@ function renderPage()
         pubsubhub();
 
         // If we are called from the bookmarklet, we must close the popup:
-        if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; }
+        if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; }
         $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
         $returnurl .= '#'.smallHash($linkdate);  // Scroll to the link which has been edited.
         header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on.
@@ -1524,7 +1527,7 @@ function renderPage()
     if (isset($_POST['cancel_edit']))
     {
         // If we are called from the bookmarklet, we must close the popup:
-        if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; }
+        if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; }
         $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
         $returnurl .= '#'.smallHash($_POST['lf_linkdate']);  // Scroll to the link which has been edited.
         header('Location: '.$returnurl); // After canceling, redirect to the page the user was on.
@@ -1543,10 +1546,8 @@ function renderPage()
         $LINKSDB->savedb(); // save to disk
 
         // If we are called from the bookmarklet, we must close the popup:
-        if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; }
-        $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
-        if ($returnurl=='?') { $returnurl = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '?'); }
-        header('Location: '.$returnurl); // After deleting the link, redirect to the page the user was on.
+        if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; }
+        header('Location: ?'); // After deleting the link, redirect to the home page.
         exit;
     }
 
@@ -1681,7 +1682,7 @@ HTML;
         if (!isset($_POST['token']) || (!isset($_FILES)) || (isset($_FILES['filetoupload']['size']) && $_FILES['filetoupload']['size']==0))
         {
             $returnurl = ( empty($_SERVER['HTTP_REFERER']) ? '?' : $_SERVER['HTTP_REFERER'] );
-            echo '<script language="JavaScript">alert("The file you are trying to upload is probably bigger than what this webserver can accept ('.getMaxFileSize().' bytes). Please upload in smaller chunks.");document.location=\''.htmlspecialchars($returnurl).'\';</script>';
+            echo '<script>alert("The file you are trying to upload is probably bigger than what this webserver can accept ('.getMaxFileSize().' bytes). Please upload in smaller chunks.");document.location=\''.htmlspecialchars($returnurl).'\';</script>';
             exit;
         }
         if (!tokenOk($_POST['token'])) die('Wrong token.');
@@ -1785,11 +1786,11 @@ function importFile()
         }
         $LINKSDB->savedb();
 
-        echo '<script language="JavaScript">alert("File '.json_encode($filename).' ('.$filesize.' bytes) was successfully processed: '.$import_count.' links imported.");document.location=\'?\';</script>';
+        echo '<script>alert("File '.json_encode($filename).' ('.$filesize.' bytes) was successfully processed: '.$import_count.' links imported.");document.location=\'?\';</script>';
     }
     else
     {
-        echo '<script language="JavaScript">alert("File '.json_encode($filename).' ('.$filesize.' bytes) has an unknown file format. Nothing was imported.");document.location=\'?\';</script>';
+        echo '<script>alert("File '.json_encode($filename).' ('.$filesize.' bytes) has an unknown file format. Nothing was imported.");document.location=\'?\';</script>';
     }
 }
 
@@ -2123,13 +2124,13 @@ function install()
         $GLOBALS['hash'] = sha1($_POST['setpassword'].$GLOBALS['login'].$GLOBALS['salt']);
         $GLOBALS['title'] = (empty($_POST['title']) ? 'Shared links on '.htmlspecialchars(indexUrl()) : $_POST['title'] );
         writeConfig();
-        echo '<script language="JavaScript">alert("Shaarli is now configured. Please enter your login/password and start shaaring your links!");document.location=\'?do=login\';</script>';
+        echo '<script>alert("Shaarli is now configured. Please enter your login/password and start shaaring your links!");document.location=\'?do=login\';</script>';
         exit;
     }
 
     // Display config form:
     list($timezone_form,$timezone_js) = templateTZform();
-    $timezone_html=''; if ($timezone_form!='') $timezone_html='<tr><td valign="top"><b>Timezone:</b></td><td>'.$timezone_form.'</td></tr>';
+    $timezone_html=''; if ($timezone_form!='') $timezone_html='<tr><td><b>Timezone:</b></td><td>'.$timezone_form.'</td></tr>';
 
     $PAGE = new pageBuilder;
     $PAGE->assign('timezone_html',$timezone_html);
@@ -2177,7 +2178,7 @@ function templateTZform($ptz=false)
         $cities_html = $cities[$pcontinent];
         $timezone_form = "Continent: <select name=\"continent\" id=\"continent\" onChange=\"onChangecontinent();\">${continents_html}</select>";
         $timezone_form .= "&nbsp;&nbsp;&nbsp;&nbsp;City: <select name=\"city\" id=\"city\">${cities[$pcontinent]}</select><br />";
-        $timezone_js = "<script language=\"JavaScript\">";
+        $timezone_js = "<script>";
         $timezone_js .= "function onChangecontinent(){document.getElementById(\"city\").innerHTML = citiescontinent[document.getElementById(\"continent\").value];}";
         $timezone_js .= "var citiescontinent = ".json_encode($cities).";" ;
         $timezone_js .= "</script>" ;
@@ -2292,7 +2293,7 @@ function writeConfig()
     $config .= ' ?>';
     if (!file_put_contents($GLOBALS['config']['CONFIG_FILE'],$config) || strcmp(file_get_contents($GLOBALS['config']['CONFIG_FILE']),$config)!=0)
     {
-        echo '<script language="JavaScript">alert("Shaarli could not create the config file. Please make sure Shaarli has the right to write in the folder is it installed in.");document.location=\'?\';</script>';
+        echo '<script>alert("Shaarli could not create the config file. Please make sure Shaarli has the right to write in the folder is it installed in.");document.location=\'?\';</script>';
         exit;
     }
 }
index 48cf5fa3b66c5159a08493a2936d4ef78c3b1283..c40daf9d385b781fe3c2c1bbfa713b00a2164ba9 100644 (file)
@@ -4,7 +4,7 @@
 <body onload="document.changepasswordform.oldpassword.focus();">
 <div id="pageheader">
        {include="page.header"}
-       <form method="POST" action="" name="changepasswordform" id="changepasswordform">
+       <form method="POST" action="#" name="changepasswordform" id="changepasswordform">
        Old password: <input type="password" name="oldpassword">&nbsp; &nbsp;
        New password: <input type="password" name="setpassword">
        <input type="hidden" name="token" value="{$token}">
index 79fea9a9916a3c15a537becd7a76fce0ae0a5c56..fdfb0b3797c13d7ee70c9827cafbd3720f5da6da 100644 (file)
        <input type="text" name="totag" id="totag">
        <input type="submit" name="renametag" value="Rename tag" class="bigbutton">
        &nbsp;&nbsp;or&nbsp; <input type="submit" name="deletetag" value="Delete tag" class="bigbutton" onClick="return confirmDeleteTag();"><br>(Case sensitive)</form>
-<script language="JavaScript">function confirmDeleteTag() { var agree=confirm("Are you sure you want to delete this tag from all links ?"); if (agree) return true ; else return false ; }</script>
+<script>function confirmDeleteTag() { var agree=confirm("Are you sure you want to delete this tag from all links ?"); if (agree) return true ; else return false ; }</script>
 </div>
 {include="page.footer"}
 {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"}
-<script language="JavaScript">
+<script>
 $(document).ready(function()
 {
     $('#fromtag').autocomplete({source:'{$source}?ws=singletag',minLength:1});
index 645107aecfe32fa1da9097f6f58da58ea3a66081..89e48bd1ced91c7b2041947ebed7661b499baea1 100644 (file)
@@ -5,26 +5,26 @@
 <div id="pageheader">
        {include="page.header"}
 {$timezone_js}
-    <form method="POST" action="" name="configform" id="configform">
+    <form method="POST" action="#" name="configform" id="configform">
        <input type="hidden" name="token" value="{$token}">
-       <table border="0" cellpadding="20">
+       <table id="configuration_table">
 
            <tr><td><b>Page title:</b></td><td><input type="text" name="title" id="title" size="50" value="{$title}"></td></tr>
 
            <tr><td><b>Title link:</b></td><td><input type="text" name="titleLink" id="titleLink" size="50" value="{$titleLink}"><br/><label for="titleLink">(default value is: ?)</label></td></tr>
-           <tr><td valign="top"><b>Timezone:</b></td><td valign="top">{$timezone_form}</td></tr>
+           <tr><td><b>Timezone:</b></td><td>{$timezone_form}</td></tr>
 
-           <tr><td valign="top"><b>Redirector</b></td><td><input type="text" name="redirector" id="redirector" size="50" value="{$redirector}"><br>(e.g. <i>http://anonym.to/?</i> will mask the HTTP_REFERER)</td></tr>
+           <tr><td><b>Redirector</b></td><td><input type="text" name="redirector" id="redirector" size="50" value="{$redirector}"><br>(e.g. <i>http://anonym.to/?</i> will mask the HTTP_REFERER)</td></tr>
 
-        <tr><td valign="top"><b>Security:</b></td><td><input type="checkbox" name="disablesessionprotection" id="disablesessionprotection" {if="!empty($GLOBALS['disablesessionprotection'])"}checked{/if}><label for="disablesessionprotection">&nbsp;Disable session cookie hijacking protection (Check this if you get disconnected often or if your IP address changes often.)</label></td></tr>
+        <tr><td><b>Security:</b></td><td><input type="checkbox" name="disablesessionprotection" id="disablesessionprotection" {if="!empty($GLOBALS['disablesessionprotection'])"}checked{/if}><label for="disablesessionprotection">&nbsp;Disable session cookie hijacking protection (Check this if you get disconnected often or if your IP address changes often.)</label></td></tr>
 
-        <tr><td valign="top"><b>Features:</b></td><td>
+        <tr><td><b>Features:</b></td><td>
                <input type="checkbox" name="disablejquery" id="disablejquery" {if="!empty($GLOBALS['disablejquery'])"}checked{/if}><label for="disablejquery">&nbsp;Disable jQuery and all heavy JavaScript (for example: Autocomplete in tags. Useful for slow computers.)</label>
         </td></tr>
-        <tr><td valign="top"><b>New link:</b></td><td>
+        <tr><td><b>New link:</b></td><td>
                <input type="checkbox" name="privateLinkByDefault" id="privateLinkByDefault" {if="!empty($GLOBALS['privateLinkByDefault'])"}checked{/if}/><label for="privateLinkByDefault">&nbsp;All new link are private by default</label></td>
         </tr>
-         <tr><td></td><td align="right"><input type="submit" name="Save" value="Save config" class="bigbutton"></td></tr>
+         <tr><td></td><td class="right"><input type="submit" name="Save" value="Save config" class="bigbutton"></td></tr>
        </table>
        </form>
 </div>
index c15a70629662d0b146c4f8f90ff993766a173a5a..c53e6f7170e33103177f6e2b631c76d1e769e590 100644 (file)
@@ -6,52 +6,52 @@
 <div class="daily">
     <div class="dailyAbout">
       All links of one day<br>in a single page.<br>
-         {if="$previousday"} <a href="?do=daily&day={$previousday}"><b>&lt;</b>Previous day</a>{else}<b>&lt;</b>Previous day{/if}
+         {if="$previousday"} <a href="?do=daily&amp;day={$previousday}"><b>&lt;</b>Previous day</a>{else}<b>&lt;</b>Previous day{/if}
          - 
-         {if="$nextday"}<a href="?do=daily&day={$nextday}">Next day<b>&gt;</b></a>{else}Next day<b>&gt;</b>{/if}
+         {if="$nextday"}<a href="?do=daily&amp;day={$nextday}">Next day<b>&gt;</b></a>{else}Next day<b>&gt;</b>{/if}
       <br><br>
-         <a href="?do=dailyrss" title="1 RSS entry per day"><img src="images/feed-icon-14x14.png#">Daily RSS Feed</a>
+         <a href="?do=dailyrss" title="1 RSS entry per day"><img src="images/feed-icon-14x14.png#" alt="rss_feed">Daily RSS Feed</a>
     </div>
-    <div class="dailyTitle"><img src="../images/floral_left.png" width="51" height="50" class="nomobile"> The Daily Shaarli <img src="../images/floral_right.png" width="51" height="50" class="nomobile"></div>
-    <div class="dailyDate"><span class="nomobile">&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;</span> {$day} <span class="nomobile">&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;&#x0097;</span></div>
+    <div class="dailyTitle"><img src="../images/floral_left.png" width="51" height="50" class="nomobile" alt="floral_left"> The Daily Shaarli <img src="../images/floral_right.png" width="51" height="50" class="nomobile" alt="floral_right"></div>
+    <div class="dailyDate"><span class="nomobile">&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;</span> {$day} <span class="nomobile">&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;</span></div>
     <div class="clear"></div>
-    
-    {if="$linksToDisplay"}
-        <div id="daily_col1">
-        {loop="col1"}
-        <div class="dailyEntry">
-            <div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
-            {if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if}
-            <div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div>
-            {if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if}
-            <div class="dailyEntryDescription">{$value.formatedDescription}</div>
-        </div>
-        {/loop}
-        </div>
 
-        <div id="daily_col2">
-        {loop="col2"}
-        <div class="dailyEntry">
-            <div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
-            {if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if}
-            <div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div>
-            {if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if}
-            <div class="dailyEntryDescription">{$value.formatedDescription}</div>
-        </div>
-        {/loop}
-        </div>    
-
-        <div id="daily_col3">
-        {loop="col3"}
-        <div class="dailyEntry">
-            <div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
-            {if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if}
-            <div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div>
-            {if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if}
-            <div class="dailyEntryDescription">{$value.formatedDescription}</div>
-        </div>
+    {if="$linksToDisplay"}
+        {loop="cols"}
+            {if="isset($value[0])"}
+            <div id="daily_col{$counter+1}">
+                {loop="value"}
+                    {$link=$value}
+                    <div class="dailyEntry">
+                        <div class="dailyEntryPermalink">
+                            <a href="?{$link.linkdate|smallHash}">
+                                <img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink">
+                            </a>
+                        </div>
+                        {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"}
+                            <div class="dailyEntryLinkdate">
+                                <a href="?{$link.linkdate|smallHash}">{$link.localdate}</a>
+                            </div>
+                        {/if}
+                        {if="$link.tags"}
+                            <div class="dailyEntryTags">
+                                {loop="link.taglist"}
+                                    {$value|htmlspecialchars} -
+                                {/loop}
+                            </div>
+                        {/if}
+                        <div class="dailyEntryTitle">
+                            <a href="{$link.url}">{$link.title|htmlspecialchars}</a>
+                        </div>
+                        {if="$link.thumbnail"}
+                            <div class="dailyEntryThumbnail">{$link.thumbnail}</div>
+                        {/if}
+                        <div class="dailyEntryDescription">{$link.formatedDescription}</div>
+                    </div>
+                {/loop}
+            </div>
+            {/if}
         {/loop}
-        </div>        
     {else}
          <div class="dailyNoEntry">No articles on this day.</div>
     {/if}
index 885feed77075b8a5be986f91761439413de7588c..ecab443d4903ae2b31c6db90c7ad14af98cfe2cf 100644 (file)
@@ -33,7 +33,7 @@
 </div>
 {include="page.footer"}
 {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"}
-<script language="JavaScript">
+<script>
 $(document).ready(function()
 {
     $('#lf_tags').autocomplete({source:'{$source}?ws=tags',minLength:1});
index 911b02c12870903dab455f838b5d4e623c233295..9d101db43092f57c877d0be554cd0a6b3923771d 100644 (file)
@@ -5,9 +5,9 @@
 <div id="pageheader">
        {include="page.header"}
        <div id="toolsdiv">
-           <a href="?do=export&what=all"><b>Export all</b> <span>: Export all links</span></a><br><br>
-           <a href="?do=export&what=public"><b>Export public</b> <span>: Export public links only</a><br><br>
-           <a href="?do=export&what=private"><b>Export private</b> <span>: Export private links only</a>
+           <a href="?do=export&amp;what=all"><b>Export all</b> <span>: Export all links</span></a><br><br>
+           <a href="?do=export&amp;what=public"><b>Export public</b> <span>: Export public links only</span></a><br><br>
+           <a href="?do=export&amp;what=private"><b>Export private</b> <span>: Export private links only</span></a>
            <div class="clear"></div>
        </div>
 </div>
index 259e56ee0af9d16df1c837f37f93ede8124c8c6c..9ac3c2f97d58ef5d4c598a97eb5879c0aebbe7a3 100644 (file)
@@ -8,7 +8,7 @@
        Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize|htmlspecialchars} bytes).
        <form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform" id="uploadform">
            <input type="hidden" name="token" value="{$token}">
-           <input type="file" name="filetoupload" size="80">
+           <input type="file" name="filetoupload">
            <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize|htmlspecialchars}">
            <input type="submit" name="import_file" value="Import" class="bigbutton"><br>
            <input type="checkbox" name="private" id="private"><label for="private">&nbsp;Import all links as private</label><br>
index cc573801884ae2a5e01fd17cff495e3638e1aceb..efc658ebc2f4f3d8e97792f3e49977ffa97d2e26 100644 (file)
@@ -6,4 +6,4 @@
 <link rel="alternate" type="application/atom+xml" href="{$feedurl}?do=atom{$searchcrits}#" title="ATOM Feed" />
 <link href="images/favicon.ico#" rel="shortcut icon" type="image/x-icon" />
 <link type="text/css" rel="stylesheet" href="inc/shaarli.css?version={$version|urlencode}#" />
-{if="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="inc/user.css?version={$version}#" />{/if}
+{if="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="inc/user.css?version={$version|urlencode}#" />{/if}
index 32b8811be0856824acf8da15ff66d6df6b73e900..df42bf6d0fbe5187782364d04121d8272588bc4d 100644 (file)
@@ -5,7 +5,7 @@
 <div id="install">
 <h1>Shaarli</h1>       
 It looks like it's the first time you run Shaarli. Please configure it:<br>
-<form method="POST" action="" name="installform" id="installform">
+<form method="POST" action="#" name="installform" id="installform">
 <table>
 <tr><td><b>Login:</b></td><td><input type="text" name="setlogin" size="30"></td></tr>
 <tr><td><b>Password:</b></td><td><input type="password" name="setpassword" size="30"></td></tr>
index 58d5867ed159fe92802fefc9bc46e2b90125d8c3..c8dfd12292e15aee31f851e08a36078ec0bfb5bb 100644 (file)
@@ -30,7 +30,7 @@
     <ul>
         {loop="links"}
         <li{if="$value.class"} class="{$value.class}"{/if}>
-            <a name="{$value.linkdate|smallHash}" id="{$value.linkdate|smallHash}"></a>
+            <a id="{$value.linkdate|smallHash}"></a>
             <div class="thumbnail">{$value.url|thumbnail}</div>
             <div class="linkcontainer">
                 {if="isLoggedIn()"}
                 {if="$GLOBALS['config']['ARCHIVE_ORG']"}
                 <span class="linkarchive"><a href="https://web.archive.org/web/{$value.url|htmlspecialchars}">archive</a> - </span>
                 {/if}
-                <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}"
-                    onclick="showQrCode(this); return false;" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}"><img src="images/qrcode.png#" title="QR-Code"></a></div> -
-                <a href={$value.url|htmlspecialchars}><span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span></a><br>
+                <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&amp;s=8&amp;d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}"
+                    onclick="return showQrCode(this);" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}">
+                   <img src="images/qrcode.png#" alt="QR-Code" title="{$value.localdate|htmlspecialchars}"></a></div> -
+                <a href="{$value.url|htmlspecialchars}"><span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span></a><br>
                 {if="$value.tags"}
                     <div class="linktaglist">
                     {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value|htmlspecialchars}</a></span> {/loop}
@@ -70,7 +71,7 @@
 
     {include="page.footer"}
 
-<script language="JavaScript">
+<script>
 // Remove any displayed QR-Code
 function remove_qrcode()
 {
@@ -79,12 +80,20 @@ function remove_qrcode()
     return false;
 }
 
+function isCanvasSupported(){
+    var elem = document.createElement('canvas');
+    return !!(elem.getContext && elem.getContext('2d'));
+}
+
 // Show the QR-Code of a permalink (when the QR-Code icon is clicked).
-function showQrCode(caller,loading=false)
+function showQrCode(caller,loading)
 {
+    if( !isCanvasSupported() ) return true;
+
     // Dynamic javascript lib loading: We only load qr.js if the QR code icon is clicked:
     if (typeof(qr)=='undefined') // Load qr.js only if not present.
     {
+        loading = typeof loading !== 'undefined' ? loading : false;
         if (!loading)  // If javascript lib is still loading, do not append script to body.
         {
             var element = document.createElement("script");
@@ -101,12 +110,12 @@ function showQrCode(caller,loading=false)
     // Build the div which contains the QR-Code:
     var element = document.createElement('div');
     element.id="permalinkQrcode";
-       // Make QR-Code div commit sepuku when clicked:
-    if ( element.attachEvent ){ element.attachEvent('onclick', 'this.parentNode.removeChild(this);' ); } // Damn IE
-    else { element.setAttribute('onclick', 'this.parentNode.removeChild(this);' ); }
+
+    // Make QR-Code div commit sepuku when clicked:
+    element.addEventListener('click', remove_qrcode ); // Works on every canvas supported browser
 
     // Build the QR-Code:
-    var image = qr.image({size: 8,value: caller.dataset.permalink});
+    var image = qr.image({size: 8,value: caller.getAttribute('data-permalink')});
     if (image)
     {
         element.appendChild(image);
index c2b98971be17f2f7725961fab9db521194e8370b..848541cd7cab79bcfa746d693c978b7555c0ef79 100644 (file)
@@ -1,6 +1,6 @@
 <div class="paging">
 {if="isLoggedIn()"}
-    <div id="paging_privatelinks">
+    <div class="paging_privatelinks">
         <a href="?privateonly">
                {if="$privateonly"}
                <img src="images/private_16x16_active.png#" width="16" height="16" title="Click to see all links" alt="Click to see all links">
                </a>
     </div>
 {/if}
-    <div id="paging_linksperpage">
+    <div class="paging_linksperpage">
         Links per page: <a href="?linksperpage=20">20</a> <a href="?linksperpage=50">50</a> <a href="?linksperpage=100">100</a>
         <form method="GET" class="linksperpage"><input type="text" name="linksperpage" size="2"></form>
     </div>
-    {if="$previous_page_url"} <a href="{$previous_page_url}" id="paging_older">&#x25C4;Older</a> {/if}
-    <div id="paging_current">page {$page_current} / {$page_max} </div>
-    {if="$next_page_url"} <a href="{$next_page_url}" id="paging_newer">Newer&#x25BA;</a> {/if}
+    {if="$previous_page_url"} <a href="{$previous_page_url}" class="paging_older">&#x25C4;Older</a> {/if}
+    <div class="paging_current">page {$page_current} / {$page_max} </div>
+    {if="$next_page_url"} <a href="{$next_page_url}" class="paging_newer">Newer&#x25BA;</a> {/if}
 </div>
index b494bf7d573b0330cee83cf6625415444c3edc43..e55a3cb471e0907046e653430cddd62c26abe054 100644 (file)
@@ -5,5 +5,5 @@
     <div id="newversion"><span id="version_id">&#x25CF;</span> Shaarli {$newversion|htmlspecialchars} is <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#download">available</a>.</div>
 {/if}
 {if="isLoggedIn()"}
-<script language="JavaScript">function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>
+<script>function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>
 {/if}
index bf299fbf44f697dcd0902ff1c82373ab5ae4966d..d3cabb2db151a9d885694ece6407b4bd0c3b517d 100644 (file)
@@ -9,15 +9,15 @@
 </head>
 <body>
 <div id="pageheader">{include="page.header"}</div>
-<center>
-<div class="picwall_container">
-    {loop="linksToDisplay"}
-    <div class="picwall_pictureframe">
-           {$value.thumbnail}<a href="{$value.permalink}"><span class="info">{$value.title|htmlspecialchars}</span></a>
-    </div>
-    {/loop}
+<div class="center">
+        <div id="picwall_container">
+            {loop="linksToDisplay"}
+            <div class="picwall_pictureframe">
+                   {$value.thumbnail}<a href="{$value.permalink}"><span class="info">{$value.title|htmlspecialchars}</span></a>
+            </div>
+            {/loop}
+        </div>
 </div>
-</center>
 {include="page.footer"}
 
 {if="empty($GLOBALS['disablejquery'])"} 
index 9418e2485ec6ac3e3d15aee4283cf76f4a4d6ac1..97205e2b07f743b760ae11668ea553022f9f5cae 100644 (file)
@@ -3,13 +3,13 @@
 <head>{include="includes"}</head>
 <body>
        <div id="pageheader">{include="page.header"}</div>
-<center>
-<div id="cloudtag">
-    {loop="tags"}
-    <span class="count">{$value.count}</span><a href="?searchtags={$key|urlencode}" style="font-size:{$value.size}pt;">{$key|htmlspecialchars}</a>
-    {/loop}
+<div class="center">
+    <div id="cloudtag">
+        {loop="tags"}
+        <span class="count">{$value.count}</span><a href="?searchtags={$key|urlencode}" style="font-size:{$value.size}pt;">{$key|htmlspecialchars}</a>
+        {/loop}
+    </div>
 </div>
-</center>
 {include="page.footer"}
 </body>
 </html>
index ae31902b6a3a5420028c3f6bffd92d88512b633f..c2520fda24dcec7468e5c13dc2a50204c4ba11fa 100644 (file)
@@ -10,7 +10,7 @@
            <a href="?do=changetag"><b>Rename/delete tags</b> <span>:  Rename or delete a tag in all links</span></a><br><br>
            <a href="?do=import"><b>Import</b> <span>:  Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)</span></a> <br><br>
            <a href="?do=export"><b>Export</b> <span>:  Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)</span></a><br><br>
-       <a class="smallbutton" onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;" href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+'&amp;title='%20+%20encodeURIComponent(title)+'&amp;description='%20+%20encodeURIComponent(document.getSelection())+'&amp;source=bookmarklet','_blank','menubar=no,height=390,width=600,toolbar=no,scrollbars=no,status=no,dialog=1');})();"><b>Shaare link</b></a> <a href="#" id="bookmark"><span>&#x21D0; Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).<br>&nbsp;&nbsp;&nbsp;&nbsp;Then click "Shaare link" button in any page you want to share.</span></a><br><br>
+       <a class="smallbutton" onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;" href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+'&amp;title='%20+%20encodeURIComponent(title)+'&amp;description='%20+%20encodeURIComponent(document.getSelection())+'&amp;source=bookmarklet','_blank','menubar=no,height=390,width=600,toolbar=no,scrollbars=no,status=no,dialog=1');})();"><b>✚Shaare link</b></a> <a href="#" style="clear:none;"><span>&#x21D0; Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).<br>&nbsp;&nbsp;&nbsp;&nbsp;Then click "✚Shaare link" button in any page you want to share.</span></a><br><br>
            <div class="clear"></div>
        </div>
 </div>