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


TypeScript EditorManager.overrideDefaults函数代码示例

本文整理汇总了TypeScript中tinymce/core/api/EditorManager.overrideDefaults函数的典型用法代码示例。如果您正苦于以下问题:TypeScript overrideDefaults函数的具体用法?TypeScript overrideDefaults怎么用?TypeScript overrideDefaults使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: function

  suite.test('overrideDefaults', function () {
    let oldBaseURI, oldBaseUrl, oldSuffix;

    oldBaseURI = EditorManager.baseURI;
    oldBaseUrl = EditorManager.baseURL;
    oldSuffix = EditorManager.suffix;

    EditorManager.overrideDefaults({
      test: 42,
      base_url: 'http://www.EditorManager.com/base/',
      suffix: 'x',
      external_plugins: {
        plugina: '//domain/plugina.js',
        pluginb: '//domain/pluginb.js'
      },
      plugin_base_urls: {
        testplugin: 'http://custom.ephox.com/dir/testplugin'
      }
    });

    LegacyUnit.strictEqual(EditorManager.baseURI.path, '/base');
    LegacyUnit.strictEqual(EditorManager.baseURL, 'http://www.EditorManager.com/base');
    LegacyUnit.strictEqual(EditorManager.suffix, 'x');
    LegacyUnit.strictEqual(new Editor('ed1', {}, EditorManager).settings.test, 42);
    LegacyUnit.strictEqual(PluginManager.urls.testplugin, 'http://custom.ephox.com/dir/testplugin');

    LegacyUnit.equal(new Editor('ed2', {
      skin_url: '/project/js/tinymce/skins/lightgray',
      external_plugins: {
        plugina: '//domain/plugina2.js',
        pluginc: '//domain/pluginc.js'
      },
      plugin_base_urls: {
        testplugin: 'http://custom.ephox.com/dir/testplugin'
      }
    }, EditorManager).settings.external_plugins, {
      plugina: '//domain/plugina2.js',
      pluginb: '//domain/pluginb.js',
      pluginc: '//domain/pluginc.js'
    });

    LegacyUnit.equal(new Editor('ed3', {
      skin_url: '/project/js/tinymce/skins/lightgray'
    }, EditorManager).settings.external_plugins, {
      plugina: '//domain/plugina.js',
      pluginb: '//domain/pluginb.js'
    });

    EditorManager.baseURI = oldBaseURI;
    EditorManager.baseURL = oldBaseUrl;
    EditorManager.suffix = oldSuffix;

    EditorManager.overrideDefaults({});
  });
开发者ID:abstask,项目名称:tinymce,代码行数:54,代码来源:EditorManagerTest.ts

示例2: function

UnitTest.asynctest('browser.tinymce.core.EditorRtlTest', function () {
  const success = arguments[arguments.length - 2];
  const failure = arguments[arguments.length - 1];
  const suite = LegacyUnit.createSuite();

  Theme();

  const teardown = function () {
    I18n.rtl = false;
    I18n.setCode('en');
    Factory.get('Control').rtl = false;
  };

  suite.test('UI rendered in RTL mode', function () {
    LegacyUnit.equal(EditorManager.activeEditor.getContainer().className.indexOf('mce-rtl') !== -1, true, 'Should have a mce-rtl class');
    LegacyUnit.equal(EditorManager.activeEditor.rtl, true, 'Should have the rtl property set');
  });

  EditorManager.addI18n('ar', {
    Bold: 'Bold test',
    _dir: 'rtl'
  });

  // Prevents the arabic language pack from being loaded
  EditorManager.overrideDefaults({
    base_url: '/project/tinymce'
  });
  ScriptLoader.ScriptLoader.markDone('http://' + document.location.host + '/project/tinymce/langs/ar.js');

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    Pipeline.async({}, suite.toSteps(editor), function () {
      teardown();
      onSuccess();
    }, onFailure);
  }, {
    language: 'ar',
    selector: 'textarea',
    add_unload_trigger: false,
    disable_nodechange: true,
    entities: 'raw',
    indent: false,
    skin_url: '/project/js/tinymce/skins/lightgray'
  }, success, failure);
});
开发者ID:abstask,项目名称:tinymce,代码行数:44,代码来源:EditorRtlTest.ts


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