@ -1,4 +1,5 @@
import json
from . . import __Orchestrator__
# Escape JS to the safe JS for the inline JS in HTML tags ATTENTION! Use it only if want to paste JS into HTML tag - not in <script>
# USAGE: JSEscapeForHTMLInline(inJSStr="lTest=\"Hello World\"; alert(\"lTest\")")
def JSEscapeForHTMLInline ( inJSStr ) :
@ -39,6 +40,27 @@ def HTMLLinkJSOnClick(inJSOnClickStr, inTitleStr, inColorStr=None):
lResult = f " <a { lCSSStyleStr } onclick= \" { inJSOnClickStr } \" > { inTitleStr } </a> "
return lResult
# Create HTMLLink by the def, argdict, arglist, gsettingsStr, logger Str titleStr, color, (add in processor queue)
def HTMLLinkDefProcessor ( inGSettings , inDef , inArgDict = None , inArgList = None , inArgGSettingsStr = " " , inArgLoggerStr = " " , inLinkTitleStr = None , inLinkColorStr = " " ) :
lDefAliasStr = inDef
if callable ( inDef ) : lDefAliasStr = str ( inDef )
if inLinkTitleStr is None : inLinkTitleStr = lDefAliasStr
lDefAliasStr = __Orchestrator__ . ProcessorAliasDefUpdate ( inGSettings = inGSettings , inDef = inDef , inAliasStr = lDefAliasStr )
lActivityList = [ __Orchestrator__ . ProcessorActivityItemCreate ( inDef = lDefAliasStr , inArgList = inArgList , inArgDict = inArgDict , inArgGSettingsStr = inArgGSettingsStr , inArgLoggerStr = inArgLoggerStr ) ]
lJSStr = JSProcessorActivityListAdd ( lActivityList )
lHTMLStr = HTMLLinkJSOnClick ( inJSOnClickStr = lJSStr , inTitleStr = inLinkTitleStr , inColorStr = inLinkColorStr )
return lHTMLStr
# Create HTMLLink by the def, argdict, arglist, gsettingsStr, logger Str titleStr, color, (execute permanently)
def HTMLLinkDefExecute ( inGSettings , inDef , inArgDict = None , inArgList = None , inArgGSettingsStr = " " , inArgLoggerStr = " " , inLinkTitleStr = None , inLinkColorStr = " " ) :
lDefAliasStr = inDef
if callable ( inDef ) : lDefAliasStr = str ( inDef )
if inLinkTitleStr is None : inLinkTitleStr = lDefAliasStr
lDefAliasStr = __Orchestrator__ . ProcessorAliasDefUpdate ( inGSettings = inGSettings , inDef = inDef , inAliasStr = lDefAliasStr )
lActivityList = [ __Orchestrator__ . ProcessorActivityItemCreate ( inDef = lDefAliasStr , inArgList = inArgList , inArgDict = inArgDict , inArgGSettingsStr = inArgGSettingsStr , inArgLoggerStr = inArgLoggerStr ) ]
lJSStr = JSActivityListExecute ( lActivityList )
lHTMLStr = HTMLLinkJSOnClick ( inJSOnClickStr = lJSStr , inTitleStr = inLinkTitleStr , inColorStr = inLinkColorStr )
return lHTMLStr
# HTML Generator for the CP up to v.1.2.0
def HTMLControlPanelBC ( inCPDict ) :