当前位置: 首页>>代码示例>>Python>>正文


Python DOM.getInnerHTML方法代码示例

本文整理汇总了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
开发者ID:anandology,项目名称:pyjamas,代码行数:17,代码来源:RichTextAreaImplStandard.py

示例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
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:FormPanel.py

示例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)
开发者ID:Afey,项目名称:pyjs,代码行数:28,代码来源:HTMLLinkPanel.py

示例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)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:11,代码来源:TabBar.py

示例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)
开发者ID:luiseduardohdbackup,项目名称:pyjs,代码行数:13,代码来源:Range.py

示例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)
开发者ID:anandology,项目名称:pyjamas,代码行数:15,代码来源:TabBar.py

示例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')
开发者ID:anandology,项目名称:pyjamas,代码行数:23,代码来源:DNDTest.py

示例8: getHTML

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
 def getHTML(self):
     return DOM.getInnerHTML(self.labelElem)
开发者ID:certik,项目名称:pyjamas,代码行数:4,代码来源:CheckBox.py

示例9: getHTML

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
 def getHTML(self):
     return DOM.getInnerHTML(self.getElement())
开发者ID:certik,项目名称:pyjamas,代码行数:4,代码来源:__init__.py

示例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())
开发者ID:Afey,项目名称:pyjs,代码行数:5,代码来源:CustomButton.py

示例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()
开发者ID:Afey,项目名称:pyjs,代码行数:33,代码来源:Anchor.py

示例12: getHTML

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
 def getHTML(self):
     return DOM.getInnerHTML(self.anchorElem)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:4,代码来源:Hyperlink.py

示例13: getHTML

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerHTML [as 别名]
 def getHTML(self):
     return DOM.getInnerHTML(self.contentElem)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:4,代码来源:TreeItem.py

示例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)
开发者ID:Afey,项目名称:pyjs,代码行数:5,代码来源:HTMLTable.py


注:本文中的pyjamas.DOM.getInnerHTML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。