mirror of https://gitlab.com/bashrc2/epicyon
Boolean theme values on designer screen
parent
22c0ccc88a
commit
6d8a80a0c6
|
@ -2173,7 +2173,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
for fieldStr in fieldsList:
|
for fieldStr in fieldsList:
|
||||||
if '=' not in fieldStr:
|
if '=' not in fieldStr:
|
||||||
continue
|
continue
|
||||||
fields[fieldStr.split('=')[0]] = fieldStr.split('=')[1].strip()
|
fieldValue = fieldStr.split('=')[1].strip()
|
||||||
|
if fieldValue == 'on':
|
||||||
|
fieldValue = 'True'
|
||||||
|
if not fieldValue:
|
||||||
|
fieldValue = 'False'
|
||||||
|
fields[fieldStr.split('=')[0]] = fieldValue
|
||||||
|
|
||||||
# get the parameters from the theme designer screen
|
# get the parameters from the theme designer screen
|
||||||
themeDesignerParams = {}
|
themeDesignerParams = {}
|
||||||
|
|
|
@ -232,6 +232,8 @@ def htmlThemeDesigner(cssCache: {}, baseDir: str,
|
||||||
|
|
||||||
fontStr = ' <div class="container">\n' + tableStr
|
fontStr = ' <div class="container">\n' + tableStr
|
||||||
colorStr = ' <div class="container">\n' + tableStr
|
colorStr = ' <div class="container">\n' + tableStr
|
||||||
|
dimensionStr = ' <div class="container">\n' + tableStr
|
||||||
|
switchStr = ' <div class="container">\n' + tableStr
|
||||||
for variableName, value in themeJson.items():
|
for variableName, value in themeJson.items():
|
||||||
if 'font-size' in variableName:
|
if 'font-size' in variableName:
|
||||||
variableNameStr = variableName.replace('-', ' ')
|
variableNameStr = variableName.replace('-', ' ')
|
||||||
|
@ -242,7 +244,7 @@ def htmlThemeDesigner(cssCache: {}, baseDir: str,
|
||||||
fontStr += \
|
fontStr += \
|
||||||
'<td><input type="text" name="themeSetting_' + \
|
'<td><input type="text" name="themeSetting_' + \
|
||||||
variableName + '" value="' + str(value) + \
|
variableName + '" value="' + str(value) + \
|
||||||
'" title="' + variableNameStr + '"></p></td></tr>\n'
|
'" title="' + variableNameStr + '"></td></tr>\n'
|
||||||
elif ('-color' in variableName or
|
elif ('-color' in variableName or
|
||||||
'-background' in variableName or
|
'-background' in variableName or
|
||||||
variableName.endswith('-text')):
|
variableName.endswith('-text')):
|
||||||
|
@ -268,11 +270,37 @@ def htmlThemeDesigner(cssCache: {}, baseDir: str,
|
||||||
colorStr += \
|
colorStr += \
|
||||||
'<td><input type="color" name="themeSetting_' + \
|
'<td><input type="color" name="themeSetting_' + \
|
||||||
variableName + '" value="' + str(value) + \
|
variableName + '" value="' + str(value) + \
|
||||||
'" title="' + variableNameStr + '"></p></td></tr>\n'
|
'" title="' + variableNameStr + '"></td></tr>\n'
|
||||||
|
elif ('-width' in variableName or
|
||||||
|
'-height' in variableName):
|
||||||
|
variableNameStr = variableName.replace('-', ' ')
|
||||||
|
variableNameStr = variableNameStr.title()
|
||||||
|
dimensionStr += \
|
||||||
|
' <tr><td><label class="labels">' + \
|
||||||
|
variableNameStr + '</label></td>'
|
||||||
|
dimensionStr += \
|
||||||
|
'<td><input type="text" name="themeSetting_' + \
|
||||||
|
variableName + '" value="' + str(value) + \
|
||||||
|
'" title="' + variableNameStr + '"></td></tr>\n'
|
||||||
|
elif value == 'True' or value == 'False':
|
||||||
|
variableNameStr = variableName.replace('-', ' ')
|
||||||
|
variableNameStr = variableNameStr.title()
|
||||||
|
switchStr += \
|
||||||
|
' <tr><td><label class="labels">' + \
|
||||||
|
variableNameStr + '</label></td>'
|
||||||
|
checkedStr = ''
|
||||||
|
if value == 'True':
|
||||||
|
checkedStr = ' checked'
|
||||||
|
switchStr += \
|
||||||
|
'<td><input type="checkbox" class="profilecheckbox" ' + \
|
||||||
|
'name="themeSetting_' + variableName + '"' + \
|
||||||
|
checkedStr + '></td></tr>\n'
|
||||||
|
|
||||||
colorStr += ' </table>\n </div>\n'
|
colorStr += ' </table>\n </div>\n'
|
||||||
fontStr += ' </table>\n </div>\n'
|
fontStr += ' </table>\n </div>\n'
|
||||||
themeForm += colorStr + fontStr
|
dimensionStr += ' </table>\n </div>\n'
|
||||||
|
switchStr += ' </table>\n </div>\n'
|
||||||
|
themeForm += colorStr + fontStr + dimensionStr + switchStr
|
||||||
themeForm += ' </form>\n'
|
themeForm += ' </form>\n'
|
||||||
themeForm += '</div>\n'
|
themeForm += '</div>\n'
|
||||||
themeForm += htmlFooter()
|
themeForm += htmlFooter()
|
||||||
|
|
Loading…
Reference in New Issue