Skip to content

Commit

Permalink
update url
Browse files Browse the repository at this point in the history
  • Loading branch information
dexteryy committed Mar 2, 2016
1 parent 7affeb3 commit eaea210
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
31 changes: 15 additions & 16 deletions README.md
Expand Up @@ -14,29 +14,29 @@ title: DarkDOM

* Learning DarkDOM Visually

[![](http://douban-f2e.github.io/cardkit-demo-darkdom/darkdom_thumbnail.png)](http://douban-f2e.github.io/cardkit-demo-darkdom/darkdom.pdf)
[![](http://dexteryy.github.io/cardkit-demo-darkdom/darkdom_thumbnail.png)](http://dexteryy.github.io/cardkit-demo-darkdom/darkdom.pdf)

* [PDF version](http://douban-f2e.github.io/cardkit-demo-darkdom/darkdom.pdf)
* [PNG version](http://douban-f2e.github.io/cardkit-demo-darkdom/darkdom.png)
* [Source code](https://github.com/douban-f2e/cardkit-demo-darkdom)
* [Online demo (folder)](http://douban-f2e.github.io/cardkit-demo-darkdom/folder.html)
* [Online demo (list)](http://douban-f2e.github.io/cardkit-demo-darkdom/index.html)
* [Online demo (deck)](http://douban-f2e.github.io/cardkit-demo-darkdom/deck.html)
* [PDF version](http://dexteryy.github.io/cardkit-demo-darkdom/darkdom.pdf)
* [PNG version](http://dexteryy.github.io/cardkit-demo-darkdom/darkdom.png)
* [Source code](https://github.com/dexteryy/cardkit-demo-darkdom)
* [Online demo (folder)](http://dexteryy.github.io/cardkit-demo-darkdom/folder.html)
* [Online demo (list)](http://dexteryy.github.io/cardkit-demo-darkdom/index.html)
* [Online demo (deck)](http://dexteryy.github.io/cardkit-demo-darkdom/deck.html)

* codepen
* [http://codepen.io/dexteryy/pen/niuCG](http://codepen.io/dexteryy/pen/niuCG)

## Components Library

> [CardKit](https://github.com/douban-f2e/CardKit) is a mobile UI library provides a series of building blocks to help you build mobile web apps quickly and simply, or transfer entire website to mobile-first web app for touch devices.
> [CardKit](https://github.com/dexteryy/CardKit) is a mobile UI library provides a series of building blocks to help you build mobile web apps quickly and simply, or transfer entire website to mobile-first web app for touch devices.
>
> CardKit building blocks are all _use-html-as-configure-style_ (like Custom Elements, directive...) components built on [DarkDOM](https://github.com/dexteryy/DarkDOM) and [Moui](https://github.com/dexteryy/moui).

### AMD and OzJS

* DarkDOM can either be viewed as an independent library, or as a part of [OzJS mirco-framework](http://ozjs.org/#framework).
* It's wrapped as a number of mutually independent [AMD (Asynchronous Module Definition)](https://github.com/amdjs/amdjs-api/wiki/AMD) modules. You should use them with [oz.js](http://ozjs.org/#start) (or require.js or [similar](http://wiki.commonjs.org/wiki/Implementations) for handling dependencies).
* It's wrapped as a number of mutually independent [AMD (Asynchronous Module Definition)](https://github.com/amdjs/amdjs-api/wiki/AMD) modules. You should use them with [oz.js](http://ozjs.org/#start) (or require.js or [similar](http://wiki.commonjs.org/wiki/Implementations) for handling dependencies).
* If you want to make them available for both other AMD code and traditional code based on global namespace. OzJS provides [a mini define/require implementation](http://ozjs.org/examples/adapter/) to transform AMD module into traditional [module pattern](http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth).
* See [http://ozjs.org](http://ozjs.org) for details.

Expand Down Expand Up @@ -64,15 +64,15 @@ var darkdom = require('darkdom');
var component = darkdom(options); // see component.set(options)
```

* `component.set(options)` --
* `component.set(options)` --
* options --
* `unique: false` --
* `unique: false` --
* `enableSource: false` --
* `entireAsContent: false` --
* `sourceAsContent: false` --
* `render: function(data){ return '<...>...</...>'; }` --
* `render: function(data){ return '<...>...</...>'; }` --
* `data.state`
* `data.content`
* `data.content`
* `data.component`
* `data.context`
* `component.state(stateName, attrName)` --
Expand All @@ -85,7 +85,7 @@ var component = darkdom(options); // see component.set(options)
* `component.response(updateEvent, function(changes){ ...; return resolved; })` --
* updateEvent -- "state:name", "component:name", "content", "remove"...
* changes --
* resolved --
* resolved --
* `component.component(childComponentName)` --
* `component.createGuard()` --

Expand Down Expand Up @@ -129,7 +129,7 @@ guard.watch(root);
* `root.getDarkState(name)` --
* `root.setDarkState(name, value, options)` --
* options --
* `update: false` --
* `update: false` --
* `root.updateDarkStates()` --
* `root.updateDarkDOM()` --
* `root.feedDarkDOM(sourceData)` --
Expand Down Expand Up @@ -159,4 +159,3 @@ See [OzJS Release History](http://ozjs.org/#release)

Copyright (c) 2010 - 2014 dexteryy
Licensed under the MIT license.

9 changes: 5 additions & 4 deletions darkdom.js
Expand Up @@ -1357,10 +1357,11 @@ function merge_source(dark_model, source_model, context){
var content = dark_model.contentData
|| (dark_model.contentData = scan_contents());
var source_content = source_model.contentData;
if (source_content && source_content.text
&& (!content.text
|| content._hasOuter)) {
content.text = source_content.text;
if (!content.text) {
content.text = '';
}
if (source_content && source_content.text) {
content.text += source_content.text;
_.mix(content._index, source_content._index);
}
// @note
Expand Down

0 comments on commit eaea210

Please sign in to comment.