GithubHelp home page GithubHelp logo

isabella232 / module-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from semantic-org/module-examples

0.0 0.0 0.0 428 KB

Annotated source of Semantic UI Module Format

Home Page: http://semantic-org.github.io/Module-Examples/docs/module.html

CSS 17.47% JavaScript 82.53%

module-examples's Introduction

What's Here

This is the annotated source of the standard module format used to power UI modules in Semantic UI.

You can view the annotated source online.

Standard Features

  • Standardizes element lifecycle, initialize, bind events, instantiate, destroy, refresh, etc.
  • Built in debug tools designed to make developer comments appear as traces during execution
  • Built in performance logging that shows diffed time in milliseconds between debug logs
  • Designed so that css selectors, metadata, regular expresions, even error messages are passed through as settings and user-editable

Advanced Features

Method Lookup

Method invocation automatically converts sentence case to camelCase or nested object during method lookup

$('.component').component('set text', 'Foobar');

Internally matches against methods

set: {
  text: function(text) {
     // do something
  }
}

As well as

setText: function(Text) {
  // do something
}

Mutation Observers

Elements use DOM Mutation Observers to allow refreshing cached values after changes

if('MutationObserver' in window) {
  observer = new MutationObserver(function(mutations) {
    module.debug('Element updated refreshing selectors');
    module.refresh();
  });
  observer.observe(element, {
    childList : true,
    subtree   : true
  });
  module.debug('Setting up mutation observer', observer);
}

Building Docs

# to get docco
npm install -g docco
# to build
docco src/*.js --css src/css/docco

module-examples's People

Contributors

jlukic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.