├── .gitignore ├── HISTORY.md ├── LICENSE ├── Package.nuspec ├── README.md ├── build ├── build-linux ├── output │ ├── knockout.mapping-latest.debug.js │ └── knockout.mapping-latest.js ├── tools │ ├── curl.exe │ └── searchReplace.js └── version-header.js ├── knockout.mapping.js └── spec ├── issues.js ├── lib ├── json2.js ├── qunit-1.10.0.css └── qunit-1.10.0.js ├── mappingBehaviors.js ├── proxyDependentObservableBehaviors.js └── runner.html /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.csproj.user 3 | bin 4 | obj 5 | *.pdb 6 | _ReSharper* 7 | *.ReSharper.user 8 | *.ReSharper 9 | desktop.ini 10 | .eprj -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | Release 2.4.1 - February 8th, 2013 2 | 3 | * Added mappedGet for observable arrays 4 | * Issue #134: Throttle issue using mapping 5 | * Issue #135: Why is custom update for observableArray firing twice when using mapping plugin? 6 | 7 | Release 2.4.0 - February 4th, 2013 8 | 9 | * Removed asynchronous processing that was used to reset mapping nesting 10 | * Improved getType performance 11 | 12 | Release 2.3.5 - December 10th, 2012 13 | 14 | * Issue #121: Added functionality so that explicit declared none observable members on a ViewModel will remain none observable after mapping 15 | 16 | Release 2.3.4 - November 22nd, 2012 17 | 18 | * Issue #114: Added new "observe" array to options 19 | 20 | Release 2.3.3 - October 30th, 2012 21 | 22 | * Fixed issue #105, #111: Update callback is not being called 23 | * Fixed issue #107: String values in mapping cause infinite recursion in extendObject 24 | 25 | Release 2.3.2 - August 20th, 2012 26 | 27 | * Fixed issue #86: Don't update properties on object with update callback 28 | 29 | Release 2.3.1 - August 6th, 2012 30 | 31 | * Fixed issue #33: Create method in mappings receive meaningless options.parent for observableArray properties 32 | * Fixed issue #99: Updating throttled observable 33 | * Fixed issue #100: private variable leaks onto window object 34 | 35 | Release 2.3.0 - July 31st, 2012 36 | 37 | * Added support for not mapping certain array elements (return "options.skip" from your create callback) 38 | * Fixed issue #91: "wrap" function makes computed writable 39 | * Fixed issue #94: Bug/problem with ignore argument in mapping.fromJS 40 | 41 | Release 2.2.4 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) - http://www.opensource.org/licenses/mit-license.php 2 | 3 | Copyright (c) Steven Sanderson, Roy Jacobs 4 | http://knockoutjs.com/documentation/plugins-mapping.html 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Knockout.Mapping 5 | 2.4.1 6 | Roy Jacobs 7 | http://www.opensource.org/licenses/mit-license.php 8 | http://knockoutjs.com/documentation/plugins-mapping.html 9 | false 10 | The mapping plugin gives you a straightforward way to map plain JavaScript objects into a view model with the appropriate Knockout observables. This is an alternative to manually writing your own JavaScript code that constructs a view model based on some data you've fetched from the server. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Object mapping plugin for [Knockout](http://knockoutjs.com/) - Find the documentation [here](http://knockoutjs.com/documentation/plugins-mapping.html). 2 | READ THIS 3 | --- 4 | Due to lack of time this project is currently not actively maintained. Feel free to be a hero-- step up and [fork this repo](https://github.com/SteveSanderson/knockout.mapping/fork)! 5 | -------------------------------------------------------------------------------- /build/build-linux: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SourceFiles= 4 | 5 | # Now call Google Closure Compiler to produce a minified version 6 | cp ../knockout.mapping.js output/knockout.mapping-latest.debug.js 7 | sed -i~ -e "s/var DEBUG=true;/\/**@const*\/var DEBUG=false;/g" output/knockout.mapping-latest.debug.js 8 | curl -d output_info=compiled_code -d output_format=text -d compilation_level=SIMPLE_OPTIMIZATIONS --data-urlencode js_code@output/knockout.mapping-latest.debug.js "http://closure-compiler.appspot.com/compile" >> output/knockout.mapping-latest.js~ 9 | cat version-header.js output/knockout.mapping-latest.js~ > output/knockout.mapping-latest.js 10 | 11 | cat version-header.js ../knockout.mapping.js > output/knockout.mapping-latest.debug.js 12 | 13 | rm -f output/*.js~ -------------------------------------------------------------------------------- /build/output/knockout.mapping-latest.debug.js: -------------------------------------------------------------------------------- 1 | /// Knockout Mapping plugin v2.4.1 2 | /// (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/ 3 | /// License: MIT (http://www.opensource.org/licenses/mit-license.php) 4 | (function (factory) { 5 | // Module systems magic dance. 6 | 7 | if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { 8 | // CommonJS or Node: hard-coded dependency on "knockout" 9 | factory(require("knockout"), exports); 10 | } else if (typeof define === "function" && define["amd"]) { 11 | // AMD anonymous module with hard-coded dependency on "knockout" 12 | define(["knockout", "exports"], factory); 13 | } else { 14 | // 8 | 9 | 10 | 11 | 33 | 34 | 35 | 36 | 37 | 38 |

QUnit Test Suite

39 |

40 |
41 |

42 |
    43 |
    test markup
    44 | 45 | 46 | --------------------------------------------------------------------------------