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


TypeScript sand.URL类代码示例

本文整理汇总了TypeScript中@ephox/sand.URL的典型用法代码示例。如果您正苦于以下问题:TypeScript URL类的具体用法?TypeScript URL怎么用?TypeScript URL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Uploader

    }, (file) => {
      const blobUri: string = URL.createObjectURL(file);

      const uploader = Uploader({
        url: info.url,
        basePath: info.basePath,
        credentials: info.credentials,
        handler: info.handler
      });

      const finalize = () => {
        api.unblock();
        URL.revokeObjectURL(blobUri);
      };

      Utils.blobToDataUri(file).then((dataUrl) => {
        const blobInfo = helpers.createBlobCache(file, blobUri, dataUrl);
        uploader.upload(blobInfo).then((url: string) => {
          api.setData({ src: { value: url, meta: { } } });
          api.showTab('General');
          changeSrc(helpers, info, state, api);
          finalize();
        }).catch((err) => {
          finalize();
          helpers.alertErr(api, err);
        });
      });
    });
开发者ID:tinymce,项目名称:tinymce,代码行数:28,代码来源:Dialog.ts

示例2: function

    cache = Arr.filter(cache, function (blobInfo) {
      if (blobInfo.blobUri() === blobUri) {
        URL.revokeObjectURL(blobInfo.blobUri());
        return false;
      }

      return true;
    });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:8,代码来源:BlobCache.ts

示例3: function

  Conversions.uriToBlob(base64Src).then(function (blob) {
    blobUriSrc = URL.createObjectURL(blob);

    viewBlock.attach();
    Pipeline.async({}, suite.toSteps({}), function () {
      viewBlock.detach();
      success();
    }, failure);
  });
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:ImageScannerTest.ts

示例4: then

          then(function (newImage) {
            const newSize = ImageSize.getNaturalImageSize(newImage);

            if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) {
              if (ImageSize.getImageSize(img)) {
                ImageSize.setImageSize(img, newSize);
              }
            }

            URL.revokeObjectURL(newImage.src);
            resolve(blob);
          });
开发者ID:abstask,项目名称:tinymce,代码行数:12,代码来源:Actions.ts

示例5: function

  return function (evt) {
    const Throbber = Factory.get('Throbber');
    const rootControl = evt.control.rootControl;
    const throbber = new Throbber(rootControl.getEl());
    const file = evt.control.value();
    const blobUri = URL.createObjectURL(file);

    const uploader = Uploader({
      url: Settings.getUploadUrl(editor),
      basePath: Settings.getUploadBasePath(editor),
      credentials: Settings.getUploadCredentials(editor),
      handler: Settings.getUploadHandler(editor)
    });

    const finalize = function () {
      throbber.hide();
      URL.revokeObjectURL(blobUri);
    };

    throbber.show();

    return Utils.blobToDataUri(file).then(function (dataUrl) {
      const blobInfo = editor.editorUpload.blobCache.create({
        blob: file,
        blobUri,
        name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, // strip extension
        base64: dataUrl.split(',')[1]
      });
      return uploader.upload(blobInfo).then(function (url) {
        const src = rootControl.find('#src');
        src.value(url);
        rootControl.find('tabpanel')[0].activateTab(0); // switch to General tab
        src.fire('change'); // this will invoke onSrcChange (and any other handlers, if any).
        finalize();
        return url;
      });
    }).catch(function (err) {
      editor.windowManager.alert(err);
      finalize();
    });
  };
开发者ID:abstask,项目名称:tinymce,代码行数:41,代码来源:UploadTab.ts

示例6: destroyState

function destroyState(state) {
  if (state) {
    URL.revokeObjectURL(state.url);
  }
}
开发者ID:danielpunkass,项目名称:tinymce,代码行数:5,代码来源:Dialog.ts

示例7: createState

function createState(blob) {
  return {
    blob,
    url: URL.createObjectURL(blob)
  };
}
开发者ID:danielpunkass,项目名称:tinymce,代码行数:6,代码来源:Dialog.ts


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