Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 );
} );
});
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 );
} );
});
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 );
} );
});
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 );
} );
});
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 );
} );
});
it( 'should return true for image element', () => {
const image = new ModelElement( 'image' );
expect( isImage( image ) ).to.be.true;
} );
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 );
} );
.toElement( (viewImage) => {
return new ModelElement('form', {id: viewImage.getAttribute('id')})
});
}).toElement(viewImage => {
return new ModelElement('tangy-acasi', {'intro-src': viewImage.getAttribute('intro-src'), 'name': viewImage.getAttribute('name')})
});
}).toElement(viewImage => new ModelElement('figure', { 'class': viewImage.getAttribute('class') }));