Observed since 20 Oct, 19:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
3m5-coco
a simple MVC Framework
a simple JavaScript MVC Framework
developed by 3m5. Media GmbH

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
this framework is a npm module, use
npm install 3m5-coco
application.jsThis 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
}
};
If something doesn't suit you, please submit a pull request that lets this framework be more flexible than it currently is.
Coco is under ISC-License
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
browserifyEnvironment{
"local_name": "browserify",
"alias": false,
"peer_metadata": null
} | ^9.0.8 | runtime |
domainEnvironment{
"local_name": "domain",
"alias": false,
"peer_metadata": null
} | 0.0.1 | runtime |
es6ifyEnvironment{
"local_name": "es6ify",
"alias": false,
"peer_metadata": null
} | ^1.6.0 | runtime |
gulpEnvironment{
"local_name": "gulp",
"alias": false,
"peer_metadata": null
} | ^3.8.11 | runtime |
gulp-cleanEnvironment{
"local_name": "gulp-clean",
"alias": false,
"peer_metadata": null
} | ^0.3.1 | runtime |
gulp-concatEnvironment{
"local_name": "gulp-concat",
"alias": false,
"peer_metadata": null
} | ^2.5.2 | runtime |
gulp-streamifyEnvironment{
"local_name": "gulp-streamify",
"alias": false,
"peer_metadata": null
} | 0.0.5 | runtime |
gulp-tapEnvironment{
"local_name": "gulp-tap",
"alias": false,
"peer_metadata": null
} | ^0.1.3 | runtime |
gulp-utilEnvironment{
"local_name": "gulp-util",
"alias": false,
"peer_metadata": null
} | ^3.0.4 | runtime |
handlebarsEnvironment{
"local_name": "handlebars",
"alias": false,
"peer_metadata": null
} | ^3.0.2 | runtime |
hbsfyEnvironment{
"local_name": "hbsfy",
"alias": false,
"peer_metadata": null
} | ^2.2.1 | runtime |
Source distribution
{
"shasum": "785d231751d3570570203288871f97abe3b61b69",
"tarball": "https://registry.npmjs.org/3m5-coco/-/3m5-coco-0.0.93.tgz",
"integrity": "sha512-hUpU/Os0YyPwrHY1OKucYKtNM1MydlkmZ6ms6jtITQl8mTPuDVUb6ENrd8hk++PfMV3udMHHhzO+xSlmLxtesQ==",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQCaUWBMC0NED+/Pe1nFzp5ZKHYShFOQ7MW1CUFNRLobIwIhANnz/hKrfKjYFje8tvYoOyD6QAkuX9lAYGgurA1Krqms"
}
]
}Observed since 20 Oct, 19:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:df2466933db8da8a101f525fe0ed74cda90bd3b8ee2a7b767ed56f4ff884bfaa