mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-30 02:03:25 +08:00
parent
69e922af36
commit
3365b72865
|
@ -27,6 +27,9 @@ CLASS z2ui5_cl_ui5 DEFINITION
|
|||
v TYPE clike
|
||||
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_ui5.
|
||||
|
||||
METHODS _ns
|
||||
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_ui5.
|
||||
|
||||
METHODS _ns_ndc
|
||||
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_ui5_ndc.
|
||||
|
||||
|
@ -42,6 +45,9 @@ CLASS z2ui5_cl_ui5 DEFINITION
|
|||
METHODS _ns_zcc
|
||||
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_ui5_ui.
|
||||
|
||||
METHODS _ns_html
|
||||
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_ui5_html.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING node TYPE REF TO z2ui5_cl_fw_utility_xml OPTIONAL.
|
||||
|
||||
|
@ -223,6 +229,14 @@ CLASS z2ui5_cl_ui5 IMPLEMENTATION.
|
|||
result = NEW #( _node->mo_parent ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD _ns.
|
||||
result = NEW #( _node ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD _ns_html.
|
||||
result = NEW #( _node ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD _ns_ndc.
|
||||
result = NEW #( _node ).
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -11,6 +11,12 @@ CLASS z2ui5_cl_ui5_html DEFINITION
|
|||
METHODS style
|
||||
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_ui5_html.
|
||||
|
||||
METHODS zz_plain
|
||||
importing
|
||||
val type string
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_ui5_html.
|
||||
|
||||
PROTECTED SECTION.
|
||||
|
||||
PRIVATE SECTION.
|
||||
|
@ -18,6 +24,15 @@ ENDCLASS.
|
|||
|
||||
|
||||
CLASS z2ui5_cl_ui5_html IMPLEMENTATION.
|
||||
|
||||
METHOD zz_plain.
|
||||
result = me.
|
||||
_add( n = `script`
|
||||
ns = `http://www.w3.org/1999/xhtml`
|
||||
t_p = VALUE #( ( n = `src` v = val ) ) )
|
||||
.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD script.
|
||||
result = me.
|
||||
_add( n = `script`
|
||||
|
|
|
@ -115,6 +115,10 @@
|
|||
|
||||
DATA mo_view TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS load_cc
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
!view TYPE REF TO z2ui5_cl_xml_view.
|
||||
|
@ -143,14 +147,28 @@
|
|||
CLASS-METHODS get_js_local
|
||||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS get_js_cc_test2
|
||||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS get_js_cc_test
|
||||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
CLASS-METHODS get_js_cc
|
||||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS z2ui5_cl_cc_driver_js IMPLEMENTATION.
|
||||
CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD constructor.
|
||||
|
@ -190,6 +208,100 @@
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js_cc_test2.
|
||||
|
||||
result = `debugger; jQuery.sap.declare("z2ui5.DriverJS");` && |\n| &&
|
||||
`sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control"` && |\n| &&
|
||||
`], (Control) => {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.DriverJS", {` && |\n| &&
|
||||
` metadata : {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` title: {` && |\n| &&
|
||||
` type: "string",` && |\n| &&
|
||||
` defaultValue: ""` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` init () {` && |\n| &&
|
||||
|\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` drive() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if( config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(config);` && |\n| &&
|
||||
` driverObj.drive();` && |\n| &&
|
||||
` } };` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` highlight() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if ( highlight_driver_config !== undefined ) { if (highlight_config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(highlight_driver_config);` && |\n| &&
|
||||
` driverObj.highlight(highlight_config);` && |\n| &&
|
||||
` } }};` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` onAfterRendering() {` && |\n| &&
|
||||
|\n| &&
|
||||
` },` && |\n| &&
|
||||
` renderer(oRm, oControl) {` && |\n| &&
|
||||
` oButton = new Button({` && |\n| &&
|
||||
` text: "highlight",` && |\n| &&
|
||||
` press: function (oEvent) {` && |\n| &&
|
||||
` oControl.highlight({` && |\n| &&
|
||||
` someData : "some data I want to pass along with the event object"` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }); ` &&
|
||||
` oRm.renderControl(oButton); ` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`});`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_js_cc_test.
|
||||
|
||||
result = `debugger; jQuery.sap.declare("z2ui5.DriverJS"); sap.ui.require([ ],` && |\n| &&
|
||||
` function() {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` var DriverJS = {};` && |\n| &&
|
||||
|\n| &&
|
||||
` DriverJS.highlight = function() {` && |\n| &&
|
||||
|\n| &&
|
||||
` if( driver !== undefined ) { if ( highlight_driver_config !== undefined ) { if (highlight_config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(highlight_driver_config);` && |\n| &&
|
||||
` driverObj.highlight(highlight_config);` && |\n| &&
|
||||
` } }};` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|\n| &&
|
||||
` return DriverJS;` && |\n| &&
|
||||
` }, /* bExport= */ true);`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_js_cc.
|
||||
|
||||
result = `sap.z2ui5.DriverJS = { };` &&
|
||||
` debugger; sap.z2ui5.DriverJS.drive = function() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if( config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(config);` && |\n| &&
|
||||
` driverObj.drive();` && |\n| &&
|
||||
` } };` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` sap.z2ui5.DriverJS.highlight = function() {` && |\n| &&
|
||||
` if( driver !== undefined ) { if ( highlight_driver_config !== undefined ) { if (highlight_config !== undefined ) {` && |\n| &&
|
||||
` driverObj = driver(highlight_driver_config);` && |\n| &&
|
||||
` driverObj.highlight(highlight_config);` && |\n| &&
|
||||
` } }};` && |\n| &&
|
||||
` };`.
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_js_local.
|
||||
result = `` && |\n| &&
|
||||
`this.driver=this.driver||{};this.driver.js=function(D){"use strict";let F={};function z(e={}){F={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,` &&
|
||||
|
@ -325,6 +437,13 @@
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD load_cc.
|
||||
|
||||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( get_js_cc( ) )->get_parent( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD load_lib.
|
||||
|
||||
DATA(js) = ``.
|
||||
|
@ -346,7 +465,7 @@
|
|||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( get_js_local( ) )->get_parent( ).
|
||||
ENDIF.
|
||||
ELSE.
|
||||
js = js && `<html:script src="` && js_url && `" ></html:script>` && |\n|.
|
||||
* js = js && `<html:script src="` && js_url && `" ></html:script>` && |\n|.
|
||||
result = mo_view->_generic( ns = `html` name = `script` t_prop = VALUE #( ( n = `src` v = js_url ) ) )->get_parent( ).
|
||||
ENDIF.
|
||||
|
||||
|
@ -505,4 +624,4 @@
|
|||
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( drive_js ).
|
||||
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
ENDCLASS.
|
||||
|
|
Loading…
Reference in New Issue
Block a user