Remove some favicons.

This commit is contained in:
Lars Jung 2014-06-13 02:45:05 +02:00
parent 78ccc49197
commit 34105d0f28
16 changed files with 60 additions and 19 deletions

View file

@ -160,6 +160,9 @@ class App {
return array();
}
// return $this->get_all_items();
// return json_decode(file_get_contents(CACHE_PATH . "/item.json"));
$cache = array();
$folder = Item::get($this, $this->to_path($url), $cache);
@ -197,12 +200,34 @@ class App {
}
public function cummulate_folders($item, &$cache) {
if (!$item->is_folder) {
return;
}
$max_date = $item->date;
$sum_size = 0;
foreach ($item->get_content($cache) as $child) {
$this->cummulate_folders($child, $cache);
if ($child->date > $max_date) {
$max_date = $child->date;
}
$sum_size += $child->size;
}
$item->date = $max_date;
$item->size = $sum_size;
}
public function get_all_items() {
$cache = array();
$root = Item::get($this, ROOT_PATH, $cache);
$this->get_all_item_content($root, $cache);
$this->cummulate_folders($root, $cache);
uasort($cache, array("Item", "cmp"));
$result = array();

View file

@ -87,6 +87,18 @@ class Item {
$this->date = @filemtime($this->path);
$this->size = Item::filesize($app, $this->path);
$this->is_content_fetched = false;
// $options = $app->get_options();
// if (!$this->is_folder && $options["hashes"]["enabled"]) {
if (!$this->is_folder) {
// $this->md5 = md5_file($this->path);
// $this->sha1 = sha1_file($this->path);
$this->md5 = null;
$this->sha1 = null;
} else {
$this->md5 = null;
$this->sha1 = null;
}
}
@ -101,6 +113,9 @@ class Item {
if ($this->is_folder) {
$obj["is_managed"] = $this->app->is_managed_url($this->url);
$obj["content"] = $this->is_content_fetched;
} else {
$obj["md5"] = $this->md5;
$obj["sha1"] = $this->sha1;
}
return $obj;

View file

@ -15,12 +15,8 @@ html.no-js.browser( lang="en" )
title index · styled with {{pkg.name}} {{pkg.version}} ({{pkg.url}})
meta( name="description", content="index styled with {{pkg.name}} {{pkg.version}} ({{pkg.url}})" )
meta( name="viewport", content="width=device-width" )
link( rel="shortcut icon", href!="#{app_href}client/images/favicon/app-16.ico" )
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{app_href}client/images/favicon/app-48.png" )
link( rel="apple-touch-icon-precomposed", sizes="57x57", type="image/png", href!="#{app_href}client/images/favicon/app-57.png" )
link( rel="apple-touch-icon-precomposed", sizes="72x72", type="image/png", href!="#{app_href}client/images/favicon/app-72.png" )
link( rel="apple-touch-icon-precomposed", sizes="114x114", type="image/png", href!="#{app_href}client/images/favicon/app-114.png" )
link( rel="apple-touch-icon-precomposed", sizes="144x144", type="image/png", href!="#{app_href}client/images/favicon/app-144.png" )
link( rel="shortcut icon", href!="#{app_href}client/images/favicon/app-16-32.ico" )
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{app_href}client/images/favicon/app-152.png" )
link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic,700italic|Ubuntu:300italic,700italic,300,700" )
link( rel="stylesheet", href!="#{app_href}client/css/styles.css" )
script( src!="#{app_href}client/js/scripts.js" )