Catalog npm
Back to packageRELEASE DETAILS

0.1.81

npm

3m5-coco

a simple MVC Framework

3m5cocohandlebarsmvc
Published28 Jun 2016
Direct dependencies20
Transitive dependenciesNot calculated

README

Current package documentation

3m5-coco

a simple JavaScript MVC Framework developed by 3m5. Media GmbH npm version

What is 3m5-coco?

  • based on dejavu class model

  • use handlebars template engine

  • use jQuery for DOM-manipulation

  • use ES6 standard - transpiled by babel --> ES5 standard published to npm

  • compatible to browserify and webpack

installation

this framework is a npm module, use

npm install 3m5-coco

Sample application.js

This file will give you a taste of how to use Coco.JS

/**
 * @author (c) Andreas Wiedenfeld <andreas.wiedenfeld@3m5.de>
 * updated at 16.09.2015
 */
/** @namespace **/

var Coco = require("3m5-coco");

var TestCollection = require("./test/testCollection");
var TestView2 = require("./test/testView2");

var CocoApplication = dejavu.Class.declare({

    initialize() {
        console.log("CocoTestApp initialized, look at available Coco-Classes: ", Coco);
                
        Coco.Translator.addEventListener(Coco.TranslatorEvent.CHANGE_LOCALE, (event) => {
          console.info("locale changed " + event.locale);
        });
                    
        Coco.Translator.loadMessagesFromObject({
          title:  {
            1: "bla-de",
            2: "blub"
          },
          title2: "Hallo %0%"
        }, "de");
    
        Coco.Translator.loadMessagesFromObject({
          title:  {
            1: "bla-en",
            2: "blub-en"
          },
          title2: "Hallo %0%"
        }, "en");
    
        Coco.Translator.setLocale("de");
        console.log("i18n example (de): " + Coco.Translator.get("title.1"));
        console.log("i18n example with replacement: " + Coco.Translator.get("title2", ["Tom"]));
    
        //change locale
        Coco.Translator.setLocale("en");
        console.log("i18n example (en): " + Coco.Translator.get("title.1"));

        var innerModel = new Coco.Model({id:123, label:"innerModel", properts: "myInnerProperty"});
        var innerCollection = new TestCollection([{id:1, label:11}, {id:2, label:22}]);
        var testModel = new Coco.Model({id:12, label:"myLabel", property: innerModel, properties: innerCollection});

        innerCollection.add(innerModel);
        console.log(testModel.getAttributes());

        //initialize a simple router
        new Coco.Router('.routerView', {
            dashboard: {
                path: '/',
                view: require("./test/testView"),
                model: testModel
            },
            imprint: {
                path: '/testView2',
                view: TestView2
            }
        }, '/');
    }

});

$(document).ready(() => {
    new CocoApplication();
});

Coco.config = {
    baseUrl: "baseURL",              //server context path
    router: {
        loaderDelay: 300        // When views are swapped by Router, this time adjusts when the loading class
    },
    restService: {              //restService configuration
        path: null,             //restService path
        cacheGet: 600,          //cache time for GET Requests of same url in seconds
        cachePost: null         //cache time for GET Requests of same url in seconds
    }
};

Documentation

https://www.3m5.de/coco/

I hate the way you did

If something doesn't suit you, please submit a pull request that lets this framework be more flexible than it currently is.

License

Coco is under ISC-License

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 20

Native requirements
20 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
JSON
Environment
{
  "local_name": "JSON",
  "alias": false,
  "peer_metadata": null
}
^1.0.0runtime
babel-polyfill
Environment
{
  "local_name": "babel-polyfill",
  "alias": false,
  "peer_metadata": null
}
^6.9.1runtime
jquery
Environment
{
  "local_name": "jquery",
  "alias": false,
  "peer_metadata": null
}
^2.2.4runtime
underscore
Environment
{
  "local_name": "underscore",
  "alias": false,
  "peer_metadata": null
}
^1.8.3runtime
browserify
Environment
{
  "local_name": "browserify",
  "alias": false,
  "peer_metadata": null
}
^13.0.0development
domain
Environment
{
  "local_name": "domain",
  "alias": false,
  "peer_metadata": null
}
0.0.1development
es6ify
Environment
{
  "local_name": "es6ify",
  "alias": false,
  "peer_metadata": null
}
^1.6.0development
gulp
Environment
{
  "local_name": "gulp",
  "alias": false,
  "peer_metadata": null
}
^3.9.1development
gulp-babel
Environment
{
  "local_name": "gulp-babel",
  "alias": false,
  "peer_metadata": null
}
^6.1.2development
gulp-clean
Environment
{
  "local_name": "gulp-clean",
  "alias": false,
  "peer_metadata": null
}
^0.3.2development
gulp-concat
Environment
{
  "local_name": "gulp-concat",
  "alias": false,
  "peer_metadata": null
}
^2.5.2development
gulp-shell
Environment
{
  "local_name": "gulp-shell",
  "alias": false,
  "peer_metadata": null
}
^0.5.2development
gulp-streamify
Environment
{
  "local_name": "gulp-streamify",
  "alias": false,
  "peer_metadata": null
}
1.0.2development
gulp-tap
Environment
{
  "local_name": "gulp-tap",
  "alias": false,
  "peer_metadata": null
}
^0.1.3development
gulp-util
Environment
{
  "local_name": "gulp-util",
  "alias": false,
  "peer_metadata": null
}
^3.0.7development
gulp-webserver
Environment
{
  "local_name": "gulp-webserver",
  "alias": false,
  "peer_metadata": null
}
^0.9.1development
handlebars
Environment
{
  "local_name": "handlebars",
  "alias": false,
  "peer_metadata": null
}
^4.0.5development
hbsfy
Environment
{
  "local_name": "hbsfy",
  "alias": false,
  "peer_metadata": null
}
^2.6.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^2.4.5development
run-sequence
Environment
{
  "local_name": "run-sequence",
  "alias": false,
  "peer_metadata": null
}
^1.1.5development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "3281ea68be51174a702ef533016774bd7c127c8c",
  "tarball": "https://registry.npmjs.org/3m5-coco/-/3m5-coco-0.1.81.tgz",
  "integrity": "sha512-uQg0TNQgRhQS4WAAac87NU9Q9huqj8e+z79AJb5a3n1MZencicqeOTpeqWwLKM2tKn6uo7VWSqhPxN3xWmzoBA==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDrGYgG3kaWN15etRyvhswz0Iuz/nCMlm61NZRwYG+8WwIhAI+AfXIn18zaVqAmqv8YV5SciLYEExgD6qNyVk2s22hk"
    }
  ]
}

Repository

PENDING
3m5/coco

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:48 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:f376e2570ca66b1e73aacd1eba3ed74931b489a5de591c2c6f2f993ee968885f

Other collected versions

0.3.016 May0.2.029 Jun0.1.8831 Mar0.1.875 Jan0.1.8623 Nov0.1.8522 JulView all collected versions →