diff --git a/src/ui/zabapgit_js_common.w3mi.data.js b/src/ui/zabapgit_js_common.w3mi.data.js index b3ee8b85a..5c7b410db 100644 --- a/src/ui/zabapgit_js_common.w3mi.data.js +++ b/src/ui/zabapgit_js_common.w3mi.data.js @@ -1355,6 +1355,7 @@ function LinkHints(linkHintHotKey){ this.pendingPath = ""; // already typed code prefix this.hintsMap = this.deployHintContainers(); this.activatedDropdown = null; + this.yankModeActive = false; } LinkHints.prototype.getHintStartValue = function(targetsCount){ @@ -1441,10 +1442,15 @@ LinkHints.prototype.handleKey = function(event){ return; } + if (event.key === "y") { + this.yankModeActive = !this.yankModeActive; + } + if (event.key === this.linkHintHotKey && Hotkeys.isHotkeyCallPossible()) { // on user hide hints, close an opened dropdown too if (this.areHintsDisplayed && this.activatedDropdown) this.closeActivatedDropdown(); + if (this.areHintsDisplayed) this.yankModeActive = false; this.pendingPath = ""; this.displayHints(!this.areHintsDisplayed); @@ -1455,10 +1461,15 @@ LinkHints.prototype.handleKey = function(event){ this.pendingPath += event.key; var hint = this.hintsMap[this.pendingPath]; - if (hint) { // we are there, we have a fully specified tooltip. Let's activate it + if (hint) { // we are there, we have a fully specified tooltip. Let's activate or yank it this.displayHints(false); event.preventDefault(); - this.hintActivate(hint); + if (this.yankModeActive) { + submitSapeventForm({ clipboard : hint.parent.firstChild.textContent },"yank_to_clipboard"); + this.yankModeActive = false; + } else { + this.hintActivate(hint); + } } else { // we are not there yet, but let's filter the link so that only // the partially matched are shown diff --git a/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.abap b/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.abap index e6a07c34f..9e49158b2 100644 --- a/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.abap +++ b/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.abap @@ -163,6 +163,10 @@ CLASS zcl_abapgit_gui_hotkey_ctl IMPLEMENTATION. && |{ ls_user_settings-link_hint_key }| && |Link Hints| && || ). + ri_html->add( |
  • | + && |y{ ls_user_settings-link_hint_key }| + && |Copy Link Text| + && |
  • | ). ENDIF. ri_html->add( '' ). diff --git a/src/ui/zcl_abapgit_gui_router.clas.abap b/src/ui/zcl_abapgit_gui_router.clas.abap index 612ef562b..318cfbdcb 100644 --- a/src/ui/zcl_abapgit_gui_router.clas.abap +++ b/src/ui/zcl_abapgit_gui_router.clas.abap @@ -569,6 +569,12 @@ CLASS zcl_abapgit_gui_router IMPLEMENTATION. 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. + WHEN zif_abapgit_definitions=>c_action-yank_to_clipboard. + lv_clip_content = ii_event->form_data( )->get( 'CLIPBOARD' ). + APPEND lv_clip_content TO lt_clipboard. + zcl_abapgit_ui_factory=>get_frontend_services( )->clipboard_export( lt_clipboard ). + MESSAGE 'Successfully exported to Clipboard.' TYPE 'S'. + rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act. ENDCASE. ENDMETHOD. diff --git a/src/zif_abapgit_definitions.intf.abap b/src/zif_abapgit_definitions.intf.abap index 9ba88c9b5..94d6e678b 100644 --- a/src/zif_abapgit_definitions.intf.abap +++ b/src/zif_abapgit_definitions.intf.abap @@ -511,6 +511,7 @@ INTERFACE zif_abapgit_definitions homepage TYPE string VALUE 'homepage', sponsor TYPE string VALUE 'sponsor', clipboard TYPE string VALUE 'clipboard', + yank_to_clipboard TYPE string VALUE 'yank_to_clipboard', show_hotkeys TYPE string VALUE 'show_hotkeys', END OF c_action. CONSTANTS c_spagpa_param_repo_key TYPE c LENGTH 20 VALUE 'REPO_KEY' ##NO_TEXT.