Explorar el Código

Changed builder so it outputs a Model for IconManagerView.

Aleksander Nowodzinski hace 9 años
padre
commit
2051b8d524

+ 23 - 0
dev/tasks/build/iconmanagermodel.tpl

@@ -0,0 +1,23 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+'use strict';
+
+import Model from '/ckeditor5/ui/model.js';
+
+const iconIds = [ {{#shapes}}'{{name}}',{{/shapes}} ];
+const iconPrefix = 'ck-icon-';
+
+/**
+ * Provides a Model containing icon sprite form IconManagerView.
+ *
+ * @memberOf ui.iconManagerModel
+ * @extends ui.Model
+ */
+
+export default new Model( {
+	icons: iconIds.map( i => i.slice( iconPrefix.length ) ),
+	sprite: `{{#shapes}}{{{svg}}}{{/shapes}}`
+} );

+ 0 - 8
dev/tasks/build/icons-template.js

@@ -1,8 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-export default `{{#shapes}}{{{svg}}}{{/shapes}}`;

+ 1 - 1
dev/tasks/build/tasks.js

@@ -292,7 +292,7 @@ module.exports = ( config ) => {
 			},
 
 			/**
-			 * The task capable of converting *.svg icon files into `./build/[formats]/theme/icons.js`
+			 * The task capable of converting *.svg icon files into `./build/[formats]/theme/iconmanagermodel.js`
 			 * sprite.
 			 *
 			 * @param {Object} options

+ 2 - 2
dev/tasks/build/utils.js

@@ -551,8 +551,8 @@ require( [ 'tests' ], bender.defer(), function( err ) {
 					inline: true,
 					render: {
 						js: {
-							template: path.join( __dirname, 'icons-template.js' ),
-							dest: 'icons.js',
+							template: path.join( __dirname, 'iconmanagermodel.tpl' ),
+							dest: 'iconmanagermodel.js',
 						}
 					}
 				}