PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / trunk
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels vtrunk
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / block / src / helper.js

helper.js in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels trunk, at block/src/helper.js

46 lines 707 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Get block attributes
3 */
4 export function getBlockAttributes() {
5 var attributes = {
6 is_admin: {
7 type: 'boolean',
8 default: false
9 },
10 uid: {
11 type: 'string',
12 default: ''
13 }
14 };
15
16 for ( var key in ayg_block.options ) {
17 var fields = ayg_block.options[ key ].fields;
18
19 for ( var field in fields ) {
20 var name = fields[ field ].name;
21
22 attributes[ name ] = {
23 type: getType( fields[ field ].type ),
24 default: fields[ field ].value
25 };
26 }
27 }
28
29 return attributes;
30 }
31
32 /**
33 * Get attribute type
34 */
35 function getType( type ) {
36 var _type = 'string';
37
38 if ( 'number' == type ) {
39 _type = 'number';
40 } else if ( 'checkbox' == type ) {
41 _type = 'boolean';
42 }
43
44 return _type;
45 }
46