• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python common.formField函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中exe.webui.common.formField函数的典型用法代码示例。如果您正苦于以下问题:Python formField函数的具体用法?Python formField怎么用?Python formField使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了formField函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: render_GET

    def render_GET(self, request):
        """Render the preferences"""
        log.debug("render_GET")

        # Rendering
        html = common.docType()
        html += u'<html xmlns="http://www.w3.org/1999/xhtml">\n'
        html += u"<head>\n"
        html += u'<style type="text/css">\n'
        html += u"@import url(/css/exe.css);\n"
        html += u"@import url(/style/base.css);\n"
        html += u"@import url(/style/standardwhite/content.css);</style>\n"
        html += u"""<script language="javascript" type="text/javascript">
            function doImportPDF(path, pages) {
                opener.nevow_clientToServerEvent('importPDF', this, '', path,
                    pages);
                window.close();
            }
        </script>"""
        html += '<script src="scripts/common.js" language="JavaScript">'
        html += "</script>\n"
        html += u"<title>" + _("Import PDF") + "</title>\n"
        html += u'<meta http-equiv="content-type" content="text/html; '
        html += u' charset=UTF-8"></meta>\n'
        html += u"</head>\n"
        html += u"<body>\n"
        html += u'<div id="main"> \n'
        html += u'<form method="post" action="" '
        html += u'id="contentForm" >'

        # package not needed for the preferences, only for rich-text fields:
        this_package = None
        html += common.formField(
            "textInput", this_package, _("Path to PDF"), "path", instruction=_("Enter path to pdf you want to import")
        )
        html += u'<input type="button" onclick="addPdf(\'\')"'
        html += u'value="%s"/>\n' % _(u"Add file")
        html += common.formField(
            "textInput",
            this_package,
            _("Pages to import"),
            "pages",
            instruction=_("Comma-separated list of pages to import"),
        )
        html += u'<div id="editorButtons"> \n'
        html += u"<br/>"
        html += common.button(
            "ok",
            _("OK"),
            enabled=True,
            _class="button",
            onClick="doImportPDF(document.forms.contentForm.path.value," + "document.forms.contentForm.pages.value)",
        )
        html += common.button("cancel", _("Cancel"), enabled=True, _class="button", onClick="window.close()")
        html += u"</div>\n"
        html += u"</div>\n"
        html += u"<br/></form>\n"
        html += u"</body>\n"
        html += u"</html>\n"
        return html.encode("utf8")
开发者ID:alendit,项目名称:exeLearning,代码行数:60,代码来源:importpdfpage.py


示例2: renderEdit

  def renderEdit(self):
      """
      Enables the user to set up their passage of text
      """
      # to render, choose the content with the preview-able resource paths:
      self.field.encodedContent = self.field.content_w_resourcePaths
      this_package = None
      if self.field_idevice is not None \
      and self.field_idevice.parentNode is not None:
          this_package = self.field_idevice.parentNode.package
          
      html = [
          # Render the iframe box
          common.formField('richTextArea', this_package, _('Text'),'',
                           self.editorId, self.field.instruc,
                           self.field.encodedContent),
          # Render our toolbar
          
          u'  <input type="button" value="%s" ' % _("Hide/Show Word"),
          u' onclick="$exeAuthoring.toggleWordInEditor(\'%s\');" />' % self.editorId,
          u'<br /><br />',
        
          common.formField('textInput',
                          '',
                          _('Other words'),
                          'clOtras'+self.id, '',
                          self.field.otrasInstruc,
                          self.field.otras,
                          size=80),
         
 
          u'</br></br>',
          ]
      
      return '\n    '.join(html)
开发者ID:exelearning,项目名称:iteexe,代码行数:35,代码来源:listablock.py


