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


TypeScript LegacyUnit.equal方法代碼示例

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


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

示例1: function

 suite.test('custom elements', function (editor) {
   editor.setContent('<custom1>c1</custom1><custom2>c1</custom2>');
   LegacyUnit.equal(editor.getContent(), '<custom1>c1</custom1><p><custom2>c1</custom2></p>');
 });
開發者ID:tinymce,項目名稱:tinymce,代碼行數:4,代碼來源:EditorTest.ts

示例2: function

 const ok = function (a, label) {
   LegacyUnit.equal(a, true, label);
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:3,代碼來源:SelectionOverridesTest.ts

示例3: function

 suite.test('TestCase-TBA: LegacyOutput: Font face', function (editor) {
   editor.setContent('<p>text</p>');
   LegacyUnit.setSelection(editor, 'p', 0, 'p', 4);
   editor.execCommand('fontname', false, 'times');
   LegacyUnit.equal(editor.getContent(), '<p><font face="times">text</font></p>');
 });
開發者ID:tinymce,項目名稱:tinymce,代碼行數:6,代碼來源:LegacyOutputPluginTest.ts

示例4: function

 suite.test('create element index from bogus', function () {
   setupHtml('<b></b><span data-mce-bogus="1"><b></b><span data-mce-bogus="1"><b></b><b></b></span></span>');
   LegacyUnit.equal(CaretBookmark.create(getRoot(), CaretPosition.before(getRoot().lastChild.lastChild.childNodes[1])), 'b[3],before');
 });
開發者ID:abstask,項目名稱:tinymce,代碼行數:4,代碼來源:CaretBookmarkTest.ts

示例5: function

 suite.test('isFakeCaretTarget', function () {
   LegacyUnit.equal(false, isFakeCaretTarget(Element.fromHtml('<p></p>').dom()), 'Should not need a fake caret');
   LegacyUnit.equal(true, isFakeCaretTarget(Element.fromHtml('<p contenteditable="false"></p>').dom()), 'Should always need a fake caret');
   LegacyUnit.equal(isTableNavigationBrowser(), isFakeCaretTarget(Element.fromHtml('<table></table>').dom()), 'Should on some browsers need a fake caret');
 });
開發者ID:enigmatic-user,項目名稱:tinymce-1,代碼行數:5,代碼來源:FakeCaretTest.ts

示例6: function

  suite.test('Compress styles', function () {
    const styles = Styles();

    LegacyUnit.equal(
      styles.serialize(
        styles.parse('border-top: 1px solid red; border-left: 1px solid red; border-bottom: 1px solid red; border-right: 1px solid red;')
      ),
      'border: 1px solid red;'
    );

    LegacyUnit.equal(
      styles.serialize(
        styles.parse('border-width: 1pt 1pt 1pt 1pt; border-style: none none none none; border-color: black black black black;')
      ),
      'border: 1pt none black;'
    );

    LegacyUnit.equal(
      styles.serialize(
        styles.parse('border-width: 1pt 4pt 2pt 3pt; border-style: solid dashed dotted none; border-color: black red green blue;')
      ),
      'border-width: 1pt 4pt 2pt 3pt; border-style: solid dashed dotted none; border-color: black red green blue;'
    );

    LegacyUnit.equal(
      styles.serialize(
        styles.parse('border-top: 1px solid red; border-left: 1px solid red; border-right: 1px solid red; border-bottom: 1px solid red')
      ),
      'border: 1px solid red;'
    );

    LegacyUnit.equal(
      styles.serialize(
        styles.parse('border-top: 1px solid red; border-right: 2px solid red; border-bottom: 3px solid red; border-left: 4px solid red')
      ),
      'border-top: 1px solid red; border-right: 2px solid red; border-bottom: 3px solid red; border-left: 4px solid red;'
    );

    LegacyUnit.equal(
      styles.serialize(
        styles.parse('padding-top: 1px; padding-right: 2px; padding-bottom: 3px; padding-left: 4px')
      ),
      'padding: 1px 2px 3px 4px;'
    );

    LegacyUnit.equal(
      styles.serialize(styles.parse('margin-top: 1px; margin-right: 2px; margin-bottom: 3px; margin-left: 4px')),
      'margin: 1px 2px 3px 4px;'
    );

    LegacyUnit.equal(
      styles.serialize(styles.parse('margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 2px')),
      'margin: 1px 1px 1px 2px;'
    );

    LegacyUnit.equal(
      styles.serialize(styles.parse('margin-top: 2px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px')),
      'margin: 2px 1px 1px 1px;'
    );

    LegacyUnit.equal(
      styles.serialize(
        styles.parse('border-top-color: red; border-right-color: green; border-bottom-color: blue; border-left-color: yellow')
      ),
      'border-color: red green blue yellow;'
    );

    LegacyUnit.equal(
      styles.serialize(styles.parse('border-width: 1px; border-style: solid; border-color: red')),
      'border: 1px solid red;'
    );

    LegacyUnit.equal(
      styles.serialize(styles.parse('border-width: 1px; border-color: red')),
      'border-width: 1px; border-color: red;'
    );
  });
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:77,代碼來源:StylesTest.ts

示例7: Promise

 return new Promise(function (resolve) {
   const pickerCtrl = getFilePickerCtrl(editor);
   LegacyUnit.equal(pickerCtrl.value(), expectedValue, 'Should have the correct file picker value');
   resolve(pickerCtrl);
 });
開發者ID:abstask,項目名稱:tinymce,代碼行數:5,代碼來源:FilePickerTest.ts


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