pax_global_header 0000666 0000000 0000000 00000000064 13057340314 0014512 g ustar 00root root 0000000 0000000 52 comment=4888305843439159bf100bd74e41768fd8650d1d knockout-3.4.2/ 0000775 0000000 0000000 00000000000 13057340314 0013355 5 ustar 00root root 0000000 0000000 knockout-3.4.2/.gitignore 0000664 0000000 0000000 00000000240 13057340314 0015341 0 ustar 00root root 0000000 0000000 *.suo *.swp *.csproj.user bin obj *.pdb _ReSharper* *.ReSharper.user *.ReSharper desktop.ini .eprj perf/* *.orig *.bak .DS_Store npm-debug.log node_modules dist knockout-3.4.2/.npmignore 0000664 0000000 0000000 00000000264 13057340314 0015356 0 ustar 00root root 0000000 0000000 # Only package the build output for npm. Developers who want sources/tests can get them from the KO repo. * !build/output/knockout-latest.js !build/output/knockout-latest.debug.js knockout-3.4.2/.travis.yml 0000664 0000000 0000000 00000000022 13057340314 0015460 0 ustar 00root root 0000000 0000000 language: node_js knockout-3.4.2/Gruntfile.js 0000664 0000000 0000000 00000014436 13057340314 0015662 0 ustar 00root root 0000000 0000000 /*global module:false*/ module.exports = function(grunt) { var _ = grunt.util._; // Project configuration grunt.initConfig({ // Metadata pkg: grunt.file.readJSON('package.json'), fragments: './build/fragments/', banner: '/*!\n' + ' * Knockout JavaScript library v<%= pkg.version %>\n' + ' * (c) The Knockout.js team - <%= pkg.homepage %>\n' + ' * License: <%= pkg.licenses[0].type %> (<%= pkg.licenses[0].url %>)\n' + ' */\n\n', checktrailingspaces: { main: { src: [ "**/*.{js,html,css,bat,ps1,sh}", "!build/output/**", "!node_modules/**" ], filter: 'isFile' } }, build: { debug: './build/output/knockout-latest.debug.js', min: './build/output/knockout-latest.js' }, dist: { debug: './dist/knockout.debug.js', min: './dist/knockout.js' }, test: { phantomjs: 'spec/runner.phantom.js', node: 'spec/runner.node.js' } }); grunt.registerTask('clean', 'Clean up output files.', function (target) { var output = grunt.config('build'); var files = [ output.debug, output.min ]; var options = { force: (target == 'force') }; _.forEach(files, function (file) { if (grunt.file.exists(file)) grunt.file.delete(file, options); }); return !this.errorCount; }); var trailingSpaceRegex = /[ ]$/; grunt.registerMultiTask('checktrailingspaces', 'checktrailingspaces', function() { var matches = []; this.files[0].src.forEach(function(filepath) { var content = grunt.file.read(filepath), lines = content.split(/\r*\n/); lines.forEach(function(line, index) { if (trailingSpaceRegex.test(line)) { matches.push([filepath, (index+1), line].join(':')); } }); }); if (matches.length) { grunt.log.error("The following files have trailing spaces that need to be cleaned up:"); grunt.log.writeln(matches.join('\n')); return false; } }); function getReferencedSources(sourceReferencesFilename) { // Returns the array of filenames referenced by a file like source-references.js var result; global.knockoutDebugCallback = function(sources) { result = sources; }; eval(grunt.file.read(sourceReferencesFilename)); return result; } function getCombinedSources() { var fragments = grunt.config('fragments'), sourceFilenames = [ fragments + 'extern-pre.js', fragments + 'amd-pre.js', getReferencedSources(fragments + 'source-references.js'), fragments + 'amd-post.js', fragments + 'extern-post.js' ], flattenedSourceFilenames = Array.prototype.concat.apply([], sourceFilenames), combinedSources = flattenedSourceFilenames.map(function(filename) { return grunt.file.read('./' + filename); }).join(''); return combinedSources.replace('##VERSION##', grunt.config('pkg.version')); } function buildDebug(output) { var source = []; source.push(grunt.config('banner')); source.push('(function(){\n'); source.push('var DEBUG=true;\n'); source.push(getCombinedSources()); source.push('})();\n'); grunt.file.write(output, source.join('').replace(/\r\n/g, '\n')); } function buildMin(output, done) { var cc = require('closure-compiler'); var options = { compilation_level: 'ADVANCED_OPTIMIZATIONS', output_wrapper: '(function() {%output%})();' }; grunt.log.write('Compiling...'); cc.compile('/**@const*/var DEBUG=false;' + getCombinedSources(), options, function (err, stdout, stderr) { if (err) { grunt.log.error(err); done(false); } else { grunt.log.ok(); grunt.file.write(output, (grunt.config('banner') + stdout).replace(/\r\n/g, '\n')); done(true); } }); } grunt.registerMultiTask('build', 'Build', function() { if (!this.errorCount) { var output = this.data; if (this.target === 'debug') { buildDebug(output); } else if (this.target === 'min') { buildMin(output, this.async()); } } return !this.errorCount; }); grunt.registerMultiTask('test', 'Run tests', function () { var done = this.async(); grunt.util.spawn({ cmd: this.target, args: [this.data] }, function (error, result, code) { if (code === 127 /*not found*/) { grunt.verbose.error(result.stderr); // ignore this error done(true); } else { grunt.log.writeln(result.stdout); if (error) grunt.log.error(result.stderr); done(!error); } } ); }); grunt.registerTask('dist', function() { var version = grunt.config('pkg.version'), buildConfig = grunt.config('build'), distConfig = grunt.config('dist'); grunt.file.copy(buildConfig.debug, distConfig.debug); grunt.file.copy(buildConfig.min, distConfig.min); console.log('To publish, run:'); console.log(' git add bower.json'); console.log(' git add -f ' + distConfig.debug); console.log(' git add -f ' + distConfig.min); console.log(' git checkout head'); console.log(' git commit -m \'Version ' + version + ' for distribution\''); console.log(' git tag -a v' + version + ' -m \'Add tag v' + version + '\''); console.log(' git checkout master'); console.log(' git push origin --tags'); }); // Default task. grunt.registerTask('default', ['clean', 'checktrailingspaces', 'build', 'test']); }; knockout-3.4.2/LICENSE 0000664 0000000 0000000 00000002260 13057340314 0014362 0 ustar 00root root 0000000 0000000 The MIT License (MIT) - http://www.opensource.org/licenses/mit-license.php Copyright (c) Steven Sanderson, the Knockout.js team, and other contributors http://knockoutjs.com/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. knockout-3.4.2/README.md 0000664 0000000 0000000 00000005043 13057340314 0014636 0 ustar 00root root 0000000 0000000 **Knockout** is a JavaScript [MVVM](http://en.wikipedia.org/wiki/Model_View_ViewModel) (a modern variant of MVC) library that makes it easier to create rich, desktop-like user interfaces with JavaScript and HTML. It uses *observers* to make your UI automatically stay in sync with an underlying data model, along with a powerful and extensible set of *declarative bindings* to enable productive development. ##Getting started [](https://gitter.im/knockout/knockout?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) **Totally new to Knockout?** The most fun place to start is the [online interactive tutorials](http://learn.knockoutjs.com/). For more details, see * Documentation on [the project's website](http://knockoutjs.com/documentation/introduction.html) * Online examples at [http://knockoutjs.com/examples/](http://knockoutjs.com/examples/) ##Downloading Knockout You can [download released versions of Knockout](http://knockoutjs.com/downloads/) from the project's website. For Node.js developers, Knockout is also available from [npm](https://npmjs.org/) - just run `npm install knockout`. ##Building Knockout from sources If you prefer to build the library yourself: 1. **Clone the repo from GitHub** git clone https://github.com/knockout/knockout.git cd knockout 2. **Acquire build dependencies.** Make sure you have [Node.js](http://nodejs.org/) installed on your workstation. This is only needed to _build_ Knockout from sources. Knockout itself has no dependency on Node.js once it is built (it works with any server technology or none). Now run: npm install -g grunt-cli npm install The first `npm` command sets up the popular [Grunt](http://gruntjs.com/) build tool. You might need to run this command with `sudo` if you're on Linux or Mac OS X, or in an Administrator command prompt on Windows. The second `npm` command fetches the remaining build dependencies. 3. **Run the build tool** grunt Now you'll find the built files in `build/output/`. ## Running the tests If you have [phantomjs](http://phantomjs.org/download.html) installed, then the `grunt` script will automatically run the specification suite and report its results. Or, if you want to run the specs in a browser (e.g., for debugging), simply open `spec/runner.html` in your browser. ##License MIT license - [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) knockout-3.4.2/bower.json 0000664 0000000 0000000 00000000674 13057340314 0015375 0 ustar 00root root 0000000 0000000 { "name": "knockout", "homepage": "http://knockoutjs.com/", "description": "Knockout makes it easier to create rich, responsive UIs with JavaScript", "main": "dist/knockout.js", "moduleType": [ "amd", "globals", "node" ], "keywords": [ "knockout", "mvvm", "mvc", "spa" ], "license": "MIT", "ignore": [ "**/.*", "node_modules", "bower_components", "spec", "build/output" ] } knockout-3.4.2/build/ 0000775 0000000 0000000 00000000000 13057340314 0014454 5 ustar 00root root 0000000 0000000 knockout-3.4.2/build/fragments/ 0000775 0000000 0000000 00000000000 13057340314 0016442 5 ustar 00root root 0000000 0000000 knockout-3.4.2/build/fragments/amd-post.js 0000664 0000000 0000000 00000000005 13057340314 0020517 0 ustar 00root root 0000000 0000000 })); knockout-3.4.2/build/fragments/amd-pre.js 0000664 0000000 0000000 00000001100 13057340314 0020315 0 ustar 00root root 0000000 0000000 (function(factory) { // Support three module loading scenarios if (typeof define === 'function' && define['amd']) { // [1] AMD anonymous module define(['exports', 'require'], factory); } else if (typeof exports === 'object' && typeof module === 'object') { // [2] CommonJS/Node.js factory(module['exports'] || exports); // module.exports is for Node.js } else { // [3] No module loader (plain "); }; var buildFolderPath = getPathToScriptTagSrc(debugFileName); window.knockoutDebugCallback = function (scriptUrls) { for (var i = 0; i < scriptUrls.length; i++) referenceScript(buildFolderPath + scriptUrls[i]); }; referenceScript(buildFolderPath + sourcesReferenceFile); })(); knockout-3.4.2/build/output/ 0000775 0000000 0000000 00000000000 13057340314 0016014 5 ustar 00root root 0000000 0000000 knockout-3.4.2/build/output/.gitignore 0000664 0000000 0000000 00000000054 13057340314 0020003 0 ustar 00root root 0000000 0000000 knockout-latest.js knockout-latest.debug.js knockout-3.4.2/build/output/.npmignore 0000664 0000000 0000000 00000000143 13057340314 0020011 0 ustar 00root root 0000000 0000000 # This file is needed, because otherwise the .gitignore causes npm not to package the build output knockout-3.4.2/dist/ 0000775 0000000 0000000 00000000000 13057340314 0014320 5 ustar 00root root 0000000 0000000 knockout-3.4.2/dist/knockout.debug.js 0000664 0000000 0000000 00001065473 13057340314 0017620 0 ustar 00root root 0000000 0000000 /*! * Knockout JavaScript library v3.4.2 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ (function(){ var DEBUG=true; (function(undefined){ // (0, eval)('this') is a robust way of getting a reference to the global object // For details, see http://stackoverflow.com/questions/14119988/return-this-0-evalthis/14120023#14120023 var window = this || (0, eval)('this'), document = window['document'], navigator = window['navigator'], jQueryInstance = window["jQuery"], JSON = window["JSON"]; (function(factory) { // Support three module loading scenarios if (typeof define === 'function' && define['amd']) { // [1] AMD anonymous module define(['exports', 'require'], factory); } else if (typeof exports === 'object' && typeof module === 'object') { // [2] CommonJS/Node.js factory(module['exports'] || exports); // module.exports is for Node.js } else { // [3] No module loader (plain
Goodbye
"; ko.applyBindings({ sometext: 'hello' }, testNode); expect(testNode).toContainHtml('replaced
replaced
'); }); it('