optimize loading of external libraries a bit

fix bold text in Unread articles
This commit is contained in:
Andrew Dolgov 2013-03-20 20:33:46 +04:00
parent 47e909d1cf
commit b5d4716a52
6 changed files with 58 additions and 58 deletions

View File

@ -151,3 +151,7 @@ div.cdmHeader div.hlFeed, div.cdmHeader div.hlFeed a {
div.cdmContentInner p {
max-width : 650px;
}
.Unread div.cdmHeader {
font-weight : bold;
}

View File

@ -4070,4 +4070,25 @@
return $rv;
}
function stylesheet_tag($filename) {
$timestamp = filemtime($filename);
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$filename?$timestamp\"/>\n";
}
function javascript_tag($filename) {
$query = "";
if (!(strpos($filename, "?") === FALSE)) {
$query = substr($filename, strpos($filename, "?")+1);
$filename = substr($filename, 0, strpos($filename, "?"));
}
$timestamp = filemtime($filename);
if ($query) $timestamp .= "&$query";
echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"$filename?$timestamp\"></script>\n";
}
?>

View File

@ -44,8 +44,6 @@
login_sequence($link);
$dt_add = time();
no_cache_incantation();
header('Content-Type: text/html; charset=utf-8');
@ -56,9 +54,10 @@
<html>
<head>
<title>Tiny Tiny RSS</title>
<link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
<link rel="stylesheet" type="text/css" href="cdm.css?<?php echo $dt_add ?>"/>
<?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
<?php echo stylesheet_tag("tt-rss.css"); ?>
<?php echo stylesheet_tag("cdm.css"); ?>
<?php print_user_stylesheet($link) ?>
@ -74,14 +73,18 @@
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
<script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
<script type="text/javascript" src="lib/dojo/dojo.js"></script>
<script type="text/javascript" src="lib/dijit/dijit.js"></script>
<script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
<?php
foreach (array("lib/prototype.js",
"lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls",
"lib/dojo/dojo.js",
"lib/dijit/dijit.js",
"lib/dojo/tt-rss-layer.js",
"localized_js.php",
"errors.php?mode=js") as $jsfile) {
<script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
echo javascript_tag($jsfile);
} ?>
<script type="text/javascript">
<?php

View File

@ -1,31 +0,0 @@
/* http://textsnippets.com/posts/show/835 */
Position.GetWindowSize = function(w) {
w = w ? w : window;
var width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
var height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
return [width, height];
};
/* http://textsnippets.com/posts/show/836 */
Position.Center = function(element, parent) {
var w, h, pw, ph;
var d = Element.getDimensions(element);
w = d.width;
h = d.height;
Position.prepare();
if (!parent) {
var ws = Position.GetWindowSize();
pw = ws[0];
ph = ws[1];
} else {
pw = parent.offsetWidth;
ph = parent.offsetHeight;
}
element.style.top = (ph/2) - (h/2) - Position.deltaY + "px";
element.style.left = (pw/2) - (w/2) - Position.deltaX + "px";
};

View File

@ -15,8 +15,6 @@
login_sequence($link);
$dt_add = time();
no_cache_incantation();
header('Content-Type: text/html; charset=utf-8');
@ -26,21 +24,26 @@
<html>
<head>
<title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
<link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
<?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
<?php echo stylesheet_tag("tt-rss.css"); ?>
<?php print_user_stylesheet($link) ?>
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
<script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="lib/position.js"></script>
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
<script type="text/javascript" src="lib/dojo/dojo.js"></script>
<script type="text/javascript" src="lib/dijit/dijit.js"></script>
<script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
<?php
foreach (array("lib/prototype.js",
"lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls",
"lib/dojo/dojo.js",
"lib/dijit/dijit.js",
"lib/dojo/tt-rss-layer.js",
"localized_js.php",
"errors.php?mode=js") as $jsfile) {
<script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
echo javascript_tag($jsfile);
} ?>
<script type="text/javascript">
<?php

View File

@ -184,7 +184,6 @@ a:hover {
.even.Unread.Selected {
background : #fff7d5 ! important;
font-weight : bold;
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #e7d796;
@ -192,7 +191,6 @@ a:hover {
.odd.Unread.Selected {
background : #fff7d5 ! important;
font-weight : bold;
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #e7d796;
@ -244,7 +242,6 @@ a:hover {
.even.Unread {
background : #f0f0f0;
font-weight : bold;
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #c0c0c0;
@ -252,7 +249,6 @@ a:hover {
}
.odd.Unread {
font-weight : bold;
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #c0c0c0;
@ -1193,3 +1189,7 @@ span.collapseBtn {
div.postContent p {
max-width : 650px;
}
.Unread div.hlTitle {
font-weight : bold;
}