pax_global_header00006660000000000000000000000064130573403140014512gustar00rootroot0000000000000052 comment=4888305843439159bf100bd74e41768fd8650d1d knockout-3.4.2/000077500000000000000000000000001305734031400133555ustar00rootroot00000000000000knockout-3.4.2/.gitignore000066400000000000000000000002401305734031400153410ustar00rootroot00000000000000*.suo *.swp *.csproj.user bin obj *.pdb _ReSharper* *.ReSharper.user *.ReSharper desktop.ini .eprj perf/* *.orig *.bak .DS_Store npm-debug.log node_modules distknockout-3.4.2/.npmignore000066400000000000000000000002641305734031400153560ustar00rootroot00000000000000# 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.yml000066400000000000000000000000221305734031400154600ustar00rootroot00000000000000language: node_js knockout-3.4.2/Gruntfile.js000066400000000000000000000144361305734031400156620ustar00rootroot00000000000000/*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/LICENSE000066400000000000000000000022601305734031400143620ustar00rootroot00000000000000The 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.md000066400000000000000000000050431305734031400146360ustar00rootroot00000000000000**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 [![Join the chat at https://gitter.im/knockout/knockout](https://badges.gitter.im/Join%20Chat.svg)](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.json000066400000000000000000000006741305734031400153750ustar00rootroot00000000000000{ "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/000077500000000000000000000000001305734031400144545ustar00rootroot00000000000000knockout-3.4.2/build/fragments/000077500000000000000000000000001305734031400164425ustar00rootroot00000000000000knockout-3.4.2/build/fragments/amd-post.js000066400000000000000000000000051305734031400205170ustar00rootroot00000000000000})); knockout-3.4.2/build/fragments/amd-pre.js000066400000000000000000000011001305734031400203150ustar00rootroot00000000000000(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/000077500000000000000000000000001305734031400160145ustar00rootroot00000000000000knockout-3.4.2/build/output/.gitignore000066400000000000000000000000541305734031400200030ustar00rootroot00000000000000knockout-latest.js knockout-latest.debug.js knockout-3.4.2/build/output/.npmignore000066400000000000000000000001431305734031400200110ustar00rootroot00000000000000# This file is needed, because otherwise the .gitignore causes npm not to package the build output knockout-3.4.2/dist/000077500000000000000000000000001305734031400143205ustar00rootroot00000000000000knockout-3.4.2/dist/knockout.debug.js000066400000000000000000010654731305734031400176200ustar00rootroot00000000000000/*! * 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('

Goodbye

"; ko.applyBindings({ sometext: 'hello' }, testNode); expect(testNode).toContainHtml('

replaced

replaced

'); }); it('