mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 11:46:38 +08:00
Online Repo: URL to clipboard (#5034)
* import latest icon set * Add export URL to clipboard for online repos * omit parameter name * adjust indent * add url class * Update src/ui/zcl_abapgit_gui_chunk_lib.clas.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> Co-authored-by: Lars Hvam <larshp@hotmail.com> Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
This commit is contained in:
parent
0b71f14f93
commit
4b5b654b49
Binary file not shown.
|
@ -1,72 +1,75 @@
|
|||
@font-face {
|
||||
font-family: "ag-icons";
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url("../font/ag-icons.woff") format("woff");
|
||||
}
|
||||
|
||||
.icon {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.icon:before {
|
||||
font-family: ag-icons !important;
|
||||
font-style: normal;
|
||||
font-weight: normal !important;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
vertical-align: text-top;
|
||||
/* width: 1.1em; */
|
||||
/* padding-right: 0.2em */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.icon.large { font-size: 200%; }
|
||||
|
||||
.icon-abapgit:before { content: "\f101"; }
|
||||
.icon-abaplint:before { content: "\f102"; }
|
||||
.icon-arrow-circle-up:before { content: "\f103"; }
|
||||
.icon-bars:before { content: "\f104"; }
|
||||
.icon-bolt:before { content: "\f105"; }
|
||||
.icon-box:before { content: "\f106"; }
|
||||
.icon-briefcase:before { content: "\f107"; }
|
||||
.icon-bug-solid:before { content: "\f108"; }
|
||||
.icon-check:before { content: "\f109"; }
|
||||
.icon-chevron-down:before { content: "\f10a"; }
|
||||
.icon-chevron-left:before { content: "\f10b"; }
|
||||
.icon-chevron-right:before { content: "\f10c"; }
|
||||
.icon-chevron-up:before { content: "\f10d"; }
|
||||
.icon-circle-solid:before { content: "\f10e"; }
|
||||
.icon-cloud-commit:before { content: "\f10f"; }
|
||||
.icon-cloud-solid:before { content: "\f110"; }
|
||||
.icon-cloud-upload-alt:before { content: "\f111"; }
|
||||
.icon-code-branch:before { content: "\f112"; }
|
||||
.icon-code-commit:before { content: "\f113"; }
|
||||
.icon-cog:before { content: "\f114"; }
|
||||
.icon-edit-solid:before { content: "\f115"; }
|
||||
.icon-exclamation-circle:before { content: "\f116"; }
|
||||
.icon-exclamation-triangle:before { content: "\f117"; }
|
||||
.icon-file-alt:before { content: "\f118"; }
|
||||
.icon-file-code:before { content: "\f119"; }
|
||||
.icon-file-image:before { content: "\f11a"; }
|
||||
.icon-file:before { content: "\f11b"; }
|
||||
.icon-fire-alt:before { content: "\f11c"; }
|
||||
.icon-folder:before { content: "\f11d"; }
|
||||
.icon-git-alt:before { content: "\f11e"; }
|
||||
.icon-info-circle-solid:before { content: "\f11f"; }
|
||||
.icon-lock:before { content: "\f120"; }
|
||||
.icon-plug:before { content: "\f121"; }
|
||||
.icon-question-circle-solid:before { content: "\f122"; }
|
||||
.icon-server-solid:before { content: "\f123"; }
|
||||
.icon-sliders-h:before { content: "\f124"; }
|
||||
.icon-snowflake:before { content: "\f125"; }
|
||||
.icon-star:before { content: "\f126"; }
|
||||
.icon-times-solid:before { content: "\f127"; }
|
||||
.icon-tools-solid:before { content: "\f128"; }
|
||||
.icon-truck-solid:before { content: "\f129"; }
|
||||
.icon-user-solid:before { content: "\f12a"; }
|
||||
@font-face {
|
||||
font-family: "ag-icons";
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url("../font/ag-icons.woff") format("woff");
|
||||
}
|
||||
|
||||
.icon {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.icon:before {
|
||||
font-family: ag-icons !important;
|
||||
font-style: normal;
|
||||
font-weight: normal !important;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
vertical-align: text-top;
|
||||
/* width: 1.1em; */
|
||||
/* padding-right: 0.2em */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.icon.large { font-size: 200%; }
|
||||
|
||||
.icon-abapgit:before { content: "\f101"; }
|
||||
.icon-abaplint:before { content: "\f102"; }
|
||||
.icon-arrow-circle-up:before { content: "\f103"; }
|
||||
.icon-bars:before { content: "\f104"; }
|
||||
.icon-bolt:before { content: "\f105"; }
|
||||
.icon-box:before { content: "\f106"; }
|
||||
.icon-briefcase:before { content: "\f107"; }
|
||||
.icon-bug-solid:before { content: "\f108"; }
|
||||
.icon-check:before { content: "\f109"; }
|
||||
.icon-chevron-down:before { content: "\f10a"; }
|
||||
.icon-chevron-left:before { content: "\f10b"; }
|
||||
.icon-chevron-right:before { content: "\f10c"; }
|
||||
.icon-chevron-up:before { content: "\f10d"; }
|
||||
.icon-circle-solid:before { content: "\f10e"; }
|
||||
.icon-cloud-commit:before { content: "\f10f"; }
|
||||
.icon-cloud-solid:before { content: "\f110"; }
|
||||
.icon-cloud-upload-alt:before { content: "\f111"; }
|
||||
.icon-code-branch:before { content: "\f112"; }
|
||||
.icon-code-commit:before { content: "\f113"; }
|
||||
.icon-cog:before { content: "\f114"; }
|
||||
.icon-copy-solid:before { content: "\f115"; }
|
||||
.icon-edit-solid:before { content: "\f116"; }
|
||||
.icon-exclamation-circle:before { content: "\f117"; }
|
||||
.icon-exclamation-triangle:before { content: "\f118"; }
|
||||
.icon-file-alt:before { content: "\f119"; }
|
||||
.icon-file-code:before { content: "\f11a"; }
|
||||
.icon-file-image:before { content: "\f11b"; }
|
||||
.icon-file:before { content: "\f11c"; }
|
||||
.icon-fire-alt:before { content: "\f11d"; }
|
||||
.icon-folder:before { content: "\f11e"; }
|
||||
.icon-git-alt:before { content: "\f11f"; }
|
||||
.icon-info-circle-solid:before { content: "\f120"; }
|
||||
.icon-lock:before { content: "\f121"; }
|
||||
.icon-paste-solid:before { content: "\f122"; }
|
||||
.icon-plug:before { content: "\f123"; }
|
||||
.icon-question-circle-solid:before { content: "\f124"; }
|
||||
.icon-redo-alt-solid:before { content: "\f125"; }
|
||||
.icon-server-solid:before { content: "\f126"; }
|
||||
.icon-sliders-h:before { content: "\f127"; }
|
||||
.icon-snowflake:before { content: "\f128"; }
|
||||
.icon-star:before { content: "\f129"; }
|
||||
.icon-times-solid:before { content: "\f12a"; }
|
||||
.icon-tools-solid:before { content: "\f12b"; }
|
||||
.icon-truck-solid:before { content: "\f12c"; }
|
||||
.icon-user-solid:before { content: "\f12d"; }
|
||||
|
|
|
@ -186,4 +186,26 @@ CLASS ZCL_ABAPGIT_FRONTEND_SERVICES IMPLEMENTATION.
|
|||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zif_abapgit_frontend_services~clipboard_export.
|
||||
DATA lv_rc TYPE i.
|
||||
|
||||
" Note: do not use a string table for 'it_data'!
|
||||
cl_gui_frontend_services=>clipboard_export(
|
||||
EXPORTING
|
||||
no_auth_check = iv_no_auth_check
|
||||
IMPORTING
|
||||
data = it_data
|
||||
CHANGING
|
||||
rc = lv_rc
|
||||
EXCEPTIONS
|
||||
cntl_error = 1
|
||||
error_no_gui = 2
|
||||
not_supported_by_gui = 3
|
||||
no_authority = 4
|
||||
OTHERS = 5 ).
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise_t100( ).
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
|
|
@ -835,6 +835,17 @@ CLASS ZCL_ABAPGIT_GUI_CHUNK_LIB IMPLEMENTATION.
|
|||
iv_class = |url| ).
|
||||
ENDIF.
|
||||
|
||||
IF io_repo->is_offline( ) = abap_false.
|
||||
lo_repo_online ?= io_repo.
|
||||
|
||||
ri_html->add_a( iv_txt = ri_html->icon( iv_name = 'copy-solid'
|
||||
iv_class = 'pad-sides'
|
||||
iv_hint = 'Copy URL to Clipboard' )
|
||||
iv_act = |{ zif_abapgit_definitions=>c_action-clipboard }| &&
|
||||
|?clipboard={ lo_repo_online->get_url( ) }|
|
||||
iv_class = |url| ).
|
||||
ENDIF.
|
||||
|
||||
IF io_repo->is_offline( ) = abap_false AND iv_show_commit = abap_true.
|
||||
TRY.
|
||||
render_repo_top_commit_hash( ii_html = ri_html
|
||||
|
|
|
@ -570,11 +570,21 @@ CLASS zcl_abapgit_gui_router IMPLEMENTATION.
|
|||
|
||||
|
||||
METHOD other_utilities.
|
||||
TYPES ty_char600 TYPE c LENGTH 600.
|
||||
DATA lv_clip_content TYPE string.
|
||||
DATA lt_clipboard TYPE STANDARD TABLE OF ty_char600.
|
||||
|
||||
IF ii_event->mv_action = zif_abapgit_definitions=>c_action-ie_devtools.
|
||||
zcl_abapgit_services_basis=>open_ie_devtools( ).
|
||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
|
||||
ENDIF.
|
||||
CASE ii_event->mv_action.
|
||||
WHEN zif_abapgit_definitions=>c_action-ie_devtools.
|
||||
zcl_abapgit_services_basis=>open_ie_devtools( ).
|
||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
|
||||
WHEN zif_abapgit_definitions=>c_action-clipboard.
|
||||
lv_clip_content = ii_event->query( )->get( 'CLIPBOARD' ).
|
||||
APPEND lv_clip_content TO lt_clipboard.
|
||||
zcl_abapgit_ui_factory=>get_frontend_services( )->clipboard_export( lt_clipboard ).
|
||||
MESSAGE 'Successfully exported URL to Clipboard.' TYPE 'S'.
|
||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
|
||||
ENDCASE.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
|
@ -30,4 +30,11 @@ INTERFACE zif_abapgit_frontend_services PUBLIC.
|
|||
VALUE(rv_path) TYPE string
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
|
||||
METHODS clipboard_export
|
||||
IMPORTING
|
||||
iv_no_auth_check TYPE abap_bool DEFAULT abap_false
|
||||
VALUE(it_data) TYPE STANDARD TABLE
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
ENDINTERFACE.
|
||||
|
|
|
@ -489,6 +489,7 @@ INTERFACE zif_abapgit_definitions
|
|||
direction TYPE string VALUE 'direction',
|
||||
documentation TYPE string VALUE 'documentation',
|
||||
changelog TYPE string VALUE 'changelog',
|
||||
clipboard TYPE string VALUE 'clipboard',
|
||||
END OF c_action.
|
||||
CONSTANTS c_spagpa_param_repo_key TYPE c LENGTH 20 VALUE 'REPO_KEY' ##NO_TEXT.
|
||||
CONSTANTS c_spagpa_param_package TYPE c LENGTH 20 VALUE 'PACKAGE' ##NO_TEXT.
|
||||
|
|
Loading…
Reference in New Issue
Block a user