aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-25 00:40:35 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-25 00:40:35 +0100
commitab26cb6ed8904bb873e0ae4b874aed3f3a0fdb48 (patch)
tree4af146215a360e268e045aacdac258969b4eb878
parenteae19e13634593d919811f527eff9e1efd34c03b (diff)
Accessibilité sans images (expérimentation)
Expérimentation : utilisation de vraies images à la place des icônes générées en CSS. Permet de fournir un texte alternatif affiché en cas de non-chargement de l'image (par choix ou problème réseau par exemple). Meilleure sémantique (plutôt que le tag i détourné). Implémente https://github.com/marienfressinaud/FreshRSS/issues/284 Il est toujours possible de changer d'icônes selon les thèmes grâce à RSSThemes.php
-rw-r--r--app/models/RSSThemes.php4
-rw-r--r--public/scripts/main.js10
-rw-r--r--public/themes/default/freshrss.css2
-rw-r--r--public/themes/default/global.css83
-rw-r--r--public/themes/flat-design/freshrss.css2
-rw-r--r--public/themes/flat-design/global.css77
6 files changed, 13 insertions, 165 deletions
diff --git a/app/models/RSSThemes.php b/app/models/RSSThemes.php
index 6e4ddbf6d..3fd0b2ea1 100644
--- a/app/models/RSSThemes.php
+++ b/app/models/RSSThemes.php
@@ -82,7 +82,7 @@ class RSSThemes extends Model {
$url = isset(self::$themeIcons[$url]) ? (self::$themeIconsUrl . $url) :
(self::$defaultIconsUrl . $url);
- return '<i class="icon i_' . $name . '">' . $alts[$name] . '</i>';
- //return '<img class="icon" src="' . Url::display($url) . '" alt="' . $alts[$name] . '" />';
+ //return '<i class="icon i_' . $name . '">' . $alts[$name] . '</i>';
+ return '<img class="icon" src="' . Url::display($url) . '" alt="' . $alts[$name] . '" />';
}
}
diff --git a/public/scripts/main.js b/public/scripts/main.js
index e21483f28..6d8389a44 100644
--- a/public/scripts/main.js
+++ b/public/scripts/main.js
@@ -286,7 +286,15 @@ function init_column_categories() {
return;
}
$('#aside_flux').on('click', '.category>a.dropdown-toggle', function () {
- $(this).children().toggleClass("i_down").toggleClass("i_up").text($(this).hasClass("i_up") ? "△" : "▽");
+ $(this).children().each(function() {
+ if (this.alt === '▽') {
+ this.src = this.src.replace('/icons/down.', '/icons/up.');
+ this.alt = '△';
+ } else {
+ this.src = this.src.replace('/icons/up.', '/icons/down.');
+ this.alt = '▽';
+ }
+ });
$(this).parent().next(".feeds").slideToggle();
return false;
});
diff --git a/public/themes/default/freshrss.css b/public/themes/default/freshrss.css
index 78f76dd83..7d30c1806 100644
--- a/public/themes/default/freshrss.css
+++ b/public/themes/default/freshrss.css
@@ -18,6 +18,7 @@
}
.logo {
display: inline-block;
+ font-size: 48px;
height: 32px;
width: 32px;
padding: 10px;
@@ -253,7 +254,6 @@
.item.manage {
width: 40px;
white-space: nowrap;
- font-size: 0px;
text-align: center;
}
.flux_header .item.website {
diff --git a/public/themes/default/global.css b/public/themes/default/global.css
index b5cae66db..2004a1936 100644
--- a/public/themes/default/global.css
+++ b/public/themes/default/global.css
@@ -480,92 +480,9 @@ input, select, textarea {
/* ICÔNES */
.icon {
- font-size: 0;
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
line-height: 16px;
- background: center center no-repeat;
}
- .i_refresh {
- background-image: url("../icons/refresh.svg");
- }
- .i_bookmark {
- background-image: url("../icons/starred.svg");
- }
- .i_not_bookmark {
- background-image: url("../icons/unstarred.svg");
- }
- .i_read {
- background-image: url("../icons/read.svg");
- }
- .i_unread {
- background-image: url("../icons/unread.svg");
- }
- .i_all {
- background-image: url("../icons/all.svg");
- }
- .i_close {
- background-image: url("../icons/close.svg");
- }
- .i_search {
- background-image: url("../icons/search.svg");
- }
- .i_configure {
- background-image: url("../icons/configure.svg");
- }
- .i_login {
- background-image: url("../icons/login.svg");
- }
- .i_logout {
- background-image: url("../icons/logout.svg");
- }
- .i_add {
- background-image: url("../icons/add.svg");
- }
- .i_link {
- background-image: url("../icons/link.svg");
- }
- .i_down {
- background-image: url("../icons/down.svg");
- }
- .i_up {
- background-image: url("../icons/up.svg");
- }
- .i_next {
- background-image: url("../icons/next.svg");
- }
- .i_prev {
- background-image: url("../icons/prev.svg");
- }
- .i_help {
- background-image: url("../icons/help.svg");
- }
- .i_note {
- background-image: url("../icons/note.svg");
- }
- .i_note_empty {
- background-image: url("../icons/note_empty.svg");
- }
- .i_category {
- background-image: url("../icons/category.svg");
- }
- .i_category-white {
- background-image: url("../icons/category-white.svg");
- }
- .i_rss {
- background-image: url("../icons/rss.svg");
- }
- .i_share {
- background-image: url("../icons/share.svg");
- }
- .i_starred {
- background-image: url("../icons/starred.svg");
- }
- .i_non-starred {
- background-image: url("../icons/non-starred.svg");
- }
- .i_tag {
- background-image: url("../icons/tag.svg");
- }
diff --git a/public/themes/flat-design/freshrss.css b/public/themes/flat-design/freshrss.css
index 602845ef1..04c61085b 100644
--- a/public/themes/flat-design/freshrss.css
+++ b/public/themes/flat-design/freshrss.css
@@ -21,6 +21,7 @@ body {
}
.logo {
display: inline-block;
+ font-size: 48px;
height: 32px;
width: 32px;
padding: 10px;
@@ -236,7 +237,6 @@ body {
.item.manage {
width: 40px;
white-space: nowrap;
- font-size: 0px;
text-align: center;
}
.flux_header .item.website {
diff --git a/public/themes/flat-design/global.css b/public/themes/flat-design/global.css
index 0c731f74b..c53ec863c 100644
--- a/public/themes/flat-design/global.css
+++ b/public/themes/flat-design/global.css
@@ -472,86 +472,9 @@ input, select, textarea {
/* ICÔNES */
.icon {
- font-size: 0;
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
line-height: 16px;
- background: center center no-repeat;
}
- .i_refresh {
- background-image: url("icons/refresh.svg");
- }
- .i_bookmark {
- background-image: url("../icons/starred.svg");
- }
- .i_not_bookmark {
- background-image: url("../icons/unstarred.svg");
- }
- .i_read {
- background-image: url("../icons/read.svg");
- }
- .i_unread {
- background-image: url("../icons/unread.svg");
- }
- .i_all {
- background-image: url("icons/all.svg");
- }
- .i_close {
- background-image: url("icons/close.svg");
- }
- .i_search {
- background-image: url("icons/search.svg");
- }
- .i_configure {
- background-image: url("icons/configure.svg");
- }
- .i_login {
- background-image: url("../icons/login.svg");
- }
- .i_logout {
- background-image: url("../icons/logout.svg");
- }
- .i_add {
- background-image: url("icons/add.svg");
- }
- .i_link {
- background-image: url("../icons/link.svg");
- }
- .i_down {
- background-image: url("icons/down.svg");
- }
- .i_up {
- background-image: url("icons/up.svg");
- }
- .i_next {
- background-image: url("icons/next.svg");
- }
- .i_prev {
- background-image: url("icons/prev.svg");
- }
- .i_help {
- background-image: url("../icons/help.svg");
- }
- .i_category {
- background-image: url("../icons/category-white.svg");
- }
- .i_category-white {
- background-image: url("../icons/category-white.svg");
- }
- .i_rss {
- background-image: url("../icons/rss.svg");
- }
- .i_share {
- background-image: url("../icons/share.svg");
- }
- .i_starred {
- background-image: url("../icons/starred.svg");
- }
- .i_non-starred {
- background-image: url("../icons/non-starred.svg");
- }
- .i_tag {
- background-image: url("../icons/tag.svg");
- }