mirror of https://github.com/zulip/zulip.git
hotspots: Add hotspot for gear menu.
This commit is contained in:
parent
ae3881b472
commit
36472413e4
|
@ -7,6 +7,7 @@ var TOP = 'top';
|
|||
var LEFT = 'left';
|
||||
var RIGHT = 'right';
|
||||
var BOTTOM = 'bottom';
|
||||
var LEFT_BOTTOM = 'left_bottom';
|
||||
var VIEWPORT_CENTER = 'viewport_center';
|
||||
|
||||
// popover orientation can optionally be fixed here (property: popover),
|
||||
|
@ -28,6 +29,12 @@ var HOTSPOT_LOCATIONS = {
|
|||
offset_x: 0.8,
|
||||
offset_y: 0.39,
|
||||
},
|
||||
intro_gear: {
|
||||
element: '#settings-dropdown',
|
||||
offset_x: -0.4,
|
||||
offset_y: 1.2,
|
||||
popover: LEFT_BOTTOM,
|
||||
},
|
||||
intro_compose: {
|
||||
element: '#left_bar_compose_stream_button_big',
|
||||
offset_x: 0,
|
||||
|
@ -126,6 +133,14 @@ function place_popover(hotspot) {
|
|||
arrow_placement = 'left';
|
||||
break;
|
||||
|
||||
case LEFT_BOTTOM:
|
||||
popover_offset = {
|
||||
top: 0,
|
||||
left: -(popover_width + arrow_offset / 2),
|
||||
};
|
||||
arrow_placement = '';
|
||||
break;
|
||||
|
||||
case VIEWPORT_CENTER:
|
||||
popover_offset = {
|
||||
top: el_height / 2,
|
||||
|
|
|
@ -240,7 +240,8 @@
|
|||
|
||||
/* individual icon z-indexing */
|
||||
#hotspot_intro_streams_icon,
|
||||
#hotspot_intro_topics_icon {
|
||||
#hotspot_intro_topics_icon,
|
||||
#hotspot_intro_gear_icon {
|
||||
z-index: 103;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ IGNORED_PHRASES = [
|
|||
r"organization administrator",
|
||||
r"user",
|
||||
r"an unknown operating system",
|
||||
r"Go to Settings",
|
||||
|
||||
# SPECIAL CASES
|
||||
# Enter is usually capitalized
|
||||
|
|
|
@ -21,6 +21,11 @@ ALL_HOTSPOTS = {
|
|||
'easy to follow, and make it easy to reply to conversations that start '
|
||||
'while you are offline.'),
|
||||
},
|
||||
'intro_gear': {
|
||||
'title': _('Settings'),
|
||||
'description': _('Go to Settings to configure your '
|
||||
'notifications and display settings.'),
|
||||
},
|
||||
'intro_compose': {
|
||||
'title': _('Compose'),
|
||||
'description': _('Click here to start a new conversation. Pick a topic '
|
||||
|
@ -44,7 +49,7 @@ def get_next_hotspots(user: UserProfile) -> List[Dict[str, object]]:
|
|||
return []
|
||||
|
||||
seen_hotspots = frozenset(UserHotspot.objects.filter(user=user).values_list('hotspot', flat=True))
|
||||
for hotspot in ['intro_reply', 'intro_streams', 'intro_topics', 'intro_compose']:
|
||||
for hotspot in ['intro_reply', 'intro_streams', 'intro_topics', 'intro_gear', 'intro_compose']:
|
||||
if hotspot not in seen_hotspots:
|
||||
return [{
|
||||
'name': hotspot,
|
||||
|
|
Loading…
Reference in New Issue