From a2a37742e40d6ff516280175a5b85e1e2bef66bf Mon Sep 17 00:00:00 2001 From: Faldrian <faldrian@och-noe.de> Date: Fri, 1 Aug 2014 22:07:24 +0200 Subject: [PATCH] added keyboard shortcut help topic --- app/assets/javascripts/app/views/help_view.js | 11 ++++++++++- .../templates/faq_keyboard_shortcuts_tpl.jst.hbs | 15 +++++++++++++++ app/assets/templates/help_tpl.jst.hbs | 4 ++++ config/locales/diaspora/de.yml | 8 ++++++++ config/locales/diaspora/de_formal.yml | 8 ++++++++ config/locales/diaspora/en.yml | 8 ++++++++ 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 app/assets/templates/faq_keyboard_shortcuts_tpl.jst.hbs diff --git a/app/assets/javascripts/app/views/help_view.js b/app/assets/javascripts/app/views/help_view.js index b46d2209ff..16757f4c32 100644 --- a/app/assets/javascripts/app/views/help_view.js +++ b/app/assets/javascripts/app/views/help_view.js @@ -5,7 +5,8 @@ app.views.Help = app.views.StaticContentView.extend({ "click .faq-link" : "sectionClicked", "click .faq-link-getting-help" : "gettingHelp", "click .faq-link-sharing" : "sharing", - "click .faq-link-posts-and-posting" : "postsAndPosting" + "click .faq-link-posts-and-posting" : "postsAndPosting", + "click .faq-link-keyboard-shortcuts" : "keyboardShortcuts", }, initialize : function(options) { @@ -40,6 +41,7 @@ app.views.Help = app.views.StaticContentView.extend({ title_resharing_posts: Diaspora.I18n.t( 'resharing_posts.title' ), title_sharing: Diaspora.I18n.t( 'sharing.title' ), title_tags: Diaspora.I18n.t( 'tags.title' ), + title_keyboard_shortcuts: Diaspora.I18n.t( 'keyboard_shortcuts.title' ), title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' ), } @@ -143,6 +145,13 @@ app.views.Help = app.views.StaticContentView.extend({ e.preventDefault(); }, + keyboardShortcuts: function(e) { + this.renderStaticSection("keyboard_shortcuts", "faq_keyboard_shortcuts", {}); + this.menuClicked(e); + + e.preventDefault(); + }, + linkHtml: function(url, text) { return "<a href=\"" + url + "\" target=\"_blank\">" + text + "</a>"; }, diff --git a/app/assets/templates/faq_keyboard_shortcuts_tpl.jst.hbs b/app/assets/templates/faq_keyboard_shortcuts_tpl.jst.hbs new file mode 100644 index 0000000000..1f3074bbd4 --- /dev/null +++ b/app/assets/templates/faq_keyboard_shortcuts_tpl.jst.hbs @@ -0,0 +1,15 @@ + + <div class='question opened collapsible'> + <a class='toggle' href='#'> + <h4>{{ keyboard_shortcuts_q }}</h4> + </a> + <div class='answer hideable'> + {{ keyboard_shortcuts_a1 }} + <ul> + <li>{{ keyboard_shortcuts_li1 }}</li> + <li>{{ keyboard_shortcuts_li2 }}</li> + <li>{{ keyboard_shortcuts_li3 }}</li> + <li>{{ keyboard_shortcuts_li4 }}</li> + </ul> + </div> + </div> diff --git a/app/assets/templates/help_tpl.jst.hbs b/app/assets/templates/help_tpl.jst.hbs index 5048b0d432..f54bdea160 100644 --- a/app/assets/templates/help_tpl.jst.hbs +++ b/app/assets/templates/help_tpl.jst.hbs @@ -63,6 +63,10 @@ <a href="#" class="section-unselected faq-link" data-section="tags" data-items="what_are_tags_for tags_in_comments followed_tags people_tag_page filter_tags">{{ title_tags }}</a> <span class="section-selected">{{ title_tags }}</span> </li> + <li> + <a href="#" class="section-unselected faq-link-keyboard-shortcuts" data-section="keyboard_shortcuts" data-items="">{{ title_keyboard_shortcuts }}</a> + <span class="section-selected">{{ title_keyboard_shortcuts }}</span> + </li> <li> <a href="#" class="section-unselected faq-link" data-section="miscellaneous" data-items="back_to_top photo_albums subscribe_feed diaspora_app">{{ title_miscellaneous }}</a> <span class="section-selected">{{ title_miscellaneous }}</span> diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 14979284a5..7d2d7a7a2f 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -522,6 +522,14 @@ de: title: "Tags" what_are_tags_for_a: "Tags sind eine Methode, um Beiträge zu kategorisieren, normalerweise nach dem Thema. Wenn du nach einem Tag suchst, werden dir alle Beiträge mit dem Tag angezeigt, die du sehen kannst (sowohl öffentliche als auch private). So können Leute, die an einem bestimmten Thema interessiert sind, Beiträge darüber finden." what_are_tags_for_q: "Wozu gibt es Tags?" + keyboard_shortcuts: + keyboard_shortcuts_q: "Welche Tastenkürzel gibt es?" + keyboard_shortcuts_a1: "In der Streamansicht kannst du folgende Tasten benutzen:" + keyboard_shortcuts_li1: "j - zum nächsten Beitrag springen" + keyboard_shortcuts_li2: "k - zum vorigen Beitrag springen" + keyboard_shortcuts_li3: "c - den aktuellen Beitrag kommentieren" + keyboard_shortcuts_li4: "l - den aktuellen Beitrag mit „Gefällt mir“ markieren" + title: "Tastenkürzel" third_party_tools: "Drittanwendungen" tutorial: "Anleitung" tutorials: "Anleitungen" diff --git a/config/locales/diaspora/de_formal.yml b/config/locales/diaspora/de_formal.yml index c39386950d..be1eb007ca 100644 --- a/config/locales/diaspora/de_formal.yml +++ b/config/locales/diaspora/de_formal.yml @@ -522,6 +522,14 @@ de_formal: title: "Tags" what_are_tags_for_a: "Tags sind eine Methode, um Beiträge zu kategorisieren, normalerweise nach dem Thema. Wenn Sie nach einem Tag suchen, werden Ihnen alle Beiträge mit dem Tag angezeigt, die Sie sehen können (sowohl öffentliche als auch private). So können Leute, die an einem bestimmten Thema interessiert sind, Beiträge darüber finden." what_are_tags_for_q: "Wozu gibt es Tags?" + keyboard_shortcuts: + keyboard_shortcuts_q: "Welche Tastenkürzel gibt es?" + keyboard_shortcuts_a1: "In der Streamansicht können Sie folgende Tasten benutzen:" + keyboard_shortcuts_li1: "j - zum nächsten Beitrag springen" + keyboard_shortcuts_li2: "k - zum vorigen Beitrag springen" + keyboard_shortcuts_li3: "c - den aktuellen Beitrag kommentieren" + keyboard_shortcuts_li4: "l - den aktuellen Beitrag mit „Gefällt mir“ markieren" + title: "Tastenkürzel" third_party_tools: "Drittanwendungen" tutorial: "Anleitung" tutorials: "Anleitungen" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 16307e4848..808cd095f9 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -565,6 +565,14 @@ en: people_tag_page_a: "They are people who have listed that tag to describe themselves in their public profile." filter_tags_q: "How can I filter/exclude some tags from my stream?" filter_tags_a: "This is not yet available directly through diaspora*, but some %{third_party_tools} have been written that might provide this." + keyboard_shortcuts: + keyboard_shortcuts_q: "What keyboard shortcuts are available?" + keyboard_shortcuts_a1: "In the stream view you can use the following keyboard shortcuts:" + keyboard_shortcuts_li1: "j - jump to the next post" + keyboard_shortcuts_li2: "k - jump to the previous post" + keyboard_shortcuts_li3: "c - comment the current post" + keyboard_shortcuts_li4: "l - like the current post" + title: "Keyboard shortcuts" miscellaneous: title: "Miscellaneous" back_to_top_q: "Is there a quick way to go back to the top of a page after I scroll down?" -- GitLab