Simple framework for rich javascript application
JavaScript Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
css
hadron
img/users
lang
lib
quark
src
.project
README.md
index.html

README.md

Overview

Documentation Quark is a MVC framework for rich JavaScript web application. The framework is stood on the many amazing libraries. Quark Core

  • head.js
  • jQuery
  • jQueryStorage
  • jQueryRender

Quark UI

  • jQueryUI
  • jQueryFloatingMessage

Quark Util

  • jQueryUpload
  • jQuerySimpleValidate

Quark Debug

  • jQueryMockjax

Quark Test

  • Qunit

Structure

Hadron

Hadron is composed by several quarks. Define the configure for the page.

  • hadron/${application_name}.js
  • hadron/${application_name}.ren

Controller

Controllers are the glue between models and views. ( just like a gluon )

  • quark/c/${quark_name}.c.js

    //quark/c/user.c.js quark.controller.define( "user", {

      dialog : function( arg ){
          arg.render();
      },
    
      seek : function( arg ){
          User.find( { id : "foo" }, function( res ){
              arg.render( res );
          } );
      }
    

    } );

Model

Model don't know any controllers and views.

  • quark/m/${quark_name}.m.js

    //quark/m/user.m.js quark.model.define( "User", {

      find : {
          method : "take", /* Override the method name for server request */
          before : function( req ){
              /* Setup function before server request */
              return req;
          },
          callback : function( res ){
              /* Callback function after server request */
              return res;
          }
      },
    
      remove : {} /* Omit a any configure which don't need to set configure especially */
    

    } );

    User.find({ id : "foo" }); /* server request with parameter. "id=foo" */

View

View don't have any logic You can set a configure.

  • quark/v/${quark_name}.v.js

    /* quark/v/user.v.js */ quark.view.config( "user", { dialog : { button : true, dialog : { singleton : true, width : 500, close : "user.close" }, validate : { userId : /^[a-zA-Z0-9_.]{4,32}$/ } } } );

  • quark/v/${quark_name}/${method_name}.ren

endorse