本文整理汇总了Python中pyjamas.DOM.setInnerHTML方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.setInnerHTML方法的具体用法?Python DOM.setInnerHTML怎么用?Python DOM.setInnerHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.DOM
的用法示例。
在下文中一共展示了DOM.setInnerHTML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setCaption
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def setCaption(self, caption):
self.caption = caption
if caption is not None and not caption == "":
DOM.setInnerHTML(self.legend, caption)
DOM.insertChild(self.getElement(), self.legend, 0)
elif DOM.getParent(self.legend) is not None:
DOM.removeChild(self.getElement(), self.legend)
示例2: setHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def setHTML(self, html):
"""Set the face's contents as html."""
self.face = DOM.createDiv()
UIObject.setStyleName(self.button, self.face, self.STYLENAME_HTML_FACE,
True)
DOM.setInnerHTML(self.face, html)
self.button.updateButtonFace()
示例3: addMessage
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def addMessage(self, text):
d = datetime.now().strftime("%x %X")
li = DOM.createElement('li')
DOM.setInnerHTML(li,
'<dt class="time">%s</dt><dd class="txt">%s</dd>' % (
d, text))
DOM.insertChild(self.element, li, 0)
示例4: restart
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def restart(self, no_of_bomb=0):
for one in self.get_all_cells():
one.count = 0
one.state = 0
one.setStyleName('blank')
DOM.setInnerHTML(one.getElement(), '')
self.start(no_of_bomb)
示例5: ensureContentPanel
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def ensureContentPanel(self):
if self.contentPanel is None:
DOM.setInnerHTML(self.contentElem, "")
self.contentPanel = TreeContentPanel(self.contentElem)
self.contentPanel.setTreeItem(self)
if self.getTree() is not None:
self.tree.adopt(self.contentPanel)
示例6: emit
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def emit(self, record):
msg = self.format(record)
msg = escape(msg)
msg = msg.replace("\n", "<br/>\n") + "<br/>\n"
self.output += msg
self.__addLogElement()
DOM.setInnerHTML(self.div, self.output)
示例7: buildDOM
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def buildDOM(self):
leftDiv = self.getWidgetElement(0)
rightDiv = self.getWidgetElement(1)
splitDiv = self.getSplitElement()
DOM.appendChild(self.getElement(), self.container)
DOM.appendChild(self.container, leftDiv)
DOM.appendChild(self.container, splitDiv)
DOM.appendChild(self.container, rightDiv)
# Sadly, this is the only way I've found to get vertical
# centering in this case. The usually CSS hacks (display:
# table-cell, vertical-align: middle) don't work in an
# absolute positioned DIV.
thumb_html = '<img src="splitPanelThumb.png" />'
DOM.setInnerHTML(splitDiv,
"<table class='hsplitter' height='100%' cellpadding='0' " +
"cellspacing='0'><tr><td align='center' valign='middle'>" +
thumb_html +
"</td></tr></table>")
self.addScrolling(leftDiv)
self.addScrolling(rightDiv)
示例8: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def __init__(self, fbml):
self.__init__._super()
"""
Fbml
@param fbml
"""
super(self.__class__,self).setElement(DOM.createElement(u"fb:serverFbml"))
DOM.setInnerHTML(self.getElement(), fbml)
示例9: setStackText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def setStackText(self, index, text, asHTML=False):
if index >= self.getWidgetCount():
return
td = DOM.getChild(DOM.getChild(self.body, index * 2), 0)
if asHTML:
DOM.setInnerHTML(td, text)
else:
DOM.setInnerText(td, text)
示例10: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def __init__(self, name, **kwargs):
if kwargs.has_key('Element'):
div = kwargs.pop('Element')
else:
div = DOM.createDiv()
DOM.setInnerHTML(div, "<iframe name='" + name + "'>")
iframe = DOM.getFirstChild(div)
Frame.__init__(self, None, iframe, **kwargs)
示例11: testDivHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def testDivHTML(self):
e = DOM.getElementById('tests')
div = DOM.createElement('div')
DOM.appendChild(e, div)
DOM.setInnerHTML(div, 'hello world\n')
self.write_test_output('addDiv')
DOM.removeChild(e, div)
self.write_test_output('removeDiv')
示例12: addRows
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def addRows(self, table, numRows, columns):
td = DOM.createElement("td")
DOM.setInnerHTML(td, " ")
row = DOM.createElement("tr")
for cellNum in range(columns):
cell = td.cloneNode(True)
row.appendChild(cell)
for rowNum in range(numRows):
table.appendChild(row.cloneNode(True))
示例13: internalClearCell
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def internalClearCell(self, td):
maybeChild = DOM.getFirstChild(td)
widget = None
if maybeChild is not None:
widget = self.getWidget(maybeChild)
if widget is not None:
self.removeWidget(widget)
return True
DOM.setInnerHTML(td, "")
return False
示例14: onError
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def onError(self, html, statusCode):
if statusCode == 404 and self.allowEdit:
self.editor = None
self.originalText = ""
DOM.setInnerHTML(self.getElement(), '')
self.editButton = Label("create "+unescape(self.templateName))
self.editButton.addStyleName("link")
self.editButton.addStyleName("ContentPanelEditLink")
self.editButton.addClickListener(EventDelegate("onClick", self,
self.onEditContentClick))
ComplexPanel.insert(self, self.editButton, self.getElement(),
len(self.children))
return
示例15: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerHTML [as 别名]
def __init__(self, initialValue="", target="", method="POST",
basePath=None, **kwargs):
self.id = "rte" + str(hash(self))
self.setElement(DOM.createForm())
DOM.setAttribute(self.element, "method", method)
DOM.setAttribute(self.element, "target", target)
if not kwargs.has_key('ID'): kwargs['ID'] = self.id
if not kwargs.has_key('StyleName'): kwargs['StyleName'] = "gwt-RichTextEditor"
if not kwargs.has_key('Height'): kwargs['Height'] = "600px"
if not kwargs.has_key('Width'): kwargs['Width'] = "100%"
Widget.__init__(self, **kwargs)
JS("""
var rte = this;
this.element.onsubmit = function() {
$wnd.setTimeout(function() { rte.onSave.call(rte) }, 0);
return false;
}
""")
if basePath is None:
basePath = "fckeditor/"
if not basePath.endswith("/"):
basePath += "/"
fck = createFCK("fck" + self.id)
fck.Height = self.getHeight()
fck.Width = self.getWidth()
fck.Value = initialValue
fck.BasePath = basePath
fck.Config.CustomConfigurationsPath = "../../fckconfig.js"
fck.pyjsObject = self
self.loaded = False
self.saveListeners = []
self.pendingHTML = None
html = fck.CreateHtml()
DOM.setInnerHTML(self.getElement(), html)