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


Python DOM.setInnerHTML方法代码示例

本文整理汇总了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)
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:CaptionPanel.py

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

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

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

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

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

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

示例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)
开发者ID:pombredanne,项目名称:pygwt-facebook,代码行数:10,代码来源:FbServerFbml.py

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

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

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

示例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, "&nbsp;")
     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))
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:11,代码来源:Grid.py

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

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

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


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