Merge pull request #5100 from Faldrian/feature/add_help_keyboard_shortcuts

added keyboard shortcut help topic
This commit is contained in:
Jonne Haß 2014-08-03 20:11:27 +02:00
commit 0421d9336a
6 changed files with 43 additions and 1 deletions

View file

@ -23,6 +23,7 @@
* Reference Salmon endpoint in Webfinger XRD to aid discovery by alternative implementations [#5062](https://github.com/diaspora/diaspora/pull/5062) * Reference Salmon endpoint in Webfinger XRD to aid discovery by alternative implementations [#5062](https://github.com/diaspora/diaspora/pull/5062)
* Change minimal birth year for the birthday field to 1910 [#5083](https://github.com/diaspora/diaspora/pull/5083) * Change minimal birth year for the birthday field to 1910 [#5083](https://github.com/diaspora/diaspora/pull/5083)
* Add scrolling thumbnail switcher in the lightbox [#5102](https://github.com/diaspora/diaspora/pull/5102) * Add scrolling thumbnail switcher in the lightbox [#5102](https://github.com/diaspora/diaspora/pull/5102)
* Add help section about keyboard shortcuts [#5100](https://github.com/diaspora/diaspora/pull/5100)
# 0.4.0.1 # 0.4.0.1

View file

@ -5,7 +5,8 @@ app.views.Help = app.views.StaticContentView.extend({
"click .faq-link" : "sectionClicked", "click .faq-link" : "sectionClicked",
"click .faq-link-getting-help" : "gettingHelp", "click .faq-link-getting-help" : "gettingHelp",
"click .faq-link-sharing" : "sharing", "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) { initialize : function(options) {
@ -40,6 +41,7 @@ app.views.Help = app.views.StaticContentView.extend({
title_resharing_posts: Diaspora.I18n.t( 'resharing_posts.title' ), title_resharing_posts: Diaspora.I18n.t( 'resharing_posts.title' ),
title_sharing: Diaspora.I18n.t( 'sharing.title' ), title_sharing: Diaspora.I18n.t( 'sharing.title' ),
title_tags: Diaspora.I18n.t( 'tags.title' ), title_tags: Diaspora.I18n.t( 'tags.title' ),
title_keyboard_shortcuts: Diaspora.I18n.t( 'keyboard_shortcuts.title' ),
title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' ), title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' ),
} }
@ -143,6 +145,13 @@ app.views.Help = app.views.StaticContentView.extend({
e.preventDefault(); e.preventDefault();
}, },
keyboardShortcuts: function(e) {
this.renderStaticSection("keyboard_shortcuts", "faq_keyboard_shortcuts", {});
this.menuClicked(e);
e.preventDefault();
},
linkHtml: function(url, text) { linkHtml: function(url, text) {
return "<a href=\"" + url + "\" target=\"_blank\">" + text + "</a>"; return "<a href=\"" + url + "\" target=\"_blank\">" + text + "</a>";
}, },

View file

@ -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>

View file

@ -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> <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> <span class="section-selected">{{ title_tags }}</span>
</li> </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> <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> <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> <span class="section-selected">{{ title_miscellaneous }}</span>

View file

@ -565,6 +565,14 @@ en:
people_tag_page_a: "They are people who have listed that tag to describe themselves in their public profile." 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_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." 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 on the current post"
keyboard_shortcuts_li4: "l - like the current post"
title: "Keyboard shortcuts"
miscellaneous: miscellaneous:
title: "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?" back_to_top_q: "Is there a quick way to go back to the top of a page after I scroll down?"

View file

@ -77,6 +77,11 @@ describe("app.views.Help", function(){
expect(this.view.$el.find('#faq').children().first().hasClass('faq_question_tags')).toBeTruthy(); expect(this.view.$el.find('#faq').children().first().hasClass('faq_question_tags')).toBeTruthy();
}); });
it('should show keyboard shortcuts section', function(){
this.view.$el.find('a[data-section=keyboard_shortcuts]').trigger('click');
expect(this.view.$el.find('#faq').children().first().data('template') == 'faq_keyboard_shortcuts').toBeTruthy();
});
it('should show miscellaneous section', function(){ it('should show miscellaneous section', function(){
this.view.$el.find('a[data-section=miscellaneous]').trigger('click'); this.view.$el.find('a[data-section=miscellaneous]').trigger('click');
expect(this.view.$el.find('#faq').children().first().hasClass('faq_question_miscellaneous')).toBeTruthy(); expect(this.view.$el.find('#faq').children().first().hasClass('faq_question_miscellaneous')).toBeTruthy();