<commit_before>

var menuData = [{
  name: 'Europe',
  children: [{
    name: 'Germany'
  }, {
    name: 'France',
    children: [{
      name: 'Paris'
    }]
  }, {
    name: 'Russia'
  }, {
    name: 'Great Britain'
  }]
}, {
  name: 'Asia',
  children: [{
    name: 'China'
  }, {
    name: 'Korea'
  }, {
    name: 'Japan'
  }, {
    name: 'India'
  }]
}, {
  name: 'Africa'
}]


var graphData = [{
  name: 'Bar',
  icon: 'bar'
}, {
  name: 'Curve',
  icon: 'curve'
}, {
  name: 'Line',
  icon: 'line'
}, {
  name: 'Pie',
  icon: 'pie'
}]




$.ergo({
  etype: 'box',
  renderTo: '.preview',
  cls: 'button-container',
  items: [{
    etype: 'dropdown-button',
    xicon: 'ui-icon ui-icon-triangle-1-s',
    binding: function(obj) {
      this.opt('icon', 'silk-icon-chart-'+obj.icon);
//      this.opt('text', obj.name);
    },
    updateOnValueChanged: true,
//    icon: 'silk-icon-chart-line',
    data: graphData[1],
    components: {
      dropdown: {
        data: graphData,
        menuModel: {
          item: {
            content: {
              etype: 'text-item',
              icon: true,
              components: {
                content: {
                  dataId: 'name'
                },
                icon: {
                  dataId: 'icon',
                  binding: function(val) { this.el.addClass('silk-icon-chart-'+val);}
                }            
              }            
            }            
          }
        }
      }
    },
    onSelect: function(e) {
      this.data.set(e.target.data.get())
    }
  }, {
    etype: 'dropdown-button',
//    text: 'Location',
    xicon: 'e-icon-spinner-down',
    binding: function(obj) {
      this.opt('text', obj.name);
    },
    content: {
      width: 60
    },
    data: {name: 'Location'},
    updateOnValueChanged: true,
    components: {
      dropdown: {
        data: menuData,
        menuModel: {
          item: {
            content: {
              dataId: 'name'
            }            
          }
        }
      }
    },
    onSelect: function(e) {
      this.data.set(e.target.data.get());
//      growl.info('Selected item: '+e.target.content.getValue());
    }    
  }, {
  	extensions: ['selectable'],
  	defaultItem: {
  		etype: 'icon-button',
  		cls: 'e-bg-3',
  		onClick: function() {
  			this.parent.selection.set(this);
  		}
  	},
  	components: {
  		left: {
  			cls: 'left-checkbox', //e-corner-left e-no-border-right',
  			icon: 'silk-icon-male'
  		},
  		splitter: {
  			cls: 'e-border-no-left e-border-right',
  			style: {'padding-left': 0, 'padding-right': 0},
  			width: 1
  		},
  		right: {
  			cls: 'right-checkbox', //e-corner-right',
  			icon: 'silk-icon-female'
  		}
  	},
  	onAfterBuild: function() {
  		this.selection.set(this.left);
  	}
  }, {
  	extensions: ['selectable'],
  	defaultItem: {
  		etype: 'button',
  		cls: 'e-bg-3 e-border-all',
  		onClick: function() {
  			this.parent.selection.set(this);
  		},
  		style: {
  			'color': '#fff',
  			'font-weight': 'bold',
  			'text-shadow': '1px 1px 1px #888'
  		}
  	},
  	components: {
  		left: {
  			cls: 'left-checkbox',
  			text: 'ON'
//  			icon: 'silk-icon-male'
  		},
  		splitter: {
  			cls: 'e-border-no-left e-border-right',
  			style: {'padding-left': 0, 'padding-right': 0},
  			width: 1,
  			innerHtml: '&nbsp;'
  		},
  		right: {
  			cls: 'right-checkbox off', //e-corner-right',
  			text: 'OFF'

//  			icon: 'silk-icon-female'
  		}<commit_msg>fixed checkbutton sample<commit_after>

var menuData = [{
  name: 'Europe',
  children: [{
    name: 'Germany'
  }, {
    name: 'France',
    children: [{
      name: 'Paris'
    }]
  }, {
    name: 'Russia'
  }, {
    name: 'Great Britain'
  }]
}, {
  name: 'Asia',
  children: [{
    name: 'China'
  }, {
    name: 'Korea'
  }, {
    name: 'Japan'
  }, {
    name: 'India'
  }]
}, {
  name: 'Africa'
}]


var graphData = [{
  name: 'Bar',
  icon: 'bar'
}, {
  name: 'Curve',
  icon: 'curve'
}, {
  name: 'Line',
  icon: 'line'
}, {
  name: 'Pie',
  icon: 'pie'
}]




$.ergo({
  etype: 'box',
  renderTo: '.preview',
  cls: 'button-container',
  items: [{
    etype: 'dropdown-button',
    xicon: 'ui-icon ui-icon-triangle-1-s',
    binding: function(obj) {
      this.opt('icon', 'silk-icon-chart-'+obj.icon);
//      this.opt('text', obj.name);
    },
    updateOnValueChanged: true,
//    icon: 'silk-icon-chart-line',
    data: graphData[1],
    components: {
      dropdown: {
        data: graphData,
        menuModel: {
          item: {
            content: {
              etype: 'text-item',
              icon: true,
              components: {
                content: {
                  dataId: 'name'
                },
                icon: {
                  dataId: 'icon',
                  binding: function(val) { this.el.addClass('silk-icon-chart-'+val);}
                }            
              }            
            }            
          }
        }
      }
    },
    onSelect: function(e) {
      this.data.set(e.target.data.get())
    }
  }, {
    etype: 'dropdown-button',
//    text: 'Location',
    xicon: 'e-icon-spinner-down',
    binding: function(obj) {
      this.opt('text', obj.name);
    },
    content: {
      width: 60
    },
    data: {name: 'Location'},
    updateOnValueChanged: true,
    components: {
      dropdown: {
        data: menuData,
        menuModel: {
          item: {
            content: {
              dataId: 'name'
            }            
          }
        }
      }
    },
    onSelect: function(e) {
      this.data.set(e.target.data.get());
//      growl.info('Selected item: '+e.target.content.getValue());
    }    
  }, {
  	extensions: ['selectable'],
  	defaultComponent: {
  		etype: 'icon-button',
  		cls: 'e-bg-3',
  		onClick: function() {
  			this.parent.selection.set(this);
  		}
  	},
  	components: {
  		left: {
  			cls: 'left-checkbox', //e-corner-left e-no-border-right',
  			icon: 'silk-icon-male'
  		},
  		splitter: {
  			cls: 'e-border-no-left e-border-right',
  			style: {'padding-left': 0, 'padding-right': 0},
  			width: 1
  		},
  		right: {
  			cls: 'right-checkbox', //e-corner-right',
  			icon: 'silk-icon-female'
  		}
  	},
  	onAfterBuild: function() {
  		this.selection.set(this.left);
  	}
  }, {
  	extensions: ['selectable'],
  	defaultComponent: {
  		etype: 'button',
  		cls: 'e-bg-3 e-border-all',
  		onClick: function() {
  			this.parent.selection.set(this);
  		},
  		style: {
  			'color': '#fff',
  			'font-weight': 'bold',
  			'text-shadow': '1px 1px 1px #888'
  		}
  	},
  	components: {
  		left: {
  			cls: 'left-checkbox',
  			text: 'ON'
//  			icon: 'silk-icon-male'
  		},
  		splitter: {
  			cls: 'e-border-no-left e-border-right',
  			style: {'padding-left': 0, 'padding-right': 0},
  			width: 1,
  			innerHtml: '&nbsp;'
  		},
  		right: {
  			cls: 'right-checkbox off', //e-corner-right',
  			text: 'OFF'

//  			icon: 'silk-icon-female'
  		}
{'fraction_non_alphanumeric': 0.18241601143674052, 'fraction_numerical': 0.005146533238027162, 'mean_word_length': 1.6409966024915061, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1994191', 'n_tokens_mistral': 2796, 'n_tokens_neox': 2644, 'n_words': 442}