aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-25 17:08:17 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-25 17:08:17 +0200
commit48a1aa7d52e712d5f64a33a003b31f23a00b99f5 (patch)
treeab6e6de44c007836edda8f0b2ded29c8d28ca1a1 /app/views
parent32ee8feccfb28aa3141469581cd04d4813fd6835 (diff)
ajout de la fonctionnalité pour paramétrer les raccourcis
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/flux.phtml2
-rw-r--r--app/views/configure/shortcut.phtml34
-rw-r--r--app/views/index/index.phtml2
-rw-r--r--app/views/javascript/main.phtml27
4 files changed, 56 insertions, 9 deletions
diff --git a/app/views/configure/flux.phtml b/app/views/configure/flux.phtml
index fe1ddc644..1aa26c634 100644
--- a/app/views/configure/flux.phtml
+++ b/app/views/configure/flux.phtml
@@ -36,6 +36,8 @@
</div>
<input type="submit" value="Valider" />
+
+ <button formaction="<?php echo Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>">Supprimer</button>
<?php } ?>
</form>
<?php } else { ?>
diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml
new file mode 100644
index 000000000..6fc253dd5
--- /dev/null
+++ b/app/views/configure/shortcut.phtml
@@ -0,0 +1,34 @@
+<datalist id="keys">
+ <?php foreach ($this->list_keys as $key) { ?>
+ <option value="<?php echo $key; ?>">
+ <?php } ?>
+</datalist>
+
+<?php $s = $this->conf->shortcuts (); ?>
+
+<form method="post" action="">
+ <h1>Gérer les raccourcis</h1>
+
+ <label for="mark_read">Marquer l'article comme lu</label>
+ <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" />
+
+ <label for="mark_favorite">Mettre l'article en favori</label>
+ <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" />
+
+ <label for="go_website">Afficher l'article sur le site d'origine</label>
+ <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" />
+
+ <label for="next_entry">Passer à l'article suivant</label>
+ <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" />
+
+ <label for="prev_entry">Passer à l'article précédent</label>
+ <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" />
+
+ <label for="next_page">Passer à la page suivant</label>
+ <input type="text" id="next_page" name="shortcuts[next_page]" list="keys" value="<?php echo $s['next_page']; ?>" />
+
+ <label for="prev_page">Passer à la page précédente</label>
+ <input type="text" id="prev_page" name="shortcuts[prev_page]" list="keys" value="<?php echo $s['prev_page']; ?>" />
+
+ <input type="submit" value="Valider" />
+</form>
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index c3f4242c4..27a6f9fe2 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -22,7 +22,7 @@
sur <a target="_blank" href="<?php echo $feed->website (); ?>"><?php echo $feed->name (); ?> <img src="http://www.google.com/s2/favicons?domain=<?php echo get_domain ($feed->website ()); ?>" alt="" /></a>,
</div>
- <h1><a target="_blank" href="<?php echo $item->link (); ?>"> <?php echo $item->title (); ?></a></h1>
+ <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"> <?php echo $item->title (); ?></a></h1>
<div class="content"><?php echo $item->content (); ?></div>
<div class="after">
diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml
index c801ba7d0..beae6c12b 100644
--- a/app/views/javascript/main.phtml
+++ b/app/views/javascript/main.phtml
@@ -4,9 +4,15 @@ var hide_posts = true;
var hide_posts = false;
<?php } ?>
-function redirect (url) {
+<?php $s = $this->conf->shortcuts (); ?>
+
+function redirect (url, new_tab = false) {
if (url) {
- location.href = url;
+ if (new_tab) {
+ window.open (url);
+ } else {
+ location.href = url;
+ }
}
}
@@ -98,19 +104,19 @@ $(document).ready (function () {
});
// Touches de manipulation
- shortcut.add("m", function () {
+ shortcut.add("<?php echo $s['mark_read']; ?>", function () {
// on marque comme lu ou non lu
active = $(".post.flux.active");
mark_read (active);
});
- shortcut.add("f", function () {
+ shortcut.add("<?php echo $s['mark_favorite']; ?>", function () {
// on marque comme favori ou non favori
active = $(".post.flux.active");
mark_favorite (active);
});
// Touches de navigation
- shortcut.add("page_up", function () {
+ shortcut.add("<?php echo $s['prev_entry']; ?>", function () {
old_active = $(".post.flux.active");
last_active = $(".post.flux:last");
new_active = old_active.prev ();
@@ -121,7 +127,7 @@ $(document).ready (function () {
slide (last_active, old_active);
}
});
- shortcut.add("page_down", function () {
+ shortcut.add("<?php echo $s['next_entry']; ?>", function () {
old_active = $(".post.flux.active");
first_active = $(".post.flux:first");
new_active = old_active.next ();
@@ -132,7 +138,7 @@ $(document).ready (function () {
slide (first_active, old_active);
}
});
- shortcut.add("right", function () {
+ shortcut.add("<?php echo $s['next_page']; ?>", function () {
url = $(".pager-next a").attr ("href");
if (url === undefined) {
url = $(".pager-first a").attr ("href");
@@ -140,7 +146,7 @@ $(document).ready (function () {
redirect (url);
});
- shortcut.add("left", function () {
+ shortcut.add("<?php echo $s['prev_page']; ?>", function () {
url = $(".pager-previous a").attr ("href");
if (url === undefined) {
url = $(".pager-last a").attr ("href");
@@ -148,4 +154,9 @@ $(document).ready (function () {
redirect (url);
});
+ shortcut.add("<?php echo $s['go_website']; ?>", function () {
+ url = $(".post.flux.active h1.title a").attr ("href");
+
+ redirect (url, true);
+ });
});