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


TypeScript console.log方法代碼示例

本文整理匯總了TypeScript中@ephox/dom-globals.console.log方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript console.log方法的具體用法?TypeScript console.log怎麽用?TypeScript console.log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ephox/dom-globals.console的用法示例。


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

示例1: function

const getAllHistory = function (): Record<string, string[]> {
  const unparsedHistory = localStorage.getItem(STORAGE_KEY);
  if (unparsedHistory === null) {
    return {};
  }
  // parse history
  let history;
  try {
    history = JSON.parse(unparsedHistory);
  } catch (e) {
    if (e instanceof SyntaxError) {
      console.log('Local storage ' + STORAGE_KEY + ' was not valid JSON', e);
      return {};
    }
    throw e;
  }
  // validate the parsed value
  if (!isRecordOfUrlArray(history)) {
    console.log('Local storage ' + STORAGE_KEY + ' was not valid format', history);
    return {};
  }
  return history;
};
開發者ID:tinymce,項目名稱:tinymce,代碼行數:23,代碼來源:UrlInputHistory.ts

示例2: success

UnitTest.asynctest('browser.tinymce.plugins.imagetools.SequenceTest', (success, failure) => {

  const platform = PlatformDetection.detect();

  if (platform.browser.isIE() || platform.browser.isEdge()) {
    console.log('Disabled on IE and Edge because of race conditions');
    return success();
  }

  const srcUrl = '/project/tinymce/src/plugins/imagetools/demo/img/dogleft.jpg';
  // var corsUrl = 'http://moxiecode.cachefly.net/tinymce/v9/images/logo.png';

  Plugin();

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const imgOps = ImageOps(editor);

    const sManipulateImage = function (message, url) {
      return Log.stepsAsStep('TBA', `ImageTools: ${message}`, [
        ImageUtils.sLoadImage(editor, url),
        tinyApis.sSelect('img', []),
        imgOps.sExecToolbar('Flip horizontally'),
        imgOps.sExecToolbar('Rotate clockwise'),
        imgOps.sExecDialog('Invert'),
        imgOps.sExecDialog('Crop'),
        imgOps.sExecDialog('Resize'),
        imgOps.sExecDialog('Flip vertically'),
        imgOps.sExecDialog('Rotate clockwise'),
        imgOps.sExecDialog('Brightness'),
        imgOps.sExecDialog('Sharpen'),
        imgOps.sExecDialog('Contrast'),
        imgOps.sExecDialog('Color levels'),
        imgOps.sExecDialog('Gamma')
      ]);
    };

    Pipeline.async({}, [
      // sManipulateImage('Test image operations on an image CORS domain', corsUrl),
      sManipulateImage('Test image operations on an image from the same domain', srcUrl)
    ], onSuccess, onFailure);
  }, {
    theme: 'silver',
    plugins: 'imagetools',
    imagetools_cors_hosts: ['moxiecode.cachefly.net'],
    base_url: '/project/tinymce/js/tinymce',
    toolbar: 'editimage',
  }, success, failure);
});
開發者ID:tinymce,項目名稱:tinymce,代碼行數:49,代碼來源:SequenceTest.ts

示例3:

  onSubmit: (api) => {
    const data = api.getData();

    // tslint:disable-next-line:no-console
    console.log({
      title: data.title,
      keywords: data.keywords,
      description: data.description,
      robots: data.robots,
      author: data.author,
      encoding: data.encoding
    });

    api.close();
  }
開發者ID:tinymce,項目名稱:tinymce,代碼行數:15,代碼來源:DocumentPropsDialogSpec.ts

示例4:

  onSubmit: (api) => {
    const data = api.getData();

    // tslint:disable-next-line:no-console
    console.log({
      source: data.source,
      width: data.size.width,
      height: data.size.height,
      embed: data.embed,
      altsource: data.altsource,
      poster: data.poster
    });

    api.close();
  }
開發者ID:tinymce,項目名稱:tinymce,代碼行數:15,代碼來源:MediaDialogSpec.ts

示例5:

  onSubmit: (api) => {
    const data = api.getData();

    // tslint:disable-next-line:no-console
    console.log({
      type: data.rowtype,
      align: data.align,
      height: data.height,
      borderstyle: data.borderstyle,
      bordercolor: data.bordercolor,
      backgroundcolor: data.backgroundcolor
    });

    api.close();
  }
開發者ID:tinymce,項目名稱:tinymce,代碼行數:15,代碼來源:TableRowDialogSpec.ts

