Hotkey improvements (#2143)

* hotkey improvements

* linter fixes
This commit is contained in:
sbcgua 2018-11-26 19:27:48 +02:00 committed by Lars Hvam
parent 819ac3940a
commit 299ff5d9d5
9 changed files with 241 additions and 152 deletions

View File

@ -40,16 +40,31 @@ CLASS zcl_abapgit_gui_chunk_lib DEFINITION PUBLIC FINAL CREATE PUBLIC.
RAISING zcx_abapgit_exception. RAISING zcx_abapgit_exception.
CLASS-METHODS render_hotkey_overview CLASS-METHODS render_hotkey_overview
IMPORTING
io_page TYPE REF TO zcl_abapgit_gui_page
RETURNING RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING RAISING
zcx_abapgit_exception. zcx_abapgit_exception.
CLASS-METHODS render_infopanel
IMPORTING
iv_div_id TYPE string
iv_title TYPE string
iv_hide TYPE abap_bool DEFAULT abap_true
iv_hint TYPE string OPTIONAL
io_content TYPE REF TO zcl_abapgit_html
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING
zcx_abapgit_exception.
ENDCLASS. ENDCLASS.
CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION. CLASS ZCL_ABAPGIT_GUI_CHUNK_LIB IMPLEMENTATION.
METHOD render_branch_span. METHOD render_branch_span.
@ -100,7 +115,7 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
METHOD render_hotkey_overview. METHOD render_hotkey_overview.
DATA: lv_display TYPE string, DATA: lv_hint TYPE string,
lt_hotkeys TYPE zif_abapgit_definitions=>tty_hotkey, lt_hotkeys TYPE zif_abapgit_definitions=>tty_hotkey,
lt_actions TYPE zif_abapgit_gui_page_hotkey=>tty_hotkey_action, lt_actions TYPE zif_abapgit_gui_page_hotkey=>tty_hotkey_action,
lo_settings TYPE REF TO zcl_abapgit_settings. lo_settings TYPE REF TO zcl_abapgit_settings.
@ -109,56 +124,82 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
<ls_action> LIKE LINE OF lt_actions. <ls_action> LIKE LINE OF lt_actions.
lo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ). lo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ).
lt_hotkeys = lo_settings->get_hotkeys( ).
lt_hotkeys = lo_settings->get_hotkeys( ). lt_actions = zcl_abapgit_hotkeys=>get_default_hotkeys_from_pages( io_page ).
lt_actions = zcl_abapgit_hotkeys=>get_default_hotkeys_from_pages( ).
CREATE OBJECT ro_html. CREATE OBJECT ro_html.
lv_display = 'display:none'. " Render hotkeys
ro_html->add( '<ul class="hotkeys">' ).
ro_html->add( |<div id="hotkeys" class="news" style="{ lv_display }">| ).
ro_html->add( '<div class="headbar title">Hotkeys'
&& '<div class="float-right">'
&& zcl_abapgit_html=>a(
iv_txt = '&#x274c;'
iv_typ = zif_abapgit_definitions=>c_action_type-onclick
iv_act = 'closeHotkeyOverview()'
iv_class = 'close-btn' )
&& '</div></div>' ).
READ TABLE lt_hotkeys ASSIGNING <ls_hotkey>
WITH KEY action = zcl_abapgit_gui_page=>c_global_page_action-showhotkeys.
IF sy-subrc = 0.
ro_html->add( |<div class="paddings">Close window with '{ <ls_hotkey>-sequence }' |
&& |or upper right corner X</div>| ).
ENDIF.
" Generate hotkeys
ro_html->add( |<div class="newslist">| ).
ro_html->add( '<table>' ).
LOOP AT lt_hotkeys ASSIGNING <ls_hotkey>. LOOP AT lt_hotkeys ASSIGNING <ls_hotkey>.
READ TABLE lt_actions ASSIGNING <ls_action> READ TABLE lt_actions ASSIGNING <ls_action>
WITH TABLE KEY action WITH TABLE KEY action
COMPONENTS action = <ls_hotkey>-action. COMPONENTS action = <ls_hotkey>-action.
IF sy-subrc = 0. IF sy-subrc = 0.
ro_html->add( '<tr>' ). ro_html->add( |<li>|
ro_html->add( |<td>{ <ls_hotkey>-sequence }</td><td>-</td><td>{ <ls_action>-name }</td>| ). && |<span class="key-id">{ <ls_hotkey>-sequence }</span>|
ro_html->add( '</tr>' ). && |<span class="key-descr">{ <ls_action>-name }</span>|
&& |</li>| ).
ENDIF. ENDIF.
ENDLOOP. ENDLOOP.
ro_html->add( '</ul>' ).
ro_html->add( '</table>' ). " Wrap
READ TABLE lt_hotkeys ASSIGNING <ls_hotkey>
WITH KEY action = zcl_abapgit_gui_page=>c_global_page_action-showhotkeys.
IF sy-subrc = 0.
lv_hint = |Close window with '{ <ls_hotkey>-sequence }' or upper right corner 'X'|.
ENDIF.
ro_html = render_infopanel(
iv_div_id = 'hotkeys'
iv_title = 'Hotkeys'
iv_hint = lv_hint
iv_hide = abap_true
io_content = ro_html ).
IF zcl_abapgit_hotkeys=>should_show_hint( ) = abap_true.
ro_html->add( |<div id="hotkeys-hint" class="corner-hint">|
&& |Press '{ <ls_hotkey>-sequence }' to get keyboard shortcuts list|
&& |</div>| ).
ENDIF.
ENDMETHOD.
METHOD render_infopanel.
DATA lv_display TYPE string.
CREATE OBJECT ro_html.
IF iv_hide = abap_true. " Initially hide
lv_display = 'display:none'.
ENDIF.
ro_html->add( |<div id="{ iv_div_id }" class="info-panel" style="{ lv_display }">| ).
ro_html->add( |<div class="info-title">{ iv_title }|
&& '<div class="float-right">'
&& zcl_abapgit_html=>a(
iv_txt = '&#x274c;'
iv_typ = zif_abapgit_definitions=>c_action_type-onclick
iv_act = |toggleDisplay('{ iv_div_id }')|
iv_class = 'close-btn' )
&& '</div></div>' ).
IF iv_hint IS NOT INITIAL.
ro_html->add( '<div class="info-hint">'
&& zcl_abapgit_html=>icon( iv_name = 'alert' iv_class = 'pad-right' )
&& iv_hint
&& '</div>' ).
ENDIF.
ro_html->add( |<div class="info-list">| ).
ro_html->add( io_content ).
ro_html->add( '</div>' ). ro_html->add( '</div>' ).
ro_html->add( '</div>' ). ro_html->add( '</div>' ).
ENDMETHOD. ENDMETHOD.
@ -219,7 +260,7 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
METHOD render_news. METHOD render_news.
DATA: lv_text TYPE string, DATA: lv_text TYPE string,
lv_display TYPE string, lv_hint TYPE string,
lt_log TYPE zcl_abapgit_news=>tt_log. lt_log TYPE zcl_abapgit_news=>tt_log.
FIELD-SYMBOLS: <ls_line> LIKE LINE OF lt_log. FIELD-SYMBOLS: <ls_line> LIKE LINE OF lt_log.
@ -232,30 +273,7 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
lt_log = io_news->get_log( ). lt_log = io_news->get_log( ).
IF io_news->has_unseen( ) = abap_false. " Render news
lv_display = 'display:none'.
ENDIF.
ro_html->add( |<div id="news" class="news" style="{ lv_display }">| ).
ro_html->add( '<div class="headbar title">Announcement of the latest changes'
&& '<div class="float-right">'
&& zcl_abapgit_html=>a(
iv_txt = '&#x274c;'
iv_typ = zif_abapgit_definitions=>c_action_type-onclick
iv_act = 'displayNews()'
iv_class = 'close-btn' )
&& '</div></div>' ).
IF io_news->has_important( ) = abap_true.
ro_html->add( '<div class="headbar important">'
&& zcl_abapgit_html=>icon( iv_name = 'alert' iv_class = 'pad-right' )
&& 'Please note changes marked with "!"'
&& '</div>' ).
ENDIF.
" Generate news
ro_html->add( |<div class="newslist">| ).
LOOP AT lt_log ASSIGNING <ls_line>. LOOP AT lt_log ASSIGNING <ls_line>.
IF <ls_line>-is_header = abap_true. IF <ls_line>-is_header = abap_true.
IF <ls_line>-pos_to_cur > 0. IF <ls_line>-pos_to_cur > 0.
@ -270,9 +288,18 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
ro_html->add( |<li>{ <ls_line>-text }</li>| ). ro_html->add( |<li>{ <ls_line>-text }</li>| ).
ENDIF. ENDIF.
ENDLOOP. ENDLOOP.
ro_html->add( '</div>' ).
ro_html->add( '</div>' ). " Wrap
IF io_news->has_important( ) = abap_true.
lv_hint = 'Please note changes marked with "!"'.
ENDIF.
ro_html = render_infopanel(
iv_div_id = 'news'
iv_title = 'Announcement of the latest changes'
iv_hint = lv_hint
iv_hide = boolc( io_news->has_unseen( ) = abap_false )
io_content = ro_html ).
ENDMETHOD. ENDMETHOD.
@ -320,7 +347,7 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
ELSE. ELSE.
lv_icon = 'arrow-up/grey80'. lv_icon = 'arrow-up/grey80'.
ENDIF. ENDIF.
ro_html->add_a( iv_act = 'displayNews()' ro_html->add_a( iv_act = |toggleDisplay('news')|
iv_typ = zif_abapgit_definitions=>c_action_type-onclick iv_typ = zif_abapgit_definitions=>c_action_type-onclick
iv_txt = zcl_abapgit_html=>icon( iv_name = lv_icon iv_txt = zcl_abapgit_html=>icon( iv_name = lv_icon
iv_class = 'pad-sides' iv_class = 'pad-sides'

View File

@ -153,7 +153,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE IMPLEMENTATION.
DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions. DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions.
ls_hotkey_action-name = |Global: Show hotkeys|. ls_hotkey_action-name = |Show hotkeys help|.
ls_hotkey_action-action = c_global_page_action-showhotkeys. ls_hotkey_action-action = c_global_page_action-showhotkeys.
ls_hotkey_action-default_hotkey = |?|. ls_hotkey_action-default_hotkey = |?|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions. INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
@ -221,8 +221,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE IMPLEMENTATION.
METHOD render_hotkey_overview. METHOD render_hotkey_overview.
CREATE OBJECT ro_html. ro_html = zcl_abapgit_gui_chunk_lib=>render_hotkey_overview( me ).
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_hotkey_overview( ) ).
ENDMETHOD. ENDMETHOD.

View File

@ -173,12 +173,12 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_CODE_INSP IMPLEMENTATION.
DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions. DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions.
ls_hotkey_action-name = |Code Inspector: Stage|. ls_hotkey_action-name = |Stage|.
ls_hotkey_action-action = c_actions-stage. ls_hotkey_action-action = c_actions-stage.
ls_hotkey_action-default_hotkey = |s|. ls_hotkey_action-default_hotkey = |s|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions. INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Code Inspector: Re-Run|. ls_hotkey_action-name = |Re-Run|.
ls_hotkey_action-action = c_actions-rerun. ls_hotkey_action-action = c_actions-rerun.
ls_hotkey_action-default_hotkey = |r|. ls_hotkey_action-default_hotkey = |r|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions. INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.

View File

@ -1041,7 +1041,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions. DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions.
ls_hotkey_action-name = |Diff: Stage|. ls_hotkey_action-name = |Stage changes|.
ls_hotkey_action-action = |stagePatch|. ls_hotkey_action-action = |stagePatch|.
ls_hotkey_action-default_hotkey = |s|. ls_hotkey_action-default_hotkey = |s|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions. INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.

View File

@ -44,7 +44,7 @@ ENDCLASS.
CLASS zcl_abapgit_gui_page_main IMPLEMENTATION. CLASS ZCL_ABAPGIT_GUI_PAGE_MAIN IMPLEMENTATION.
METHOD build_main_menu. METHOD build_main_menu.
@ -307,6 +307,58 @@ CLASS zcl_abapgit_gui_page_main IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions.
DATA: ls_hotkey_action TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_action.
ls_hotkey_action-name = |abapGit settings|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_settings.
ls_hotkey_action-default_hotkey = |x|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Stage changes|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_stage.
ls_hotkey_action-default_hotkey = |s|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Switch branch|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-git_branch_switch.
ls_hotkey_action-default_hotkey = |b|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Installed repo list|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_repo_overview.
ls_hotkey_action-default_hotkey = |o|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Refresh repository|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_refresh.
ls_hotkey_action-default_hotkey = |r|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Pull|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-git_pull.
ls_hotkey_action-default_hotkey = |p|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Add online repository|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_newonline.
ls_hotkey_action-default_hotkey = |n|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Uninstall repository|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_purge.
ls_hotkey_action-default_hotkey = |u|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Show diffs|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_diff.
ls_hotkey_action-default_hotkey = |d|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ENDMETHOD.
METHOD zif_abapgit_gui_page~on_event. METHOD zif_abapgit_gui_page~on_event.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key, DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
@ -362,57 +414,4 @@ CLASS zcl_abapgit_gui_page_main IMPLEMENTATION.
ENDCASE. ENDCASE.
ENDMETHOD. ENDMETHOD.
METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions.
DATA: ls_hotkey_action TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_action.
ls_hotkey_action-name = |Main: Settings|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_settings.
ls_hotkey_action-default_hotkey = |x|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: Stage|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_stage.
ls_hotkey_action-default_hotkey = |s|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: Switch branch|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-git_branch_switch.
ls_hotkey_action-default_hotkey = |b|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: Repo overview|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_repo_overview.
ls_hotkey_action-default_hotkey = |o|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: Refresh|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_refresh.
ls_hotkey_action-default_hotkey = |r|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: Pull|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-git_pull.
ls_hotkey_action-default_hotkey = |p|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: + Online|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_newonline.
ls_hotkey_action-default_hotkey = |n|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: Uninstall|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_purge.
ls_hotkey_action-default_hotkey = |u|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-name = |Main: Show diff|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_diff.
ls_hotkey_action-default_hotkey = |d|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ENDMETHOD.
ENDCLASS. ENDCLASS.

View File

@ -487,7 +487,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION.
DATA: ls_hotkey_action TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_action. DATA: ls_hotkey_action TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_action.
ls_hotkey_action-name = |Stage: Patch|. ls_hotkey_action-name = |Patch|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_patch. ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_patch.
ls_hotkey_action-default_hotkey = |p|. ls_hotkey_action-default_hotkey = |p|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions. INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.

View File

@ -6,6 +6,8 @@ CLASS zcl_abapgit_hotkeys DEFINITION
PUBLIC SECTION. PUBLIC SECTION.
CLASS-METHODS: CLASS-METHODS:
get_default_hotkeys_from_pages get_default_hotkeys_from_pages
IMPORTING
io_page TYPE REF TO zcl_abapgit_gui_page OPTIONAL
RETURNING RETURNING
VALUE(rt_hotkey_actions) TYPE zif_abapgit_gui_page_hotkey=>tty_hotkey_action VALUE(rt_hotkey_actions) TYPE zif_abapgit_gui_page_hotkey=>tty_hotkey_action
RAISING RAISING
@ -19,16 +21,25 @@ CLASS zcl_abapgit_hotkeys DEFINITION
RAISING RAISING
zcx_abapgit_exception. zcx_abapgit_exception.
CLASS-METHODS should_show_hint
RETURNING
VALUE(rv_yes) TYPE abap_bool.
PRIVATE SECTION.
CLASS-DATA gv_hint_was_shown TYPE abap_bool.
ENDCLASS. ENDCLASS.
CLASS zcl_abapgit_hotkeys IMPLEMENTATION. CLASS ZCL_ABAPGIT_HOTKEYS IMPLEMENTATION.
METHOD get_default_hotkeys_from_pages. METHOD get_default_hotkeys_from_pages.
DATA: lt_hotkey_actions TYPE zif_abapgit_gui_page_hotkey=>tty_hotkey_action, DATA: lt_hotkey_actions TYPE zif_abapgit_gui_page_hotkey=>tty_hotkey_action,
lo_interface TYPE REF TO cl_oo_interface, lo_interface TYPE REF TO cl_oo_interface,
lv_class_name TYPE abap_abstypename,
lt_classes TYPE seo_relkeys. lt_classes TYPE seo_relkeys.
FIELD-SYMBOLS: <ls_class> TYPE seorelkey. FIELD-SYMBOLS: <ls_class> TYPE seorelkey.
@ -42,8 +53,13 @@ CLASS zcl_abapgit_hotkeys IMPLEMENTATION.
ENDTRY. ENDTRY.
lt_classes = lo_interface->get_implementing_classes( ). lt_classes = lo_interface->get_implementing_classes( ).
IF io_page IS BOUND.
lv_class_name = cl_abap_classdescr=>get_class_name( io_page ).
SHIFT lv_class_name LEFT DELETING LEADING '\CLASS='.
ENDIF.
LOOP AT lt_classes ASSIGNING <ls_class>. LOOP AT lt_classes ASSIGNING <ls_class>.
CHECK lv_class_name IS INITIAL OR lv_class_name = <ls_class>-clsname.
CALL METHOD (<ls_class>-clsname)=>zif_abapgit_gui_page_hotkey~get_hotkey_actions CALL METHOD (<ls_class>-clsname)=>zif_abapgit_gui_page_hotkey~get_hotkey_actions
RECEIVING RECEIVING
@ -108,4 +124,11 @@ CLASS zcl_abapgit_hotkeys IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD should_show_hint.
IF gv_hint_was_shown = abap_false.
rv_yes = abap_true.
gv_hint_was_shown = abap_true.
ENDIF.
ENDMETHOD.
ENDCLASS. ENDCLASS.

View File

@ -791,7 +791,7 @@ div.tutorial h2 {
/* News Announcement */ /* News Announcement */
div.news { div.info-panel {
position: absolute; position: absolute;
z-index: 99; z-index: 99;
top: 36px; top: 36px;
@ -802,18 +802,24 @@ div.news {
box-shadow: 1px 1px 3px 2px #dcdcdc; box-shadow: 1px 1px 3px 2px #dcdcdc;
} }
div.news div.headbar { div.info-panel div.info-hint {
text-transform: uppercase; text-transform: uppercase;
font-size: small; font-size: small;
padding: 4px 6px; padding: 8px 6px 0px;
text-align: center;
color: #ccc;
} }
div.news div.title { div.info-panel div.info-title {
text-transform: uppercase;
font-size: small;
padding: 6px;
text-align: center;
color: #f8f8f8; color: #f8f8f8;
background-color: #888; background-color: #888;
} }
div.news div.title a.close-btn { div.info-panel div.info-title a.close-btn {
color: #d8d8d8; color: #d8d8d8;
padding-left: 12px; padding-left: 12px;
padding-right: 2px; padding-right: 2px;
@ -821,19 +827,18 @@ div.news div.title a.close-btn {
bottom: 1px; bottom: 1px;
} }
div.news div.important { color: #aaa; } div.info-panel div.info-list {
div.news div.newslist { padding: 0.8em 0.7em 1em;
padding: 0.5em 0.7em;
color: #444; color: #444;
} }
div.news li { div.info-panel li {
padding-left: 10px; padding-left: 10px;
list-style-type: none; list-style-type: none;
} }
div.news h1:first-child { margin: auto; } div.info-panel h1:first-child { margin: auto; }
div.news h1 { div.info-panel h1 {
font-size: inherit; font-size: inherit;
padding: 6px 4px; padding: 6px 4px;
margin: 4px auto auto; margin: 4px auto auto;
@ -841,7 +846,7 @@ div.news h1 {
font-weight: normal; font-weight: normal;
} }
div.news .version-marker { div.info-panel .version-marker {
color: white; color: white;
display: inline-block; display: inline-block;
margin-left: 20px; margin-left: 20px;
@ -851,12 +856,12 @@ div.news .version-marker {
background-color: #ccc; background-color: #ccc;
} }
div.news .update { div.info-panel .update {
border: #e8ba30 1px solid; border: #e8ba30 1px solid;
background-color: #f5c538; background-color: #f5c538;
} }
.newslist td { div.info-panel div.info-list td {
padding-right: 1em padding-right: 1em
} }
@ -899,4 +904,42 @@ div.news .update {
/* diff-patch */ /* diff-patch */
.patch-active { .patch-active {
color: lightgrey !important; color: lightgrey !important;
} }
/* HOTKEYS */
ul.hotkeys {
list-style-type: none;
padding: 0;
margin: 0;
font-size: smaller;
}
ul.hotkeys span.key-id {
background: #f0f0f0;
border: 1px solid #dcdcdc;
border-radius: 3px;
padding: 1px 7px;
width: 0.5em;
display: inline-block;
text-align: center;
margin-top: 0.2em;
}
ul.hotkeys span.key-descr {
margin-left: 1.2em;
}
div.corner-hint {
position: fixed;
bottom: 10px;
right: 10px;
color: #aaa;
border: 1px solid #ccc;
border-radius: 3px;
padding: 4px;
font-size: smaller;
opacity: 0.5;
background: white;
z-index: 99;
}

View File

@ -576,15 +576,9 @@ DiffHelper.prototype.highlightButton = function(state) {
**********************************************************/ **********************************************************/
// News announcement // News announcement
function displayNews() { function toggleDisplay(divId) {
var div = document.getElementById("news"); var div = document.getElementById(divId);
div.style.display = (div.style.display) ? '' : 'none'; if (div) div.style.display = (div.style.display) ? '' : 'none';
}
// Hotkey Overview
function closeHotkeyOverview() {
var div = document.getElementById("hotkeys");
div.style.display = (div.style.display) ? '' : 'none';
} }
function KeyNavigation() { function KeyNavigation() {
@ -945,7 +939,11 @@ function setKeyBindings(oKeyMap){
var oHotkeys = new Hotkeys(oKeyMap); var oHotkeys = new Hotkeys(oKeyMap);
document.addEventListener('keypress', oHotkeys.onkeydown.bind(oHotkeys)); document.addEventListener('keypress', oHotkeys.onkeydown.bind(oHotkeys));
setTimeout(function(){
var div = document.getElementById("hotkeys-hint");
if (div) div.style.opacity = 0.2;
}, 4900);
setTimeout(function(){ toggleDisplay("hotkeys-hint") }, 5000);
} }
/* /*