本文整理汇总了Python中exe.webui.common.textInput函数的典型用法代码示例。如果您正苦于以下问题:Python textInput函数的具体用法?Python textInput怎么用?Python textInput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了textInput函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form elements for editing this block
"""
log.debug("renderEdit")
html = "<div class=\"iDevice\"><br/>\n"
html += common.textInput("title"+self.id, self.idevice.title)
html += u"<br/><br/>\n"
types = [(_(u"Geogebra"), "geogebra"),
(_(u"Other"), "other")]
html += u"<b>%s</b>" % _("Applet Type")
html += '<select onchange="submitChange(\'changeType%s\', \'type%s\')";' % (self.id, self.id)
html += 'name="type%s" id="type%s">\n' % (self.id, self.id)
for type, value in types:
html += "<option value=\""+value+"\" "
if self.idevice.type == value:
html += "selected "
html += ">" + type + "</option>\n"
html += "</select> \n"
html += common.elementInstruc(self.idevice.typeInstruc) + "<br/><br/>"
if self.idevice.message <> "":
html += '<p style="color:red"><b>' + self.idevice.message + '</b></p>'
html += common.textInput("path"+self.id, "", 50)
html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id
html += u'value="%s" />\n' % _(u"Add files")
html += u'<input type="submit" name="%s" value="%s"' % ("upload"+self.id,
_(u"Upload"))
html += common.elementInstruc(self.idevice.fileInstruc)
html += u'<br/>\n'
html += u'<b>%s</b>\n' % _(u'Applet Code:')
html += common.elementInstruc(self.idevice.codeInstruc)
html += u'<br/>\n'
html += common.textArea('code'+self.id,
self.idevice.appletCode,rows="12")
if self.idevice.userResources:
html += '<table>'
for resource in self.idevice.userResources:
html += '<tr><td>%s</td><td>' % resource.storageName
html += common.submitImage(self.id, resource.storageName,
"/images/stock-cancel.png",
_("Delete File"))
html += '</td></tr>\n'
html += '</table>'
html += u'<br/>\n'
html += self.renderEditButtons(undo=self.idevice.undo)
html += u'\n</div>\n'
return html
示例2: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
html = u'<div class="block">\n'
html += u"<strong>%s</strong> " % _('URL:')
html += common.elementInstruc(self.idevice.urlInstruc)
html += u"</div>\n"
html += u'<div class="block">\n'
html += common.textInput("url"+self.id, self.idevice.url)
heightArr = [['small', '200'],
['medium', '300'],
['large', '500'],
['super-size', '800']]
html += u"</div>\n"
html += u'<div class="block">\n'
this_package = None
if self.idevice is not None and self.idevice.parentNode is not None:
this_package = self.idevice.parentNode.package
html += common.formField('select', this_package, _('Frame Height:'),
"height"+self.id,
options = heightArr,
selection = self.idevice.height)
html += u"</div>\n"
html += self.renderEditButtons()
return html
示例3: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
html = "<div class=\"iDevice\">\n"
# JRJ
# Quitamos el prefijo "FPD -"
# (let's remove the "FPD -" prefix)
if self.idevice.title.find("FPD - ") == 0:
self.idevice.title = x_(u"Now it's your turn")
html += common.textInput("title"+self.id, self.idevice.title)
html += u"<br/><br/>\n"
for element in self.questionElements:
html += element.renderEdit()
value = _("Add another Question")
html += "<br/>"
html += common.submitButton("addQuestion"+self.id, value)
html += "<br/><br/>"
html += self.renderEditButtons(undo=self.idevice.undo)
html += "</div>\n"
return html
示例4: renderEdit
def renderEdit(self):
"""
Returns an XHTML string with the form element for editing this field
"""
html = "<b>%s</b><br/>" % _("Feedback")
html += "<b>%s </b>" % _("Button Caption")
html += common.textInput("btnCaption" + self.id, self.field.buttonCaption, 25)
html += "<br/><br/>"
html += common.textInput("name" + self.id, self.field.name, 25)
html += common.submitImage("deleteField", self.id, "/images/stock-cancel.png", _("Delete"), 1)
html += "<br/>\n"
this_package = None
html += common.formField("richTextArea", this_package, "", "instruc", self.id, "", self.field.instruc)
html += "<br/>"
return html
示例5: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form elements for editing this block
"""
log.debug("renderEdit")
html = u"<div class=\"iDevice\">\n"
html += common.textInput("title"+self.id, self.idevice.title) + '<br/><br/>'
html += self.mediaElement.renderEdit()
floatArr = [[_(u'Left'), 'left'],
[_(u'Right'), 'right'],
[_(u'None'), 'none']]
this_package = None
if self.idevice is not None and self.idevice.parentNode is not None:
this_package = self.idevice.parentNode.package
html += common.formField('select', this_package, _("Align:"),
"float" + self.id, '',
self.idevice.alignInstruc,
floatArr, self.idevice.float)
#html += u'<div class="block">' #<b>%s</b></div>' % _(u"Caption:")
#html += common.textInput("caption" + self.id, self.idevice.media.caption)
#html += common.elementInstruc(self.idevice.media.captionInstruc)
html += "<br/>" + self.textElement.renderEdit()
emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis),
(_(u"Some emphasis"), Idevice.SomeEmphasis)]
html += common.formField('select', this_package, _('Emphasis'),
'emphasis', self.id,
'', # TODO: Instructions
emphasisValues,
self.idevice.emphasis)
html += self.renderEditButtons()
html += u"</div>\n"
return html
示例6: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
html = "<div class=\"iDevice\"><br/>\n"
if self.idevice.message<>"":
html += common.editModeHeading(self.idevice.message)
title_val = self.idevice.title
if title_val == _("Multi-choice"):
title_val = ""
html += common.textInput("title"+self.id, title_val,
default_prompt=_("Type your title here")) + '<br/>'
for element in self.questionElements:
html += element.renderEdit()
html += "<br/>"
html += "<br/>"
value = _("Add another question")
html += common.submitButton("addQuestion"+unicode(self.id), value,
extra_classes="add_item_button")
html += "<br /><br />"
html += self.renderEditButtons(undo=self.idevice.undo)
html += "</div>\n"
return html
示例7: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
self.previewing = True
html = u'<div class="iDevice"><br/>\n'
# JRJ
# Quitamos el prefijo "FPD -"
# (let's remove the "FPD -" prefix)
if self.idevice.title.find("FPD - ") == 0:
self.idevice.title = x_(u"Translation")
html += common.textInput("title"+self.id, self.idevice.title)
html += self.storyElement.renderEdit()
for element in self.questionElements:
html += element.renderEdit()
html += u"</table>\n"
value = _(u"Add another activity")
html += common.submitButton(u"addQuestion"+unicode(self.id), value)
html += u"<br /><br />" + self.renderEditButtons(undo=self.idevice.undo)
html += u"</div>\n"
return html
示例8: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
html = "<div class=\"iDevice\"><br/>\n"
if self.idevice.message<>"":
html += common.editModeHeading(self.idevice.message)
# JR
# Quitamos el prefijo "FPD -"
if self.idevice.title.find("FPD - ") == 0:
self.idevice.title = x_(u"Autoevaluacion")
# html += common.textInput("title"+self.id, self.idevice.title) + '<br/>'
html += common.textInput("title"+self.id, self.idevice.title)
for element in self.questionElements:
html += element.renderEdit()
# html += "<br/>"
html += "<br/>"
value = _("Add another question")
html += common.submitButton("addQuestion"+unicode(self.id), value)
html += "<br /><br />"
html += self.renderEditButtons(undo=self.idevice.undo)
html += "</div>\n"
return html
示例9: renderEdit
def renderEdit(self):
html = u"<div>\n"
html += common.textInput("path"+self.id, "", 50, \
onclick="addFile('%s')" % self.id, readonly="readonly" )
html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id
html += u'value="%s" />\n' % _(u"Browse")
buttonName = _(u"Replace")
if self.field.fileResource is None:
buttonName = _(u"Upload")
html += u'<input type="submit" name="%s" value="%s" />' % ("upload"+self.id,
buttonName)
html += common.elementInstruc(self.field.fileInstruc)
html += self.fileDescriptionElement.renderEdit()
if self.field.fileResource is not None:
html += "<div class='block'><strong>"
html += _("File") + ": %s " % self.field.fileResource.storageName
if self.showDelFile:
html += common.submitImage("delfile" + self.id, self.field.fileResource.storageName,
"/images/stock-cancel.png",
_("Delete File"))
html += "</strong></div>"
else:
html += "<i>"+_("No File Uploaded Currently") + "</i>"
html += "<br/></div>"
html += field_engine_make_delete_button(self)
return html
示例10: renderEdit
def renderEdit(self, style):
"""
Renders a screen that allows the user to enter paragraph text and choose
which words are hidden.
"""
"""
html = [
u'<div class="iDevice">',
u'<div class="block">',
# common.textInput("title"+self.id, self.idevice.title),
common.textInput("title"+self.id, "Autoevaluación"),
u'</div>',
self.instructionElement.renderEdit(),
self.clozeElement.renderEdit(),
self.feedbackElement.renderEdit(),
self.renderEditButtons(),
u'</div>'
]
return u'\n '.join(html)"""
html = "<div class=\"iDevice\"><br/>\n"
html = "<div class=\"block\">"
# JR
# Quitamos el prefijo "FPD -"
if self.idevice.title.find("FPD - ") == 0:
self.idevice.title = x_(u"Autoevaluacion")
html += common.textInput("title"+self.id, self.idevice.title)
html += "</div>"
html += self.instructionElement.renderEdit()
html += self.clozeElement.renderEdit()
html += self.feedbackElement.renderEdit()
html += self.renderEditButtons()
html += "</div>"
return html
示例11: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
html = u'<div>'
html += '<span class="js-idevice-title-label">'
html += '<label for="title'+self.id+'">'+_('Title')+':</label> '
html += common.elementInstruc(_('The title and the icon are not required. If you leave them empty the iDevice will have no emphasis.'))
html += '</span>'
html += common.hiddenField("iconiDevice" + self.id, self.idevice.icon)
html += u'<a class="js-show-icon-panel-button" href="javascript:showMessageBox(\'iconpanel\');" title="%s"><img src="/images/stock-insert-image.png" alt="%s" width="16" height="16" /></a>' % (_('Select an icon'),_('Choose an Image'))
# Get icon source (if it exists)
icon = self.idevice.icon
icon_exists = False
if icon != '':
idevice_icon = Path(G.application.config.stylesDir / style / 'icon_' + self.idevice.icon + '.gif')
if idevice_icon.exists():
icon_exists = True
else:
idevice_icon = Path(G.application.config.stylesDir/style/"icon_" + self.idevice.icon + ".png")
if idevice_icon.exists():
icon_exists = True
# Icon HTML element
html += u'<img class="js-idevide-icon-preview" name="iconiDevice%s" id="iconiDevice"' % (self.id)
if icon_exists:
html += u' src="/style/%s/icon_%s%s"' % (style, icon, idevice_icon.ext)
else:
html += u' src="/images/empty.gif"'
html += u'/>'
# Delete button
html += u'<a href="javascript:deleteIcon(%s);" id="deleteIcon%s" class="deleteIcon" title="%s"' % (self.id, self.id, _('Delete'))
# If the icon doesn't exists
if not icon_exists:
html += u' style="display: none;"'
html += u'>'
html += u'<img class="js-delete-icon" alt="%s" src="%s"/>' % (_('Delete'), '/images/stock-delete.png')
html += u'</a>'
html += common.textInput("title" + self.id, self.idevice.title)
html += u'<div class="js-icon-panel-container">'
html += u'<div id="iconpaneltitle">%s</div>' % _("Icons")
html += u'<div id="iconpanelcontent">'
html += self.__renderIcons(style)
html += u'</div>'
html += u"</div>"
for element in self.elements:
html += element.renderEdit()
html += self.renderEditButtons()
html += u"</div>"
return html
示例12: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
html = "<div class=\"iDevice\"><br/>\n"
html += common.textInput("title"+self.id, self.idevice.title)
html += self.commentElement.renderEdit()
html += "<br/>" + self.renderEditButtons()
html += "</div>\n"
return html
示例13: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form elements for editing this block
"""
log.debug("renderEdit")
html = u"<div class=\"iDevice\"><br/>\n"
print self.idevice.message
if self.idevice.message != "":
html += common.editModeHeading(self.idevice.message)
html += common.elementInstruc(self.idevice.kpseInstruc_)
html += common.textInput("kpse" + self.id, self.idevice.latexpath)
html += u'<input type="button" onclick="addKpsepath(\'%s\')"' % self.id
html += u"value=\"%s\"/>\n" % _(u"Search")
html += u"<br/><br/>\n"
html += common.textInput("title" + self.id, self.idevice.title) + "<br/><br/>"
this_package = None
if self.idevice is not None and self.idevice.parentNode is not None:
this_package = self.idevice.parentNode.package
html += common.textInput("path" + self.id, self.idevice.source)
html += u'<input type="button" onclick="addTeX(\'%s\')"' % self.id
html += u"value=\"%s\"/>\n" % _(u"Add file")
html += common.submitButton(u"loadSource"+self.id, _(u"Load"))
html += u"<br/>\n"
html += self.articleElement.renderEdit()
emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis),
(_(u"Some emphasis"), Idevice.SomeEmphasis)]
html += common.formField('select', this_package, _('Emphasis'),
'emphasis', self.id,
'', # TODO: Instructions
emphasisValues,
self.idevice.emphasis)
html += self.renderEditButtons(undo=self.idevice.undo)
html += u"</div>\n"
return html