本文整理汇总了Python中pyjamas.DOM.getInnerHTML方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.getInnerHTML方法的具体用法?Python DOM.getInnerHTML怎么用?Python DOM.getInnerHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.DOM
的用法示例。
在下文中一共展示了DOM.getInnerHTML方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onElementInitialized
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def onElementInitialized(self):
# Issue 1897: This method is called after a timeout, during which time the
# element might by detached.
if not self.initializing:
return
print "onElementInit", DOM.getInnerHTML(self.beforeInitPlaceholder)
self.initializing = False
RichTextAreaImpl.onElementInitialized(self)
# When the iframe is ready, ensure cached content is set.
if self.beforeInitPlaceholder is not None:
self.setHTMLImpl(DOM.getInnerHTML(self.beforeInitPlaceholder))
self.beforeInitPlaceholder = None
示例2: getTextContents
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getTextContents(self, iframe):
try:
if not iframe.contentDocument:
return None
return DOM.getInnerHTML(iframe.contentDocument.body)
except:
return None
示例3: replaceLinks
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def replaceLinks(self, tagname="a"):
""" replaces <tag href="#pagename">sometext</tag> with:
Hyperlink("sometext", "pagename")
"""
tags = self.findTags(tagname)
pageloc = Window.getLocation()
pagehref = pageloc.getPageHref()
for el in tags:
href = el.href
l = href.split("#")
if len(l) != 2:
continue
if l[0] != pagehref:
continue
token = l[1]
if not token:
continue
html = DOM.getInnerHTML(el)
parent = DOM.getParent(el)
index = DOM.getChildIndex(parent, el)
hl = Hyperlink(TargetHistoryToken=token,
HTML=html,
Element=DOM.createSpan())
DOM.insertChild(parent, hl.getElement(), index)
self.children.insert(index, hl)
parent.removeChild(el)
示例4: getTabHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getTabHTML(self, index):
widget = self.getTabWidget(index)
if hasattr(widget, "getHTML"):
return widget.getHTML()
elif hasattr(widget, "getText"): # assume it's a Label if it has getText
return widget.getText()
else:
fpe = DOM.getParent(self.focusablePanel.getElement())
return DOM.getInnerHTML(fpe)
示例5: getHtmlText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getHtmlText(rng):
"""
Get the complete html fragment enclosed by this range. Ensures that all
opening and closing tags are included.
@param range js range to get the html of
@return an html string of the range
"""
parent = DOM.createElement("span")
copyContents(rng, parent)
return DOM.getInnerHTML(parent)
示例6: getTabHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getTabHTML(self, index):
if index >= self.getTabCount():
return None
delPanel = self.panel.getWidget(index + 1)
focusablePanel = delPanel.getFocusablePanel()
widget = focusablePanel.getWidget()
if hasattr(widget, "getHTML"):
return widget.getHTML()
elif hasattr(widget, "getText"): # assume it's a Label if it has getText
return widget.getText()
else:
fpe = DOM.getParent(self.focusablePanel.getElement())
return DOM.getInnerHTML(fpe)
示例7: onDragStart
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def onDragStart(self, event):
dt = event.dataTransfer
target = DOM.eventGetTarget(event)
target = Widget(Element=target)
try:
id = target.getID()
except:
id = ''
if id == 'datadrag0':
dt.setData('text/plain', 'Hello World!')
elif id == 'datadrag1':
logo = doc().getElementById('logo')
logo_parent_element = DOM.getParent(logo)
text = DOM.getInnerText(logo_parent_element)
html = DOM.getInnerHTML(logo_parent_element)
uri = DOM.getAttribute(logo, 'src')
dt.setData('text/plain', text)
dt.setData('text/html', html)
dt.setData('text/uri-list', uri)
elif id == 'datadrag2':
dt.setData('x-star-trek/tribble', 'I am a tribble')
示例8: getHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getHTML(self):
return DOM.getInnerHTML(self.labelElem)
示例9: getHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getHTML(self):
return DOM.getInnerHTML(self.getElement())
示例10: getHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getHTML(self):
"""Gets the face's contents as html."""
return DOM.getInnerHTML(self.getFace())
示例11: HTMLPanel
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
<head>
<title>Example 5</title>
</head>
<body>
<p>Test 5: Processes server html and insert click listeners into links:
<span id='link1' class = 'wikilink'>link 1</span> and <span id='link2' class = 'wikilink'>link 2</span>.
</p>
</body>
</html>
"""
html3 = HTMLPanel(serverXml)
links = list()
for elem in html3.findTags('span'):
if DOM.getElemAttribute(elem, 'class') == 'wikilink':
linkClass = DOM.getElemAttribute(elem, 'class')
links.append(elem)
if len(links) > 0:
parent = DOM.getParent(links[0])
for link in links:
linkId = DOM.getElemAttribute(link, 'id')
linkClass = DOM.getElemAttribute(link, 'class')
linkInner = DOM.getInnerHTML(link)
a3 = Hyperlink(text = linkInner, Element = DOM.createSpan())
a3.addClickListener(onClick)
a3.setID('param2')
#todo: modify HTMLPanel to replace an element instead of add
#html3.replace(a3, linkId)
DOM.setInnerHTML(link, '') # clear existing text
html3.add(a3, linkId)
RootPanel().add(html3)
pyjd.run()
示例12: getHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getHTML(self):
return DOM.getInnerHTML(self.anchorElem)
示例13: getHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getHTML(self):
return DOM.getInnerHTML(self.contentElem)
示例14: getHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
def getHTML(self, row, column):
element = self.cellFormatter.getElement(row, column)
return DOM.getInnerHTML(element)