imageediting.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global document, Event */
  6. import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
  7. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  8. import ImageEditing from '../../src/image/imageediting';
  9. import ImageLoadObserver from '../../src/image/imageloadobserver';
  10. import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
  11. import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
  12. import { isImageWidget } from '../../src/image/utils';
  13. import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';
  14. import env from '@ckeditor/ckeditor5-utils/src/env';
  15. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  16. describe( 'ImageEditing', () => {
  17. let editor, model, doc, view, viewDocument;
  18. testUtils.createSinonSandbox();
  19. beforeEach( () => {
  20. // Most tests assume non-edge environment but we do not set `contenteditable=false` on Edge so stub `env.isEdge`.
  21. testUtils.sinon.stub( env, 'isEdge' ).get( () => false );
  22. return VirtualTestEditor
  23. .create( {
  24. plugins: [ ImageEditing ]
  25. } )
  26. .then( newEditor => {
  27. editor = newEditor;
  28. model = editor.model;
  29. doc = model.document;
  30. view = editor.editing.view;
  31. viewDocument = view.document;
  32. } );
  33. } );
  34. it( 'should be loaded', () => {
  35. expect( editor.plugins.get( ImageEditing ) ).to.be.instanceOf( ImageEditing );
  36. } );
  37. it( 'should set proper schema rules', () => {
  38. expect( model.schema.checkChild( [ '$root' ], 'image' ) ).to.be.true;
  39. expect( model.schema.checkAttribute( [ '$root', 'image' ], 'src' ) ).to.be.true;
  40. expect( model.schema.checkAttribute( [ '$root', 'image' ], 'alt' ) ).to.be.true;
  41. expect( model.schema.isObject( 'image' ) ).to.be.true;
  42. expect( model.schema.checkChild( [ '$root', 'image' ], 'image' ) ).to.be.false;
  43. expect( model.schema.checkChild( [ '$root', 'image' ], '$text' ) ).to.be.false;
  44. expect( model.schema.checkChild( [ '$root', '$block' ], 'image' ) ).to.be.false;
  45. } );
  46. it( 'should register ImageLoadObserver', () => {
  47. expect( view.getObserver( ImageLoadObserver ) ).to.be.instanceOf( ImageLoadObserver );
  48. } );
  49. // See https://github.com/ckeditor/ckeditor5-image/issues/142.
  50. it( 'should update the ui after image has been loaded in the DOM', () => {
  51. const element = document.createElement( 'div' );
  52. document.body.appendChild( element );
  53. ClassicTestEditor.create( element, {
  54. plugins: [ ImageEditing ]
  55. } ).then( editor => {
  56. editor.data.set( '<figure class="image"><img src="foo.png" alt="bar" /></figure>' );
  57. const spy = sinon.spy();
  58. editor.ui.on( 'update', spy );
  59. element.querySelector( 'img' ).dispatchEvent( new Event( 'load' ) );
  60. sinon.assert.calledOnce( spy );
  61. return editor.destroy().then( () => element.remove() );
  62. } );
  63. } );
  64. describe( 'conversion in data pipeline', () => {
  65. describe( 'model to view', () => {
  66. it( 'should convert', () => {
  67. setModelData( model, '<image src="foo.png" alt="alt text"></image>' );
  68. expect( editor.getData() ).to.equal( '<figure class="image"><img alt="alt text" src="foo.png"></figure>' );
  69. } );
  70. it( 'should convert without alt attribute', () => {
  71. setModelData( model, '<image src="foo.png"></image>' );
  72. expect( editor.getData() ).to.equal( '<figure class="image"><img src="foo.png"></figure>' );
  73. } );
  74. it( 'should convert srcset attribute to srcset and sizes attribute', () => {
  75. setModelData( model,
  76. '<image src="foo.png" alt="alt text" srcset=\'{ "data": "small.png 148w, big.png 1024w" }\'></image>'
  77. );
  78. expect( normalizeHtml( editor.getData() ) ).to.equal(
  79. '<figure class="image">' +
  80. '<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w"></img>' +
  81. '</figure>'
  82. );
  83. } );
  84. it( 'should convert srcset attribute to width, srcset and add sizes attribute', () => {
  85. setModelData( model,
  86. '<image ' +
  87. 'src="foo.png" ' +
  88. 'alt="alt text" ' +
  89. 'srcset=\'{ "data": "small.png 148w, big.png 1024w", "width": "1024" }\'>' +
  90. '</image>'
  91. );
  92. expect( normalizeHtml( editor.getData() ) ).to.equal(
  93. '<figure class="image">' +
  94. '<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w" width="1024"></img>' +
  95. '</figure>'
  96. );
  97. } );
  98. it( 'should not convert srcset attribute if is already consumed', () => {
  99. editor.data.downcastDispatcher.on( 'attribute:srcset:image', ( evt, data, conversionApi ) => {
  100. const modelImage = data.item;
  101. conversionApi.consumable.consume( modelImage, evt.name );
  102. }, { priority: 'high' } );
  103. setModelData( model,
  104. '<image ' +
  105. 'src="foo.png" ' +
  106. 'alt="alt text" ' +
  107. 'srcset=\'{ "data": "small.png 148w, big.png 1024w", "width": "1024" }\'>' +
  108. '</image>'
  109. );
  110. expect( editor.getData() ).to.equal(
  111. '<figure class="image">' +
  112. '<img alt="alt text" src="foo.png">' +
  113. '</figure>'
  114. );
  115. } );
  116. it( 'should not convert srcset attribute if has wrong data', () => {
  117. setModelData( model,
  118. '<image ' +
  119. 'src="foo.png" ' +
  120. 'alt="alt text" ' +
  121. 'srcset=\'{ "foo":"bar" }\'>' +
  122. '</image>' );
  123. const image = doc.getRoot().getChild( 0 );
  124. model.change( writer => {
  125. writer.removeAttribute( 'srcset', image );
  126. } );
  127. expect( editor.getData() ).to.equal(
  128. '<figure class="image">' +
  129. '<img alt="alt text" src="foo.png">' +
  130. '</figure>'
  131. );
  132. } );
  133. } );
  134. describe( 'view to model', () => {
  135. it( 'should convert image figure', () => {
  136. editor.setData( '<figure class="image"><img src="foo.png" alt="alt text" /></figure>' );
  137. expect( getModelData( model, { withoutSelection: true } ) )
  138. .to.equal( '<image alt="alt text" src="foo.png"></image>' );
  139. } );
  140. it( 'should not convert if there is no image class', () => {
  141. editor.setData( '<figure class="quote">My quote</figure>' );
  142. expect( getModelData( model, { withoutSelection: true } ) )
  143. .to.equal( '' );
  144. } );
  145. it( 'should not convert if there is no img inside #1', () => {
  146. editor.setData( '<figure class="image"></figure>' );
  147. expect( getModelData( model, { withoutSelection: true } ) )
  148. .to.equal( '' );
  149. } );
  150. it( 'should not convert if there is no img inside #2', () => {
  151. editor.setData( '<figure class="image">test</figure>' );
  152. expect( getModelData( model, { withoutSelection: true } ) )
  153. .to.equal( '' );
  154. } );
  155. it( 'should convert without alt attribute', () => {
  156. editor.setData( '<figure class="image"><img src="foo.png" /></figure>' );
  157. expect( getModelData( model, { withoutSelection: true } ) )
  158. .to.equal( '<image src="foo.png"></image>' );
  159. } );
  160. it( 'should not convert without src attribute', () => {
  161. editor.setData( '<figure class="image"><img alt="alt text" /></figure>' );
  162. expect( getModelData( model, { withoutSelection: true } ) )
  163. .to.equal( '' );
  164. } );
  165. it( 'should not convert in wrong context', () => {
  166. model.schema.register( 'div', { inheritAllFrom: '$block' } );
  167. model.schema.addChildCheck( ( ctx, childDef ) => {
  168. if ( ctx.endsWith( '$root' ) && childDef.name == 'image' ) {
  169. return false;
  170. }
  171. } );
  172. editor.conversion.elementToElement( { model: 'div', view: 'div' } );
  173. editor.setData( '<div><figure class="image"><img src="foo.png" alt="alt text" /></figure></div>' );
  174. expect( getModelData( model, { withoutSelection: true } ) )
  175. .to.equal( '<div></div>' );
  176. } );
  177. it( 'should not convert if img is already consumed', () => {
  178. editor.data.upcastDispatcher.on( 'element:figure', ( evt, data, conversionApi ) => {
  179. const img = data.viewItem.getChild( 0 );
  180. conversionApi.consumable.consume( img, { name: true } );
  181. }, { priority: 'high' } );
  182. editor.setData( '<figure class="image"><img src="foo.png" alt="alt text" /></figure>' );
  183. expect( getModelData( model, { withoutSelection: true } ) )
  184. .to.equal( '' );
  185. } );
  186. it( 'should not convert if figure is already consumed', () => {
  187. editor.data.upcastDispatcher.on( 'element:figure', ( evt, data, conversionApi ) => {
  188. conversionApi.consumable.consume( data.viewItem, { name: true, class: 'image' } );
  189. }, { priority: 'high' } );
  190. editor.setData( '<figure class="image"><img src="foo.png" alt="alt text" /></figure>' );
  191. expect( getModelData( model, { withoutSelection: true } ) )
  192. .to.equal( '' );
  193. } );
  194. it( 'should dispatch conversion for nested elements', () => {
  195. const conversionSpy = sinon.spy();
  196. editor.data.upcastDispatcher.on( 'element:figcaption', conversionSpy );
  197. editor.setData( '<figure class="image"><img src="foo.png" alt="alt text" /><figcaption></figcaption></figure>' );
  198. sinon.assert.calledOnce( conversionSpy );
  199. } );
  200. it( 'should convert bare img element', () => {
  201. editor.setData( '<img src="foo.png" alt="alt text" />' );
  202. expect( getModelData( model, { withoutSelection: true } ) )
  203. .to.equal( '<image alt="alt text" src="foo.png"></image>' );
  204. } );
  205. it( 'should not convert alt attribute on non-img element', () => {
  206. model.schema.register( 'div', {
  207. inheritAllFrom: '$block',
  208. allowAttributes: 'alt'
  209. } );
  210. editor.conversion.elementToElement( { model: 'div', view: 'div' } );
  211. editor.setData( '<div alt="foo"></div>' );
  212. expect( getModelData( model, { withoutSelection: true } ) ).to.equal( '<div></div>' );
  213. } );
  214. it( 'should convert image with srcset attribute', () => {
  215. editor.setData(
  216. '<figure class="image">' +
  217. '<img src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w" />' +
  218. '</figure>'
  219. );
  220. expect( getModelData( model, { withoutSelection: true } ) )
  221. .to.equal( '<image alt="alt text" src="foo.png" srcset="{"data":"small.png 148w, big.png 1024w"}"></image>' );
  222. } );
  223. it( 'should convert image with srcset and width attributes', () => {
  224. editor.setData(
  225. '<figure class="image">' +
  226. '<img src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w" width="1024" />' +
  227. '</figure>'
  228. );
  229. expect( getModelData( model, { withoutSelection: true } ) ).to.equal(
  230. '<image alt="alt text" src="foo.png" srcset="{"data":"small.png 148w, big.png 1024w","width":"1024"}"></image>' );
  231. } );
  232. it( 'should ignore sizes attribute', () => {
  233. editor.setData(
  234. '<figure class="image">' +
  235. '<img src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w" sizes="50vw" />' +
  236. '</figure>'
  237. );
  238. expect( getModelData( model, { withoutSelection: true } ) )
  239. .to.equal( '<image alt="alt text" src="foo.png" srcset="{"data":"small.png 148w, big.png 1024w"}"></image>' );
  240. } );
  241. describe( 'should autohoist images', () => {
  242. beforeEach( () => {
  243. model.schema.register( 'div', { inheritAllFrom: '$block' } );
  244. editor.conversion.elementToElement( { model: 'div', view: 'div' } );
  245. } );
  246. it( 'image between non-hoisted elements', () => {
  247. editor.setData( '<div>foo<img src="foo.jpg" alt="foo" />bar</div>' );
  248. expect( getModelData( model, { withoutSelection: true } ) ).to.equal(
  249. '<div>foo</div>' +
  250. '<image alt="foo" src="foo.jpg"></image>' +
  251. '<div>bar</div>'
  252. );
  253. } );
  254. it( 'multiple images', () => {
  255. editor.setData( '<div>foo<img src="foo.jpg" alt="foo" />ba<img src="foo.jpg" alt="foo" />r</div>' );
  256. expect( getModelData( model, { withoutSelection: true } ) ).to.equal(
  257. '<div>foo</div>' +
  258. '<image alt="foo" src="foo.jpg"></image>' +
  259. '<div>ba</div>' +
  260. '<image alt="foo" src="foo.jpg"></image>' +
  261. '<div>r</div>'
  262. );
  263. } );
  264. it( 'images on borders of parent', () => {
  265. editor.setData( '<div><img src="foo.jpg" alt="foo" />foobar<img src="foo.jpg" alt="foo" /></div>' );
  266. expect( getModelData( model, { withoutSelection: true } ) ).to.equal(
  267. '<image alt="foo" src="foo.jpg"></image>' +
  268. '<div>foobar</div>' +
  269. '<image alt="foo" src="foo.jpg"></image>'
  270. );
  271. } );
  272. it( 'images are only content of parent', () => {
  273. editor.setData( '<div><img src="foo.jpg" alt="foo" /><img src="foo.jpg" alt="foo" /></div>' );
  274. expect( getModelData( model, { withoutSelection: true } ) ).to.equal(
  275. '<image alt="foo" src="foo.jpg"></image>' +
  276. '<image alt="foo" src="foo.jpg"></image>'
  277. );
  278. } );
  279. it( 'deep autohoisting #1', () => {
  280. model.schema.extend( 'div', { allowIn: 'div' } );
  281. editor.setData( '<div>foo<div>xx<img src="foo.jpg" alt="foo" /></div>bar</div>' );
  282. expect( getModelData( model, { withoutSelection: true } ) ).to.equal(
  283. '<div>' +
  284. 'foo' +
  285. '<div>' +
  286. 'xx' +
  287. '</div>' +
  288. '</div>' +
  289. '<image alt="foo" src="foo.jpg"></image>' +
  290. '<div>bar</div>'
  291. );
  292. } );
  293. it( 'deep autohoisting #2', () => {
  294. model.schema.extend( 'div', { allowIn: 'div' } );
  295. editor.setData(
  296. '<div>x</div>' +
  297. '<div><div><div><img src="foo.jpg" alt="foo" /></div></div></div>' +
  298. '<div>y</div>'
  299. );
  300. expect( getModelData( model, { withoutSelection: true } ) ).to.equal(
  301. '<div>x</div><image alt="foo" src="foo.jpg"></image><div>y</div>'
  302. );
  303. } );
  304. it( 'should not break a limiting element', () => {
  305. model.schema.register( 'limit', {
  306. inheritAllFrom: '$block',
  307. isLimit: true
  308. } );
  309. model.schema.extend( 'div', { allowIn: 'limit' } );
  310. editor.conversion.elementToElement( { model: 'limit', view: 'limit' } );
  311. editor.setData( '<limit><div>foo<img src="foo.jpg" alt="foo" />bar</div></limit>' );
  312. // <limit> element does not have converters so it is not converted.
  313. expect( getModelData( model, { withoutSelection: true } ) ).to.equal( '<limit><div>foobar</div></limit>' );
  314. } );
  315. it( 'should not convert and autohoist image element without src attribute (which is not allowed by schema)', () => {
  316. editor.setData( '<div>foo<img alt="foo" />bar</div>' );
  317. expect( getModelData( model, { withoutSelection: true } ) ).to.equal( '<div>foobar</div>' );
  318. } );
  319. } );
  320. } );
  321. } );
  322. describe( 'conversion in editing pipeline', () => {
  323. describe( 'model to view', () => {
  324. it( 'should convert', () => {
  325. setModelData( model, '<image src="foo.png" alt="alt text"></image>' );
  326. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  327. '<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
  328. );
  329. } );
  330. it( 'converted element should be widgetized', () => {
  331. setModelData( model, '<image src="foo.png" alt="alt text"></image>' );
  332. const figure = viewDocument.getRoot().getChild( 0 );
  333. expect( figure.name ).to.equal( 'figure' );
  334. expect( isImageWidget( figure ) ).to.be.true;
  335. } );
  336. it( 'should convert attribute change', () => {
  337. setModelData( model, '<image src="foo.png" alt="alt text"></image>' );
  338. const image = doc.getRoot().getChild( 0 );
  339. model.change( writer => {
  340. writer.setAttribute( 'alt', 'new text', image );
  341. } );
  342. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  343. '<figure class="ck-widget image" contenteditable="false"><img alt="new text" src="foo.png"></img></figure>'
  344. );
  345. } );
  346. it( 'should convert attribute removal', () => {
  347. setModelData( model, '<image src="foo.png" alt="alt text"></image>' );
  348. const image = doc.getRoot().getChild( 0 );
  349. model.change( writer => {
  350. writer.removeAttribute( 'alt', image );
  351. } );
  352. expect( getViewData( view, { withoutSelection: true } ) )
  353. .to.equal( '<figure class="ck-widget image" contenteditable="false"><img src="foo.png"></img></figure>' );
  354. } );
  355. it( 'should not convert change if is already consumed', () => {
  356. setModelData( model, '<image src="foo.png" alt="alt text"></image>' );
  357. const image = doc.getRoot().getChild( 0 );
  358. editor.editing.downcastDispatcher.on( 'attribute:alt:image', ( evt, data, conversionApi ) => {
  359. conversionApi.consumable.consume( data.item, 'attribute:alt' );
  360. }, { priority: 'high' } );
  361. model.change( writer => {
  362. writer.removeAttribute( 'alt', image );
  363. } );
  364. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  365. '<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
  366. );
  367. } );
  368. it( 'should convert srcset attribute to srcset and sizes', () => {
  369. setModelData( model,
  370. '<image ' +
  371. 'src="foo.png" ' +
  372. 'alt="alt text" ' +
  373. 'srcset=\'{ "data":"small.png 148w, big.png 1024w" }\'>' +
  374. '</image>' );
  375. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  376. '<figure class="ck-widget image" contenteditable="false">' +
  377. '<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w"></img>' +
  378. '</figure>'
  379. );
  380. } );
  381. it( 'should not convert srcset attribute if has wrong data', () => {
  382. setModelData( model,
  383. '<image ' +
  384. 'src="foo.png" ' +
  385. 'alt="alt text" ' +
  386. 'srcset=\'{ "foo":"bar" }\'>' +
  387. '</image>' );
  388. const image = doc.getRoot().getChild( 0 );
  389. model.change( writer => {
  390. writer.removeAttribute( 'srcset', image );
  391. } );
  392. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  393. '<figure class="ck-widget image" contenteditable="false">' +
  394. '<img alt="alt text" src="foo.png"></img>' +
  395. '</figure>'
  396. );
  397. } );
  398. it( 'should convert srcset attribute to srcset, width and sizes', () => {
  399. setModelData( model,
  400. '<image ' +
  401. 'src="foo.png" ' +
  402. 'alt="alt text" ' +
  403. 'srcset=\'{ "data":"small.png 148w, big.png 1024w", "width":"1024" }\'>' +
  404. '</image>' );
  405. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  406. '<figure class="ck-widget image" contenteditable="false">' +
  407. '<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w" width="1024"></img>' +
  408. '</figure>'
  409. );
  410. } );
  411. it( 'should remove sizes and srcsset attribute when srcset attribute is removed from model', () => {
  412. setModelData( model, '<image src="foo.png" srcset=\'{ "data": "small.png 148w, big.png 1024w" }\'></image>' );
  413. const image = doc.getRoot().getChild( 0 );
  414. model.change( writer => {
  415. writer.removeAttribute( 'srcset', image );
  416. } );
  417. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  418. '<figure class="ck-widget image" contenteditable="false">' +
  419. '<img src="foo.png"></img>' +
  420. '</figure>'
  421. );
  422. } );
  423. it( 'should remove width, sizes and srcsset attribute when srcset attribute is removed from model', () => {
  424. setModelData( model,
  425. '<image ' +
  426. 'src="foo.png" ' +
  427. 'srcset=\'{ "data": "small.png 148w, big.png 1024w", "width": "1024" }\'>' +
  428. '</image>'
  429. );
  430. const image = doc.getRoot().getChild( 0 );
  431. model.change( writer => {
  432. writer.removeAttribute( 'srcset', image );
  433. } );
  434. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  435. '<figure class="ck-widget image" contenteditable="false">' +
  436. '<img src="foo.png"></img>' +
  437. '</figure>'
  438. );
  439. } );
  440. it( 'should not convert srcset attribute if is already consumed', () => {
  441. editor.editing.downcastDispatcher.on( 'attribute:srcset:image', ( evt, data, conversionApi ) => {
  442. const modelImage = data.item;
  443. conversionApi.consumable.consume( modelImage, evt.name );
  444. }, { priority: 'high' } );
  445. setModelData( model,
  446. '<image ' +
  447. 'src="foo.png" ' +
  448. 'alt="alt text" ' +
  449. 'srcset=\'{ "data": "small.png 148w, big.png 1024w", "width": "1024" }\'>' +
  450. '</image>'
  451. );
  452. expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
  453. '<figure class="ck-widget image" contenteditable="false">' +
  454. '<img alt="alt text" src="foo.png"></img>' +
  455. '</figure>'
  456. );
  457. } );
  458. } );
  459. } );
  460. } );