UI Schema

Setup

// Default setup options
schema.setup = {
  classPrefix: 'ui',
  dataPrefix: 'schema',
  autoLoad: true,
  autoBind: '.schema',
  autoTrigger: '.schema'
};

// Register schema events
schema.events = {
  bind: {
    type: 'bind',
    namespace: '.event.data-api.schema',
    selector: '[data-schema-event]'
  },
  retrieve: {
    type: 'retrieve',
    namespace: '.options.data-api.schema',
    selector: '[data-schema-options]'
  },
  observe: {
    type: 'observe',
    namespace: '.model.data-api.schema',
    selector: '[data-schema-model]'
  },
  render: {
    type: 'render',
    namespace: '.view.data-api.schema',
    selector: '[data-schema-view]'
  },
  insert: {
    type: 'insert',
    namespace: '.template.data-api.schema',
    selector: 'template[data-schema-target]'
  },
  route: {
    type: 'route',
    namespace: '.navigation.data-api.schema',
    selector: 'a[data-schema-route]'
  },
  validate: {
    type: 'validate',
    namespace: '.form.data-api.schema',
    selector: 'form[data-schema-validate]'
  },
  rating: {
    type: 'rating',
    namespace: '.form.data-api.schema',
    selector: 'input[data-schema-rating]'
  },
  tagging: {
    type: 'tagging',
    namespace: '.form.data-api.schema',
    selector: 'input[data-schema-tagging]'
  },
  lazyload: {
    type: 'lazyload',
    namespace: '.image.data-api.schema',
    selector: 'img[data-schema-lazyload]'
  },
  magnify: {
    type: 'magnify',
    namespace: '.image.data-api.schema',
    selector: 'img[data-schema-magnify]'
  },
  sprite: {
    type: 'sprite',
    namespace: '.icon.svg.data-api.schema',
    selector: 'i[data-schema-icon]'
  },
  trim: {
    type: 'trim',
    namespace: '.text.dom.data-api.schema',
    selector: '[data-schema-trim]'
  },
  copy: {
    type: 'copy',
    namespace: '.text.dom.data-api.schema',
    selector: '[data-schema-copy]'
  },
  extract: {
    type: 'extract',
    namespace: '.dom.data-api.schema',
    selector: '[data-schema-extract]'
  },
  dismiss: {
    type: 'dismiss',
    namespace: '.dom.data-api.schema',
    selector: '[data-schema-dismiss]'
  },
  autoplay: {
    type: 'autoplay',
    namespace: '.dom.data-api.schema',
    selector: '[data-schema-autoplay]'
  },
  toggle: {
    type: 'toggle',
    namespace: '.class.data-api.schema',
    selector: '[data-schema-toggle]'
  }
};