diff options
-rw-r--r-- | inc/shaarli.css | 39 | ||||
-rw-r--r-- | index.php | 67 | ||||
-rw-r--r-- | tpl/changepassword.html | 2 | ||||
-rw-r--r-- | tpl/changetag.html | 4 | ||||
-rw-r--r-- | tpl/configure.html | 16 | ||||
-rw-r--r-- | tpl/daily.html | 80 | ||||
-rw-r--r-- | tpl/editlink.html | 2 | ||||
-rw-r--r-- | tpl/export.html | 6 | ||||
-rw-r--r-- | tpl/import.html | 2 | ||||
-rw-r--r-- | tpl/includes.html | 2 | ||||
-rw-r--r-- | tpl/install.html | 2 | ||||
-rw-r--r-- | tpl/linklist.html | 29 | ||||
-rw-r--r-- | tpl/linklist.paging.html | 10 | ||||
-rw-r--r-- | tpl/page.footer.html | 2 | ||||
-rw-r--r-- | tpl/picwall.html | 16 | ||||
-rw-r--r-- | tpl/tagcloud.html | 12 | ||||
-rw-r--r-- | tpl/tools.html | 2 |
17 files changed, 160 insertions, 133 deletions
diff --git a/inc/shaarli.css b/inc/shaarli.css index e7396ccb..325515ef 100644 --- a/inc/shaarli.css +++ b/inc/shaarli.css | |||
@@ -291,34 +291,34 @@ h1 { | |||
291 | color: #fff; | 291 | color: #fff; |
292 | } | 292 | } |
293 | 293 | ||
294 | #paging_privatelinks { | 294 | .paging_privatelinks { |
295 | float: left; | 295 | float: left; |
296 | } | 296 | } |
297 | 297 | ||
298 | #paging_linksperpage { | 298 | .paging_linksperpage { |
299 | float: right; | 299 | float: right; |
300 | padding-right: 5px; | 300 | padding-right: 5px; |
301 | } | 301 | } |
302 | 302 | ||
303 | #paging_linksperpage form.linksperpage { | 303 | .paging_linksperpage form.linksperpage { |
304 | display: inline; | 304 | display: inline; |
305 | } | 305 | } |
306 | 306 | ||
307 | #paging_linksperpage form.linksperpage input { | 307 | .paging_linksperpage form.linksperpage input { |
308 | height: 15px; | 308 | height: 15px; |
309 | } | 309 | } |
310 | 310 | ||
311 | #paging_current { | 311 | .paging_current { |
312 | display: inline; | 312 | display: inline; |
313 | color: #fff; | 313 | color: #fff; |
314 | padding: 0 20 0 20; | 314 | padding: 0 20 0 20; |
315 | } | 315 | } |
316 | 316 | ||
317 | #paging_older { | 317 | .paging_older { |
318 | margin-right: 15px; | 318 | margin-right: 15px; |
319 | } | 319 | } |
320 | 320 | ||
321 | #paging_newer { | 321 | .paging_newer { |
322 | margin-left: 15px; | 322 | margin-left: 15px; |
323 | } | 323 | } |
324 | 324 | ||
@@ -562,7 +562,6 @@ a.qrcode img { | |||
562 | } | 562 | } |
563 | 563 | ||
564 | #cloudtag a { | 564 | #cloudtag a { |
565 | font-weight:bold; | ||
566 | color: black; | 565 | color: black; |
567 | text-decoration: none; | 566 | text-decoration: none; |
568 | } | 567 | } |
@@ -813,6 +812,10 @@ div.dailyEntryTitle { | |||
813 | font-weight: bold; | 812 | font-weight: bold; |
814 | } | 813 | } |
815 | 814 | ||
815 | div.dailyEntryLinkdate { | ||
816 | font-size: 8pt; | ||
817 | } | ||
818 | |||
816 | div.dailyEntryThumbnail { | 819 | div.dailyEntryThumbnail { |
817 | width: 100%; | 820 | width: 100%; |
818 | text-align: center; | 821 | text-align: center; |
@@ -844,6 +847,10 @@ div.dailyNoEntry { | |||
844 | clear: both; | 847 | clear: both; |
845 | } | 848 | } |
846 | 849 | ||
850 | .right { | ||
851 | text-align: right; | ||
852 | } | ||
853 | |||
847 | /* For lazy images loading in picture wall. | 854 | /* For lazy images loading in picture wall. |
848 | Using http://www.appelsiini.net/projects/lazyload | 855 | Using http://www.appelsiini.net/projects/lazyload |
849 | */ | 856 | */ |
@@ -851,6 +858,12 @@ div.dailyNoEntry { | |||
851 | display: none; | 858 | display: none; |
852 | } | 859 | } |
853 | 860 | ||
861 | #configuration_table td { | ||
862 | border: none; | ||
863 | padding: 10px; | ||
864 | vertical-align: top; | ||
865 | } | ||
866 | |||
854 | @media print { | 867 | @media print { |
855 | html { | 868 | html { |
856 | border: none; | 869 | border: none; |
@@ -959,17 +972,17 @@ div.dailyNoEntry { | |||
959 | left: 0px; | 972 | left: 0px; |
960 | } | 973 | } |
961 | 974 | ||
962 | #paging_privatelinks { | 975 | .paging_privatelinks { |
963 | float: none; | 976 | float: none; |
964 | } | 977 | } |
965 | 978 | ||
966 | #paging_linksperpage { | 979 | .paging_linksperpage { |
967 | float: none; | 980 | float: none; |
968 | margin-bottom: 10px; | 981 | margin-bottom: 10px; |
969 | font-size: smaller; | 982 | font-size: smaller; |
970 | } | 983 | } |
971 | 984 | ||
972 | #paging_older, #paging_newer, #paging_linksperpage a { | 985 | #paging_older, #paging_newer, .paging_linksperpage a { |
973 | border: 1px solid black; | 986 | border: 1px solid black; |
974 | padding: 3px 5px 3px 5px; | 987 | padding: 3px 5px 3px 5px; |
975 | background-color: #666; | 988 | background-color: #666; |
@@ -1030,3 +1043,7 @@ div.dailyNoEntry { | |||
1030 | .highlight { | 1043 | .highlight { |
1031 | background-color: #FFFF33; | 1044 | background-color: #FFFF33; |
1032 | } | 1045 | } |
1046 | |||
1047 | .center { | ||
1048 | text-align: center; | ||
1049 | } | ||
@@ -89,7 +89,7 @@ header("Cache-Control: post-check=0, pre-check=0", false); | |||
89 | header("Pragma: no-cache"); | 89 | header("Pragma: no-cache"); |
90 | 90 | ||
91 | // Directories creations (Note that your web host may require different rights than 705.) | 91 | // Directories creations (Note that your web host may require different rights than 705.) |
92 | 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>'); | 92 | if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory.</pre>'); |
93 | 93 | ||
94 | // Handling of old config file which do not have the new parameters. | 94 | // Handling of old config file which do not have the new parameters. |
95 | if (empty($GLOBALS['title'])) $GLOBALS['title']='Shared links on '.htmlspecialchars(indexUrl()); | 95 | if (empty($GLOBALS['title'])) $GLOBALS['title']='Shared links on '.htmlspecialchars(indexUrl()); |
@@ -118,7 +118,7 @@ function checkphpversion() | |||
118 | if (version_compare(PHP_VERSION, '5.1.0') < 0) | 118 | if (version_compare(PHP_VERSION, '5.1.0') < 0) |
119 | { | 119 | { |
120 | header('Content-Type: text/plain; charset=utf-8'); | 120 | header('Content-Type: text/plain; charset=utf-8'); |
121 | echo 'Your server supports PHP '.PHP_VERSION.'. Shaarli requires at least php 5.1.0, and thus cannot run. Sorry.'; | 121 | 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.'; |
122 | exit; | 122 | exit; |
123 | } | 123 | } |
124 | } | 124 | } |
@@ -430,7 +430,7 @@ if (isset($_POST['login'])) | |||
430 | ban_loginFailed(); | 430 | ban_loginFailed(); |
431 | $redir = ''; | 431 | $redir = ''; |
432 | 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']):''); } | 432 | 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']):''); } |
433 | echo '<script language="JavaScript">alert("Wrong login/password.");document.location=\'?do=login'.$redir.'\';</script>'; // Redirect to login screen. | 433 | echo '<script>alert("Wrong login/password.");document.location=\'?do=login'.$redir.'\';</script>'; // Redirect to login screen. |
434 | exit; | 434 | exit; |
435 | } | 435 | } |
436 | } | 436 | } |
@@ -794,14 +794,16 @@ class linkdb implements Iterator, Countable, ArrayAccess | |||
794 | { | 794 | { |
795 | // FIXME: explode(' ',$searchterms) and perform a AND search. | 795 | // FIXME: explode(' ',$searchterms) and perform a AND search. |
796 | // FIXME: accept double-quotes to search for a string "as is"? | 796 | // FIXME: accept double-quotes to search for a string "as is"? |
797 | // Using mb_convert_case($val, MB_CASE_LOWER, 'UTF-8') allows us to perform searches on | ||
798 | // Unicode text. See https://github.com/shaarli/Shaarli/issues/75 for examples. | ||
797 | $filtered=array(); | 799 | $filtered=array(); |
798 | $s = strtolower($searchterms); | 800 | $s = mb_convert_case($searchterms, MB_CASE_LOWER, 'UTF-8'); |
799 | foreach($this->links as $l) | 801 | foreach($this->links as $l) |
800 | { | 802 | { |
801 | $found= (strpos(strtolower($l['title']),$s)!==false) | 803 | $found= (strpos(mb_convert_case($l['title'], MB_CASE_LOWER, 'UTF-8'),$s) !== false) |
802 | || (strpos(strtolower($l['description']),$s)!==false) | 804 | || (strpos(mb_convert_case($l['description'], MB_CASE_LOWER, 'UTF-8'),$s) !== false) |
803 | || (strpos(strtolower($l['url']),$s)!==false) | 805 | || (strpos(mb_convert_case($l['url'], MB_CASE_LOWER, 'UTF-8'),$s) !== false) |
804 | || (strpos(strtolower($l['tags']),$s)!==false); | 806 | || (strpos(mb_convert_case($l['tags'], MB_CASE_LOWER, 'UTF-8'),$s) !== false); |
805 | if ($found) $filtered[$l['linkdate']] = $l; | 807 | if ($found) $filtered[$l['linkdate']] = $l; |
806 | } | 808 | } |
807 | krsort($filtered); | 809 | krsort($filtered); |
@@ -813,12 +815,14 @@ class linkdb implements Iterator, Countable, ArrayAccess | |||
813 | // e.g. print_r($mydb->filterTags('linux programming')); | 815 | // e.g. print_r($mydb->filterTags('linux programming')); |
814 | public function filterTags($tags,$casesensitive=false) | 816 | public function filterTags($tags,$casesensitive=false) |
815 | { | 817 | { |
816 | $t = str_replace(',',' ',($casesensitive?$tags:strtolower($tags))); | 818 | // Same as above, we use UTF-8 conversion to handle various graphemes (i.e. cyrillic, or greek) |
819 | // TODO: is $casesensitive ever true ? | ||
820 | $t = str_replace(',',' ',($casesensitive?$tags:mb_convert_case($tags, MB_CASE_LOWER, 'UTF-8'))); | ||
817 | $searchtags=explode(' ',$t); | 821 | $searchtags=explode(' ',$t); |
818 | $filtered=array(); | 822 | $filtered=array(); |
819 | foreach($this->links as $l) | 823 | foreach($this->links as $l) |
820 | { | 824 | { |
821 | $linktags = explode(' ',($casesensitive?$l['tags']:strtolower($l['tags']))); | 825 | $linktags = explode(' ',($casesensitive?$l['tags']:mb_convert_case($l['tags'], MB_CASE_LOWER, 'UTF-8'))); |
822 | if (count(array_intersect($linktags,$searchtags)) == count($searchtags)) | 826 | if (count(array_intersect($linktags,$searchtags)) == count($searchtags)) |
823 | $filtered[$l['linkdate']] = $l; | 827 | $filtered[$l['linkdate']] = $l; |
824 | } | 828 | } |
@@ -1147,6 +1151,7 @@ function showDaily() | |||
1147 | $linksToDisplay[$key]['taglist']=$taglist; | 1151 | $linksToDisplay[$key]['taglist']=$taglist; |
1148 | $linksToDisplay[$key]['formatedDescription']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))); | 1152 | $linksToDisplay[$key]['formatedDescription']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))); |
1149 | $linksToDisplay[$key]['thumbnail'] = thumbnail($link['url']); | 1153 | $linksToDisplay[$key]['thumbnail'] = thumbnail($link['url']); |
1154 | $linksToDisplay[$key]['localdate'] = linkdate2locale($link['linkdate']); | ||
1150 | } | 1155 | } |
1151 | 1156 | ||
1152 | /* We need to spread the articles on 3 columns. | 1157 | /* We need to spread the articles on 3 columns. |
@@ -1173,10 +1178,7 @@ function showDaily() | |||
1173 | $PAGE = new pageBuilder; | 1178 | $PAGE = new pageBuilder; |
1174 | $PAGE->assign('linksToDisplay',$linksToDisplay); | 1179 | $PAGE->assign('linksToDisplay',$linksToDisplay); |
1175 | $PAGE->assign('linkcount',count($LINKSDB)); | 1180 | $PAGE->assign('linkcount',count($LINKSDB)); |
1176 | $PAGE->assign('col1',$columns[0]); | 1181 | $PAGE->assign('cols', $columns); |
1177 | $PAGE->assign('col1',$columns[0]); | ||
1178 | $PAGE->assign('col2',$columns[1]); | ||
1179 | $PAGE->assign('col3',$columns[2]); | ||
1180 | $PAGE->assign('day',utf8_encode(strftime('%A %d, %B %Y',linkdate2timestamp($day.'_000000')))); | 1182 | $PAGE->assign('day',utf8_encode(strftime('%A %d, %B %Y',linkdate2timestamp($day.'_000000')))); |
1181 | $PAGE->assign('previousday',$previousday); | 1183 | $PAGE->assign('previousday',$previousday); |
1182 | $PAGE->assign('nextday',$nextday); | 1184 | $PAGE->assign('nextday',$nextday); |
@@ -1251,8 +1253,9 @@ function renderPage() | |||
1251 | ksort($tags); | 1253 | ksort($tags); |
1252 | $tagList=array(); | 1254 | $tagList=array(); |
1253 | foreach($tags as $key=>$value) | 1255 | foreach($tags as $key=>$value) |
1256 | // Tag font size scaling: default 15 and 30 logarithm bases affect scaling, 22 and 6 are arbitrary font sizes for max and min sizes. | ||
1254 | { | 1257 | { |
1255 | $tagList[$key] = array('count'=>$value,'size'=>max(40*$value/$maxcount,8)); | 1258 | $tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6); |
1256 | } | 1259 | } |
1257 | $PAGE = new pageBuilder; | 1260 | $PAGE = new pageBuilder; |
1258 | $PAGE->assign('linkcount',count($LINKSDB)); | 1261 | $PAGE->assign('linkcount',count($LINKSDB)); |
@@ -1385,12 +1388,12 @@ function renderPage() | |||
1385 | 1388 | ||
1386 | // Make sure old password is correct. | 1389 | // Make sure old password is correct. |
1387 | $oldhash = sha1($_POST['oldpassword'].$GLOBALS['login'].$GLOBALS['salt']); | 1390 | $oldhash = sha1($_POST['oldpassword'].$GLOBALS['login'].$GLOBALS['salt']); |
1388 | if ($oldhash!=$GLOBALS['hash']) { echo '<script language="JavaScript">alert("The old password is not correct.");document.location=\'?do=changepasswd\';</script>'; exit; } | 1391 | if ($oldhash!=$GLOBALS['hash']) { echo '<script>alert("The old password is not correct.");document.location=\'?do=changepasswd\';</script>'; exit; } |
1389 | // Save new password | 1392 | // Save new password |
1390 | $GLOBALS['salt'] = sha1(uniqid('',true).'_'.mt_rand()); // Salt renders rainbow-tables attacks useless. | 1393 | $GLOBALS['salt'] = sha1(uniqid('',true).'_'.mt_rand()); // Salt renders rainbow-tables attacks useless. |
1391 | $GLOBALS['hash'] = sha1($_POST['setpassword'].$GLOBALS['login'].$GLOBALS['salt']); | 1394 | $GLOBALS['hash'] = sha1($_POST['setpassword'].$GLOBALS['login'].$GLOBALS['salt']); |
1392 | writeConfig(); | 1395 | writeConfig(); |
1393 | echo '<script language="JavaScript">alert("Your password has been changed.");document.location=\'?do=tools\';</script>'; | 1396 | echo '<script>alert("Your password has been changed.");document.location=\'?do=tools\';</script>'; |
1394 | exit; | 1397 | exit; |
1395 | } | 1398 | } |
1396 | else // show the change password form. | 1399 | else // show the change password form. |
@@ -1421,7 +1424,7 @@ function renderPage() | |||
1421 | $GLOBALS['disablejquery']=!empty($_POST['disablejquery']); | 1424 | $GLOBALS['disablejquery']=!empty($_POST['disablejquery']); |
1422 | $GLOBALS['privateLinkByDefault']=!empty($_POST['privateLinkByDefault']); | 1425 | $GLOBALS['privateLinkByDefault']=!empty($_POST['privateLinkByDefault']); |
1423 | writeConfig(); | 1426 | writeConfig(); |
1424 | echo '<script language="JavaScript">alert("Configuration was saved.");document.location=\'?do=tools\';</script>'; | 1427 | echo '<script>alert("Configuration was saved.");document.location=\'?do=tools\';</script>'; |
1425 | exit; | 1428 | exit; |
1426 | } | 1429 | } |
1427 | else // Show the configuration form. | 1430 | else // Show the configuration form. |
@@ -1465,7 +1468,7 @@ function renderPage() | |||
1465 | $LINKSDB[$key]=$value; | 1468 | $LINKSDB[$key]=$value; |
1466 | } | 1469 | } |
1467 | $LINKSDB->savedb(); // Save to disk. | 1470 | $LINKSDB->savedb(); // Save to disk. |
1468 | echo '<script language="JavaScript">alert("Tag was removed from '.count($linksToAlter).' links.");document.location=\'?\';</script>'; | 1471 | echo '<script>alert("Tag was removed from '.count($linksToAlter).' links.");document.location=\'?\';</script>'; |
1469 | exit; | 1472 | exit; |
1470 | } | 1473 | } |
1471 | 1474 | ||
@@ -1482,7 +1485,7 @@ function renderPage() | |||
1482 | $LINKSDB[$key]=$value; | 1485 | $LINKSDB[$key]=$value; |
1483 | } | 1486 | } |
1484 | $LINKSDB->savedb(); // Save to disk. | 1487 | $LINKSDB->savedb(); // Save to disk. |
1485 | echo '<script language="JavaScript">alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>'; | 1488 | echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>'; |
1486 | exit; | 1489 | exit; |
1487 | } | 1490 | } |
1488 | } | 1491 | } |
@@ -1513,7 +1516,7 @@ function renderPage() | |||
1513 | pubsubhub(); | 1516 | pubsubhub(); |
1514 | 1517 | ||
1515 | // If we are called from the bookmarklet, we must close the popup: | 1518 | // If we are called from the bookmarklet, we must close the popup: |
1516 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } | 1519 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; } |
1517 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); | 1520 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); |
1518 | $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. | 1521 | $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. |
1519 | header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. | 1522 | header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. |
@@ -1524,7 +1527,7 @@ function renderPage() | |||
1524 | if (isset($_POST['cancel_edit'])) | 1527 | if (isset($_POST['cancel_edit'])) |
1525 | { | 1528 | { |
1526 | // If we are called from the bookmarklet, we must close the popup: | 1529 | // If we are called from the bookmarklet, we must close the popup: |
1527 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } | 1530 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; } |
1528 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); | 1531 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); |
1529 | $returnurl .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited. | 1532 | $returnurl .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited. |
1530 | header('Location: '.$returnurl); // After canceling, redirect to the page the user was on. | 1533 | header('Location: '.$returnurl); // After canceling, redirect to the page the user was on. |
@@ -1543,10 +1546,8 @@ function renderPage() | |||
1543 | $LINKSDB->savedb(); // save to disk | 1546 | $LINKSDB->savedb(); // save to disk |
1544 | 1547 | ||
1545 | // If we are called from the bookmarklet, we must close the popup: | 1548 | // If we are called from the bookmarklet, we must close the popup: |
1546 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } | 1549 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; } |
1547 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); | 1550 | header('Location: ?'); // After deleting the link, redirect to the home page. |
1548 | if ($returnurl=='?') { $returnurl = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '?'); } | ||
1549 | header('Location: '.$returnurl); // After deleting the link, redirect to the page the user was on. | ||
1550 | exit; | 1551 | exit; |
1551 | } | 1552 | } |
1552 | 1553 | ||
@@ -1681,7 +1682,7 @@ HTML; | |||
1681 | if (!isset($_POST['token']) || (!isset($_FILES)) || (isset($_FILES['filetoupload']['size']) && $_FILES['filetoupload']['size']==0)) | 1682 | if (!isset($_POST['token']) || (!isset($_FILES)) || (isset($_FILES['filetoupload']['size']) && $_FILES['filetoupload']['size']==0)) |
1682 | { | 1683 | { |
1683 | $returnurl = ( empty($_SERVER['HTTP_REFERER']) ? '?' : $_SERVER['HTTP_REFERER'] ); | 1684 | $returnurl = ( empty($_SERVER['HTTP_REFERER']) ? '?' : $_SERVER['HTTP_REFERER'] ); |
1684 | 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>'; | 1685 | 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>'; |
1685 | exit; | 1686 | exit; |
1686 | } | 1687 | } |
1687 | if (!tokenOk($_POST['token'])) die('Wrong token.'); | 1688 | if (!tokenOk($_POST['token'])) die('Wrong token.'); |
@@ -1785,11 +1786,11 @@ function importFile() | |||
1785 | } | 1786 | } |
1786 | $LINKSDB->savedb(); | 1787 | $LINKSDB->savedb(); |
1787 | 1788 | ||
1788 | echo '<script language="JavaScript">alert("File '.json_encode($filename).' ('.$filesize.' bytes) was successfully processed: '.$import_count.' links imported.");document.location=\'?\';</script>'; | 1789 | echo '<script>alert("File '.json_encode($filename).' ('.$filesize.' bytes) was successfully processed: '.$import_count.' links imported.");document.location=\'?\';</script>'; |
1789 | } | 1790 | } |
1790 | else | 1791 | else |
1791 | { | 1792 | { |
1792 | echo '<script language="JavaScript">alert("File '.json_encode($filename).' ('.$filesize.' bytes) has an unknown file format. Nothing was imported.");document.location=\'?\';</script>'; | 1793 | echo '<script>alert("File '.json_encode($filename).' ('.$filesize.' bytes) has an unknown file format. Nothing was imported.");document.location=\'?\';</script>'; |
1793 | } | 1794 | } |
1794 | } | 1795 | } |
1795 | 1796 | ||
@@ -2123,13 +2124,13 @@ function install() | |||
2123 | $GLOBALS['hash'] = sha1($_POST['setpassword'].$GLOBALS['login'].$GLOBALS['salt']); | 2124 | $GLOBALS['hash'] = sha1($_POST['setpassword'].$GLOBALS['login'].$GLOBALS['salt']); |
2124 | $GLOBALS['title'] = (empty($_POST['title']) ? 'Shared links on '.htmlspecialchars(indexUrl()) : $_POST['title'] ); | 2125 | $GLOBALS['title'] = (empty($_POST['title']) ? 'Shared links on '.htmlspecialchars(indexUrl()) : $_POST['title'] ); |
2125 | writeConfig(); | 2126 | writeConfig(); |
2126 | echo '<script language="JavaScript">alert("Shaarli is now configured. Please enter your login/password and start shaaring your links!");document.location=\'?do=login\';</script>'; | 2127 | echo '<script>alert("Shaarli is now configured. Please enter your login/password and start shaaring your links!");document.location=\'?do=login\';</script>'; |
2127 | exit; | 2128 | exit; |
2128 | } | 2129 | } |
2129 | 2130 | ||
2130 | // Display config form: | 2131 | // Display config form: |
2131 | list($timezone_form,$timezone_js) = templateTZform(); | 2132 | list($timezone_form,$timezone_js) = templateTZform(); |
2132 | $timezone_html=''; if ($timezone_form!='') $timezone_html='<tr><td valign="top"><b>Timezone:</b></td><td>'.$timezone_form.'</td></tr>'; | 2133 | $timezone_html=''; if ($timezone_form!='') $timezone_html='<tr><td><b>Timezone:</b></td><td>'.$timezone_form.'</td></tr>'; |
2133 | 2134 | ||
2134 | $PAGE = new pageBuilder; | 2135 | $PAGE = new pageBuilder; |
2135 | $PAGE->assign('timezone_html',$timezone_html); | 2136 | $PAGE->assign('timezone_html',$timezone_html); |
@@ -2177,7 +2178,7 @@ function templateTZform($ptz=false) | |||
2177 | $cities_html = $cities[$pcontinent]; | 2178 | $cities_html = $cities[$pcontinent]; |
2178 | $timezone_form = "Continent: <select name=\"continent\" id=\"continent\" onChange=\"onChangecontinent();\">${continents_html}</select>"; | 2179 | $timezone_form = "Continent: <select name=\"continent\" id=\"continent\" onChange=\"onChangecontinent();\">${continents_html}</select>"; |
2179 | $timezone_form .= " City: <select name=\"city\" id=\"city\">${cities[$pcontinent]}</select><br />"; | 2180 | $timezone_form .= " City: <select name=\"city\" id=\"city\">${cities[$pcontinent]}</select><br />"; |
2180 | $timezone_js = "<script language=\"JavaScript\">"; | 2181 | $timezone_js = "<script>"; |
2181 | $timezone_js .= "function onChangecontinent(){document.getElementById(\"city\").innerHTML = citiescontinent[document.getElementById(\"continent\").value];}"; | 2182 | $timezone_js .= "function onChangecontinent(){document.getElementById(\"city\").innerHTML = citiescontinent[document.getElementById(\"continent\").value];}"; |
2182 | $timezone_js .= "var citiescontinent = ".json_encode($cities).";" ; | 2183 | $timezone_js .= "var citiescontinent = ".json_encode($cities).";" ; |
2183 | $timezone_js .= "</script>" ; | 2184 | $timezone_js .= "</script>" ; |
@@ -2292,7 +2293,7 @@ function writeConfig() | |||
2292 | $config .= ' ?>'; | 2293 | $config .= ' ?>'; |
2293 | if (!file_put_contents($GLOBALS['config']['CONFIG_FILE'],$config) || strcmp(file_get_contents($GLOBALS['config']['CONFIG_FILE']),$config)!=0) | 2294 | if (!file_put_contents($GLOBALS['config']['CONFIG_FILE'],$config) || strcmp(file_get_contents($GLOBALS['config']['CONFIG_FILE']),$config)!=0) |
2294 | { | 2295 | { |
2295 | 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>'; | 2296 | 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>'; |
2296 | exit; | 2297 | exit; |
2297 | } | 2298 | } |
2298 | } | 2299 | } |
diff --git a/tpl/changepassword.html b/tpl/changepassword.html index 48cf5fa3..c40daf9d 100644 --- a/tpl/changepassword.html +++ b/tpl/changepassword.html | |||
@@ -4,7 +4,7 @@ | |||
4 | <body onload="document.changepasswordform.oldpassword.focus();"> | 4 | <body onload="document.changepasswordform.oldpassword.focus();"> |
5 | <div id="pageheader"> | 5 | <div id="pageheader"> |
6 | {include="page.header"} | 6 | {include="page.header"} |
7 | <form method="POST" action="" name="changepasswordform" id="changepasswordform"> | 7 | <form method="POST" action="#" name="changepasswordform" id="changepasswordform"> |
8 | Old password: <input type="password" name="oldpassword"> | 8 | Old password: <input type="password" name="oldpassword"> |
9 | New password: <input type="password" name="setpassword"> | 9 | New password: <input type="password" name="setpassword"> |
10 | <input type="hidden" name="token" value="{$token}"> | 10 | <input type="hidden" name="token" value="{$token}"> |
diff --git a/tpl/changetag.html b/tpl/changetag.html index 79fea9a9..fdfb0b37 100644 --- a/tpl/changetag.html +++ b/tpl/changetag.html | |||
@@ -12,11 +12,11 @@ | |||
12 | <input type="text" name="totag" id="totag"> | 12 | <input type="text" name="totag" id="totag"> |
13 | <input type="submit" name="renametag" value="Rename tag" class="bigbutton"> | 13 | <input type="submit" name="renametag" value="Rename tag" class="bigbutton"> |
14 | or <input type="submit" name="deletetag" value="Delete tag" class="bigbutton" onClick="return confirmDeleteTag();"><br>(Case sensitive)</form> | 14 | or <input type="submit" name="deletetag" value="Delete tag" class="bigbutton" onClick="return confirmDeleteTag();"><br>(Case sensitive)</form> |
15 | <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> | 15 | <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> |
16 | </div> | 16 | </div> |
17 | {include="page.footer"} | 17 | {include="page.footer"} |
18 | {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"} | 18 | {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"} |
19 | <script language="JavaScript"> | 19 | <script> |
20 | $(document).ready(function() | 20 | $(document).ready(function() |
21 | { | 21 | { |
22 | $('#fromtag').autocomplete({source:'{$source}?ws=singletag',minLength:1}); | 22 | $('#fromtag').autocomplete({source:'{$source}?ws=singletag',minLength:1}); |
diff --git a/tpl/configure.html b/tpl/configure.html index 645107ae..89e48bd1 100644 --- a/tpl/configure.html +++ b/tpl/configure.html | |||
@@ -5,26 +5,26 @@ | |||
5 | <div id="pageheader"> | 5 | <div id="pageheader"> |
6 | {include="page.header"} | 6 | {include="page.header"} |
7 | {$timezone_js} | 7 | {$timezone_js} |
8 | <form method="POST" action="" name="configform" id="configform"> | 8 | <form method="POST" action="#" name="configform" id="configform"> |
9 | <input type="hidden" name="token" value="{$token}"> | 9 | <input type="hidden" name="token" value="{$token}"> |
10 | <table border="0" cellpadding="20"> | 10 | <table id="configuration_table"> |
11 | 11 | ||
12 | <tr><td><b>Page title:</b></td><td><input type="text" name="title" id="title" size="50" value="{$title}"></td></tr> | 12 | <tr><td><b>Page title:</b></td><td><input type="text" name="title" id="title" size="50" value="{$title}"></td></tr> |
13 | 13 | ||
14 | <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> | 14 | <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> |
15 | <tr><td valign="top"><b>Timezone:</b></td><td valign="top">{$timezone_form}</td></tr> | 15 | <tr><td><b>Timezone:</b></td><td>{$timezone_form}</td></tr> |
16 | 16 | ||
17 | <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> | 17 | <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> |
18 | 18 | ||
19 | <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"> Disable session cookie hijacking protection (Check this if you get disconnected often or if your IP address changes often.)</label></td></tr> | 19 | <tr><td><b>Security:</b></td><td><input type="checkbox" name="disablesessionprotection" id="disablesessionprotection" {if="!empty($GLOBALS['disablesessionprotection'])"}checked{/if}><label for="disablesessionprotection"> Disable session cookie hijacking protection (Check this if you get disconnected often or if your IP address changes often.)</label></td></tr> |
20 | 20 | ||
21 | <tr><td valign="top"><b>Features:</b></td><td> | 21 | <tr><td><b>Features:</b></td><td> |
22 | <input type="checkbox" name="disablejquery" id="disablejquery" {if="!empty($GLOBALS['disablejquery'])"}checked{/if}><label for="disablejquery"> Disable jQuery and all heavy JavaScript (for example: Autocomplete in tags. Useful for slow computers.)</label> | 22 | <input type="checkbox" name="disablejquery" id="disablejquery" {if="!empty($GLOBALS['disablejquery'])"}checked{/if}><label for="disablejquery"> Disable jQuery and all heavy JavaScript (for example: Autocomplete in tags. Useful for slow computers.)</label> |
23 | </td></tr> | 23 | </td></tr> |
24 | <tr><td valign="top"><b>New link:</b></td><td> | 24 | <tr><td><b>New link:</b></td><td> |
25 | <input type="checkbox" name="privateLinkByDefault" id="privateLinkByDefault" {if="!empty($GLOBALS['privateLinkByDefault'])"}checked{/if}/><label for="privateLinkByDefault"> All new link are private by default</label></td> | 25 | <input type="checkbox" name="privateLinkByDefault" id="privateLinkByDefault" {if="!empty($GLOBALS['privateLinkByDefault'])"}checked{/if}/><label for="privateLinkByDefault"> All new link are private by default</label></td> |
26 | </tr> | 26 | </tr> |
27 | <tr><td></td><td align="right"><input type="submit" name="Save" value="Save config" class="bigbutton"></td></tr> | 27 | <tr><td></td><td class="right"><input type="submit" name="Save" value="Save config" class="bigbutton"></td></tr> |
28 | </table> | 28 | </table> |
29 | </form> | 29 | </form> |
30 | </div> | 30 | </div> |
diff --git a/tpl/daily.html b/tpl/daily.html index c15a7062..c53e6f71 100644 --- a/tpl/daily.html +++ b/tpl/daily.html | |||
@@ -6,52 +6,52 @@ | |||
6 | <div class="daily"> | 6 | <div class="daily"> |
7 | <div class="dailyAbout"> | 7 | <div class="dailyAbout"> |
8 | All links of one day<br>in a single page.<br> | 8 | All links of one day<br>in a single page.<br> |
9 | {if="$previousday"} <a href="?do=daily&day={$previousday}"><b><</b>Previous day</a>{else}<b><</b>Previous day{/if} | 9 | {if="$previousday"} <a href="?do=daily&day={$previousday}"><b><</b>Previous day</a>{else}<b><</b>Previous day{/if} |
10 | - | 10 | - |
11 | {if="$nextday"}<a href="?do=daily&day={$nextday}">Next day<b>></b></a>{else}Next day<b>></b>{/if} | 11 | {if="$nextday"}<a href="?do=daily&day={$nextday}">Next day<b>></b></a>{else}Next day<b>></b>{/if} |
12 | <br><br> | 12 | <br><br> |
13 | <a href="?do=dailyrss" title="1 RSS entry per day"><img src="images/feed-icon-14x14.png#">Daily RSS Feed</a> | 13 | <a href="?do=dailyrss" title="1 RSS entry per day"><img src="images/feed-icon-14x14.png#" alt="rss_feed">Daily RSS Feed</a> |
14 | </div> | 14 | </div> |
15 | <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> | 15 | <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> |
16 | <div class="dailyDate"><span class="nomobile">———————————</span> {$day} <span class="nomobile">———————————</span></div> | 16 | <div class="dailyDate"><span class="nomobile">———————————</span> {$day} <span class="nomobile">———————————</span></div> |
17 | <div class="clear"></div> | 17 | <div class="clear"></div> |
18 | |||
19 | {if="$linksToDisplay"} | ||
20 | <div id="daily_col1"> | ||
21 | {loop="col1"} | ||
22 | <div class="dailyEntry"> | ||
23 | <div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div> | ||
24 | {if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if} | ||
25 | <div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div> | ||
26 | {if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if} | ||
27 | <div class="dailyEntryDescription">{$value.formatedDescription}</div> | ||
28 | </div> | ||
29 | {/loop} | ||
30 | </div> | ||
31 | 18 | ||
32 | <div id="daily_col2"> | 19 | {if="$linksToDisplay"} |
33 | {loop="col2"} | 20 | {loop="cols"} |
34 | <div class="dailyEntry"> | 21 | {if="isset($value[0])"} |
35 | <div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div> | 22 | <div id="daily_col{$counter+1}"> |
36 | {if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if} | 23 | {loop="value"} |
37 | <div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div> | 24 | {$link=$value} |
38 | {if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if} | 25 | <div class="dailyEntry"> |
39 | <div class="dailyEntryDescription">{$value.formatedDescription}</div> | 26 | <div class="dailyEntryPermalink"> |
40 | </div> | 27 | <a href="?{$link.linkdate|smallHash}"> |
41 | {/loop} | 28 | <img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"> |
42 | </div> | 29 | </a> |
43 | 30 | </div> | |
44 | <div id="daily_col3"> | 31 | {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"} |
45 | {loop="col3"} | 32 | <div class="dailyEntryLinkdate"> |
46 | <div class="dailyEntry"> | 33 | <a href="?{$link.linkdate|smallHash}">{$link.localdate}</a> |
47 | <div class="dailyEntryPermalink"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div> | 34 | </div> |
48 | {if="$value.tags"}<div class="dailyEntryTags">{loop="value.taglist"}{$value|htmlspecialchars} - {/loop}</div>{/if} | 35 | {/if} |
49 | <div class="dailyEntryTitle"><a href="{$value.url}">{$value.title|htmlspecialchars}</a></div> | 36 | {if="$link.tags"} |
50 | {if="$value.thumbnail"}<div class="dailyEntryThumbnail">{$value.thumbnail}</div>{/if} | 37 | <div class="dailyEntryTags"> |
51 | <div class="dailyEntryDescription">{$value.formatedDescription}</div> | 38 | {loop="link.taglist"} |
52 | </div> | 39 | {$value|htmlspecialchars} - |
40 | {/loop} | ||
41 | </div> | ||
42 | {/if} | ||
43 | <div class="dailyEntryTitle"> | ||
44 | <a href="{$link.url}">{$link.title|htmlspecialchars}</a> | ||
45 | </div> | ||
46 | {if="$link.thumbnail"} | ||
47 | <div class="dailyEntryThumbnail">{$link.thumbnail}</div> | ||
48 | {/if} | ||
49 | <div class="dailyEntryDescription">{$link.formatedDescription}</div> | ||
50 | </div> | ||
51 | {/loop} | ||
52 | </div> | ||
53 | {/if} | ||
53 | {/loop} | 54 | {/loop} |
54 | </div> | ||
55 | {else} | 55 | {else} |
56 | <div class="dailyNoEntry">No articles on this day.</div> | 56 | <div class="dailyNoEntry">No articles on this day.</div> |
57 | {/if} | 57 | {/if} |
diff --git a/tpl/editlink.html b/tpl/editlink.html index 885feed7..ecab443d 100644 --- a/tpl/editlink.html +++ b/tpl/editlink.html | |||
@@ -33,7 +33,7 @@ | |||
33 | </div> | 33 | </div> |
34 | {include="page.footer"} | 34 | {include="page.footer"} |
35 | {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"} | 35 | {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"} |
36 | <script language="JavaScript"> | 36 | <script> |
37 | $(document).ready(function() | 37 | $(document).ready(function() |
38 | { | 38 | { |
39 | $('#lf_tags').autocomplete({source:'{$source}?ws=tags',minLength:1}); | 39 | $('#lf_tags').autocomplete({source:'{$source}?ws=tags',minLength:1}); |
diff --git a/tpl/export.html b/tpl/export.html index 911b02c1..9d101db4 100644 --- a/tpl/export.html +++ b/tpl/export.html | |||
@@ -5,9 +5,9 @@ | |||
5 | <div id="pageheader"> | 5 | <div id="pageheader"> |
6 | {include="page.header"} | 6 | {include="page.header"} |
7 | <div id="toolsdiv"> | 7 | <div id="toolsdiv"> |
8 | <a href="?do=export&what=all"><b>Export all</b> <span>: Export all links</span></a><br><br> | 8 | <a href="?do=export&what=all"><b>Export all</b> <span>: Export all links</span></a><br><br> |
9 | <a href="?do=export&what=public"><b>Export public</b> <span>: Export public links only</a><br><br> | 9 | <a href="?do=export&what=public"><b>Export public</b> <span>: Export public links only</span></a><br><br> |
10 | <a href="?do=export&what=private"><b>Export private</b> <span>: Export private links only</a> | 10 | <a href="?do=export&what=private"><b>Export private</b> <span>: Export private links only</span></a> |
11 | <div class="clear"></div> | 11 | <div class="clear"></div> |
12 | </div> | 12 | </div> |
13 | </div> | 13 | </div> |
diff --git a/tpl/import.html b/tpl/import.html index 259e56ee..9ac3c2f9 100644 --- a/tpl/import.html +++ b/tpl/import.html | |||
@@ -8,7 +8,7 @@ | |||
8 | Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize|htmlspecialchars} bytes). | 8 | Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize|htmlspecialchars} bytes). |
9 | <form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform" id="uploadform"> | 9 | <form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform" id="uploadform"> |
10 | <input type="hidden" name="token" value="{$token}"> | 10 | <input type="hidden" name="token" value="{$token}"> |
11 | <input type="file" name="filetoupload" size="80"> | 11 | <input type="file" name="filetoupload"> |
12 | <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize|htmlspecialchars}"> | 12 | <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize|htmlspecialchars}"> |
13 | <input type="submit" name="import_file" value="Import" class="bigbutton"><br> | 13 | <input type="submit" name="import_file" value="Import" class="bigbutton"><br> |
14 | <input type="checkbox" name="private" id="private"><label for="private"> Import all links as private</label><br> | 14 | <input type="checkbox" name="private" id="private"><label for="private"> Import all links as private</label><br> |
diff --git a/tpl/includes.html b/tpl/includes.html index cc573801..efc658eb 100644 --- a/tpl/includes.html +++ b/tpl/includes.html | |||
@@ -6,4 +6,4 @@ | |||
6 | <link rel="alternate" type="application/atom+xml" href="{$feedurl}?do=atom{$searchcrits}#" title="ATOM Feed" /> | 6 | <link rel="alternate" type="application/atom+xml" href="{$feedurl}?do=atom{$searchcrits}#" title="ATOM Feed" /> |
7 | <link href="images/favicon.ico#" rel="shortcut icon" type="image/x-icon" /> | 7 | <link href="images/favicon.ico#" rel="shortcut icon" type="image/x-icon" /> |
8 | <link type="text/css" rel="stylesheet" href="inc/shaarli.css?version={$version|urlencode}#" /> | 8 | <link type="text/css" rel="stylesheet" href="inc/shaarli.css?version={$version|urlencode}#" /> |
9 | {if="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="inc/user.css?version={$version}#" />{/if} | 9 | {if="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="inc/user.css?version={$version|urlencode}#" />{/if} |
diff --git a/tpl/install.html b/tpl/install.html index 32b8811b..df42bf6d 100644 --- a/tpl/install.html +++ b/tpl/install.html | |||
@@ -5,7 +5,7 @@ | |||
5 | <div id="install"> | 5 | <div id="install"> |
6 | <h1>Shaarli</h1> | 6 | <h1>Shaarli</h1> |
7 | It looks like it's the first time you run Shaarli. Please configure it:<br> | 7 | It looks like it's the first time you run Shaarli. Please configure it:<br> |
8 | <form method="POST" action="" name="installform" id="installform"> | 8 | <form method="POST" action="#" name="installform" id="installform"> |
9 | <table> | 9 | <table> |
10 | <tr><td><b>Login:</b></td><td><input type="text" name="setlogin" size="30"></td></tr> | 10 | <tr><td><b>Login:</b></td><td><input type="text" name="setlogin" size="30"></td></tr> |
11 | <tr><td><b>Password:</b></td><td><input type="password" name="setpassword" size="30"></td></tr> | 11 | <tr><td><b>Password:</b></td><td><input type="password" name="setpassword" size="30"></td></tr> |
diff --git a/tpl/linklist.html b/tpl/linklist.html index 58d5867e..c8dfd122 100644 --- a/tpl/linklist.html +++ b/tpl/linklist.html | |||
@@ -30,7 +30,7 @@ | |||
30 | <ul> | 30 | <ul> |
31 | {loop="links"} | 31 | {loop="links"} |
32 | <li{if="$value.class"} class="{$value.class}"{/if}> | 32 | <li{if="$value.class"} class="{$value.class}"{/if}> |
33 | <a name="{$value.linkdate|smallHash}" id="{$value.linkdate|smallHash}"></a> | 33 | <a id="{$value.linkdate|smallHash}"></a> |
34 | <div class="thumbnail">{$value.url|thumbnail}</div> | 34 | <div class="thumbnail">{$value.url|thumbnail}</div> |
35 | <div class="linkcontainer"> | 35 | <div class="linkcontainer"> |
36 | {if="isLoggedIn()"} | 36 | {if="isLoggedIn()"} |
@@ -51,9 +51,10 @@ | |||
51 | {if="$GLOBALS['config']['ARCHIVE_ORG']"} | 51 | {if="$GLOBALS['config']['ARCHIVE_ORG']"} |
52 | <span class="linkarchive"><a href="https://web.archive.org/web/{$value.url|htmlspecialchars}">archive</a> - </span> | 52 | <span class="linkarchive"><a href="https://web.archive.org/web/{$value.url|htmlspecialchars}">archive</a> - </span> |
53 | {/if} | 53 | {/if} |
54 | <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}" | 54 | <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}" |
55 | onclick="showQrCode(this); return false;" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}"><img src="images/qrcode.png#" title="QR-Code"></a></div> - | 55 | onclick="return showQrCode(this);" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}"> |
56 | <a href={$value.url|htmlspecialchars}><span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span></a><br> | 56 | <img src="images/qrcode.png#" alt="QR-Code" title="{$value.localdate|htmlspecialchars}"></a></div> - |
57 | <a href="{$value.url|htmlspecialchars}"><span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span></a><br> | ||
57 | {if="$value.tags"} | 58 | {if="$value.tags"} |
58 | <div class="linktaglist"> | 59 | <div class="linktaglist"> |
59 | {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value|htmlspecialchars}</a></span> {/loop} | 60 | {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value|htmlspecialchars}</a></span> {/loop} |
@@ -70,7 +71,7 @@ | |||
70 | 71 | ||
71 | {include="page.footer"} | 72 | {include="page.footer"} |
72 | 73 | ||
73 | <script language="JavaScript"> | 74 | <script> |
74 | // Remove any displayed QR-Code | 75 | // Remove any displayed QR-Code |
75 | function remove_qrcode() | 76 | function remove_qrcode() |
76 | { | 77 | { |
@@ -79,12 +80,20 @@ function remove_qrcode() | |||
79 | return false; | 80 | return false; |
80 | } | 81 | } |
81 | 82 | ||
83 | function isCanvasSupported(){ | ||
84 | var elem = document.createElement('canvas'); | ||
85 | return !!(elem.getContext && elem.getContext('2d')); | ||
86 | } | ||
87 | |||
82 | // Show the QR-Code of a permalink (when the QR-Code icon is clicked). | 88 | // Show the QR-Code of a permalink (when the QR-Code icon is clicked). |
83 | function showQrCode(caller,loading=false) | 89 | function showQrCode(caller,loading) |
84 | { | 90 | { |
91 | if( !isCanvasSupported() ) return true; | ||
92 | |||
85 | // Dynamic javascript lib loading: We only load qr.js if the QR code icon is clicked: | 93 | // Dynamic javascript lib loading: We only load qr.js if the QR code icon is clicked: |
86 | if (typeof(qr)=='undefined') // Load qr.js only if not present. | 94 | if (typeof(qr)=='undefined') // Load qr.js only if not present. |
87 | { | 95 | { |
96 | loading = typeof loading !== 'undefined' ? loading : false; | ||
88 | if (!loading) // If javascript lib is still loading, do not append script to body. | 97 | if (!loading) // If javascript lib is still loading, do not append script to body. |
89 | { | 98 | { |
90 | var element = document.createElement("script"); | 99 | var element = document.createElement("script"); |
@@ -101,12 +110,12 @@ function showQrCode(caller,loading=false) | |||
101 | // Build the div which contains the QR-Code: | 110 | // Build the div which contains the QR-Code: |
102 | var element = document.createElement('div'); | 111 | var element = document.createElement('div'); |
103 | element.id="permalinkQrcode"; | 112 | element.id="permalinkQrcode"; |
104 | // Make QR-Code div commit sepuku when clicked: | 113 | |
105 | if ( element.attachEvent ){ element.attachEvent('onclick', 'this.parentNode.removeChild(this);' ); } // Damn IE | 114 | // Make QR-Code div commit sepuku when clicked: |
106 | else { element.setAttribute('onclick', 'this.parentNode.removeChild(this);' ); } | 115 | element.addEventListener('click', remove_qrcode ); // Works on every canvas supported browser |
107 | 116 | ||
108 | // Build the QR-Code: | 117 | // Build the QR-Code: |
109 | var image = qr.image({size: 8,value: caller.dataset.permalink}); | 118 | var image = qr.image({size: 8,value: caller.getAttribute('data-permalink')}); |
110 | if (image) | 119 | if (image) |
111 | { | 120 | { |
112 | element.appendChild(image); | 121 | element.appendChild(image); |
diff --git a/tpl/linklist.paging.html b/tpl/linklist.paging.html index c2b98971..848541cd 100644 --- a/tpl/linklist.paging.html +++ b/tpl/linklist.paging.html | |||
@@ -1,6 +1,6 @@ | |||
1 | <div class="paging"> | 1 | <div class="paging"> |
2 | {if="isLoggedIn()"} | 2 | {if="isLoggedIn()"} |
3 | <div id="paging_privatelinks"> | 3 | <div class="paging_privatelinks"> |
4 | <a href="?privateonly"> | 4 | <a href="?privateonly"> |
5 | {if="$privateonly"} | 5 | {if="$privateonly"} |
6 | <img src="images/private_16x16_active.png#" width="16" height="16" title="Click to see all links" alt="Click to see all links"> | 6 | <img src="images/private_16x16_active.png#" width="16" height="16" title="Click to see all links" alt="Click to see all links"> |
@@ -10,11 +10,11 @@ | |||
10 | </a> | 10 | </a> |
11 | </div> | 11 | </div> |
12 | {/if} | 12 | {/if} |
13 | <div id="paging_linksperpage"> | 13 | <div class="paging_linksperpage"> |
14 | Links per page: <a href="?linksperpage=20">20</a> <a href="?linksperpage=50">50</a> <a href="?linksperpage=100">100</a> | 14 | Links per page: <a href="?linksperpage=20">20</a> <a href="?linksperpage=50">50</a> <a href="?linksperpage=100">100</a> |
15 | <form method="GET" class="linksperpage"><input type="text" name="linksperpage" size="2"></form> | 15 | <form method="GET" class="linksperpage"><input type="text" name="linksperpage" size="2"></form> |
16 | </div> | 16 | </div> |
17 | {if="$previous_page_url"} <a href="{$previous_page_url}" id="paging_older">◄Older</a> {/if} | 17 | {if="$previous_page_url"} <a href="{$previous_page_url}" class="paging_older">◄Older</a> {/if} |
18 | <div id="paging_current">page {$page_current} / {$page_max} </div> | 18 | <div class="paging_current">page {$page_current} / {$page_max} </div> |
19 | {if="$next_page_url"} <a href="{$next_page_url}" id="paging_newer">Newer►</a> {/if} | 19 | {if="$next_page_url"} <a href="{$next_page_url}" class="paging_newer">Newer►</a> {/if} |
20 | </div> | 20 | </div> |
diff --git a/tpl/page.footer.html b/tpl/page.footer.html index b494bf7d..e55a3cb4 100644 --- a/tpl/page.footer.html +++ b/tpl/page.footer.html | |||
@@ -5,5 +5,5 @@ | |||
5 | <div id="newversion"><span id="version_id">●</span> Shaarli {$newversion|htmlspecialchars} is <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#download">available</a>.</div> | 5 | <div id="newversion"><span id="version_id">●</span> Shaarli {$newversion|htmlspecialchars} is <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#download">available</a>.</div> |
6 | {/if} | 6 | {/if} |
7 | {if="isLoggedIn()"} | 7 | {if="isLoggedIn()"} |
8 | <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> | 8 | <script>function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script> |
9 | {/if} | 9 | {/if} |
diff --git a/tpl/picwall.html b/tpl/picwall.html index bf299fbf..d3cabb2d 100644 --- a/tpl/picwall.html +++ b/tpl/picwall.html | |||
@@ -9,15 +9,15 @@ | |||
9 | </head> | 9 | </head> |
10 | <body> | 10 | <body> |
11 | <div id="pageheader">{include="page.header"}</div> | 11 | <div id="pageheader">{include="page.header"}</div> |
12 | <center> | 12 | <div class="center"> |
13 | <div class="picwall_container"> | 13 | <div id="picwall_container"> |
14 | {loop="linksToDisplay"} | 14 | {loop="linksToDisplay"} |
15 | <div class="picwall_pictureframe"> | 15 | <div class="picwall_pictureframe"> |
16 | {$value.thumbnail}<a href="{$value.permalink}"><span class="info">{$value.title|htmlspecialchars}</span></a> | 16 | {$value.thumbnail}<a href="{$value.permalink}"><span class="info">{$value.title|htmlspecialchars}</span></a> |
17 | </div> | 17 | </div> |
18 | {/loop} | 18 | {/loop} |
19 | </div> | ||
19 | </div> | 20 | </div> |
20 | </center> | ||
21 | {include="page.footer"} | 21 | {include="page.footer"} |
22 | 22 | ||
23 | {if="empty($GLOBALS['disablejquery'])"} | 23 | {if="empty($GLOBALS['disablejquery'])"} |
diff --git a/tpl/tagcloud.html b/tpl/tagcloud.html index 9418e248..97205e2b 100644 --- a/tpl/tagcloud.html +++ b/tpl/tagcloud.html | |||
@@ -3,13 +3,13 @@ | |||
3 | <head>{include="includes"}</head> | 3 | <head>{include="includes"}</head> |
4 | <body> | 4 | <body> |
5 | <div id="pageheader">{include="page.header"}</div> | 5 | <div id="pageheader">{include="page.header"}</div> |
6 | <center> | 6 | <div class="center"> |
7 | <div id="cloudtag"> | 7 | <div id="cloudtag"> |
8 | {loop="tags"} | 8 | {loop="tags"} |
9 | <span class="count">{$value.count}</span><a href="?searchtags={$key|urlencode}" style="font-size:{$value.size}pt;">{$key|htmlspecialchars}</a> | 9 | <span class="count">{$value.count}</span><a href="?searchtags={$key|urlencode}" style="font-size:{$value.size}pt;">{$key|htmlspecialchars}</a> |
10 | {/loop} | 10 | {/loop} |
11 | </div> | ||
11 | </div> | 12 | </div> |
12 | </center> | ||
13 | {include="page.footer"} | 13 | {include="page.footer"} |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
diff --git a/tpl/tools.html b/tpl/tools.html index ae31902b..c2520fda 100644 --- a/tpl/tools.html +++ b/tpl/tools.html | |||
@@ -10,7 +10,7 @@ | |||
10 | <a href="?do=changetag"><b>Rename/delete tags</b> <span>: Rename or delete a tag in all links</span></a><br><br> | 10 | <a href="?do=changetag"><b>Rename/delete tags</b> <span>: Rename or delete a tag in all links</span></a><br><br> |
11 | <a href="?do=import"><b>Import</b> <span>: Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)</span></a> <br><br> | 11 | <a href="?do=import"><b>Import</b> <span>: Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)</span></a> <br><br> |
12 | <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> | 12 | <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> |
13 | <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)+'&title='%20+%20encodeURIComponent(title)+'&description='%20+%20encodeURIComponent(document.getSelection())+'&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>⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).<br> Then click "Shaare link" button in any page you want to share.</span></a><br><br> | 13 | <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)+'&title='%20+%20encodeURIComponent(title)+'&description='%20+%20encodeURIComponent(document.getSelection())+'&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>⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).<br> Then click "✚Shaare link" button in any page you want to share.</span></a><br><br> |
14 | <div class="clear"></div> | 14 | <div class="clear"></div> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |