本文整理汇总了Python中exe.webui.common.submitImage函数的典型用法代码示例。如果您正苦于以下问题:Python submitImage函数的具体用法?Python submitImage怎么用?Python submitImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了submitImage函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: renderEdit
def renderEdit(self):
"""
Returns an XHTML string for editing this option element
"""
html = self.question_question.renderEdit()
#removed unnecessary elements kthamm 111028
#html += _("True") + " "
#html += common.option(self.keyId, self.question.isCorrect, "true")
#html += _("False") + " "
#html += common.option(self.keyId, not self.question.isCorrect, "false")
#html += "<br/><br/>\n"
#html += common.elementInstruc(self.idevice.keyInstruc)
#html += self.question_hint.renderEdit()
#end removed
html += self.question_feedback.renderEdit()
html += common.submitImage(self.id, self.idevice.id,
"/images/stock-cancel.png",
_("Delete question"))
html += "<br/><br/>\n"
return html
示例2: 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
示例3: renderEdit
def renderEdit(self):
"""
Returns an XHTML string with the form element for editing this element
"""
html = u"<div class=\"iDevice\">\n"
html += common.submitImage(self.id, self.idevice.id,
"/images/stock-cancel.png",
_("Delete question"))
html += self.questionElement.renderEdit()
html += u"<table width =\"100%%\">"
html += u"<thead>"
html += u"<tr>"
html += u"<th>%s " % _("Options")
html += common.elementInstruc(self.question.optionInstruc)
html += u"</th>"
html += u"</tr>"
html += u"</thead>"
html += u"<tbody>"
for element in self.options:
html += element.renderEdit()
html += u"</tbody>"
html += u"</table>\n"
value = _(u"Add another Option")
html += common.submitButton("addOption"+unicode(self.id), value)
html += u"<br />"
html += u"</div>\n"
return html
示例4: renderViewButtons
def renderViewButtons(self):
"""
Returns an XHTML string for the view buttons
"""
html = common.submitImage(u"edit", self.id,
u"/images/stock-edit.png",
_(u"Edit"), self.package.isChanged)
return html
示例5: 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
示例6: renderEdit
def renderEdit(self):
"""
Returns an XHTML string with the form element for editing this field
"""
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)
return html
示例7: renderViewButtons
def renderViewButtons(self):
"""
Returns an XHTML string for the view buttons
"""
html = '<p class="exe-controls idevice-edition-buttons">'
html += common.submitImage(u"edit", self.id,
u"/images/stock-edit.png",
_(u"Edit"), self.package.isChanged, True)
html += common.confirmThenSubmitImage(
_(u"This will delete this iDevice. Do you really want to do this?"),
u"delete",
self.id, u"/images/stock-cancel.png",
_(u"Delete"), 1)
html += '</p>'
return html
示例8: renderEdit
def renderEdit(self):
"""
Returns an XHTML string for editing this option element
"""
html = u"<tr><td align=\"left\"><b>%s</b>" % _("Option")
html += common.elementInstruc(self.question.optionInstruc)
header = ""
if self.index == 0:
header = _("Correct Option")
html += u"</td><td align=\"right\"><b>%s</b>\n" % header
html += u"</td><td>\n"
if self.index == 0:
html += common.elementInstruc(self.question.correctAnswerInstruc)
html += "</td></tr><tr><td colspan=2>\n"
# rather than using answerElement.renderEdit(),
# access the appropriate content_w_resourcePaths attribute directly,
# since this is in a customised output format
# (in a table, with an extra delete-option X to the right)
this_package = None
if self.answerElement.field_idevice is not None \
and self.answerElement.field_idevice.parentNode is not None:
this_package = self.answerElement.field_idevice.parentNode.package
html += common.richTextArea(self.answerId,
self.answerElement.field.content_w_resourcePaths,
package=this_package)
html += "</td><td align=\"center\">\n"
html += common.option("c"+self.keyId,
self.option.isCorrect, self.id)
html += "<br><br><br><br>\n"
html += common.submitImage(self.id, self.idevice.id,
"/images/stock-cancel.png",
_(u"Delete option"))
html += "</td></tr>\n"
return html
示例9: renderEdit
def renderEdit(self, style):
"""
Returns an XHTML string with the form element for editing this block
"""
html = u"<div>\n"
html += common.ideviceShowEditMessage(self)
html += """<div class='edit_inline_hint'>The Hangman activity
creates a game where the learner has to guess the letters in a
word from a hint. Everytime a letter is guessed incorrectly they
lose a life, represented by an image (e.g. a series of pictures
with less and less apples on a tree)
</div>
"""
html += self.titleElement.renderEdit()
#show words to be guessed
html += _("<h2>Words to Guess</h2>")
for wordIndex in range(0, len(self.wordElements)):
html += "<div class='idevice_item_container' style='width: 500px;'>"
word = self.wordElements[wordIndex]
html += "<table width='99%'><tr><td valign='top'>"
html += "<strong>"
html += _("Word %s" % str(wordIndex+1))
html += "</strong>"
html += self.hintElements[wordIndex].renderEdit()
html += word.renderEdit()
html += "</td><td valign='top' style='text-align: right'>"
if wordIndex > 0:
html += common.submitImage(word.id, word.field.idevice.id,
"/images/stock-cancel.png",
_("Remove This Word")) + "<br/>"
html += "</td></tr></table>"
html += "</div>"
html += common.submitButton("addWord"+unicode(self.id),\
_("Add Word"), extra_classes="add_item_button")
#render edit of these images
for img_count in range(0, len(self.chanceImageElements)):
imgElement = self.chanceImageElements[img_count]
html += "<div class='idevice_item_container' style='width: 700px;'>"
html += "<table><tr><td valign='top'>"
html += "<strong>"
html += "Chance %s" % str(img_count+1)
html += "</strong>"
html += imgElement.renderEdit()
html += "</td><td valign='top' style='text-align: right'>"
html += common.submitImage(imgElement.id, imgElement.field.idevice.id,
"/images/stock-cancel.png",
_("Remove This Chance"))
html += "</td></tr></table>"
html += "</div>"
addChanceButtonLabel = _("Add Chance")
html += common.submitButton("addChance"+unicode(self.id), \
addChanceButtonLabel, extra_classes="add_item_button")
html += self.contentElement.renderEdit()
html += self.alphabetElement.renderEdit()
#messages to show the user for different events
html += self.wrongGuessTextElement.renderEdit()
html += self.lostLevelTextElement.renderEdit()
html += self.levelPassedTextElement.renderEdit()
html += self.gameWonTextElement.renderEdit()
html += self.resetButtonTextElement.renderEdit()
divId = "fieldtype_advanced" + self.id
html += "<input name='showbox" + divId + "' type='checkbox' onchange='$(\"#" + divId + "\").toggle()'/>"
html += _("Show Advanced Options") + "<br/>"
html += "<div id='" + divId + "' style='display: none' "
html += ">"
#styles for buttons
html += self.letterButtonStyleElement.renderEdit()
html += self.wrongLetterButtonStyleElement.renderEdit()
html += self.rightLetterButtonStyleElement.renderEdit()
#style of the text fields
html += self.hintFieldStyleElement.renderEdit()
html += self.wordAreaStyleElement.renderEdit()
html += self.resetButtonStyleElement.renderEdit()
html += "</div>"
html += "<br/>"
html += "<br/>"
html += self.renderEditButtons()
html += u"</div>\n"
return html
示例10: renderEditButtons
def renderEditButtons(self, undo=True):
"""
Returns an XHTML string for the edit buttons
"""
html = "<br></br>" #Added this so there is space between end of Idevice page and the icons at the botton when authoring
html += common.submitImage(u"done", self.id,
#u"/images/stock-apply.png",
u"/images/dialog-ok-apply-2.png",
_(u"Done"),1)
html +=" " #Added
if undo:
html += common.submitImage(u"cancel", self.id,
#u"/images/stock-undo.png",
u"/images/edit-undo-5.png",
_(u"Undo Edits"),1)
html +=" " #Added
else:
html += common.submitImage(u"no_cancel", self.id,
u"/images/stock-undoNOT.png",
_(u"Can NOT Undo Edits"),1)
html +=" " #Added
html += common.confirmThenSubmitImage(
_(u"This will delete this iDevice. Do you really want to do this?"),
u"delete",
#self.id, u"/images/stock-cancel.png",
self.id, u"/images/dialog-cancel-3.png",
_(u"Delete"), 1)
html +=" " #Added
if self.idevice.isFirst():
html += common.image(u"movePrev", u"/images/draw-arrow-up-off.png", alt=None, cssClass=u"submit")
html +=" "
else:
html += common.submitImage(u"movePrev", self.id,
u"/images/draw-arrow-up.png",
_(u"Move Up"),1)
html +=" "
if self.idevice.isLast():
html += common.image(u"moveNext", u"/images/draw-arrow-down-off.png", alt=None,
cssClass=u"submit")
html +=" "
else:
html += common.submitImage(u"moveNext", self.id,
u"/images/draw-arrow-down.png",
_(u"Move Down"),1)
html +=" "
html += "<br></br>" #There is no space, line between the finish icons in page and Move To option.
options = [(_(u"---Move To---"), "")]
options += self.__getNodeOptions(self.package.root, 0)
html += common.select(u"move", self.id, options)
if self.purpose.strip() or self.tip.strip():
html += u'<a title="%s" ' % _(u'Pedagogical Help')
html += u'onmousedown="Javascript:updateCoords(event);" '
html += u"onclick=\"Javascript:showMe('p"+self.id+"', 420, 240);\" "
html += u'href="Javascript:void(0)" style="cursor:help;"> '
html += u'<img alt="%s" class="info" src="/images/info.png" ' \
% _('Information')
html += u'style="align:middle;" /></a>\n'
html += u'<div id="p%s" style="display:none;">' % self.id
html += u'<div style="float:right;">'
html += u'<img alt="%s" src="/images/stock-stop.png" ' % _('Close')
html += u' title="%s" ' % _(u"Close")
html += u'onmousedown="Javascript:hideMe();"/></div>'
if self.purpose != "":
html += u'<div class="popupDivLabel">'
html += u' ' + _(u"Purpose") + u'</div>'
html += self.purpose
if self.tip != "":
html += u'<div class="block"><b>' + _(u"Tip:") + u'</b></div>'
html += self.tip
html += u'\n'
html += u'</div><br/><br/>\n'
return html
示例11: field_engine_make_delete_button
def field_engine_make_delete_button(element, imgAltText = "Delete Item", prefix = ""):
html = ""
html += common.submitImage(prefix + element.id, element.field.idevice.id,
"/images/stock-cancel.png",
_(imgAltText))
return html
示例12: renderEditButtons
def renderEditButtons(self, undo=True):
"""
Returns an XHTML string for the edit buttons
"""
html = common.submitImage(u"done", self.id,
u"/images/stock-apply.png",
_(u"Done"),1)
if undo:
html += common.confirmThenSubmitImage(
_(u"Exit without saving?"),
u"cancel",
self.id, u"/images/stock-undo.png",
_(u"Undo Edits"), 1)
else:
html += common.submitImage(u"no_cancel", self.id,
u"/images/stock-undoNOT.png",
_(u"Can NOT Undo Edits"),1)
html += common.confirmThenSubmitImage(
_(u"This will delete this iDevice. Do you really want to do this?"),
u"delete",
self.id, u"/images/stock-cancel.png",
_(u"Delete"), 1)
if self.idevice.isFirst():
html += common.image(u"movePrev", u"/images/stock-go-up-off.png", 16, 16, None, u"submit")
else:
html += common.submitImage(u"movePrev", self.id,
u"/images/stock-go-up.png",
_(u"Move Up"),1)
if self.idevice.isLast():
html += common.image(u"moveNext", u"/images/stock-go-down-off.png", 16, 16, None, u"submit")
else:
html += common.submitImage(u"moveNext", self.id,
u"/images/stock-go-down.png",
_(u"Move Down"),1)
options = [(_(u"---Move To---"), "")]
options += self.__getNodeOptions(self.package.root, 0)
html += common.select(u"move", self.id, options)
if self.purpose.strip() or self.tip.strip():
html += u'<a title="%s" ' % _(u'Pedagogical Help')
html += u"onclick=\"showMessageBox('"+self.id+"');\" "
html += u'href="javascript:void(0)" style="cursor:help;margin-left:.2em;">'
html += u'<img alt="%s" class="info" src="/images/info.png" ' \
% _('Information')
html += u'style="align:middle;" /></a>\n'
html += u'<div style="display:none;">'
if self.purpose != "":
html += u'<div id="'+self.id+'title">'+_(u"Purpose")+'</div>'
html += u'<div id="'+self.id+'content">'+self.purpose+'</div>'
if self.tip != "":
html += u'<div id="'+self.id+'title">'+_(u"Tip:")+'</div>'
html += u'<div id="'+self.id+'content">'+self.tip+'</div>'
html += u'</div>\n'
return html