示例3: renderEdit

    def renderEdit(self, style):
        """
        Returns an XHTML string with the form elements for editing this block
        """
        log.debug("renderEdit")
        html  = u"<div class=\"iDevice\">\n"
        html += common.textInput("title"+self.id, self.idevice.title) + '<br/><br/>'
        html += self.mediaElement.renderEdit()       
        floatArr    = [[_(u'Left'), 'left'],
                      [_(u'Right'), 'right'],
                      [_(u'None'),  'none']]

        this_package = None
        if self.idevice is not None and self.idevice.parentNode is not None:
            this_package = self.idevice.parentNode.package
        html += common.formField('select', this_package, _("Align:"),
                                 "float" + self.id, '',
                                 self.idevice.alignInstruc,
                                 floatArr, self.idevice.float)
        #html += u'<div class="block">' #<b>%s</b></div>' % _(u"Caption:")
        #html += common.textInput("caption" + self.id, self.idevice.media.caption)
        #html += common.elementInstruc(self.idevice.media.captionInstruc)
        html += "<br/>" + self.textElement.renderEdit()
        emphasisValues = [(_(u"No emphasis"),     Idevice.NoEmphasis),
                          (_(u"Some emphasis"),   Idevice.SomeEmphasis)]

        html += common.formField('select', this_package, _('Emphasis'),
                                 'emphasis', self.id, 
                                 '', # TODO: Instructions
                                 emphasisValues,
                                 self.idevice.emphasis)
        html += self.renderEditButtons()
        html += u"</div>\n"
        return html
开发者ID:RichDijk,项目名称:eXe,代码行数:34,代码来源:multimediablock.py


示例4: render_GET

    def render_GET(self, request):
        """Render the preferences"""
        log.debug("render_GET")
        
        # Rendering
        html  = common.docType()
        html += u"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
        html += u"<head>\n"
        html += u"<style type=\"text/css\">\n"
        html += u"@import url(/css/exe.css);\n"
        html += u'@import url(/style/base.css);\n'
        html += u"@import url(/style/standardwhite/content.css);</style>\n"
        html += u'''<script language="javascript" type="text/javascript">
            function setLocaleAndAnchors(l,anchors) {
                parent.nevow_clientToServerEvent('setLocale', this, '', l)
                parent.nevow_clientToServerEvent('setInternalAnchors', this, '', anchors)
                parent.Ext.getCmp('preferenceswin').close()
            }
        </script>'''
        html += u"<title>"+_("eXe : elearning XHTML editor")+"</title>\n"
        html += u"<meta http-equiv=\"content-type\" content=\"text/html; "
        html += u" charset=UTF-8\"></meta>\n";
        html += u"</head>\n"
        html += u"<body>\n"
        html += u"<div id=\"main\"> \n"     
        html += u"<form method=\"post\" action=\"\" "
        html += u"id=\"contentForm\" >"  

        # package not needed for the preferences, only for rich-text fields:
        this_package = None
        html += common.formField('select', this_package, _(u"Select Language"),
                                 'locale',
                                 options = self.localeNames,
                                 selection = self.config.locale)

        internal_anchor_options = [(_(u"Enable All Internal Linking"), "enable_all"),
                                   (_(u"Disable Auto-Top Internal Linking"), "disable_autotop"),
                                   (_(u"Disable All Internal Linking"), "disable_all")]
        html += common.formField('select', this_package, _(u"Internal Linking (for Web Site Exports only)"),
                                 'internalAnchors', 
                                 '', # TODO: Instructions
                                 options = internal_anchor_options,
                                 selection = self.config.internalAnchors)

        html += u"<div id=\"editorButtons\"> \n"     
        html += u"<br/>" 
        html += common.button("ok", _("OK"), enabled=True,
                _class="button",
                onClick="setLocaleAndAnchors(document.forms.contentForm.locale.value,"
                    "document.forms.contentForm.internalAnchors.value)")
        html += common.button("cancel", _("Cancel"), enabled=True,
                _class="button", onClick="parent.Ext.getCmp('preferenceswin').close()")
        html += u"</div>\n"
        html += u"</div>\n"
        html += u"<br/></form>\n"
        html += u"</body>\n"
        html += u"</html>\n"
        return html.encode('utf8')
开发者ID:manamani,项目名称:iteexe,代码行数:58,代码来源:preferencespage.py


