mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Add GUI and HTML control info to page footer (#6261)
Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
ea1964ef47
commit
170b03cf5d
|
@ -68,7 +68,9 @@ CLASS zcl_abapgit_gui_page DEFINITION PUBLIC ABSTRACT
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_time TYPE string
|
!iv_time TYPE string
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(ri_html) TYPE REF TO zif_abapgit_html .
|
VALUE(ri_html) TYPE REF TO zif_abapgit_html
|
||||||
|
RAISING
|
||||||
|
zcx_abapgit_exception .
|
||||||
METHODS render_link_hints
|
METHODS render_link_hints
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!ii_html TYPE REF TO zif_abapgit_html
|
!ii_html TYPE REF TO zif_abapgit_html
|
||||||
|
@ -99,6 +101,9 @@ CLASS zcl_abapgit_gui_page DEFINITION PUBLIC ABSTRACT
|
||||||
VALUE(ri_html) TYPE REF TO zif_abapgit_html
|
VALUE(ri_html) TYPE REF TO zif_abapgit_html
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception .
|
zcx_abapgit_exception .
|
||||||
|
METHODS get_version_details
|
||||||
|
RETURNING
|
||||||
|
VALUE(rv_version) TYPE string.
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,15 +122,8 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD footer.
|
METHOD footer.
|
||||||
|
|
||||||
DATA lv_version_detail TYPE string.
|
|
||||||
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
||||||
|
|
||||||
IF zcl_abapgit_factory=>get_environment( )->is_merged( ) = abap_true.
|
|
||||||
lv_version_detail = ` - Standalone Version`.
|
|
||||||
ELSE.
|
|
||||||
lv_version_detail = ` - Developer Version`.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ri_html->add( '<div id="footer">' ).
|
ri_html->add( '<div id="footer">' ).
|
||||||
ri_html->add( '<table class="w100"><tr>' ).
|
ri_html->add( '<table class="w100"><tr>' ).
|
||||||
|
|
||||||
|
@ -145,7 +143,7 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
||||||
iv_txt = ri_html->icon( iv_name = 'abapgit'
|
iv_txt = ri_html->icon( iv_name = 'abapgit'
|
||||||
iv_hint = iv_time ) ).
|
iv_hint = iv_time ) ).
|
||||||
ri_html->add( '</div>' ).
|
ri_html->add( '</div>' ).
|
||||||
ri_html->add( |<div class="version">{ zif_abapgit_version=>c_abap_version }{ lv_version_detail }</div>| ).
|
ri_html->add( |<div id="footer-version" class="version">{ get_version_details( ) }</div>| ).
|
||||||
ri_html->add( '</td>' ).
|
ri_html->add( '</td>' ).
|
||||||
|
|
||||||
ri_html->add( '<td id="debug-output" class="w40"></td>' ).
|
ri_html->add( '<td id="debug-output" class="w40"></td>' ).
|
||||||
|
@ -156,6 +154,37 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD get_version_details.
|
||||||
|
|
||||||
|
DATA lo_frontend_serv TYPE REF TO zif_abapgit_frontend_services.
|
||||||
|
|
||||||
|
rv_version = zif_abapgit_version=>c_abap_version.
|
||||||
|
|
||||||
|
IF zcl_abapgit_factory=>get_environment( )->is_merged( ) = abap_true.
|
||||||
|
rv_version = rv_version && ` - Standalone Version`.
|
||||||
|
ELSE.
|
||||||
|
rv_version = rv_version && ` - Developer Version`.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
lo_frontend_serv = zcl_abapgit_ui_factory=>get_frontend_services( ).
|
||||||
|
|
||||||
|
CASE abap_true.
|
||||||
|
WHEN lo_frontend_serv->is_webgui( ).
|
||||||
|
rv_version = rv_version && ` - Web`.
|
||||||
|
WHEN lo_frontend_serv->is_sapgui_for_windows( ).
|
||||||
|
rv_version = rv_version && ` - Win`.
|
||||||
|
WHEN lo_frontend_serv->is_sapgui_for_java( ).
|
||||||
|
rv_version = rv_version && ` - Java`.
|
||||||
|
WHEN OTHERS.
|
||||||
|
ASSERT 1 = 2.
|
||||||
|
ENDCASE.
|
||||||
|
|
||||||
|
" Will be filled by JS method displayBrowserControlFooter
|
||||||
|
rv_version = rv_version && '<span id="browser-control-footer"></span>'.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD header_script_links.
|
METHOD header_script_links.
|
||||||
|
|
||||||
ii_html->add( '<script src="js/common.js"></script>' ).
|
ii_html->add( '<script src="js/common.js"></script>' ).
|
||||||
|
@ -215,6 +244,27 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD render_browser_control_warning.
|
||||||
|
|
||||||
|
DATA li_documentation_link TYPE REF TO zif_abapgit_html.
|
||||||
|
|
||||||
|
CREATE OBJECT li_documentation_link TYPE zcl_abapgit_html.
|
||||||
|
|
||||||
|
li_documentation_link->add_a(
|
||||||
|
iv_txt = 'Documentation'
|
||||||
|
iv_typ = zif_abapgit_html=>c_action_type-url
|
||||||
|
iv_act = 'https://docs.abapgit.org/guide-sapgui.html#sap-gui-for-windows' ).
|
||||||
|
|
||||||
|
ii_html->add( '<div id="browser-control-warning" class="browser-control-warning">' ).
|
||||||
|
ii_html->add( zcl_abapgit_gui_chunk_lib=>render_warning_banner(
|
||||||
|
|Attention: You use Edge browser control. |
|
||||||
|
&& |There are several known malfunctions. See |
|
||||||
|
&& li_documentation_link->render( ) ) ).
|
||||||
|
ii_html->add( '</div>' ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD render_command_palettes.
|
METHOD render_command_palettes.
|
||||||
|
|
||||||
ii_html->add( 'var gCommandPalette = new CommandPalette(enumerateUiActions, {' ).
|
ii_html->add( 'var gCommandPalette = new CommandPalette(enumerateUiActions, {' ).
|
||||||
|
@ -294,27 +344,6 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD render_browser_control_warning.
|
|
||||||
|
|
||||||
DATA li_documentation_link TYPE REF TO zif_abapgit_html.
|
|
||||||
|
|
||||||
CREATE OBJECT li_documentation_link TYPE zcl_abapgit_html.
|
|
||||||
|
|
||||||
li_documentation_link->add_a(
|
|
||||||
iv_txt = 'Documentation'
|
|
||||||
iv_typ = zif_abapgit_html=>c_action_type-url
|
|
||||||
iv_act = 'https://docs.abapgit.org/guide-sapgui.html#sap-gui-for-windows' ).
|
|
||||||
|
|
||||||
ii_html->add( '<div id="browser-control-warning" class="browser-control-warning">' ).
|
|
||||||
ii_html->add( zcl_abapgit_gui_chunk_lib=>render_warning_banner(
|
|
||||||
|Attention: You use Edge browser control. |
|
|
||||||
&& |There are several known malfunctions. See |
|
|
||||||
&& li_documentation_link->render( ) ) ).
|
|
||||||
ii_html->add( '</div>' ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD scripts.
|
METHOD scripts.
|
||||||
|
|
||||||
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
||||||
|
@ -326,6 +355,7 @@ CLASS zcl_abapgit_gui_page IMPLEMENTATION.
|
||||||
render_link_hints( ri_html ).
|
render_link_hints( ri_html ).
|
||||||
render_command_palettes( ri_html ).
|
render_command_palettes( ri_html ).
|
||||||
ri_html->add( |toggleBrowserControlWarning();| ).
|
ri_html->add( |toggleBrowserControlWarning();| ).
|
||||||
|
ri_html->add( |displayBrowserControlFooter();| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
/* exported onDiffCollapse */
|
/* exported onDiffCollapse */
|
||||||
/* exported restoreScrollPosition */
|
/* exported restoreScrollPosition */
|
||||||
/* exported toggleBrowserControlWarning */
|
/* exported toggleBrowserControlWarning */
|
||||||
|
/* exported displayBrowserControlFooter */
|
||||||
|
|
||||||
/**********************************************************
|
/**********************************************************
|
||||||
* Polyfills
|
* Polyfills
|
||||||
|
@ -2485,8 +2486,20 @@ function toggleSticky() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************
|
||||||
|
* Browser Control
|
||||||
|
**********************************************************/
|
||||||
|
|
||||||
|
// Toggle display of warning message when using Edge (based on Chromium) browser control
|
||||||
|
// Todo: Remove once https://github.com/abapGit/abapGit/issues/4841 is fixed
|
||||||
function toggleBrowserControlWarning(){
|
function toggleBrowserControlWarning(){
|
||||||
if (!navigator.userAgent.includes("Edg")){
|
if (!navigator.userAgent.includes("Edg")){
|
||||||
document.getElementById("browser-control-warning").style.display = "none";
|
document.getElementById("browser-control-warning").style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Output type of HTML control in the abapGit footer
|
||||||
|
function displayBrowserControlFooter() {
|
||||||
|
var out = document.getElementById("browser-control-footer");
|
||||||
|
out.innerHTML = " - " + ( navigator.userAgent.includes("Edg") ? "Edge" : "IE" );
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user