How to use the @ckeditor/ckeditor5-engine/src/model/element function in @ckeditor/ckeditor5-engine

To help you get started, we’ve selected a few @ckeditor/ckeditor5-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
editor.document.enqueueChanges( () => {
          const imageElement1 = new ModelElement( 'image', { src: '../../assets/images/never.png'});
          const imageElement2 = new ModelElement( 'image', { src: '../../assets/images/once.png'});
          const imageElement3 = new ModelElement( 'image', { src: '../../assets/images/few.png'});
          const imageElement4 = new ModelElement( 'image', { src: '../../assets/images/many.png'});

          // const prb1 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'never'}, [imageElement1])
          // const prb2 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'once'}, [imageElement2])
          // const prb3 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'few'}, [imageElement3])
          // const prb4 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'many'}, [imageElement4])

          // const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [prb1, prb2, prb3, prb4])
          const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [imageElement1, imageElement2, imageElement3, imageElement4])
          const form = new ModelElement( 'form', {'id': formName, 'onchange': ''}, [acasi])

          editor.data.insertContent( form, editor.document.selection );
        } );
      });
github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
editor.document.enqueueChanges( () => {
          const imageElement1 = new ModelElement( 'image', { src: '../../assets/images/never.png'});
          const imageElement2 = new ModelElement( 'image', { src: '../../assets/images/once.png'});
          const imageElement3 = new ModelElement( 'image', { src: '../../assets/images/few.png'});
          const imageElement4 = new ModelElement( 'image', { src: '../../assets/images/many.png'});

          // const prb1 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'never'}, [imageElement1])
          // const prb2 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'once'}, [imageElement2])
          // const prb3 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'few'}, [imageElement3])
          // const prb4 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'many'}, [imageElement4])

          // const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [prb1, prb2, prb3, prb4])
          const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [imageElement1, imageElement2, imageElement3, imageElement4])
          const form = new ModelElement( 'form', {'id': formName, 'onchange': ''}, [acasi])

          editor.data.insertContent( form, editor.document.selection );
        } );
      });
github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
editor.document.enqueueChanges( () => {
          const imageElement1 = new ModelElement( 'image', { src: '../../assets/images/never.png'});
          const imageElement2 = new ModelElement( 'image', { src: '../../assets/images/once.png'});
          const imageElement3 = new ModelElement( 'image', { src: '../../assets/images/few.png'});
          const imageElement4 = new ModelElement( 'image', { src: '../../assets/images/many.png'});

          // const prb1 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'never'}, [imageElement1])
          // const prb2 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'once'}, [imageElement2])
          // const prb3 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'few'}, [imageElement3])
          // const prb4 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'many'}, [imageElement4])

          // const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [prb1, prb2, prb3, prb4])
          const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [imageElement1, imageElement2, imageElement3, imageElement4])
          const form = new ModelElement( 'form', {'id': formName, 'onchange': ''}, [acasi])

          editor.data.insertContent( form, editor.document.selection );
        } );
      });
github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
editor.document.enqueueChanges( () => {
          const imageElement1 = new ModelElement( 'image', { src: '../../assets/images/never.png'});
          const imageElement2 = new ModelElement( 'image', { src: '../../assets/images/once.png'});
          const imageElement3 = new ModelElement( 'image', { src: '../../assets/images/few.png'});
          const imageElement4 = new ModelElement( 'image', { src: '../../assets/images/many.png'});

          // const prb1 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'never'}, [imageElement1])
          // const prb2 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'once'}, [imageElement2])
          // const prb3 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'few'}, [imageElement3])
          // const prb4 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'many'}, [imageElement4])

          // const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [prb1, prb2, prb3, prb4])
          const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [imageElement1, imageElement2, imageElement3, imageElement4])
          const form = new ModelElement( 'form', {'id': formName, 'onchange': ''}, [acasi])

          editor.data.insertContent( form, editor.document.selection );
        } );
      });
github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
editor.document.enqueueChanges( () => {
          const imageElement1 = new ModelElement( 'image', { src: '../../assets/images/never.png'});
          const imageElement2 = new ModelElement( 'image', { src: '../../assets/images/once.png'});
          const imageElement3 = new ModelElement( 'image', { src: '../../assets/images/few.png'});
          const imageElement4 = new ModelElement( 'image', { src: '../../assets/images/many.png'});

          // const prb1 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'never'}, [imageElement1])
          // const prb2 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'once'}, [imageElement2])
          // const prb3 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'few'}, [imageElement3])
          // const prb4 = new ModelElement( 'paper-radio-button', {'name':name, 'value': 'many'}, [imageElement4])

          // const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [prb1, prb2, prb3, prb4])
          const acasi = new ModelElement( 'tangy-acasi', {'intro-src':url, 'name': taName}, [imageElement1, imageElement2, imageElement3, imageElement4])
          const form = new ModelElement( 'form', {'id': formName, 'onchange': ''}, [acasi])

          editor.data.insertContent( form, editor.document.selection );
        } );
      });
github ckeditor / ckeditor5-image / tests / image / utils.js View on Github external
it( 'should return true for image element', () => {
			const image = new ModelElement( 'image' );

			expect( isImage( image ) ).to.be.true;
		} );
github ckeditor / ckeditor5-image / tests / imagecaption / utils.js View on Github external
it( 'should return caption element from image element', () => {
			const dummy = new ModelElement( 'dummy' );
			const caption = new ModelElement( 'caption' );
			const image = new ModelElement( 'image', null, [ dummy, caption ] );

			expect( getCaptionFromImage( image ) ).to.equal( caption );
		} );
github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
.toElement( (viewImage) => {
        return new ModelElement('form', {id: viewImage.getAttribute('id')})
        });
github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
}).toElement(viewImage => {
      return new ModelElement('tangy-acasi', {'intro-src': viewImage.getAttribute('intro-src'), 'name': viewImage.getAttribute('name')})
    });
github Tangerine-Community / Tangerine / client-v3 / ckeditor / plugins / ckeditor5-acasi / src / acasi.js View on Github external
    }).toElement(viewImage => new ModelElement('figure', { 'class': viewImage.getAttribute('class') }));