示例5: renderEdit

 def renderEdit(self, style):
     """
     Returns an XHTML string with the form element for editing this block
     """
     html  = u'<div class="block">\n'
     html += u"<strong>%s</strong> " % _('URL:')
     html += common.elementInstruc(self.idevice.urlInstruc)
     html += u"</div>\n"
     html += u'<div class="block">\n'
     html += common.textInput("url"+self.id, self.idevice.url) 
     heightArr = [['small',      '200'],
                  ['medium',     '300'],
                  ['large',      '500'],
                  ['super-size', '800']]
     html += u"</div>\n"
     html += u'<div class="block">\n'
     this_package = None
     if self.idevice is not None and self.idevice.parentNode is not None:
         this_package = self.idevice.parentNode.package
     html += common.formField('select', this_package, _('Frame Height:'), 
                              "height"+self.id,
                              options = heightArr,
                              selection = self.idevice.height)
     html += u"</div>\n"
     html += self.renderEditButtons()
     return html
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:26,代码来源:externalurlblock.py


示例6: render_GET

    def render_GET(self, request):
        """Render the preferences"""
        log.debug("render_GET")
        
        # Rendering
        html  = common.docType()
        html += u"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
        html += u"<head>\n"
        html += u"<style type=\"text/css\">\n"
        html += u"@import url(/css/exe.css);\n"
        html += u'@import url(/style/base.css);\n'
        html += u"@import url(/style/standardwhite/content.css);</style>\n"
        html += u'<script type="text/javascript" src="/scripts/common.js">'
        html += u'</script>\n'
        html += u'''<script language="javascript" type="text/javascript">
            function importXliff(from_source) {
                parent.nevow_clientToServerEvent('mergeXliffPackage', this, '', '%s', from_source);
                parent.Ext.getCmp("xliffimportwin").close();
            }
        </script>''' % quote(request.args['path'][0])
        html += u"<title>"+_("eXe : elearning XHTML editor")+"</title>\n"
        html += u"<meta http-equiv=\"content-type\" content=\"text/html; "
        html += u" charset=UTF-8\"></meta>\n";
        html += u"</head>\n"
        html += u"<body>\n"
        html += u"<div id=\"main\"> \n"
        html += u"<p>&nbsp;</p>\n"
        html += u"<form method=\"post\" action=\"\" "
        html += u"id=\"contentForm\" >"

        # package not needed for the preferences, only for rich-text fields:
        this_package = None
        html += common.formField('checkbox', this_package, _(u"Import from source language"),
                                 'from_source',
                                 name = 'from_source',
                                 checked = False,
                                 title = None,
                                 instruction = _(u"If you choose this option, \
the import process will take the texts from source language instead of target \
language."))

        html += u"<div id=\"editorButtons\"> \n"
        html += u"<br/>" 
        html += common.button("ok", _("OK"), enabled=True,
                _class="button",
                onClick="importXliff(document.forms.contentForm.from_source.checked \
                )")
        html += common.button("cancel", _("Cancel"), enabled=True,
                _class="button", onClick="parent.Ext.getCmp('xliffimportwin').close()")
        html += u"</div>\n"
        html += u"</div>\n"
        html += u"<br/></form>\n"
        html += u"</body>\n"
        html += u"</html>\n"
        return html.encode('utf8')
开发者ID:Rafav,项目名称:iteexe,代码行数:55,代码来源:xliffimportpreferencespage.py


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


示例8: renderEdit

  def renderEdit(self):
      """
      Enables the user to set up their passage of text
      """
      # to render, choose the content with the preview-able resource paths:
      self.field.encodedContent = self.field.content_w_resourcePaths
      this_package = None
      if self.field_idevice is not None \
      and self.field_idevice.parentNode is not None:
          this_package = self.field_idevice.parentNode.package
          
      html = [
          # Render the iframe box
          common.formField('richTextArea', this_package, _('Text'),'',
                           self.editorId, self.field.instruc,
                           self.field.encodedContent, 
                           default_prompt = self.field.default_prompt),
          # Render our toolbar
          
          u'  <input type="button" value="%s" ' % _("Hide/Show Word"),
          u' onclick="tinyMCE.execInstanceCommand(\'%s\',\'Underline\', false);" />' % self.editorId,
          u'</br></br>',
        
          common.formField('textInput',
                          '',
                          _('Other words'),
                          'clOtras'+self.id, '',
                          self.field.otrasInstruc,
                          self.field.otras,
                          size=80, 
                          default_prompt = "Enter additional words for learners to select from separated by ,"),
         
 
          u'</br></br>',
          ]
      
      return '\n    '.join(html)
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:37,代码来源:listablock.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python common.getExportDocType函数代码示例发布时间:2022-05-24
下一篇:
Python common.elementInstruc函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap