當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fullcalendar.htmlEscape函數代碼示例

本文整理匯總了TypeScript中fullcalendar.htmlEscape函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript htmlEscape函數的具體用法?TypeScript htmlEscape怎麽用?TypeScript htmlEscape使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了htmlEscape函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: buildCellObject

 buildCellObject(date, text, rowUnit) {
   date = date.clone() // ensure our own reference
   const spanHtml = this.buildGotoAnchorHtml(
     {
       date,
       type: rowUnit,
       forceOff: !rowUnit
     },
     {
       'class': 'fc-cell-text'
     },
     htmlEscape(text)
   )
   return { text, spanHtml, date, colspan: 1 }
 }
開發者ID:diomed,項目名稱:fullcalendar-scheduler,代碼行數:15,代碼來源:TimelineView.ts

示例2: renderHeadResourceCellHtml

 // given a resource and an optional date
 renderHeadResourceCellHtml(resource, date?, colspan = 1) {
   return '<th class="fc-resource-cell"' +
     ' data-resource-id="' + resource.id + '"' +
     (date ?
       ' data-date="' + date.format('YYYY-MM-DD') + '"' :
       '') +
     (colspan > 1 ?
       ' colspan="' + colspan + '"' :
       '') +
   '>' +
     htmlEscape(
       this.view.getResourceText(resource)
     ) +
   '</th>'
 }
開發者ID:diomed,項目名稱:fullcalendar-scheduler,代碼行數:16,代碼來源:ResourceDayTableMixin.ts

示例3: fgSegHtml

  fgSegHtml(seg, disableResizing) {
    const { eventDef } = seg.footprint
    const isDraggable = this.view.isEventDefDraggable(eventDef)
    const isResizableFromStart = seg.isStart && this.view.isEventDefResizableFromStart(eventDef)
    const isResizableFromEnd = seg.isEnd && this.view.isEventDefResizableFromEnd(eventDef)

    const classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd)
    classes.unshift('fc-timeline-event', 'fc-h-event')

    const timeText = this.getTimeText(seg.footprint)

    return '<a class="' + classes.join(' ') + '" style="' + cssToStr(this.getSkinCss(seg.footprint.eventDef)) + '"' +
      (eventDef.url ?
        ' href="' + htmlEscape(eventDef.url) + '"' :
        '') +
      '>' +
      '<div class="fc-content">' +
        (timeText ?
          '<span class="fc-time">' +
            htmlEscape(timeText) +
          '</span>'
        :
          '') +
        '<span class="fc-title">' +
          (eventDef.title ? htmlEscape(eventDef.title) : '&nbsp;') +
        '</span>' +
      '</div>' +
      '<div class="fc-bg" />' +
      (isResizableFromStart ?
        '<div class="fc-resizer fc-start-resizer"></div>' :
        '') +
      (isResizableFromEnd ?
        '<div class="fc-resizer fc-end-resizer"></div>' :
        '') +
    '</a>'
  }
開發者ID:diomed,項目名稱:fullcalendar-scheduler,代碼行數:36,代碼來源:TimelineEventRenderer.ts

示例4: renderSpreadsheetSkeleton

  /*
  Populates the TR with cells containing data about the resource
  */
  renderSpreadsheetSkeleton(tr) {
    const { theme } = this.view.calendar
    const { resource } = this

    for (let colSpec of this.view.colSpecs) {

      if (colSpec.group) { // not responsible for group-based rows. VRowGroup is
        continue
      }

      const input = // the source text, and the main argument for the filter functions
        colSpec.field ?
          resource[colSpec.field] || null :
          resource

      const text =
        typeof colSpec.text === 'function' ?
          colSpec.text(resource, input) : // the colspec provided a text filter function
          input

      let contentEl = $(
        '<div class="fc-cell-content">' +
          (colSpec.isMain ? this.renderGutterHtml() : '') +
          '<span class="fc-cell-text">' +
            (text ? htmlEscape(text) : '&nbsp;') +
          '</span>' +
        '</div>'
      )

      if (typeof colSpec.render === 'function') { // a filter function for the element
        contentEl = colSpec.render(resource, contentEl, input) || contentEl
      }

      const td = $('<td class="' + theme.getClass('widgetContent') + '"/>')
        .append(contentEl)

      // the first cell of the row needs to have an inner div for setTrInnerHeight
      if (colSpec.isMain) {
        td.wrapInner('<div/>')
      }

      tr.append(td)
    }

    tr.attr('data-resource-id', resource.id)
  }
開發者ID:diomed,項目名稱:fullcalendar-scheduler,代碼行數:49,代碼來源:ResourceRow.ts

示例5: renderHeadHtml

  renderHeadHtml() {
    const { theme } = this.view.calendar
    const { colSpecs } = this.view

    let html = '<table class="' + theme.getClass('tableGrid') + '">'

    let colGroupHtml = '<colgroup>'
    for (let o of colSpecs) {
      if (o.isMain) {
        colGroupHtml += '<col class="fc-main-col"/>'
      } else {
        colGroupHtml += '<col/>'
      }
    }

    colGroupHtml += '</colgroup>'
    this.colGroupHtml = colGroupHtml
    html += colGroupHtml

    html += '<tbody>'

    if (this.view.superHeaderText) {
      html +=
        '<tr class="fc-super">' +
          '<th class="' + theme.getClass('widgetHeader') + '" colspan="' + colSpecs.length + '">' +
            '<div class="fc-cell-content">' +
              '<span class="fc-cell-text">' +
                htmlEscape(this.view.superHeaderText) +
              '</span>' +
            '</div>' +
          '</th>' +
        '</tr>'
    }

    html += '<tr>'

    for (let i = 0; i < colSpecs.length; i++) {
      let o = colSpecs[i]
      const isLast = i === (colSpecs.length - 1)

      html +=
        `<th class="` + theme.getClass('widgetHeader') + `">` +
          '<div>' +
            '<div class="fc-cell-content">' +
              (o.isMain ?
                '<span class="fc-expander-space">' +
                  '<span class="fc-icon"></span>' +
                '</span>' :
                '') +
              '<span class="fc-cell-text">' +
                htmlEscape(o.labelText || '') + // what about normalizing this value ahead of time?
              '</span>' +
            '</div>' +
            (!isLast ? '<div class="fc-col-resizer"></div>' : '') +
          '</div>' +
        '</th>'
    }

    html += '</tr>'
    html += '</tbody></table>'

    return html
  }
開發者ID:diomed,項目名稱:fullcalendar-scheduler,代碼行數:63,代碼來源:Spreadsheet.ts


注:本文中的fullcalendar.htmlEscape函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。