-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaa4b30
commit a93b9af
Showing
10 changed files
with
3,947 additions
and
1,840 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,3 @@ test_html/bind_test.bundle.js | |
docs/ | ||
npm-debug.log | ||
bower_components | ||
|
||
milo.min.js | ||
milo.min.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"laxbreak": true, | ||
"browser": true, | ||
"node": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
var Model = require('milo-core').Model | ||
|
||
Model.registerWithDOMStorage = Model$$registerWithDOMStorage; | ||
|
||
|
||
function Model$$registerWithDOMStorage() { | ||
var DOMStorage = require('./index'); | ||
DOMStorage.registerDataType('Model', Model_domStorageSerializer, Model_domStorageParser); | ||
DOMStorage.registerDataType('ModelPath', Model_domStorageSerializer, Model_domStorageParser, 'Model'); | ||
} | ||
|
||
|
||
function Model_domStorageSerializer(value) { | ||
var data = value.get(); | ||
return JSON.stringify(data); | ||
} | ||
|
||
|
||
function Model_domStorageParser(valueStr) { | ||
var data = _.jsonParse(valueStr); | ||
return new Model(data); | ||
} |
Oops, something went wrong.