How to use class - 10 common examples

To help you get started, we’ve selected a few class examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Droppe / Lu / public / scripts / lu-controls / Button / Play.js View on Github external
/**
 * Representation of a button element preconfigured with a 'play' event
 * @class NextButton
 * @constructor
 * @extends Button
 * @requires ptclass
 * @param {HTMLElement} element The HTML element surrounded by the control
 * @param {Object} settings Configuration properties for this instance
 */
var Class = require( 'class' ),
  Button = require( 'lu/Button' ),
  PlayButton;

PlayButton = Class.create( Button, ( function () {
  var PLAYING_EVENT = 'playing',
    PAUSED_EVENT = 'paused';

  // RETURN METHODS OBJECT
  return {
   /**
    * PTClass constructor 
    * @method initialize
    * @public
    * @param {Object} $super Pointer to superclass constructor
    * @param {Object} $element JQuery object for the element wrapped by the component
    * @param {Object} settings Configuration settings
    */
    initialize: function ( $super, $element, settings ) {

      // PRIVATE INSTANCE PROPERTIES
github Droppe / Lu / public / scripts / lu-controls / Button / Next.js View on Github external
var Class = require( 'class' ),
  Button = require( 'lu/Button' ),
  NextButton;

/**
 * Representation of a button element preconfigured with a 'next' event
 * @class NextButton
 * @constructor
 * @extends Button
 * @param {HTMLElement} element The HTML element surrounded by the control
 * @param {Object} settings Configuration properties for this instance
 */
NextButton = Class.create( Button, ( function () {

  var MAXED_EVENT = 'maxed',
    SELECTED_EVENT = 'selected';

  // RETURN METHODS OBJECT
  return {
   /**
    * PTClass constructor 
    * @method initialize
    * @public
    * @param {Object} $super Pointer to superclass constructor
    * @param {Object} $element JQuery object for the element wrapped by the component
    * @param {Object} settings Configuration settings
    */    
   initialize: function ( $super, $element, settings ) {
github Droppe / Lu / public / scripts / libraries / athena / controls / Button / Load.js View on Github external
/**
 * Representation of a button element preconfigured with a 'next' event
 * @class LoadButton
 * @constructor
 * @extends Button
 * @requires ptclass
 * @param {HTMLElement} element The HTML element surrounded by the control
 * @param {Object} settings Configuration properties for this instance
 */
var Class = require( 'class' ),
  Button = require( 'athena/Button' ),
  LoadButton;

LoadButton = Class.create( Button, ( function () {

   // RETURN METHODS OBJECT
   return {
     /**
      * PTClass constructor 
      * @method initialize
      * @public
      * @param {Object} $super Pointer to superclass constructor
      * @param {Object} $element JQuery object for the element wrapped by the component
      * @param {Object} settings Configuration settings
      */    
     initialize: function ( $super, $element, settings ) {

       // PRIVATE INSTANCE PROPERTIES

       /**
github Droppe / Lu / public / scripts / lu-controls / Checkbox.js View on Github external
/**
 * Toggles the display of related content to a change event 
 * from a checkbox or other single element.
 * @class Checkbox
 * @constructor
 * @extends Abstract
 * @requires ptclass
 * @param {HTMLElement} element The HTML element containing this component
 * @param {Object} settings Configuration properties for this instance 
 */
var Class = require( 'class' ),
  Abstract = require( 'lu/Abstract' ),
  Checkbox;

Checkbox = Class.create( Abstract,  ( function () {

  // RETURN METHODS OBJECT
  return {
    /**
     * PTClass constructor 
     * @method initialize
     * @public
     * @param {Object} $super Pointer to superclass constructor
     * @param {Object} $element JQuery object for the element wrapped by the component
     * @param {Object} settings Configuration settings
     */    
    initialize: function ( $super, $element, settings ) {


      // PRIVATE INSTANCE PROPERTIES
github Droppe / Lu / public / scripts / lu-controls / Container / Switcher.js View on Github external
/**
 * Representation of a stateful button element
 * @class Switcher
 * @constructor
 * @extends Container
 * @requires ptclass
 * @param {HTMLElement} element The HTML element surrounded by the control
 * @param {Object} settings Configuration properties for this instance
 */
var Class = require( 'class' ),
  Container = require( 'lu/Container' ),
  Switcher;

Switcher = Class.create( Container,  ( function () {

  var DISABLED = "disabled";

  // RETURN METHODS OBJECT
  return {
    /**
     * PTClass constructor 
     * @method initialize
     * @public
     * @param {Object} $super Pointer to superclass constructor
     * @param {Object} $element JQuery object for the element wrapped by the component
     * @param {Object} settings Configuration settings
     */    
    initialize: function ( $super, $element, settings ) {

      // PRIVATE INSTANCE PROPERTIES
github mixteam / mixsln / src / components / xBase.js View on Github external
define(function(require, exports, module) {

require('reset');
var win = window,
	doc = win.document,
	Class = require('class'),
	components = {},

	xBase = Class.create({
		initialize : function(name, module) {
			var that = this
				;

			that._name = name;
			that._module = module;
			that._isEnable = false;
		},

		getModule : function() {
			return this._module;
		},

		enable : function() {	// overwrite
			var that = this,
				module = that._module
github Droppe / Lu / public / scripts / libraries / athena / controls / Button / Off.js View on Github external
/**
 * Representation of a button element preconfigured with a 'next' event
 * @class OffButton
 * @constructor
 * @extends Button
 * @requires ptclass
 * @param {HTMLElement} element The HTML element surrounded by the control
 * @param {Object} settings Configuration properties for this instance
 */
var Class = require( 'class' ),
  Button = require( 'athena/Button' ),
  OffButton;

OffButton = Class.create( Button, ( function () {

   // RETURN METHODS OBJECT
   return {
     /**
      * PTClass constructor 
      * @method initialize
      * @public
      * @param {Object} $super Pointer to superclass constructor
      * @param {Object} $element JQuery object for the element wrapped by the component
      * @param {Object} settings Configuration settings
      */    
     initialize: function ( $super, $element, settings ) {

       // PRIVATE INSTANCE PROPERTIES

       /**
github Droppe / Lu / public / scripts / libraries / athena / controls / Button / Last.js View on Github external
/**
 * Representation of a button element preconfigured with a 'next' event
 * @class LastButton
 * @constructor
 * @extends Button
 * @requires ptclass
 * @param {HTMLElement} element The HTML element surrounded by the control
 * @param {Object} settings Configuration properties for this instance
 */
var Class = require( 'class' ),
  Button = require( 'athena/Button' ),
  LastButton;

LastButton = Class.create( Button,  ( function () {

   // RETURN METHODS OBJECT
   return {
     /**
      * PTClass constructor 
      * @method initialize
      * @public
      * @param {Object} $super Pointer to superclass constructor
      * @param {Object} $element JQuery object for the element wrapped by the component
      * @param {Object} settings Configuration settings
      */    
     initialize: function ( $super, $element, settings ) {

       // PRIVATE INSTANCE PROPERTIES

       /**
github Droppe / Lu / public / scripts / lu-controls / Button / MultiSwitch.js View on Github external
/**
 * Representation of a stateful button element
 * @class MultiSwitch
 * @constructor
 * @extends Switch
 * @requires ptclass
 * @param {HTMLElement} element The HTML element surrounded by the control
 * @param {Object} settings Configuration properties for this instance
 */
var Class = require( 'class' ),
  Switch = require( 'lu/Button/Switch' ),
  MultiSwitch;

MultiSwitch = Class.create( Switch,  ( function () {

   // RETURN METHODS OBJECT
   return {
     /**
      * PTClass constructor 
      * @method initialize
      * @public
      * @param {Object} $super Pointer to superclass constructor
      * @param {Object} $element JQuery object for the element wrapped by the component
      * @param {Object} settings Configuration settings
      */    
     initialize: function ( $super, $element, settings ) {

       // PRIVATE INSTANCE PROPERTIES

       /**
github Droppe / Lu / public / scripts / lu-controls / Radio.js View on Github external
/**
 * Toggles the display of related content to a change event from a grouping of radio buttons.
 * @class RadioButton
 * @constructor
 * @extends FormSelect
 * @requires ptclass
 * @param {HTMLElement} element The HTML element containing this component
 * @param {Object} settings Configuration properties for this instance 
 */
var Class = require( 'class' ),
  FormSelect = require( 'lu/Abstract' ),
  RadioButton;

RadioButton = Class.create( FormSelect,  ( function () {

  // RETURN METHODS OBJECT
  return {
    /**
     * PTClass constructor 
     * @method initialize
     * @public
     * @param {Object} $super Pointer to superclass constructor
     * @param {Object} $element JQuery object for the element wrapped by the component
     * @param {Object} settings Configuration settings
     */    
    initialize: function ( $super, $element, settings ) {

      // PRIVATE INSTANCE PROPERTIES

      /**

class

A simple yet powerful Ruby-like Class inheritance system

MIT
Latest version published 11 years ago

Package Health Score

42 / 100
Full package analysis

Popular class functions