示例6: onAction

  const generateButton = (editor: Editor, buttonType: 'button', name, num) => {
    const names = [];

    for (let i = 0; i <= num; i++) {
      editor.ui.registry.addButton(`${name}-${i}`, {
        type: buttonType,
        icon: `*-${i}-*`,
        onAction (comp) {
          console.log(`${name} ${i} button clicked`);
        }
      });

      names.push(`${name}-${i}`);
    }
    return names;
  };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:16,代碼來源:ToolbarButtonDemo.ts

示例7: SilverTheme

UnitTest.asynctest('browser.tinymce.plugins.image.ImageResizeTest', (success, failure) => {
  SilverTheme();
  ImagePlugin();

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyUi = TinyUi(editor);

    Pipeline.async({}, [
      Log.stepsAsStep('TBA', 'Image: image proportion constrains should work directly', [
        tinyUi.sClickOnToolbar('click image button', 'button[aria-label="Insert/edit image"]'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('button.tox-browse-url'),
                Mouse.cClick
              ]),
              Chain.control(
                cAssertInputValue(generalTabSelectors.width, '1'),
                Guard.tryUntil('did not find width input with value 1', 10, 1000)
              ),
              cSetInputValue(generalTabSelectors.height, '5'),
              Chain.control(
                cAssertInputValue(generalTabSelectors.width, '5'),
                Guard.tryUntil('did not find width input with value 5', 10, 1000)
              ),
            ]
          ),
          tinyUi.cSubmitDialog(),
          Chain.inject(editor),
          cAssertCleanHtml('Checking output', '<p><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" width="5" height="5" /></p>')
        ])
      ])

    ], onSuccess, onFailure);
  }, {
      theme: 'silver',
      plugins: 'image',
      toolbar: 'image',
      base_url: '/project/tinymce/js/tinymce',
      file_picker_callback(callback) {
        // tslint:disable-next-line:no-console
        console.log('file picker pressed');
        callback('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
      }
    }, success, failure);
});
開發者ID:tinymce,項目名稱:tinymce,代碼行數:47,代碼來源:ImageResizeTest.ts

示例8:

  onSubmit: (api) => {
    const data = api.getData();

    // tslint:disable-next-line:no-console
    console.log({
      width: data.width,
      height: data.height,
      cellspacing: data.cellspacing,
      cellpadding: data.cellpadding,
      border: data.border,
      caption: data.caption,
      borderstyle: data.borderstyle,
      bordercolor: data.bordercolor,
      backgroundcolor: data.backgroundcolor
    });

    api.close();
  }
開發者ID:tinymce,項目名稱:tinymce,代碼行數:18,代碼來源:TableDialogSpec.ts

示例9:

  onSubmit: (api) => {
    const data = api.getData();

    // tslint:disable-next-line:no-console
    console.log({
      width: data.width,
      height: data.height,
      celltype: data.celltype,
      scope: data.scope,
      halign: data.halign,
      valign: data.valign,
      borderstyle: data.borderstyle,
      bordercolor: data.bordercolor,
      backgroundcolor: data.backgroundcolor
    });

    api.close();
  }
開發者ID:tinymce,項目名稱:tinymce,代碼行數:18,代碼來源:TableCellDialogSpec.ts

示例10: function

export default function () {
  const ephoxUi = SelectorFind.first('#ephox-ui').getOrDie();

  const menu = StylesMenu.sketch({
    formats: {
      menus: {
        Beta: [
          { title: 'Beta-1', isSelected: Fun.constant(false), getPreview: Fun.constant('') },
          { title: 'Beta-2', isSelected: Fun.constant(false), getPreview: Fun.constant('') },
          { title: 'Beta-3', isSelected: Fun.constant(false), getPreview: Fun.constant('') }
        ]
      },
      expansions: {
        Beta: 'Beta'
      },
      items: [
        { title: 'Alpha', isSelected: Fun.constant(false), getPreview: Fun.constant('') },
        { title: 'Beta', isSelected: Fun.constant(false), getPreview: Fun.constant('') },
        { title: 'Gamma', isSelected: Fun.constant(true), getPreview: Fun.constant('') }
      ]
    },
    handle (format) {
      // tslint:disable-next-line:no-console
      console.log('firing', format);
    }
  });

  const gui = Gui.create();
  Attachment.attachSystem(ephoxUi, gui);

  const container = GuiFactory.build({
    dom: UiDomFactory.dom('<div class="${prefix}-outer-container ${prefix}-fullscreen-maximized"></div>'),
    components: [
      {
        dom: UiDomFactory.dom('<div class="${prefix}-dropup" style="height: 500px;"></div>'),
        components: [
          menu
        ]
      }
    ]
  });

  gui.add(container);
}
開發者ID:tinymce,項目名稱:tinymce,代碼行數:44,代碼來源:StylesMenuDemo.ts


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