mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-02 13:03:01 +08:00
XML highlighter for db_pages
Extension of XML-syntax highliting to yet another page in abapGit.
This commit is contained in:
parent
3e5a97483a
commit
f7ba61641f
|
@ -593,6 +593,7 @@ div.db_entry {
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.db_entry pre {
|
div.db_entry pre {
|
||||||
display: block;
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -603,6 +604,11 @@ div.db_entry pre {
|
||||||
margin: 0.5em 0em;
|
margin: 0.5em 0em;
|
||||||
width: 50em;
|
width: 50em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.db_entry span.xml_tag { color: #457ce3; }
|
||||||
|
div.db_entry span.attr { color: #b777fb; }
|
||||||
|
div.db_entry span.attr_val { color: #7a02f9; }
|
||||||
|
|
||||||
div.db_entry table.toolbar {
|
div.db_entry table.toolbar {
|
||||||
width: 50em;
|
width: 50em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<RELID>MI</RELID>
|
<RELID>MI</RELID>
|
||||||
<OBJID>ZABAPGIT_CSS_COMMON</OBJID>
|
<OBJID>ZABAPGIT_CSS_COMMON</OBJID>
|
||||||
<NAME>filename</NAME>
|
<NAME>filename</NAME>
|
||||||
<VALUE>~wwwtmp.css</VALUE>
|
<VALUE>ZABAPGIT_CSS_COMMON.css</VALUE>
|
||||||
</WWWPARAMS>
|
</WWWPARAMS>
|
||||||
<WWWPARAMS>
|
<WWWPARAMS>
|
||||||
<RELID>MI</RELID>
|
<RELID>MI</RELID>
|
||||||
|
|
|
@ -26,9 +26,11 @@ CLASS lcl_gui_page_db_display IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD render_content.
|
METHOD render_content.
|
||||||
|
|
||||||
DATA: lv_data TYPE lcl_persistence_db=>ty_content-data_str,
|
DATA:
|
||||||
ls_action TYPE lcl_persistence_db=>ty_content,
|
lo_highlighter TYPE REF TO lcl_syntax_highlighter,
|
||||||
lv_action TYPE string.
|
lv_data TYPE lcl_persistence_db=>ty_content-data_str,
|
||||||
|
ls_action TYPE lcl_persistence_db=>ty_content,
|
||||||
|
lv_action TYPE string.
|
||||||
|
|
||||||
TRY.
|
TRY.
|
||||||
lv_data = lcl_app=>db( )->read(
|
lv_data = lcl_app=>db( )->read(
|
||||||
|
@ -37,13 +39,14 @@ CLASS lcl_gui_page_db_display IMPLEMENTATION.
|
||||||
CATCH lcx_not_found ##NO_HANDLER.
|
CATCH lcx_not_found ##NO_HANDLER.
|
||||||
ENDTRY.
|
ENDTRY.
|
||||||
|
|
||||||
|
" Create syntax highlighter
|
||||||
|
lo_highlighter = lcl_syntax_highlighter=>create( '*.xml' ).
|
||||||
|
|
||||||
ls_action-type = ms_key-type.
|
ls_action-type = ms_key-type.
|
||||||
ls_action-value = ms_key-value.
|
ls_action-value = ms_key-value.
|
||||||
lv_action = lcl_html_action_utils=>dbkey_encode( ls_action ).
|
lv_action = lcl_html_action_utils=>dbkey_encode( ls_action ).
|
||||||
|
|
||||||
lv_data = lcl_xml_pretty=>print( lv_data ).
|
lv_data = lcl_xml_pretty=>print( lv_data ).
|
||||||
lv_data = escape( val = lv_data
|
lv_data = lo_highlighter->process_line( lv_data ).
|
||||||
format = cl_abap_format=>e_html_attr ).
|
|
||||||
|
|
||||||
CREATE OBJECT ro_html.
|
CREATE OBJECT ro_html.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user