![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Light-weight javascript module framework (Inspired by flight - A component-based, event-driven JavaScript framework from Twitter http://flightjs.github.io/)
It supports packages for nodejs, bower & rails.
As a gem for rails provides:
As a package for nodejs provides:
As a package for bower provides:
npm install dou --save
bower install dou --save
requirejs.config({
...
paths: {
'dou' : 'bower_components/dou/dou'
},
shim: {
dou: {
exports: 'dou'
}
},
...
});
gem "dou-rails"
And run bundle install
. The rest of the installation depends on
whether the asset pipeline is being used.
The dou-rails files will be added to the asset pipeline and available for you to use. If they're not already in app/assets/javascripts/application.js
by default, add these lines:
//= require dou-min
var dou = require('dou');
var Super = dou.define({
/* members are class members (methods or variable), not instance members */
members: {
methodA: function() {...},
methodB: function() {...}
}
});
var inst = new Super();
inst.methodA();
var Clazz = dou.define({
extend : Super,
members : {
methodC: function() {...}
}
});
var inst = new Clazz();
inst.methodA();
inst.methodB();
inst.methodC();
var Clazz = dou.define({
extend : Super
},
/* constructor */
function(arg) {
// construction goes here
}
);
var inst = new Clazz(arg);
function mixin1() {
/* 'this' is prototype of Target Class. in this case Clazz.prototype */
this.methodD = function() { return 'foo'; };
}
function mixin2() {
/* 'this' is prototype of Target Class. in this case Clazz.prototype */
this.methodE = function() { return 'bar'; };
}
var Clazz = dou.define({
extend : Super,
mixins : [mixin1, mixin2]
});
var inst = new Clazz();
inst.methodD();
inst.methodE();
function mixin() {
this.before('methodA', function(arg) {
/* before logic */
...
});
this.after('methodB', function(arg) {
/* after logic */
...
});
this.around('methodC', function(origin, arg) {
/* before logic */
...
/* origin logic */
origin(arg);
/* after logic */
...
});
}
var Clazz = dou.define({
extend : Super,
/* dou.with.advice should be mixed in. */
mixins : [dou.with.advice, mixin]
});
var inst = new Clazz();
inst.methodA('abc');
var Clazz = dou.define({
mixins : [dou.with.event],
members : {
test: function(x) {
this.trigger('test', x);
}
}
});
var inst = new Clazz();
inst.on('test', function(e) {
console.log(e);
});
inst.test(1);
inst.off('test');
var Clazz = dou.define({
/* dou.with.property includes dou.with.event mixin */
mixins : [dou.with.property]
});
var inst = new Clazz();
inst.on('change', function(e) {
console.log(e.before);
console.log(e.after);
});
inst.set('attr1', 'value1');
inst.set({
attr1 : 'value1',
attr2 : 'value2'
});
var val = inst.get('attr1'); // val should be 'value1'
var Clazz = dou.define({
/* dou.with.lifecycle includes 2 mixins (dou.with.property and dou.with.event) */
mixins : [dou.with.lifecycle],
members : {
defaults : {
attr1: 'A',
attr2: 'B'
}
}
});
var inst = new Clazz();
inst.initialize({
attr2: 'b'
});
var val1 = inst.get('attr1'); // val1 should be 'A'
var val2 = inst.get('attr2'); // val2 should be 'b'
Copyright (c) 2014 Hearty, Oh. Licensed under the MIT license.
FAQs
Light-weight javascript module framework
The npm package dou receives a total of 3 weekly downloads. As such, dou popularity was classified as not popular.
We found that dou demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.